Skip to contentSkip to conversation

new package: fwup (host and target)

PATCH New Wojciech Nizinski 3 participants 3 messages Apr 5, 2016 – Jun 13, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 new package: fwup (host and target)

To easily generate bootable binary image of SD card.
BR package files comes from project https://github.com/fhunleth/bbb-
buildroot-fwup

---
 package/Config.in                |  1 +
 package/Config.in.host           |  1 +
 package/fwup/Config.in           | 14 ++++++++++++++
 package/fwup/Config.in.host      |  6 ++++++
 package/fwup/fwup.mk             | 21 +++++++++++++++++++++
 package/libarchive/libarchive.mk |  1 +
 package/libsodium/libsodium.mk   |  1 +
 7 files changed, 45 insertions(+)
 create mode 100644 package/fwup/Config.in
 create mode 100644 package/fwup/Config.in.host
 create mode 100644 package/fwup/fwup.mk
package/Config.in +1 -0
index 5dd6374..58666af 100644
@@ -171,6 +171,7 @@ menu "Filesystem and flash utilities"
 	source "package/exfat-utils/Config.in"
 	source "package/f2fs-tools/Config.in"
 	source "package/flashbench/Config.in"
+	source "package/fwup/Config.in"
 	source "package/genext2fs/Config.in"
 	source "package/genpart/Config.in"
 	source "package/genromfs/Config.in"
package/Config.in.host +1 -0
index 1c691a3..2b1bde7 100644
@@ -10,6 +10,7 @@ menu "Host utilities"
 	source "package/e2fsprogs/Config.in.host"
 	source "package/e2tools/Config.in.host"
 	source "package/faketime/Config.in.host"
+	source "package/fwup/Config.in.host"
 	source "package/genext2fs/Config.in.host"
 	source "package/genimage/Config.in.host"
 	source "package/genpart/Config.in.host"
package/fwup/Config.in new file +14 -0
new file mode 100644
index 0000000..67736b2
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_FWUP
+	bool "fwup"
+	depends on BR2_USE_MMU
+	select BR2_PACKAGE_LIBARCHIVE
+	select BR2_PACKAGE_ZLIB        # required by libarchive to include zip compression
+	select BR2_PACKAGE_LIBCONFUSE
+	select BR2_PACKAGE_LIBSODIUM
+	help
+	  Fwup is a scriptable embedded Linux firmware update creator and runner.
+
+	  https://github.com/fhunleth/fwup
+
+comment "fwup needs a toolchain w/ wchar"
+	depends on !BR2_USE_WCHAR
package/fwup/Config.in.host new file +6 -0
new file mode 100644
index 0000000..ae71a33
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_HOST_FWUP
+	bool "host fwup"
+	help
+	  Fwup is a scriptable embedded Linux firmware update creator and runner.
+
+	  https://github.com/fhunleth/fwup
package/fwup/fwup.mk new file +21 -0
new file mode 100644
index 0000000..1feee07
@@ -0,0 +1,21 @@
+#############################################################
+#
+# fwup
+#
+#############################################################
+
+FWUP_VERSION = v0.6.1
+FWUP_SITE = $(call github,fhunleth,fwup,$(FWUP_VERSION))
+FWUP_LICENSE = Apache-2.0
+FWUP_LICENSE_FILES = LICENSE
+FWUP_AUTORECONF = YES
+FWUP_DEPENDENCIES = libconfuse libarchive libsodium
+
+define FWUP_RUN_AUTOGEN
+	cd $(@D) && PATH=$(BR_PATH) ./autogen.sh
+endef
+HOST_FWUP_PRE_CONFIGURE_HOOKS += FWUP_RUN_AUTOGEN
+FWUP_PRE_CONFIGURE_HOOKS += FWUP_RUN_AUTOGEN
+
+$(eval $(autotools-package))
+$(eval $(host-autotools-package))
package/libarchive/libarchive.mk +1 -0
index 206de3f..f45335e 100644
@@ -93,3 +93,4 @@ LIBARCHIVE_CONF_OPTS += --without-lzma
 endif
 
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
package/libsodium/libsodium.mk +1 -0
index 09bc777..fd89ced 100644
@@ -15,3 +15,4 @@ LIBSODIUM_CONF_OPTS += --disable-pie
 endif
 
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/1 new package: fwup (host and target)

Hello,

Quoted 5 lines · Wojciech Nizinski

To easily generate bootable binary image of SD card.
BR package files comes from project https://github.com/fhunleth/bbb-
buildroot-fwup

Thanks, I've merged your patch, after doing a number of changes. See below for the details.

package/fwup/Config.in line 3

Quoted 9 lines
package/fwup/Config.in new file +3 -0
new file mode 100644
index 0000000..67736b2
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_FWUP
+	bool "fwup"
+	depends on BR2_USE_MMU

You missed the wchar dependency here... even though you had a comment for it.

package/fwup/Config.in line 5

Quoted 2 lines
package/fwup/Config.in new file +2 -0
+	select BR2_PACKAGE_LIBARCHIVE
+	select BR2_PACKAGE_ZLIB        # required by libarchive to include zip compression

I've put the comment above the select, since the comment is pretty long.

package/fwup/Config.in line 9

Quoted 4 lines
package/fwup/Config.in new file +4 -0
+	select BR2_PACKAGE_LIBCONFUSE
+	select BR2_PACKAGE_LIBSODIUM
+	help
+	  Fwup is a scriptable embedded Linux firmware update creator and runner.

I've rewrapped the help text, this line was slightly too long.

package/fwup/Config.in line 13

Quoted 4 lines
package/fwup/Config.in new file +4 -0
+
+	  https://github.com/fhunleth/fwup
+
+comment "fwup needs a toolchain w/ wchar"

I've added:

depends on BR2_USE_MMU

here since we don't want this comment to be shown on platforms where fwup can anyway not be enabled.

package/fwup/Config.in.host line 4

Quoted 11 lines
package/fwup/Config.in new file +1 -0
+	depends on !BR2_USE_WCHAR
package/fwup/Config.in.host new file +4 -0
new file mode 100644
index 0000000..ae71a33
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_HOST_FWUP
+	bool "host fwup"
+	help
+	  Fwup is a scriptable embedded Linux firmware update creator and runner.

I rewrapped this.

Quoted 8 lines
package/fwup/Config.in.host new file +2 -0
+
+	  https://github.com/fhunleth/fwup
package/fwup/fwup.mk new file +0 -0
new file mode 100644
index 0000000..1feee07

package/fwup/fwup.mk line 7

Quoted 7 lines
package/fwup/fwup.mk new file +7 -0
@@ -0,0 +1,21 @@
+#############################################################
+#
+# fwup
+#
+#############################################################
+
+FWUP_VERSION = v0.6.1

I've updated to 0.7.0? which has been released since then.

package/fwup/fwup.mk line 18

Quoted 11 lines
package/fwup/fwup.mk new file +11 -0
+FWUP_SITE = $(call github,fhunleth,fwup,$(FWUP_VERSION))
+FWUP_LICENSE = Apache-2.0
+FWUP_LICENSE_FILES = LICENSE
+FWUP_AUTORECONF = YES
+FWUP_DEPENDENCIES = libconfuse libarchive libsodium
+
+define FWUP_RUN_AUTOGEN
+	cd $(@D) && PATH=$(BR_PATH) ./autogen.sh
+endef
+HOST_FWUP_PRE_CONFIGURE_HOOKS += FWUP_RUN_AUTOGEN
+FWUP_PRE_CONFIGURE_HOOKS += FWUP_RUN_AUTOGEN

I've replaced this hook by a hook that simply creates the m4 directory, which is all what was missing to make autoreconf work.

I've submitted a patch fixing this upstream:
https://github.com/fhunleth/fwup/pull/32.

Also, fwup failed to build for the target with the uClibc C library, which is our default C library. I had to make a patch for the source code (it was failing even with your original patch based on 0.6.1). I've submitted the patch upstream:
https://github.com/fhunleth/fwup/pull/31.

package/libarchive/libarchive.mk LIBARCHIVE_CONF_OPTS += --without-lzma · line 96

Quoted 12 lines
package/fwup/fwup.mk new file +3 -0
+
+$(eval $(autotools-package))
+$(eval $(host-autotools-package))
package/libarchive/libarchive.mk +1 -0
index 206de3f..f45335e 100644
@@ -93,3 +93,4 @@ LIBARCHIVE_CONF_OPTS += --without-lzma
 endif
 
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))

This should have been part of a separate patch, so I've split it. Also, adding this line is not sufficient: by default HOST_<pkg>_DEPENDENCIES is derived from <pkg>_DEPENDENCIES.

So when you have:

ifeq ($(BR2_PACKAGE_NETTLE),y)
LIBARCHIVE_DEPENDENCIES += nettle
else
LIBARCHIVE_CONF_OPTS += --without-nettle
endif

if you don't do anything, then HOST_LIBARCHIVE_DEPENDENCIES will contain host-nettle. Except that there is no host-nettle package, so the build would fail.

To avoid this, I added explicitly:

# The only user of host-libarchive needs zlib support HOST_LIBARCHIVE_DEPENDENCIES = host-zlib

HOST_LIBARCHIVE_CONF_OPTS = \
        --disable-bsdtar \
        --disable-bsdcpio \
        --disable-acl \
        --disable-xattr \
        --without-bz2lib \
        --without-expat \
        --without-libiconv-prefix \
        --without-xml2 \
        --without-lzo2 \
        --without-nettle \
        --without-openssl \
        --without-lzma

package/libsodium/libsodium.mk LIBSODIUM_CONF_OPTS += --disable-pie · line 18

Quoted 9 lines
package/libsodium/libsodium.mk +1 -0
index 09bc777..fd89ced 100644
@@ -15,3 +15,4 @@ LIBSODIUM_CONF_OPTS += --disable-pie
 endif
 
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))

I've also split this to a separate patch.

Thanks for your contribution!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 new package: fwup (host and target)

Hi Thomas and Wojciech,

Quoted 96 lines · Thomas Petazzoni

Hello,

Quoted 5 lines · Wojciech Nizinski

To easily generate bootable binary image of SD card.
BR package files comes from project https://github.com/fhunleth/bbb-
buildroot-fwup

Thanks, I've merged your patch, after doing a number of changes. See below for the details.

package/fwup/Config.in line 3

Quoted 9 lines
package/fwup/Config.in new file +3 -0
new file mode 100644
index 0000000..67736b2
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_FWUP
+     bool "fwup"
+     depends on BR2_USE_MMU

You missed the wchar dependency here... even though you had a comment for it.

package/fwup/Config.in line 5

Quoted 2 lines
package/fwup/Config.in new file +2 -0
+     select BR2_PACKAGE_LIBARCHIVE
+     select BR2_PACKAGE_ZLIB        # required by libarchive to include zip compression

I've put the comment above the select, since the comment is pretty long.

package/fwup/Config.in line 9

Quoted 4 lines
package/fwup/Config.in new file +4 -0
+     select BR2_PACKAGE_LIBCONFUSE
+     select BR2_PACKAGE_LIBSODIUM
+     help
+       Fwup is a scriptable embedded Linux firmware update creator and runner.

I've rewrapped the help text, this line was slightly too long.

package/fwup/Config.in line 13

Quoted 4 lines
package/fwup/Config.in new file +4 -0
+
+       https://github.com/fhunleth/fwup
+
+comment "fwup needs a toolchain w/ wchar"

I've added:

depends on BR2_USE_MMU

here since we don't want this comment to be shown on platforms where fwup can anyway not be enabled.

package/fwup/Config.in.host line 4

Quoted 11 lines
package/fwup/Config.in new file +1 -0
+     depends on !BR2_USE_WCHAR
package/fwup/Config.in.host new file +4 -0
new file mode 100644
index 0000000..ae71a33
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_HOST_FWUP
+     bool "host fwup"
+     help
+       Fwup is a scriptable embedded Linux firmware update creator and runner.

I rewrapped this.

Quoted 8 lines
package/fwup/Config.in.host new file +2 -0
+
+       https://github.com/fhunleth/fwup
package/fwup/fwup.mk new file +0 -0
new file mode 100644
index 0000000..1feee07

package/fwup/fwup.mk line 7

Quoted 7 lines
package/fwup/fwup.mk new file +7 -0
@@ -0,0 +1,21 @@
+#############################################################
+#
+# fwup
+#
+#############################################################
+
+FWUP_VERSION = v0.6.1

I've updated to 0.7.0? which has been released since then.

package/fwup/fwup.mk line 18

Quoted 11 lines
package/fwup/fwup.mk new file +11 -0
+FWUP_SITE = $(call github,fhunleth,fwup,$(FWUP_VERSION))
+FWUP_LICENSE = Apache-2.0
+FWUP_LICENSE_FILES = LICENSE
+FWUP_AUTORECONF = YES
+FWUP_DEPENDENCIES = libconfuse libarchive libsodium
+
+define FWUP_RUN_AUTOGEN
+     cd $(@D) && PATH=$(BR_PATH) ./autogen.sh
+endef
+HOST_FWUP_PRE_CONFIGURE_HOOKS += FWUP_RUN_AUTOGEN
+FWUP_PRE_CONFIGURE_HOOKS += FWUP_RUN_AUTOGEN

I've replaced this hook by a hook that simply creates the m4 directory, which is all what was missing to make autoreconf work.

Quoted 8 lines

I've submitted a patch fixing this upstream:
https://github.com/fhunleth/fwup/pull/32.

Also, fwup failed to build for the target with the uClibc C library, which is our default C library. I had to make a patch for the source code (it was failing even with your original patch based on 0.6.1). I've submitted the patch upstream:
https://github.com/fhunleth/fwup/pull/31.

Thanks for fixing these. I hadn't been paying attention and missed the fwup conversation here. Anyway, I've merged your PRs and plan to make a minor release this week. I'll send a patch this way to remove the need for BR to carry patches for fwup.

-Frank