[Buildroot] [PATCH] Adding owfs support

Romain Naour romain.naour at openwide.fr
Mon Jul 13 11:03:42 UTC 2015


Hi Istvan,

Le 21/05/2015 15:02, root a écrit :
> ---
>  package/Config.in                                  |   1 +
>  .../0001-fix-owshell-libusb-for-owfs-3.1p0.patch   | 127 +++++++++++++++++++++
>  package/owfs/Config.in                             |  33 ++++++
>  package/owfs/owfs.mk                               |  20 ++++
>  4 files changed, 181 insertions(+)
>  create mode 100644 package/owfs/0001-fix-owshell-libusb-for-owfs-3.1p0.patch
>  create mode 100644 package/owfs/Config.in
>  create mode 100644 package/owfs/owfs.mk
> 
> diff --git a/package/Config.in b/package/Config.in
> index e0c2e2a..bbc20a8 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -846,6 +846,7 @@ menu "Hardware handling"
>  	source "package/mtdev/Config.in"
>  	source "package/ne10/Config.in"
>  	source "package/neardal/Config.in"
> +        source "package/owfs/Config.in"
>  	source "package/pcsc-lite/Config.in"
>  	source "package/tslib/Config.in"
>  	source "package/urg/Config.in"
> diff --git a/package/owfs/0001-fix-owshell-libusb-for-owfs-3.1p0.patch b/package/owfs/0001-fix-owshell-libusb-for-owfs-3.1p0.patch
> new file mode 100644
> index 0000000..cdaa39d
> --- /dev/null
> +++ b/package/owfs/0001-fix-owshell-libusb-for-owfs-3.1p0.patch

You need to add your Sob line and a description about the change.

> @@ -0,0 +1,127 @@
> +diff -Nur owfs-3.1p0/module/owshell/src/c/Makefile.am owfs-3.1p0-patched/module/owshell/src/c/Makefile.am
> +--- a/module/owshell/src/c/Makefile.am	2015-01-11 02:31:32.000000000 +0100
> ++++ b/module/owshell/src/c/Makefile.am	2015-05-02 19:13:00.000000000 +0200
> +@@ -41,7 +41,9 @@
> + 	-Wcast-align \
> + 	-Wstrict-prototypes \
> + 	-Wredundant-decls \
> +-	${EXTRACFLAGS}
> ++        ${EXTRACFLAGS} \
> ++        ${LIBUSB_CFLAGS} \
> ++        ${PTHREAD_CFLAGS}

I don't think this is the right fix with the PATH overwrite in owfs.mk. If you
have a link issue with libusb, you can try to use pkg-config to retrieve the
necessary CFLAGS. To be investigated...

> + 
> +-LDADD = ${LD_EXTRALIBS} ${OSLIBS}
> ++LDADD = ${LIBUSB_LIBS} ${PTHREAD_LIBS} ${LD_EXTRALIBS} ${OSLIBS}
> + 
> +diff -Nur owfs-3.1p0/module/owshell/src/c/Makefile.in owfs-3.1p0-patched/module/owshell/src/c/Makefile.in
> +--- a/module/owshell/src/c/Makefile.in	2015-03-15 02:38:32.000000000 +0100
> ++++ b/module/owshell/src/c/Makefile.in	2015-05-02 19:12:00.000000000 +0200

Since the package is autoreconfed, you doesn't need to patch Makefile.in.

> +@@ -1,7 +1,7 @@
> +-# Makefile.in generated by automake 1.14.1 from Makefile.am.
> ++# Makefile.in generated by automake 1.15 from Makefile.am.
> + # @configure_input@
> + 
> +-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
> ++# Copyright (C) 1994-2014 Free Software Foundation, Inc.
> + 
> + # This Makefile.in is free software; the Free Software Foundation
> + # gives unlimited permission to copy and/or distribute it,
> +@@ -15,7 +15,17 @@
> + @SET_MAKE@
> + 
> + VPATH = @srcdir@
> +-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
> ++am__is_gnu_make = { \
> ++  if test -z '$(MAKELEVEL)'; then \
> ++    false; \
> ++  elif test -n '$(MAKE_HOST)'; then \
> ++    true; \
> ++  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
> ++    true; \
> ++  else \
> ++    false; \
> ++  fi; \
> ++}
> + am__make_running_with_option = \
> +   case $${target_option-} in \
> +       ?) ;; \
> +@@ -82,16 +92,8 @@
> + bin_PROGRAMS = owget$(EXEEXT) owdir$(EXEEXT) owread$(EXEEXT) \
> + 	owwrite$(EXEEXT) owpresent$(EXEEXT) owexist$(EXEEXT)
> + subdir = module/owshell/src/c
> +-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
> +-	$(top_srcdir)/src/scripts/install/mkinstalldirs \
> +-	$(top_srcdir)/src/scripts/install/depcomp
> + ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
> +-am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \
> +-	$(top_srcdir)/src/scripts/m4/ltoptions.m4 \
> +-	$(top_srcdir)/src/scripts/m4/ltsugar.m4 \
> +-	$(top_srcdir)/src/scripts/m4/ltversion.m4 \
> +-	$(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \
> +-	$(top_srcdir)/acinclude.m4 \
> ++am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
> + 	$(top_srcdir)/src/scripts/m4/acx_pthread.m4 \
> + 	$(top_srcdir)/module/swig/perl5/perl5.m4 \
> + 	$(top_srcdir)/module/swig/php/php.m4 \
> +@@ -99,6 +101,7 @@
> + 	$(top_srcdir)/module/owtcl/tcl.m4 $(top_srcdir)/configure.ac
> + am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
> + 	$(ACLOCAL_M4)
> ++DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
> + mkinstalldirs = $(SHELL) \
> + 	$(top_srcdir)/src/scripts/install/mkinstalldirs
> + CONFIG_HEADER = $(top_builddir)/src/include/config.h
> +@@ -201,6 +204,9 @@
> +   done | $(am__uniquify_input)`
> + ETAGS = etags
> + CTAGS = ctags
> ++am__DIST_COMMON = $(srcdir)/Makefile.in \
> ++	$(top_srcdir)/src/scripts/install/depcomp \
> ++	$(top_srcdir)/src/scripts/install/mkinstalldirs
> + DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
> + ACLOCAL = @ACLOCAL@
> + AMTAR = @AMTAR@
> +@@ -295,6 +301,7 @@
> + LT_CURRENT = @LT_CURRENT@
> + LT_RELEASE = @LT_RELEASE@
> + LT_REVISION = @LT_REVISION@
> ++LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
> + MAKEINFO = @MAKEINFO@
> + MANIFEST_TOOL = @MANIFEST_TOOL@
> + MKDIR_P = @MKDIR_P@
> +@@ -498,9 +505,11 @@
> + 	-Wcast-align \
> + 	-Wstrict-prototypes \
> + 	-Wredundant-decls \
> +-	${EXTRACFLAGS}
> ++	${EXTRACFLAGS} \
> ++        ${LIBUSB_CFLAGS} \
> ++        ${PTHREAD_CFLAGS}
> + 
> +-LDADD = ${LD_EXTRALIBS} ${OSLIBS}
> ++LDADD = ${LIBUSB_LIBS} ${PTHREAD_LIBS} ${LD_EXTRALIBS} ${OSLIBS}
> + all: all-am
> + 
> + .SUFFIXES:
> +@@ -514,10 +523,9 @@
> + 	      exit 1;; \
> + 	  esac; \
> + 	done; \
> +-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign module/owshell/src/c/Makefile'; \
> ++	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu module/owshell/src/c/Makefile'; \
> + 	$(am__cd) $(top_srcdir) && \
> +-	  $(AUTOMAKE) --foreign module/owshell/src/c/Makefile
> +-.PRECIOUS: Makefile
> ++	  $(AUTOMAKE) --gnu module/owshell/src/c/Makefile
> + Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
> + 	@case '$?' in \
> + 	  *config.status*) \
> +@@ -865,6 +873,8 @@
> + 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
> + 	tags tags-am uninstall uninstall-am uninstall-binPROGRAMS
> + 
> ++.PRECIOUS: Makefile
> ++
> + 
> + # Tell versions [3.59,3.63) of GNU make to not export all variables.
> + # Otherwise a system limit (for SysV at least) may be exceeded.
> diff --git a/package/owfs/Config.in b/package/owfs/Config.in
> new file mode 100644
> index 0000000..7633e3e
> --- /dev/null
> +++ b/package/owfs/Config.in
> @@ -0,0 +1,33 @@
> +config BR2_PACKAGE_OWFS
> +        bool "owfs"
> +        select BR2_PACKAGE_LIBFUSE
> +        help
> +          OWFS is an easy way to use the powerful 1-wire system of
> +          Dallas/Maxim.
> +          http://owfs.org/
> +          Original owfs patch comes from here:
> +          https://github.com/davygravy/owfsplug
> +          by Dave Purdy davygravy
> +          

There are some trailing space

> +          Notes:
> +          - uClibc: librpc must be enabled
> +          - FUSE must be enabled in the kernel (module or built-in)
> +          

ditto

> +          Tested on 2015.2 and master git, uclibc and glibc.
> +          This package based on owfs version 3.1p0 from sourceforge:
> +          http://sourceforge.net/projects/owfs/files/owfs/
> +
> +          Usage:
> +            Create a mountpoint, where you will use owfs, for example:
> +            mkdir /mnt/1wire
> +          

ditto

> +            Issue the following command, where the ttySx is your owfs port:
> +            owfs /dev/ttySx /mnt/1wire
> +            Enjoy :)
> +
> +          Summarized by Istvan Pongracz (pongraczi on github)
> +          16th of May, 2015
> +
> +          
> +
> +

ditto + empty new lines.

I like that you add an usage example here :)

> diff --git a/package/owfs/owfs.mk b/package/owfs/owfs.mk
> new file mode 100644
> index 0000000..7ba784d
> --- /dev/null
> +++ b/package/owfs/owfs.mk
> @@ -0,0 +1,20 @@
> +###############################################################################
> +#
> +# owfs
> +#
> +###############################################################################

Usually we add a new line here

> +OWFS_VERSION = 3.1p0

> +OWFS_SOURCE = owfs-$(OWFS_VERSION).tar.gz

This is not needed since tar.gz extension is the default.

> +OWFS_SITE =  http://downloads.sourceforge.net/project/owfs/owfs/$(OWFS_VERSION)

> +OWFS_INSTALL_STAGING = YES

Why this is needed ?

> +OWFS_INSTALL_TARGET = YES

This is not needed since target packages are installed to target by default.

> +OWFS_CONF_ENV = PATH=$(STAGING_DIR)/usr/bin:$(BR_PATH)

> +OWFS_CONF_OPTS = --enable-owshell --enable-owhttpd --enable-owftpd \
> +--enable-owserver --enable-ownet --enable-ownetlib --enable-owtap \
> +--enable-owmon --enable-owcapi  --enable-usb 

There is a trailing space here.

> +OWFS_DEPENDENCIES = libfuse libusb libusb-compat

In the Config.in you select only the libfuse package, you must also select
libusb and libusb-compat.

> +OWFS_AUTORECONF = YES

You need to add a comment to say why the package needs to be autoreconfed.
Just add the patch's name:
# 0001-fix-owshell-libusb-for-owfs-3.1p0.patch
OWFS_AUTORECONF = YES

> +
> +$(eval $(autotools-package))

> +$(eval $(host-autotools-package))
> +
> 
Why a host package is needed ?

Can you resend an updated version of your patch ?

Best regards,
Romain Naour


More information about the buildroot mailing list