Skip to contentSkip to conversation

Pull request for branch yem-host-image-tools

GIT PULL New Yann E. MORIN 2 participants 9 messages Feb 8, 2013

lore
Share & tools
lore
#0 lore raw

Hello All!

This series adds a few host packages usefull for manipulating the generated filesystem images.

It is of much interest when the post-image series [0] from Thomas has been applied.

[0] http://patchwork.ozlabs.org/patch/219004/

I plan on submitting sample post-{build,image} scripts demonstrating use of these packages in the (hopefuly near) future (my current scripts are working great, but need some cleanup first).

The following changes since commit 7d1184de763c2a9779d454ab96a05080458fb3c9:

package/tvheadend: use a non-root user to run the daemon (2013-02-08 15:50:17 +0100)

are available in the git repository at:
git://gitorious.org/buildroot/buildroot.git yem-host-image-tools

Yann E. MORIN (6):
package/e2fsprogs: add host-package selection package/dosfstools: add host-package selection package/libconfuse: add host variant package/genimage: new host-only package package/genpart: new host-only package package/mtools: new host-package

 package/Config.in.host                        |    5 +++++
 package/dosfstools/Config.in.host             |    6 ++++++
 package/dosfstools/dosfstools.mk              |    9 +++++++++
 package/e2fsprogs/Config.in.host              |    6 ++++++
 package/genimage/Config.in.host               |   12 ++++++++++++
 package/genimage/genimage.mk                  |   12 ++++++++++++
 package/genpart/Config.in.host                |    8 ++++++++
 package/genpart/genpart-fix-return-code.patch |   25 +++++++++++++++++++++++++
 package/genpart/genpart.mk                    |   11 +++++++++++
 package/libconfuse/libconfuse.mk              |    1 +
 package/mtools/Config.in.host                 |    9 +++++++++
 package/mtools/mtools.mk                      |   15 +++++++++++++++
 12 files changed, 119 insertions(+), 0 deletions(-)
 create mode 100644 package/dosfstools/Config.in.host
 create mode 100644 package/e2fsprogs/Config.in.host
 create mode 100644 package/genimage/Config.in.host
 create mode 100644 package/genimage/genimage.mk
 create mode 100644 package/genpart/Config.in.host
 create mode 100644 package/genpart/genpart-fix-return-code.patch
 create mode 100644 package/genpart/genpart.mk
 create mode 100644 package/mtools/Config.in.host
 create mode 100644 package/mtools/mtools.mk

Regards,
Yann E. MORIN

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#1 lore raw

PATCH 1/6 package/e2fsprogs: add host-package selection

Add the e2fsprogs as a host-package selection in the menuconfig.

---
 package/Config.in.host           |    1 +
 package/e2fsprogs/Config.in.host |    6 ++++++
 2 files changed, 7 insertions(+), 0 deletions(-)
 create mode 100644 package/e2fsprogs/Config.in.host
package/Config.in.host +1 -0
index 79050f2..8813f5b 100644
@@ -1,6 +1,7 @@
 menu "Host utilities"
 
 source "package/dfu-util/Config.in.host"
+source "package/e2fsprogs/Config.in.host"
 source "package/lpc3250loader/Config.in.host"
 source "package/omap-u-boot-utils/Config.in.host"
 source "package/openocd/Config.in.host"
package/e2fsprogs/Config.in.host new file +6 -0
new file mode 100644
index 0000000..ea6a0bd
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_HOST_E2FSPROGS
+	bool "host e2fsprogs"
+	help
+	  The EXT2 file system utilities.
+	  
+	  http://e2fsprogs.sf.net
Signature · 1 line
1.7.2.5
#2 lore raw

PATCH 2/6 package/dosfstools: add host-package selection

In reply to Yann E. MORIN

Add dosfstools as a host-package selection in the menuconfig.

---
 package/Config.in.host            |    1 +
 package/dosfstools/Config.in.host |    6 ++++++
 package/dosfstools/dosfstools.mk  |    9 +++++++++
 3 files changed, 16 insertions(+), 0 deletions(-)
 create mode 100644 package/dosfstools/Config.in.host
package/Config.in.host +1 -0
index 8813f5b..43f292c 100644
@@ -1,6 +1,7 @@
 menu "Host utilities"
 
 source "package/dfu-util/Config.in.host"
+source "package/dosfstools/Config.in.host"
 source "package/e2fsprogs/Config.in.host"
 source "package/lpc3250loader/Config.in.host"
 source "package/omap-u-boot-utils/Config.in.host"
package/dosfstools/Config.in.host new file +6 -0
new file mode 100644
index 0000000..9f9ceab
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_HOST_DOSFSTOOLS
+	bool "host dosfstools"
+	help
+	  Tools for creating and checking DOS FAT filesystems.
+	  
+	  http://www.daniel-baumann.ch/software/dosfstools/
package/dosfstools/dosfstools.mk +9 -0
index 4f89364..cacd6dd 100644
@@ -36,4 +36,13 @@ define DOSFSTOOLS_CLEAN_CMDS
 	-$(MAKE) -C $(@D) clean
 endef
 
+define HOST_DOSFSTOOLS_BUILD_CMDS
+	$(MAKE) CC="$(HOSTCC)" -C $(@D)
+endef
+
+define HOST_DOSFSTOOLS_INSTALL_CMDS
+	$(MAKE) -C $(@D) CC="$(HOSTCC)" PREFIX=$(HOST_DIR)/usr install
+endef
+
 $(eval $(generic-package))
+$(eval $(host-generic-package))
Signature · 1 line
1.7.2.5
#3 lore raw

PATCH 2/6 package/dosfstools: add host-package selection

Dear Yann E. MORIN,

package/dosfstools/dosfstools.mk define DOSFSTOOLS_CLEAN_CMDS · line 45

Quoted 7 lines · Yann E. MORIN
package/dosfstools/dosfstools.mk +7 -0
+define HOST_DOSFSTOOLS_BUILD_CMDS
+	$(MAKE) CC="$(HOSTCC)" -C $(@D)
+endef
+
+define HOST_DOSFSTOOLS_INSTALL_CMDS
+	$(MAKE) -C $(@D) CC="$(HOSTCC)" PREFIX=$(HOST_DIR)/usr install
+endef

$(HOST_CONFIGURE_OPTS) here maybe instead of CC="$(HOSTCC)" ?

Thanks,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#4 lore raw

PATCH 3/6 package/libconfuse: add host variant

In reply to Yann E. MORIN

Needed later by genimage.

---
 package/libconfuse/libconfuse.mk |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
package/libconfuse/libconfuse.mk +1 -0
index 2fa8241..d88a209 100644
@@ -10,3 +10,4 @@ LIBCONFUSE_INSTALL_STAGING = YES
 LIBCONFUSE_CONF_OPT = --disable-rpath
 
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
Signature · 1 line
1.7.2.5
#5 lore raw

PATCH 4/6 package/genimage: new host-only package

In reply to Yann E. MORIN
---
 package/Config.in.host          |    1 +
 package/genimage/Config.in.host |   12 ++++++++++++
 package/genimage/genimage.mk    |   12 ++++++++++++
 3 files changed, 25 insertions(+), 0 deletions(-)
 create mode 100644 package/genimage/Config.in.host
 create mode 100644 package/genimage/genimage.mk
package/Config.in.host +1 -0
index 43f292c..c456d5d 100644
@@ -3,6 +3,7 @@ menu "Host utilities"
 source "package/dfu-util/Config.in.host"
 source "package/dosfstools/Config.in.host"
 source "package/e2fsprogs/Config.in.host"
+source "package/genimage/Config.in.host"
 source "package/lpc3250loader/Config.in.host"
 source "package/omap-u-boot-utils/Config.in.host"
 source "package/openocd/Config.in.host"
package/genimage/Config.in.host new file +12 -0
new file mode 100644
index 0000000..cfa267c
@@ -0,0 +1,12 @@
+config BR2_PACKAGE_HOST_GENIMAGE
+	bool "host genimage"
+	help
+	  genimage is a tool to generate multiple filesystem and flash images
+	  from a given root filesystem tree. genimage is intended to be run
+	  in a fakeroot environment.
+	  
+	  Configuration is done is a config file parsed by libconfuse. Options
+	  like the path to tools can be given in environment variables, the config
+	  file or commandline switches.
+	  
+	  http://www.pengutronix.de/software/genimage/
package/genimage/genimage.mk new file +12 -0
new file mode 100644
index 0000000..8fe9bf7
@@ -0,0 +1,12 @@
+#############################################################
+#
+# genimage
+#
+##############################################################
+
+GENIMAGE_VERSION        = 4
+GENIMAGE_SOURCE         = genimage-$(GENIMAGE_VERSION).tar.xz
+GENIMAGE_SITE           = http://www.pengutronix.de/software/genimage/download/
+GENIMAGE_DEPENDENCIES   = libconfuse
+
+$(eval $(host-autotools-package))
Signature · 1 line
1.7.2.5
#6 lore raw

PATCH 5/6 package/genpart: new host-only package

In reply to Yann E. MORIN
---
 package/Config.in.host                        |    1 +
 package/genpart/Config.in.host                |    8 ++++++++
 package/genpart/genpart-fix-return-code.patch |   25 +++++++++++++++++++++++++
 package/genpart/genpart.mk                    |   11 +++++++++++
 4 files changed, 45 insertions(+), 0 deletions(-)
 create mode 100644 package/genpart/Config.in.host
 create mode 100644 package/genpart/genpart-fix-return-code.patch
 create mode 100644 package/genpart/genpart.mk
package/Config.in.host +1 -0
index c456d5d..e97f6e8 100644
@@ -4,6 +4,7 @@ source "package/dfu-util/Config.in.host"
 source "package/dosfstools/Config.in.host"
 source "package/e2fsprogs/Config.in.host"
 source "package/genimage/Config.in.host"
+source "package/genpart/Config.in.host"
 source "package/lpc3250loader/Config.in.host"
 source "package/omap-u-boot-utils/Config.in.host"
 source "package/openocd/Config.in.host"
package/genpart/Config.in.host new file +8 -0
new file mode 100644
index 0000000..f986504
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_HOST_GENPART
+	bool "host genpart"
+	help
+	  Generate a 16 byte partition table entry defined by command line
+	  arguments and dump it to stdout. No CHS magic is done, only lba
+	  entries are filled out.
+	  
+	  http://www.pengutronix.de/software/genpart/index_en.html
package/genpart/genpart-fix-return-code.patch new file +25 -0
new file mode 100644
index 0000000..14ff165
@@ -0,0 +1,25 @@
+genpart: return 0 if partition writen OK, with no do_magic
+
+If do_magic is false, we don't won't write the 0xaa55 magic.
+However, if we succesfully wrote the partition entry, we still
+want to return 0 to indicate success.
+
+Signed-off-by: "Yann E. MORIN" <[email protected]>
+Cc: Robert Schwebel <[email protected]>
+
+--
+Patch sent upstream, but no mailing list.
+Status: pending...
+
+diff -durN host-genpart-1.0.2.orig/src/genpart.c host-genpart-1.0.2/src/genpart.c
+--- host-genpart-1.0.2.orig/src/genpart.c	2009-12-20 21:54:56.000000000 +0100
++++ host-genpart-1.0.2/src/genpart.c	2013-01-22 23:13:24.109752579 +0100
+@@ -92,6 +92,8 @@
+ 		if (do_magic) {
+ 			if (fwrite(&magic, 2, 1, stdout) > 0)
+ 				rc=0;
++		} else {
++			rc=0;
+ 		}
+ 	}
+ 	return rc;
package/genpart/genpart.mk new file +11 -0
new file mode 100644
index 0000000..735333a
@@ -0,0 +1,11 @@
+#############################################################
+#
+# genpart
+#
+#############################################################
+
+GENPART_VERSION       = 1.0.2
+GENPART_SOURCE        = genpart-$(GENPART_VERSION).tar.bz2
+GENPART_SITE          = http://www.pengutronix.de/software/genpart/download/
+
+$(eval $(host-autotools-package))
Signature · 1 line
1.7.2.5
#7 lore raw

PATCH 6/6 package/mtools: new host-package

In reply to Yann E. MORIN
---
 package/Config.in.host        |    1 +
 package/mtools/Config.in.host |    9 +++++++++
 package/mtools/mtools.mk      |   15 +++++++++++++++
 3 files changed, 25 insertions(+), 0 deletions(-)
 create mode 100644 package/mtools/Config.in.host
 create mode 100644 package/mtools/mtools.mk
package/Config.in.host +1 -0
index e97f6e8..7c0dd20 100644
@@ -6,6 +6,7 @@ source "package/e2fsprogs/Config.in.host"
 source "package/genimage/Config.in.host"
 source "package/genpart/Config.in.host"
 source "package/lpc3250loader/Config.in.host"
+source "package/mtools/Config.in.host"
 source "package/omap-u-boot-utils/Config.in.host"
 source "package/openocd/Config.in.host"
 source "package/sam-ba/Config.in.host"
package/mtools/Config.in.host new file +9 -0
new file mode 100644
index 0000000..d534b5e
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_HOST_MTOOLS
+	bool "host mtools"
+	help
+	  Mtools is a collection of utilities to access MS-DOS disks from
+	  Unix without mounting them. It supports Win'95 style long file
+	  names, OS/2 Xdf disks and 2m disks (store up to 1992k on a high
+	  density 3 1/2 disk).
+	  
+	  http://www.tux.org/pub/tux/mtools/
package/mtools/mtools.mk new file +15 -0
new file mode 100644
index 0000000..95cc73e
@@ -0,0 +1,15 @@
+#############################################################
+#
+# dosfstools
+#
+#############################################################
+
+MTOOLS_VERSION          = 4.0.18
+MTOOLS_SOURCE           = mtools-$(MTOOLS_VERSION).tar.bz2
+MTOOLS_SITE             = http://ftp.gnu.org/gnu/mtools/
+
+MTOOLS_CONF_OPT = --enable-xdf        \
+                  --enable-vold       \
+                  --enable-new-vold
+
+$(eval $(host-autotools-package))
Signature · 1 line
1.7.2.5
#8 lore raw

PATCH 6/6 package/mtools: new host-package

Dear Yann E. MORIN,

Quoted 6 lines · Yann E. MORIN
package/mtools/mtools.mk new file +0 -0
new file mode 100644
index 0000000..95cc73e

package/mtools/mtools.mk line 8

Quoted 8 lines
package/mtools/mtools.mk new file +8 -0
@@ -0,0 +1,15 @@
+#############################################################
+#
+# dosfstools
+#
+#############################################################
+
+MTOOLS_VERSION          = 4.0.18
+MTOOLS_SOURCE           = mtools-$(MTOOLS_VERSION).tar.bz2

Why so many spaces ? :-)

package/mtools/mtools.mk line 9

Quoted 1 line
package/mtools/mtools.mk new file +1 -0
+MTOOLS_SITE             = http://ftp.gnu.org/gnu/mtools/

BR2_GNU_MIRROR

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com