[Buildroot] [PATCH 2/2] mtd-utils.git: fix targets

Daniel Mack daniel at caiaq.de
Thu Aug 6 06:36:12 UTC 2009


On Wed, Aug 05, 2009 at 09:47:07PM +0200, Peter Korsgaard wrote:
> >>>>> "Daniel" == Daniel Mack <daniel at caiaq.de> writes:
> 
>  Daniel> - Update git version for mtd-utils.git.
>  Daniel> - In this new version, a new tool named 'ubiformat' exists which is
>  Daniel>   exported by this patch.
>  Daniel> - The tool ubimirror does not exist anymore, remove support for it.
>  Daniel> - remove two patches that do no longer apply
>  Daniel> - add a patch that removes the unconditional setting of
>  Daniel>   -D_FILE_OFFSET_BITS=64
>  Daniel> - introduce EXTRA_CPPFLAGS that is set to -D_FILE_OFFSET_BITS=64 in case
>  Daniel>   BR2_LARGEFILE is set
>  Daniel> - select BR2_PACKAGE_LIBUUID for BR2_PACKAGE_MTD
> 
> Thanks, but it still doesn't build with a default (E.G. non-largefile)
> config:
> 
> mkfs.ubifs.c: In function 'write_leb':
> mkfs.ubifs.c:768: error: 'off64_t' undeclared (first use in this function)
> mkfs.ubifs.c:768: error: (Each undeclared identifier is reported only once
> mkfs.ubifs.c:768: error: for each function it appears in.)
> mkfs.ubifs.c:768: error: expected ';' before 'pos'
> mkfs.ubifs.c:776: warning: implicit declaration of function 'lseek64'
> mkfs.ubifs.c:776: error: 'pos' undeclared (first use in this function)
> mkfs.ubifs.c: In function 'add_file':
> mkfs.ubifs.c:1264: error: 'O_LARGEFILE' undeclared (first use in this
> function)
> 
> I expect that you just need to make mkfs.ubifs depend on largefile
> support in the toolchain if it cannot easily be fixed in the sources.

Hmm, yes. Unfortunately, we'll have to depend on LARGEFILE then. Give
the patch below a try - and thanks for the patience :)

Daniel

>From 9c112f72743a04b7fe6b9db3920ebdbea81ebfc2 Mon Sep 17 00:00:00 2001
From: Daniel Mack <daniel at caiaq.de>
Date: Wed, 3 Jun 2009 13:35:00 +0200
Subject: [PATCH] mtd-utils.git: fix targets

- Update git version for mtd-utils.git.
- In this new version, a new tool named 'ubiformat' exists which is
  exported by this patch.
- The tool ubimirror does not exist anymore, remove support for it.
- remove two patches that do no longer apply
- select BR2_PACKAGE_LIBUUID for BR2_PACKAGE_MTD
- select BR2_PACKAGE_LZO for both MTD versions
- depend on BR2_LARGEFILE for BR2_PACKAGE_MTD_GIT

Signed-off-by: Daniel Mack <daniel at caiaq.de>
---
 package/mtd/Config.in                              |   14 +++---
 .../mtd/mtd-utils.git/mtd-utils-all-targets.patch  |   34 --------------
 .../mtd/mtd-utils.git/mtd-utils-target-acl.patch   |   48 --------------------
 package/mtd/mtd-utils.git/mtd.mk                   |   10 ++--
 4 files changed, 13 insertions(+), 93 deletions(-)
 delete mode 100644 package/mtd/mtd-utils.git/mtd-utils-all-targets.patch
 delete mode 100644 package/mtd/mtd-utils.git/mtd-utils-target-acl.patch

diff --git a/package/mtd/Config.in b/package/mtd/Config.in
index 125175f..906137c 100644
--- a/package/mtd/Config.in
+++ b/package/mtd/Config.in
@@ -1,6 +1,8 @@
 menuconfig BR2_PACKAGE_MTD
 	bool "mtd/jffs2 utilities"
+	select BR2_PACKAGE_LZO
 	select BR2_PACKAGE_ZLIB
+	select BR2_PACKAGE_LIBUUID
 	help
 	  Build mtd/jffs utilities
 
@@ -11,12 +13,12 @@ choice
 
 config BR2_PACKAGE_MTD_UTILS
 	bool "Use MTD-utils release"
-	select BR2_PACKAGE_LZO
 	help
 	  Build mtd/jffs utilities with Dataflash support
 
 config BR2_PACKAGE_MTD_UTILS_GIT
 	bool "Use MTD-utils from GIT"
+	depends on BR2_LARGEFILE
 	help
 	  Use the latest from GIT or a particular revision.
 	  You should probably say NO except for specific purpose.
@@ -127,11 +129,6 @@ config BR2_PACKAGE_MTD_UBIDETACH
 	default y
 	depends on BR2_PACKAGE_MTD_UTILS_GIT
 
-config BR2_PACKAGE_MTD_UBIMIRROR
-	bool "ubimirror"
-	default y
-	depends on BR2_PACKAGE_MTD_UTILS_GIT
-
 config BR2_PACKAGE_MTD_UBIMKVOL
 	bool "ubimkvol"
 	default y
@@ -152,5 +149,10 @@ config BR2_PACKAGE_MTD_UBIUPDATEVOL
 	default y
 	depends on BR2_PACKAGE_MTD_UTILS_GIT
 
+config BR2_PACKAGE_MTD_UBIFORMAT
+	bool "ubiformat"
+	default y
+	depends on BR2_PACKAGE_MTD_UTILS_GIT
+
 endif
 
diff --git a/package/mtd/mtd-utils.git/mtd-utils-all-targets.patch b/package/mtd/mtd-utils.git/mtd-utils-all-targets.patch
deleted file mode 100644
index e887118..0000000
--- a/package/mtd/mtd-utils.git/mtd-utils-all-targets.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-diff -urN mtd-utils-1.1.0-0rig/Makefile mtd-utils-1.1.0/Makefile
---- mtd-utils-1.1.0-0rig/Makefile	2007-08-03 15:55:51.000000000 +0200
-+++ mtd-utils-1.1.0/Makefile	2007-09-27 08:20:55.000000000 +0200
-@@ -72,6 +72,30 @@
- $(BUILDDIR)/sumtool: $(BUILDDIR)/sumtool.o $(BUILDDIR)/crc32.o
- 	$(CC) $(LDFLAGS) -o $@ $^
- 
-+ftl_format:	$(BUILDDIR)/ftl_format
-+flash_erase:	$(BUILDDIR)/flash_erase
-+flash_eraseall:	$(BUILDDIR)/flash_eraseall
-+nanddump:	$(BUILDDIR)/nanddump
-+doc_loadbios:	$(BUILDDIR)/doc_loadbios
-+mkfs.jffs:	$(BUILDDIR)/mkfs.jffs
-+ftl_check:	$(BUILDDIR)/ftl_check
-+mkfs.jffs2:	$(BUILDDIR)/mkfs.jffs2
-+flash_lock:	$(BUILDDIR)/flash_lock
-+flash_unlock:	$(BUILDDIR)/flash_unlock
-+flash_info:	$(BUILDDIR)/flash_info
-+flash_otp_info:	$(BUILDDIR)/flash_otp_info
-+flash_otp_dump:	$(BUILDDIR)/flash_otp_dump
-+mtd_debug:	$(BUILDDIR)/mtd_debug
-+flashcp:	$(BUILDDIR)/flashcp
-+nandwrite:	$(BUILDDIR)/nandwrite
-+jffs2dump:	$(BUILDDIR)/jffs2dump
-+nftldump:	$(BUILDDIR)/nftldump
-+nftl_format:	$(BUILDDIR)/nftl_format
-+docfdisk:	$(BUILDDIR)/docfdisk
-+rfddump:	$(BUILDDIR)/rfddump
-+rfdformat:	$(BUILDDIR)/rfdformat
-+sumtool:	$(BUILDDIR)/sumtool
-+
- install: ${TARGETS}
- 	mkdir -p ${DESTDIR}/${SBINDIR}
- 	install -m0755 ${TARGETS} ${DESTDIR}/${SBINDIR}/
diff --git a/package/mtd/mtd-utils.git/mtd-utils-target-acl.patch b/package/mtd/mtd-utils.git/mtd-utils-target-acl.patch
deleted file mode 100644
index 953786e..0000000
--- a/package/mtd/mtd-utils.git/mtd-utils-target-acl.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-Author:	Ulf Samuelsson
-Date:	2007-01-25
-
-Log:
-Patch adding "sys/acl.h" needed to compile mtd.
-
-Modified:
-	package/mtd/mtd_acl.patch
-
-Changeset
-	package/mtd/mtd_acl.patch
-
-diff -urN mtd_orig-0rig/include/sys/acl.h mtd_orig/include/sys/acl.h
---- mtd_orig-0rig/include/sys/acl.h	1970-01-01 01:00:00.000000000 +0100
-+++ mtd_orig/include/sys/acl.h	2007-01-17 20:11:22.000000000 +0100
-@@ -0,0 +1,32 @@
-+/*
-+  File: linux/posix_acl.h
-+
-+  (C) 2002 Andreas Gruenbacher, <a.gruenbacher at computer.org>
-+*/
-+
-+
-+#ifndef __LINUX_POSIX_ACL_H
-+#define __LINUX_POSIX_ACL_H
-+
-+#define ACL_UNDEFINED_ID	(-1)
-+
-+/* a_type field in acl_user_posix_entry_t */
-+#define ACL_TYPE_ACCESS		(0x8000)
-+#define ACL_TYPE_DEFAULT	(0x4000)
-+
-+/* e_tag entry in struct posix_acl_entry */
-+#define ACL_USER_OBJ		(0x01)
-+#define ACL_USER		(0x02)
-+#define ACL_GROUP_OBJ		(0x04)
-+#define ACL_GROUP		(0x08)
-+#define ACL_MASK		(0x10)
-+#define ACL_OTHER		(0x20)
-+
-+/* permissions in the e_perm field */
-+#define ACL_READ		(0x04)
-+#define ACL_WRITE		(0x02)
-+#define ACL_EXECUTE		(0x01)
-+//#define ACL_ADD		(0x08)
-+//#define ACL_DELETE		(0x10)
-+
-+#endif  /* __LINUX_POSIX_ACL_H */
diff --git a/package/mtd/mtd-utils.git/mtd.mk b/package/mtd/mtd-utils.git/mtd.mk
index ca25ee5..3c17c21 100644
--- a/package/mtd/mtd-utils.git/mtd.mk
+++ b/package/mtd/mtd-utils.git/mtd.mk
@@ -3,7 +3,7 @@
 # mtd provides jffs2 utilities
 #
 #############################################################
-MTD_VERSION:=fcb52ccc99679460640386c297023f852b108f68
+MTD_VERSION:=e783e75e09b4a0a519665afd7bdeaf2985e7a09c
 MTD_SOURCE:=mtd-utils-$(MTD_VERSION).tar.gz
 MTD_URL:=http://git.infradead.org/mtd-utils.git?a=snapshot;h=$(MTD_VERSION);sf=tgz
 MTD_HOST_DIR:= $(TOOL_BUILD_DIR)/mtd-utils-$(MTD_VERSION)
@@ -98,11 +98,11 @@ MTD_TARGETS_UBI_y :=
 MTD_TARGETS_UBI_$(BR2_PACKAGE_MTD_UBIATTACH) += ubiattach
 MTD_TARGETS_UBI_$(BR2_PACKAGE_MTD_UBICRC32) += ubicrc32
 MTD_TARGETS_UBI_$(BR2_PACKAGE_MTD_UBIDETACH) += ubidetach
-MTD_TARGETS_UBI_$(BR2_PACKAGE_MTD_UBIMIRROR) += ubimirror
 MTD_TARGETS_UBI_$(BR2_PACKAGE_MTD_UBIMKVOL) += ubimkvol
 MTD_TARGETS_UBI_$(BR2_PACKAGE_MTD_UBINFO) += ubinfo
 MTD_TARGETS_UBI_$(BR2_PACKAGE_MTD_UBIRMVOL) += ubirmvol
 MTD_TARGETS_UBI_$(BR2_PACKAGE_MTD_UBIUPDATEVOL) += ubiupdatevol
+MTD_TARGETS_UBI_$(BR2_PACKAGE_MTD_UBIFORMAT) += ubiformat
 
 MTD_BUILD_TARGETS := $(addprefix $(MTD_DIR)/, $(MTD_TARGETS_y)) $(addprefix $(MTD_DIR)/ubi-utils/, $(MTD_TARGETS_UBI_y))
 
@@ -110,8 +110,8 @@ $(MTD_BUILD_TARGETS): $(MTD_DIR)/.unpacked
 	mkdir -p $(TARGET_DIR)/usr/sbin
 	$(MAKE1) OPTFLAGS="-DNEED_BCOPY -Dbcmp=memcmp -I$(STAGING_DIR)/usr/include $(TARGET_CFLAGS)" \
 		LDFLAGS="$(TARGET_LDFLAGS)" \
-	       BUILDDIR=$(MTD_DIR) \
-	       CROSS=$(TARGET_CROSS) CC=$(TARGET_CC) WITHOUT_XATTR=1 -C $(MTD_DIR)
+		BUILDDIR=$(MTD_DIR) \
+		CROSS=$(TARGET_CROSS) CC=$(TARGET_CC) WITHOUT_XATTR=1 -C $(MTD_DIR)
 
 MTD_TARGETS := $(addprefix $(TARGET_DIR)/usr/sbin/, $(MTD_TARGETS_y))
 MTD_UBI_TARGETS := $(addprefix $(TARGET_DIR)/usr/sbin/, $(MTD_TARGETS_UBI_y))
@@ -124,7 +124,7 @@ $(MTD_UBI_TARGETS): $(TARGET_DIR)/usr/sbin/% : $(MTD_DIR)/ubi-utils/%
 	cp -f $< $@
 	$(STRIPCMD) $@
 
-mtd: zlib lzo $(MTD_TARGETS) $(MTD_UBI_TARGETS)
+mtd: zlib lzo libuuid $(MTD_TARGETS) $(MTD_UBI_TARGETS)
 
 mtd-source: $(DL_DIR)/$(MTD_SOURCE)
 
-- 
1.6.3.3




More information about the buildroot mailing list