[Buildroot] [PATCH 1/2] target/ubifs: fix compilation

Daniel Mack daniel at caiaq.de
Mon Jul 20 12:22:27 UTC 2009


On Sun, Jul 19, 2009 at 04:06:58PM +0200, Peter Korsgaard wrote:
>  Daniel> Signed-off-by: Daniel Mack <daniel at caiaq.de>
>  Daniel> ---
>  Daniel>  target/ubifs/ubifsroot.mk |   21 +++++++++++----------
> 
> 
> We'll also need to remove the 'depends on BROKEN' from Config.in

Ok, done.

>  Daniel>  1 files changed, 11 insertions(+), 10 deletions(-)
> 
>  Daniel> diff --git a/target/ubifs/ubifsroot.mk b/target/ubifs/ubifsroot.mk
>  Daniel> index 1707e46..d14bde1 100644
>  Daniel> --- a/target/ubifs/ubifsroot.mk
>  Daniel> +++ b/target/ubifs/ubifsroot.mk
>  Daniel> @@ -5,12 +5,13 @@
>  Daniel>  #############################################################
>  Daniel>  #MKFS_UBIFS_VERSION=2582f128dad78591bc3adcc87c343c690bb82e61
>  Daniel>  #MKFS_UBIFS_URL=http://git.infradead.org/users/dedekind/mkfs.ubifs.git?a=snapshot;h=$(MKFS_UBIFS_VERSION);sf=tgz
>  Daniel> -MKFS_UBIFS_VERSION=v0.4
>  Daniel> -MKFS_UBIFS_URL=http://git.infradead.org/users/dedekind/mkfs.ubifs.git?a=snapshot;h=refs/tags/mkfs.ubifs-$(MKFS_UBIFS_VERSION);sf=tgz
>  Daniel> -MKFS_UBIFS_SOURCE:=mkfs.ubifs-$(MKFS_UBIFS_VERSION).tar.gz
>  Daniel> -MKFS_UBIFS_DIR:= $(BUILD_DIR)/mkfs-ubifs-$(MKFS_UBIFS_VERSION)
>  Daniel> -MKFS_UBIFS_CAT:=$(ZCAT)
>  Daniel> -MKFS_UBIFS_NAME:=mkfs.ubifs
>  Daniel> +MKFS_UBIFS_VERSION=HEAD
>  Daniel> +MKFS_UBIFS_URL=http://git.infradead.org/mtd-utils.git?a=snapshot\;h=$(MKFS_UBIFS_VERSION)\;sf=tgz
> 
> 
> Why the backslashes? Wget here adds them to the URL:
> 
> --2009-07-19 15:54:50--
>   http://git.infradead.org/mtd-utils.git?a=snapshot%5C;h=HEAD%5C;sf=tgz
> 
> Which obviously fails.

Argh. Done, thanks.

>  Daniel> +MKFS_UBIFS_SOURCE=mtd-utils-$(MKFS_UBIFS_VERSION).tar.gz
>  Daniel> +MKFS_UBIFS_DIR=$(BUILD_DIR)/mkfs-utils-ubifs
>  Daniel> +MKFS_UBIFS_CAT=$(ZCAT)
>  Daniel> +MKFS_UBIFS_NAME=mtd-utils
>  Daniel> +MKFS_UBIFS_BINARY=$(MKFS_UBIFS_DIR)/mkfs.ubifs/mkfs.ubifs
>  
>  Daniel>  $(DL_DIR)/$(MKFS_UBIFS_SOURCE):
>  Daniel>  	$(WGET) -O $(DL_DIR)/$(MKFS_UBIFS_SOURCE) "$(MKFS_UBIFS_URL)"
>  Daniel> @@ -21,14 +22,14 @@ $(MKFS_UBIFS_DIR)/.unpacked: $(DL_DIR)/$(MKFS_UBIFS_SOURCE)
>  Daniel>  	toolchain/patch-kernel.sh $(MKFS_UBIFS_DIR) target/ubifs/ mkfs-ubifs-\*.patch
>  Daniel>  	touch $@
>  
>  Daniel> -$(MKFS_UBIFS_DIR)/mkfs.ubifs: $(MKFS_UBIFS_DIR)/.unpacked
>  Daniel> -	$(MAKE) -C $(MKFS_UBIFS_DIR)
>  Daniel> +$(MKFS_UBIFS_BINARY): $(MKFS_UBIFS_DIR)/.unpacked
>  Daniel> +	$(MAKE) -j1 -C $(MKFS_UBIFS_DIR) BUILDDIR=$(MKFS_UBIFS_DIR) WITHOUT_XATTR=1
> 
> 
> We have MAKE1 for this.

Fixed.

> The build breaks if you don't have liblzo development headers on the
> build host:
> 
> gcc -I./include   -DWITHOUT_XATTR -D_FILE_OFFSET_BITS=64 -O2 -g -Wall -Wextra -Wwrite-strings -Wno-sign-compare -c -o /tmp/br/i686/build_i686/mkfs-utils-ubifs/compr_lzo.o compr_lzo.c -g -Wp,-MD,/tmp/br/i686/build_i686/mkfs-utils-ubifs/.compr_lzo.c.dep
> compr_lzo.c:29:23: error: lzo/lzo1x.h: No such file or directory
> compr_lzo.c: In function ‘jffs2_lzo_cmpr’:
> compr_lzo.c:51: error: ‘lzo_uint’ undeclared (first use in this function)
> compr_lzo.c:51: error: (Each undeclared identifier is reported only once
> compr_lzo.c:51: error: for each function it appears in.)

Hmm. What's your propose to check that? We can't depend on a config flag
to be set, and building that liblzo-dev package manually doesn't seem to
be the right ay to go either.

> I really think the proper solution is to build the ubifs tools for the
> host in the mtd-utils package like we do for mkfs.jffs2. Now, if the
> mtd guys would put out a 1.3 release with all the new stuff it would
> be even better.

Which wouldn't solve the above problem, right? When there's a new
release, I'll have another look at it :)

> Care to fix this and resend?

See the patch below.

Thanks,
Daniel

>From e34756129287322dade8e1cb49df4a19d31d4bc5 Mon Sep 17 00:00:00 2001
From: Daniel Mack <daniel at caiaq.de>
Date: Wed, 3 Jun 2009 13:24:27 +0200
Subject: [PATCH] target/ubifs: fix compilation

The ubifs rootfs target does not currently build because the repository
listed in ubifsroot.mk does not exist anymore. Consequently, the used
tag is also wrong.

As the code base for mtd utils seem to have been merged in the past,
there are dependencies between ubi-utils, mkfs.ubifs and the mtd core
now, so we have no other option than building the whole thing.

WITHOUT_XATTR was added to the make parameters because it did not build
on my system without that. Maybe that should become a auto* variable
dependency in the future.

BUILDDIR is needed by the mtd-utils Makefile, otherwise built object
files are put to $(PWD) which is the toplevel br2 path.

MKFS_UBIFS_BINARY was added to ease the path chaos a bit.

Signed-off-by: Daniel Mack <daniel at caiaq.de>
---
 target/ubifs/Config.in    |    1 -
 target/ubifs/ubifsroot.mk |   21 +++++++++++----------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/target/ubifs/Config.in b/target/ubifs/Config.in
index 886c34b..90ebfd9 100644
--- a/target/ubifs/Config.in
+++ b/target/ubifs/Config.in
@@ -1,6 +1,5 @@
 config BR2_TARGET_ROOTFS_UBIFS
 	bool "ubifs root filesystem"
-	depends on BROKEN # upstream git gone, should use mtd-utils
 	select BR2_HOST_FAKEROOT
 	help
 	  Build a ubifs root filesystem
diff --git a/target/ubifs/ubifsroot.mk b/target/ubifs/ubifsroot.mk
index 1707e46..c4d9051 100644
--- a/target/ubifs/ubifsroot.mk
+++ b/target/ubifs/ubifsroot.mk
@@ -5,12 +5,13 @@
 #############################################################
 #MKFS_UBIFS_VERSION=2582f128dad78591bc3adcc87c343c690bb82e61
 #MKFS_UBIFS_URL=http://git.infradead.org/users/dedekind/mkfs.ubifs.git?a=snapshot;h=$(MKFS_UBIFS_VERSION);sf=tgz
-MKFS_UBIFS_VERSION=v0.4
-MKFS_UBIFS_URL=http://git.infradead.org/users/dedekind/mkfs.ubifs.git?a=snapshot;h=refs/tags/mkfs.ubifs-$(MKFS_UBIFS_VERSION);sf=tgz
-MKFS_UBIFS_SOURCE:=mkfs.ubifs-$(MKFS_UBIFS_VERSION).tar.gz
-MKFS_UBIFS_DIR:= $(BUILD_DIR)/mkfs-ubifs-$(MKFS_UBIFS_VERSION)
-MKFS_UBIFS_CAT:=$(ZCAT)
-MKFS_UBIFS_NAME:=mkfs.ubifs
+MKFS_UBIFS_VERSION=HEAD
+MKFS_UBIFS_URL=http://git.infradead.org/mtd-utils.git?a=snapshot;h=$(MKFS_UBIFS_VERSION);sf=tgz
+MKFS_UBIFS_SOURCE=mtd-utils-$(MKFS_UBIFS_VERSION).tar.gz
+MKFS_UBIFS_DIR=$(BUILD_DIR)/mkfs-utils-ubifs
+MKFS_UBIFS_CAT=$(ZCAT)
+MKFS_UBIFS_NAME=mtd-utils
+MKFS_UBIFS_BINARY=$(MKFS_UBIFS_DIR)/mkfs.ubifs/mkfs.ubifs
 
 $(DL_DIR)/$(MKFS_UBIFS_SOURCE):
 	$(WGET) -O $(DL_DIR)/$(MKFS_UBIFS_SOURCE) "$(MKFS_UBIFS_URL)"
@@ -21,14 +22,14 @@ $(MKFS_UBIFS_DIR)/.unpacked: $(DL_DIR)/$(MKFS_UBIFS_SOURCE)
 	toolchain/patch-kernel.sh $(MKFS_UBIFS_DIR) target/ubifs/ mkfs-ubifs-\*.patch
 	touch $@
 
-$(MKFS_UBIFS_DIR)/mkfs.ubifs: $(MKFS_UBIFS_DIR)/.unpacked
-	$(MAKE) -C $(MKFS_UBIFS_DIR)
+$(MKFS_UBIFS_BINARY): $(MKFS_UBIFS_DIR)/.unpacked
+	$(MAKE1) -C $(MKFS_UBIFS_DIR) BUILDDIR=$(MKFS_UBIFS_DIR) WITHOUT_XATTR=1
 	touch -c $@
 
 mkfs.ubifs-dirclean:
 	rm -rf $(MKFS_UBIFS_DIR)
 
-mkfs.ubifs: $(MKFS_UBIFS_DIR)/mkfs.ubifs
+mkfs.ubifs: $(MKFS_UBIFS_BINARY)
 
 #############################################################
 #
@@ -88,7 +89,7 @@ ifneq ($(TARGET_DEVICE_TABLE),)
 		>> $(PROJECT_BUILD_DIR)/_fakeroot.$(notdir $(UBIFS_TARGET))
 endif
 	# Use fakeroot so mkfs.ubifs believes the previous fakery
-	echo "$(MKFS_UBIFS_DIR)/mkfs.ubifs -d $(TARGET_DIR) " \
+	echo "$(MKFS_UBIFS_BINARY) -d $(TARGET_DIR) " \
 		"$(UBIFS_OPTS) -o $(UBIFS_BASE)" >> $(PROJECT_BUILD_DIR)/_fakeroot.$(notdir $(UBIFS_TARGET))
 	chmod a+x $(PROJECT_BUILD_DIR)/_fakeroot.$(notdir $(UBIFS_TARGET))
 	$(HOST_DIR)/usr/bin/fakeroot -- $(PROJECT_BUILD_DIR)/_fakeroot.$(notdir $(UBIFS_TARGET))
-- 
1.6.3.1




More information about the buildroot mailing list