From 0fe8279abf852dedfdfcbe8db6384056a125a8f5 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Mon, 1 Mar 2010 23:56:37 +0100 Subject: [PATCH 01/44] genromfs: add new package Signed-off-by: Thomas Petazzoni --- package/Config.in | 1 + package/genromfs/Config.in | 6 ++++ .../genromfs-0.5.2-build-system.patch | 26 ++++++++++++++++ package/genromfs/genromfs.mk | 31 +++++++++++++++++++ 4 files changed, 64 insertions(+) create mode 100644 package/genromfs/Config.in create mode 100644 package/genromfs/genromfs-0.5.2-build-system.patch create mode 100644 package/genromfs/genromfs.mk diff --git a/package/Config.in b/package/Config.in index 6a695cbf4a..9c75fcc5e4 100644 --- a/package/Config.in +++ b/package/Config.in @@ -159,6 +159,7 @@ source "package/eeprog/Config.in" source "package/fconfig/Config.in" source "package/fis/Config.in" source "package/gadgetfs-test/Config.in" +source "package/genromfs/Config.in" source "package/gvfs/Config.in" source "package/hal/Config.in" if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS diff --git a/package/genromfs/Config.in b/package/genromfs/Config.in new file mode 100644 index 0000000000..2caf2a405d --- /dev/null +++ b/package/genromfs/Config.in @@ -0,0 +1,6 @@ +config BR2_PACKAGE_GENROMFS + bool "genromfs" + help + Tool to generate a ROMFS filesystem. + + http://romfs.sourceforge.net/ \ No newline at end of file diff --git a/package/genromfs/genromfs-0.5.2-build-system.patch b/package/genromfs/genromfs-0.5.2-build-system.patch new file mode 100644 index 0000000000..827fe75bd2 --- /dev/null +++ b/package/genromfs/genromfs-0.5.2-build-system.patch @@ -0,0 +1,26 @@ +--- + Makefile | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +Index: genromfs-0.5.2/Makefile +=================================================================== +--- genromfs-0.5.2.orig/Makefile ++++ genromfs-0.5.2/Makefile +@@ -6,8 +6,6 @@ + PACKAGE = genromfs + VERSION = 0.5.2 + CC = gcc +-CFLAGS = -O2 -Wall -DVERSION=\"$(VERSION)\"#-g# +-LDFLAGS = -s#-g + + DISTDIR = $(PACKAGE)-$(VERSION) + +@@ -24,7 +22,7 @@ + $(CC) $(LDFLAGS) genromfs.o -o genromfs + + .c.o: +- $(CC) $(CFLAGS) $< -c -o $@ ++ $(CC) $(CFLAGS) -DVERSION=\"$(VERSION)\" $< -c -o $@ + + clean: + rm -f genromfs *.o diff --git a/package/genromfs/genromfs.mk b/package/genromfs/genromfs.mk new file mode 100644 index 0000000000..10b8d7d4bc --- /dev/null +++ b/package/genromfs/genromfs.mk @@ -0,0 +1,31 @@ +############################################################# +# +# genromfs +# +############################################################# + +GENROMFS_VERSION=0.5.2 +GENROMFS_SOURCE=genromfs-$(GENROMFS_VERSION).tar.gz +GENROMFS_SITE=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/romfs + +define GENROMFS_BUILD_CMDS + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \ + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" +endef + +define GENROMFS_INSTALL_TARGET_CMDS + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) PREFIX=$(TARGET_DIR) install +endef + +define HOST_GENROMFS_BUILD_CMDS + $(HOST_MAKE_ENV) $(MAKE) -C $(@D) +endef + +define HOST_GENROMFS_INSTALL_CMDS + $(HOST_MAKE_ENV) $(MAKE) -C $(@D) PREFIX=$(HOST_DIR) install +endef + +$(eval $(call GENTARGETS,package,genromfs)) +$(eval $(call GENTARGETS,package,genromfs,host)) \ No newline at end of file From 069290f197cfe9659673f9186cf9c2bf452f7f1a Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Mon, 1 Mar 2010 23:59:32 +0100 Subject: [PATCH 02/44] genext2fs: new package Signed-off-by: Thomas Petazzoni --- package/Config.in | 1 + package/genext2fs/Config.in | 9 +++++++++ .../genext2fs}/genext2fs-1.4-nosquash.patch | 0 .../genext2fs-1.4-remove_ugly_warnings.patch | 0 package/genext2fs/genext2fs.mk | 12 ++++++++++++ 5 files changed, 22 insertions(+) create mode 100644 package/genext2fs/Config.in rename {target/ext2 => package/genext2fs}/genext2fs-1.4-nosquash.patch (100%) rename {target/ext2 => package/genext2fs}/genext2fs-1.4-remove_ugly_warnings.patch (100%) create mode 100644 package/genext2fs/genext2fs.mk diff --git a/package/Config.in b/package/Config.in index 9c75fcc5e4..856048abd3 100644 --- a/package/Config.in +++ b/package/Config.in @@ -159,6 +159,7 @@ source "package/eeprog/Config.in" source "package/fconfig/Config.in" source "package/fis/Config.in" source "package/gadgetfs-test/Config.in" +source "package/genext2fs/Config.in" source "package/genromfs/Config.in" source "package/gvfs/Config.in" source "package/hal/Config.in" diff --git a/package/genext2fs/Config.in b/package/genext2fs/Config.in new file mode 100644 index 0000000000..82992f8777 --- /dev/null +++ b/package/genext2fs/Config.in @@ -0,0 +1,9 @@ +config BR2_PACKAGE_GENEXT2FS + bool "genext2fs" + help + genext2fs generates an ext2 filesystem as a normal (non-root) + user. It does not require you to mount the image file to + copy files on it, nor does it require that you become the + superuser to make device nodes. + + http://genext2fs.sourceforge.net/ diff --git a/target/ext2/genext2fs-1.4-nosquash.patch b/package/genext2fs/genext2fs-1.4-nosquash.patch similarity index 100% rename from target/ext2/genext2fs-1.4-nosquash.patch rename to package/genext2fs/genext2fs-1.4-nosquash.patch diff --git a/target/ext2/genext2fs-1.4-remove_ugly_warnings.patch b/package/genext2fs/genext2fs-1.4-remove_ugly_warnings.patch similarity index 100% rename from target/ext2/genext2fs-1.4-remove_ugly_warnings.patch rename to package/genext2fs/genext2fs-1.4-remove_ugly_warnings.patch diff --git a/package/genext2fs/genext2fs.mk b/package/genext2fs/genext2fs.mk new file mode 100644 index 0000000000..8c4981edbf --- /dev/null +++ b/package/genext2fs/genext2fs.mk @@ -0,0 +1,12 @@ +############################################################# +# +# genext2fs +# +############################################################# + +GENEXT2FS_VERSION=1.4 +GENEXT2FS_SOURCE=genext2fs-$(GENEXT2FS_VERSION).tar.gz +GENEXT2FS_SITE:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/genext2fs + +$(eval $(call AUTOTARGETS,package,genext2fs)) +$(eval $(call AUTOTARGETS,package,genext2fs,host)) From f601bb72db8505def5b3acad13c67d99e2e62a1d Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 2 Mar 2010 00:01:08 +0100 Subject: [PATCH 03/44] cramfs: new package Signed-off-by: Thomas Petazzoni --- package/Config.in | 1 + package/cramfs/Config.in | 7 + package/cramfs/cramfs-01-devtable.patch | 1269 ++++++++++++++++++++++ package/cramfs/cramfs-02-endian.patch | 284 +++++ package/cramfs/cramfs-03-cygwin_IO.patch | 13 + package/cramfs/cramfs.mk | 33 + 6 files changed, 1607 insertions(+) create mode 100644 package/cramfs/Config.in create mode 100644 package/cramfs/cramfs-01-devtable.patch create mode 100644 package/cramfs/cramfs-02-endian.patch create mode 100644 package/cramfs/cramfs-03-cygwin_IO.patch create mode 100644 package/cramfs/cramfs.mk diff --git a/package/Config.in b/package/Config.in index 856048abd3..5a7bf27894 100644 --- a/package/Config.in +++ b/package/Config.in @@ -146,6 +146,7 @@ endmenu menu "Hardware handling" source "package/acpid/Config.in" +source "package/cramfs/Config.in" source "package/dbus/Config.in" source "package/dbus-glib/Config.in" source "package/dbus-python/Config.in" diff --git a/package/cramfs/Config.in b/package/cramfs/Config.in new file mode 100644 index 0000000000..553fb8a736 --- /dev/null +++ b/package/cramfs/Config.in @@ -0,0 +1,7 @@ +config BR2_PACKAGE_CRAMFS + bool "cramfs" + help + cramfs is a comporessed read-only filesystem. This package + contains the tools to generate and check a cramfs filesystem. + + http://sourceforge.net/projects/cramfs/ \ No newline at end of file diff --git a/package/cramfs/cramfs-01-devtable.patch b/package/cramfs/cramfs-01-devtable.patch new file mode 100644 index 0000000000..884eb8cb83 --- /dev/null +++ b/package/cramfs/cramfs-01-devtable.patch @@ -0,0 +1,1269 @@ +--- cramfs-1.1.orig/cramfsck.c 2002-02-22 17:00:42.000000000 -0700 ++++ cramfs-1.1/cramfsck.c 2002-12-21 01:25:17.000000000 -0700 +@@ -51,10 +51,11 @@ + #include + #include + #define _LINUX_STRING_H_ +-#include +-#include ++#include "linux/cramfs_fs.h" + #include + ++#define BLKGETSIZE _IO(0x12,96) /* return device size /512 (long *arg) */ ++ + /* Exit codes used by fsck-type programs */ + #define FSCK_OK 0 /* No errors */ + #define FSCK_NONDESTRUCT 1 /* File system errors corrected */ +@@ -75,7 +76,7 @@ + static int opt_verbose = 0; /* 1 = verbose (-v), 2+ = very verbose (-vv) */ + #ifdef INCLUDE_FS_TESTS + static int opt_extract = 0; /* extract cramfs (-x) */ +-static char *extract_dir = "root"; /* extraction directory (-x) */ ++static char *extract_dir = "/"; /* extraction directory (-x) */ + static uid_t euid; /* effective UID */ + + /* (cramfs_super + start) <= start_dir < end_dir <= start_data <= end_data */ +@@ -155,7 +156,7 @@ + } + + if (*length < sizeof(struct cramfs_super)) { +- die(FSCK_UNCORRECTED, 0, "file length too short"); ++ die(FSCK_UNCORRECTED, 0, "filesystem smaller than a cramfs superblock!"); + } + + /* find superblock */ +@@ -190,7 +191,8 @@ + die(FSCK_UNCORRECTED, 0, "zero file count"); + } + if (*length < super.size) { +- die(FSCK_UNCORRECTED, 0, "file length too short"); ++ die(FSCK_UNCORRECTED, 0, "file length too short, %lu is smaller than %lu", ++ *length, super.size); + } + else if (*length > super.size) { + fprintf(stderr, "warning: file extends past end of filesystem\n"); +@@ -267,11 +269,11 @@ + #ifdef INCLUDE_FS_TESTS + static void print_node(char type, struct cramfs_inode *i, char *name) + { +- char info[10]; ++ char info[11]; + + if (S_ISCHR(i->mode) || (S_ISBLK(i->mode))) { + /* major/minor numbers can be as high as 2^12 or 4096 */ +- snprintf(info, 10, "%4d,%4d", major(i->size), minor(i->size)); ++ snprintf(info, 11, "%4d,%4d", major(i->size), minor(i->size)); + } + else { + /* size be as high as 2^24 or 16777216 */ +@@ -445,8 +447,10 @@ + } + /* TODO: Do we need to check end_dir for empty case? */ + memcpy(newpath, path, pathlen); +- newpath[pathlen] = '/'; +- pathlen++; ++ if (pathlen > 1) { ++ newpath[pathlen] = '/'; ++ pathlen++; ++ } + if (opt_verbose) { + print_node('d', i, path); + } +--- cramfs-1.1.orig/device_table.txt 1969-12-31 17:00:00.000000000 -0700 ++++ cramfs-1.1/device_table.txt 2003-01-01 05:13:44.000000000 -0700 +@@ -0,0 +1,129 @@ ++# When building a target filesystem, it is desirable to not have to ++# become root and then run 'mknod' a thousand times. Using a device ++# table you can create device nodes and directories "on the fly". ++# ++# This is a sample device table file for use with mkcramfs. You can ++# do all sorts of interesting things with a device table file. For ++# example, if you want to adjust the permissions on a particular file ++# you can just add an entry like: ++# /sbin/foobar f 2755 0 0 - - - - - ++# and (assuming the file /sbin/foobar exists) it will be made setuid ++# root (regardless of what its permissions are on the host filesystem. ++# Furthermore, you can use a single table entry to create a many device ++# minors. For example, if I wanted to create /dev/hda and /dev/hda[0-15] ++# I could just use the following two table entries: ++# /dev/hda b 640 0 0 3 0 0 0 - ++# /dev/hda b 640 0 0 3 1 1 1 15 ++# ++# Device table entries take the form of: ++# ++# where name is the file name, type can be one of: ++# f A regular file ++# d Directory ++# c Character special device file ++# b Block special device file ++# p Fifo (named pipe) ++# uid is the user id for the target file, gid is the group id for the ++# target file. The rest of the entries (major, minor, etc) apply only ++# to device special files. ++ ++# Have fun ++# -Erik Andersen ++# ++ ++# ++/dev d 755 0 0 - - - - - ++/dev/mem c 640 0 0 1 1 0 0 - ++/dev/kmem c 640 0 0 1 2 0 0 - ++/dev/null c 640 0 0 1 3 0 0 - ++/dev/zero c 640 0 0 1 5 0 0 - ++/dev/random c 640 0 0 1 8 0 0 - ++/dev/urandom c 640 0 0 1 9 0 0 - ++/dev/tty c 666 0 0 5 0 0 0 - ++/dev/tty c 666 0 0 4 0 0 1 6 ++/dev/console c 640 0 0 5 1 0 0 - ++/dev/ram b 640 0 0 1 1 0 0 - ++/dev/ram b 640 0 0 1 0 0 1 4 ++/dev/loop b 640 0 0 7 0 0 1 2 ++/dev/ptmx c 666 0 0 5 2 0 0 - ++#/dev/ttyS c 640 0 0 4 64 0 1 4 ++#/dev/psaux c 640 0 0 10 1 0 0 - ++#/dev/rtc c 640 0 0 10 135 0 0 - ++ ++# Adjust permissions on some normal files ++#/etc/shadow f 600 0 0 - - - - - ++#/bin/tinylogin f 4755 0 0 - - - - - ++ ++# User-mode Linux stuff ++/dev/ubda b 640 0 0 98 0 0 0 - ++/dev/ubda b 640 0 0 98 1 1 1 15 ++ ++# IDE Devices ++/dev/hda b 640 0 0 3 0 0 0 - ++/dev/hda b 640 0 0 3 1 1 1 15 ++/dev/hdb b 640 0 0 3 64 0 0 - ++/dev/hdb b 640 0 0 3 65 1 1 15 ++#/dev/hdc b 640 0 0 22 0 0 0 - ++#/dev/hdc b 640 0 0 22 1 1 1 15 ++#/dev/hdd b 640 0 0 22 64 0 0 - ++#/dev/hdd b 640 0 0 22 65 1 1 15 ++#/dev/hde b 640 0 0 33 0 0 0 - ++#/dev/hde b 640 0 0 33 1 1 1 15 ++#/dev/hdf b 640 0 0 33 64 0 0 - ++#/dev/hdf b 640 0 0 33 65 1 1 15 ++#/dev/hdg b 640 0 0 34 0 0 0 - ++#/dev/hdg b 640 0 0 34 1 1 1 15 ++#/dev/hdh b 640 0 0 34 64 0 0 - ++#/dev/hdh b 640 0 0 34 65 1 1 15 ++ ++# SCSI Devices ++#/dev/sda b 640 0 0 8 0 0 0 - ++#/dev/sda b 640 0 0 8 1 1 1 15 ++#/dev/sdb b 640 0 0 8 16 0 0 - ++#/dev/sdb b 640 0 0 8 17 1 1 15 ++#/dev/sdc b 640 0 0 8 32 0 0 - ++#/dev/sdc b 640 0 0 8 33 1 1 15 ++#/dev/sdd b 640 0 0 8 48 0 0 - ++#/dev/sdd b 640 0 0 8 49 1 1 15 ++#/dev/sde b 640 0 0 8 64 0 0 - ++#/dev/sde b 640 0 0 8 65 1 1 15 ++#/dev/sdf b 640 0 0 8 80 0 0 - ++#/dev/sdf b 640 0 0 8 81 1 1 15 ++#/dev/sdg b 640 0 0 8 96 0 0 - ++#/dev/sdg b 640 0 0 8 97 1 1 15 ++#/dev/sdh b 640 0 0 8 112 0 0 - ++#/dev/sdh b 640 0 0 8 113 1 1 15 ++#/dev/sg c 640 0 0 21 0 0 1 15 ++#/dev/scd b 640 0 0 11 0 0 1 15 ++#/dev/st c 640 0 0 9 0 0 1 8 ++#/dev/nst c 640 0 0 9 128 0 1 8 ++#/dev/st c 640 0 0 9 32 1 1 4 ++#/dev/st c 640 0 0 9 64 1 1 4 ++#/dev/st c 640 0 0 9 96 1 1 4 ++ ++# Floppy disk devices ++#/dev/fd b 640 0 0 2 0 0 1 2 ++#/dev/fd0d360 b 640 0 0 2 4 0 0 - ++#/dev/fd1d360 b 640 0 0 2 5 0 0 - ++#/dev/fd0h1200 b 640 0 0 2 8 0 0 - ++#/dev/fd1h1200 b 640 0 0 2 9 0 0 - ++#/dev/fd0u1440 b 640 0 0 2 28 0 0 - ++#/dev/fd1u1440 b 640 0 0 2 29 0 0 - ++#/dev/fd0u2880 b 640 0 0 2 32 0 0 - ++#/dev/fd1u2880 b 640 0 0 2 33 0 0 - ++ ++# All the proprietary cdrom devices in the world ++#/dev/aztcd b 640 0 0 29 0 0 0 - ++#/dev/bpcd b 640 0 0 41 0 0 0 - ++#/dev/capi20 c 640 0 0 68 0 0 1 2 ++#/dev/cdu31a b 640 0 0 15 0 0 0 - ++#/dev/cdu535 b 640 0 0 24 0 0 0 - ++#/dev/cm206cd b 640 0 0 32 0 0 0 - ++#/dev/sjcd b 640 0 0 18 0 0 0 - ++#/dev/sonycd b 640 0 0 15 0 0 0 - ++#/dev/gscd b 640 0 0 16 0 0 0 - ++#/dev/sbpcd b 640 0 0 25 0 0 0 - ++#/dev/sbpcd b 640 0 0 25 0 0 1 4 ++#/dev/mcd b 640 0 0 23 0 0 0 - ++#/dev/optcd b 640 0 0 17 0 0 0 - ++ +--- cramfs-1.1.orig/mkcramfs.c 2002-02-20 01:03:32.000000000 -0700 ++++ cramfs-1.1/mkcramfs.c 2002-12-21 01:25:17.000000000 -0700 +@@ -1,3 +1,4 @@ ++/* vi: set sw=8 ts=8: */ + /* + * mkcramfs - make a cramfs file system + * +@@ -16,12 +17,21 @@ + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ * ++ * Added device table support (code taken from mkfs.jffs2.c, credit to ++ * Erik Andersen ) as well as an option to squash ++ * permissions. - Russ Dill September 2002 ++ * ++ * Reworked, cleaned up, and updated for cramfs-1.1, December 2002 ++ * - Erik Andersen ++ * + */ + + /* + * If you change the disk format of cramfs, please update fs/cramfs/README. + */ + ++#define _GNU_SOURCE + #include + #include + #include +@@ -33,8 +43,15 @@ + #include + #include + #include ++#include ++#include ++#include ++#include + #include + #include ++#ifdef DMALLOC ++#include ++#endif + + /* Exit codes used by mkfs-type programs */ + #define MKFS_OK 0 /* No errors */ +@@ -71,11 +88,17 @@ + + (1 << CRAMFS_SIZE_WIDTH) - 1 /* filesize */ \ + + (1 << CRAMFS_SIZE_WIDTH) * 4 / PAGE_CACHE_SIZE /* block pointers */ ) + ++ ++/* The kernel assumes PAGE_CACHE_SIZE as block size. */ ++#define PAGE_CACHE_SIZE (4096) ++ ++ + static const char *progname = "mkcramfs"; + static unsigned int blksize = PAGE_CACHE_SIZE; + static long total_blocks = 0, total_nodes = 1; /* pre-count the root node */ + static int image_length = 0; + ++ + /* + * If opt_holes is set, then mkcramfs can create explicit holes in the + * data, which saves 26 bytes per hole (which is a lot smaller a +@@ -91,10 +114,12 @@ + static int opt_holes = 0; + static int opt_pad = 0; + static int opt_verbose = 0; ++static int opt_squash = 0; + static char *opt_image = NULL; + static char *opt_name = NULL; + + static int warn_dev, warn_gid, warn_namelen, warn_skip, warn_size, warn_uid; ++static const char *const memory_exhausted = "memory exhausted"; + + /* In-core version of inode / directory entry. */ + struct entry { +@@ -123,7 +148,7 @@ + { + FILE *stream = status ? stderr : stdout; + +- fprintf(stream, "usage: %s [-h] [-e edition] [-i file] [-n name] dirname outfile\n" ++ fprintf(stream, "usage: %s [-h] [-e edition] [-i file] [-n name] [-D file] dirname outfile\n" + " -h print this help\n" + " -E make all warnings errors (non-zero exit status)\n" + " -e edition set edition number (part of fsid)\n" +@@ -133,39 +158,157 @@ + " -s sort directory entries (old option, ignored)\n" + " -v be more verbose\n" + " -z make explicit holes (requires >= 2.3.39)\n" +- " dirname root of the directory tree to be compressed\n" ++ " -D Use the named FILE as a device table file\n" ++ " -q squash permissions (make everything owned by root)\n" ++ " dirname root of the filesystem to be compressed\n" + " outfile output file\n", progname, PAD_SIZE); + + exit(status); + } + +-static void die(int status, int syserr, const char *fmt, ...) ++static void verror_msg(const char *s, va_list p) ++{ ++ fflush(stdout); ++ fprintf(stderr, "mkcramfs: "); ++ vfprintf(stderr, s, p); ++} ++ ++static void vperror_msg(const char *s, va_list p) ++{ ++ int err = errno; ++ ++ if (s == 0) ++ s = ""; ++ verror_msg(s, p); ++ if (*s) ++ s = ": "; ++ fprintf(stderr, "%s%s\n", s, strerror(err)); ++} ++ ++static void perror_msg(const char *s, ...) ++{ ++ va_list p; ++ ++ va_start(p, s); ++ vperror_msg(s, p); ++ va_end(p); ++} ++ ++static void error_msg_and_die(const char *s, ...) ++{ ++ va_list p; ++ ++ va_start(p, s); ++ verror_msg(s, p); ++ va_end(p); ++ putc('\n', stderr); ++ exit(MKFS_ERROR); ++} ++ ++static void perror_msg_and_die(const char *s, ...) ++{ ++ va_list p; ++ ++ va_start(p, s); ++ vperror_msg(s, p); ++ va_end(p); ++ exit(MKFS_ERROR); ++} ++#ifndef DMALLOC ++extern char *xstrdup(const char *s) ++{ ++ char *t; ++ ++ if (s == NULL) ++ return NULL; ++ t = strdup(s); ++ if (t == NULL) ++ error_msg_and_die(memory_exhausted); ++ return t; ++} ++ ++extern void *xmalloc(size_t size) ++{ ++ void *ptr = malloc(size); ++ ++ if (ptr == NULL && size != 0) ++ error_msg_and_die(memory_exhausted); ++ return ptr; ++} ++ ++extern void *xcalloc(size_t nmemb, size_t size) ++{ ++ void *ptr = calloc(nmemb, size); ++ ++ if (ptr == NULL && nmemb != 0 && size != 0) ++ error_msg_and_die(memory_exhausted); ++ return ptr; ++} ++ ++extern void *xrealloc(void *ptr, size_t size) ++{ ++ ptr = realloc(ptr, size); ++ if (ptr == NULL && size != 0) ++ error_msg_and_die(memory_exhausted); ++ return ptr; ++} ++#endif ++ ++static FILE *xfopen(const char *path, const char *mode) + { +- va_list arg_ptr; +- int save = errno; ++ FILE *fp; ++ ++ if ((fp = fopen(path, mode)) == NULL) ++ perror_msg_and_die("%s", path); ++ return fp; ++} + +- fflush(0); +- va_start(arg_ptr, fmt); +- fprintf(stderr, "%s: ", progname); +- vfprintf(stderr, fmt, arg_ptr); +- if (syserr) { +- fprintf(stderr, ": %s", strerror(save)); ++extern int xopen(const char *pathname, int flags, mode_t mode) ++{ ++ int ret; ++ ++ if (flags & O_CREAT) ++ ret = open(pathname, flags, mode); ++ else ++ ret = open(pathname, flags); ++ if (ret == -1) { ++ perror_msg_and_die("%s", pathname); + } +- fprintf(stderr, "\n"); +- va_end(arg_ptr); +- exit(status); ++ return ret; + } + ++extern char *xreadlink(const char *path) ++{ ++ static const int GROWBY = 80; /* how large we will grow strings by */ ++ ++ char *buf = NULL; ++ int bufsize = 0, readsize = 0; ++ ++ do { ++ buf = xrealloc(buf, bufsize += GROWBY); ++ readsize = readlink(path, buf, bufsize); /* 1st try */ ++ if (readsize == -1) { ++ perror_msg("%s:%s", progname, path); ++ return NULL; ++ } ++ } ++ while (bufsize < readsize + 1); ++ ++ buf[readsize] = '\0'; ++ ++ return buf; ++} ++ + static void map_entry(struct entry *entry) + { + if (entry->path) { + entry->fd = open(entry->path, O_RDONLY); + if (entry->fd < 0) { +- die(MKFS_ERROR, 1, "open failed: %s", entry->path); ++ error_msg_and_die("open failed: %s", entry->path); + } + entry->uncompressed = mmap(NULL, entry->size, PROT_READ, MAP_PRIVATE, entry->fd, 0); + if (entry->uncompressed == MAP_FAILED) { +- die(MKFS_ERROR, 1, "mmap failed: %s", entry->path); ++ error_msg_and_die("mmap failed: %s", entry->path); + } + } + } +@@ -174,8 +317,9 @@ + { + if (entry->path) { + if (munmap(entry->uncompressed, entry->size) < 0) { +- die(MKFS_ERROR, 1, "munmap failed: %s", entry->path); ++ error_msg_and_die("munmap failed: %s", entry->path); + } ++ entry->uncompressed=NULL; + close(entry->fd); + } + } +@@ -204,7 +348,8 @@ + find_identical_file(orig->next, newfile)); + } + +-static void eliminate_doubles(struct entry *root, struct entry *orig) { ++static void eliminate_doubles(struct entry *root, struct entry *orig) ++{ + if (orig) { + if (orig->size && (orig->path || orig->uncompressed)) + find_identical_file(root, orig); +@@ -232,10 +377,7 @@ + + /* Set up the path. */ + /* TODO: Reuse the parent's buffer to save memcpy'ing and duplication. */ +- path = malloc(len + 1 + MAX_INPUT_NAMELEN + 1); +- if (!path) { +- die(MKFS_ERROR, 1, "malloc failed"); +- } ++ path = xmalloc(len + 1 + MAX_INPUT_NAMELEN + 1); + memcpy(path, name, len); + endpath = path + len; + *endpath = '/'; +@@ -245,7 +387,7 @@ + dircount = scandir(name, &dirlist, 0, cramsort); + + if (dircount < 0) { +- die(MKFS_ERROR, 1, "scandir failed: %s", name); ++ error_msg_and_die("scandir failed: %s", name); + } + + /* process directory */ +@@ -269,25 +411,20 @@ + } + namelen = strlen(dirent->d_name); + if (namelen > MAX_INPUT_NAMELEN) { +- die(MKFS_ERROR, 0, +- "very long (%u bytes) filename found: %s\n" +- "please increase MAX_INPUT_NAMELEN in mkcramfs.c and recompile", ++ error_msg_and_die( ++ "Very long (%u bytes) filename `%s' found.\n" ++ " Please increase MAX_INPUT_NAMELEN in mkcramfs.c and recompile. Exiting.\n", + namelen, dirent->d_name); + } + memcpy(endpath, dirent->d_name, namelen + 1); + + if (lstat(path, &st) < 0) { ++ perror(endpath); + warn_skip = 1; + continue; + } +- entry = calloc(1, sizeof(struct entry)); +- if (!entry) { +- die(MKFS_ERROR, 1, "calloc failed"); +- } +- entry->name = strdup(dirent->d_name); +- if (!entry->name) { +- die(MKFS_ERROR, 1, "strdup failed"); +- } ++ entry = xcalloc(1, sizeof(struct entry)); ++ entry->name = xstrdup(dirent->d_name); + /* truncate multi-byte UTF-8 filenames on character boundary */ + if (namelen > CRAMFS_MAXPATHLEN) { + namelen = CRAMFS_MAXPATHLEN; +@@ -297,24 +434,25 @@ + namelen--; + /* are we reasonably certain it was UTF-8 ? */ + if (entry->name[namelen] < 0x80 || !namelen) { +- die(MKFS_ERROR, 0, "cannot truncate filenames not encoded in UTF-8"); ++ error_msg_and_die("cannot truncate filenames not encoded in UTF-8"); + } + } + entry->name[namelen] = '\0'; + } + entry->mode = st.st_mode; + entry->size = st.st_size; +- entry->uid = st.st_uid; ++ entry->uid = opt_squash ? 0 : st.st_uid; + if (entry->uid >= 1 << CRAMFS_UID_WIDTH) + warn_uid = 1; +- entry->gid = st.st_gid; +- if (entry->gid >= 1 << CRAMFS_GID_WIDTH) ++ entry->gid = opt_squash ? 0 : st.st_gid; ++ if (entry->gid >= 1 << CRAMFS_GID_WIDTH) { + /* TODO: We ought to replace with a default + gid instead of truncating; otherwise there + are security problems. Maybe mode should + be &= ~070. Same goes for uid once Linux + supports >16-bit uids. */ + warn_gid = 1; ++ } + size = sizeof(struct cramfs_inode) + ((namelen + 3) & ~3); + *fslen_ub += size; + if (S_ISDIR(st.st_mode)) { +@@ -325,21 +463,15 @@ + warn_skip = 1; + continue; + } +- entry->path = strdup(path); +- if (!entry->path) { +- die(MKFS_ERROR, 1, "strdup failed"); +- } ++ entry->path = xstrdup(path); + if ((entry->size >= 1 << CRAMFS_SIZE_WIDTH)) { + warn_size = 1; + entry->size = (1 << CRAMFS_SIZE_WIDTH) - 1; + } + } + } else if (S_ISLNK(st.st_mode)) { +- entry->uncompressed = malloc(entry->size); ++ entry->uncompressed = xreadlink(path); + if (!entry->uncompressed) { +- die(MKFS_ERROR, 1, "malloc failed"); +- } +- if (readlink(path, entry->uncompressed, entry->size) < 0) { + warn_skip = 1; + continue; + } +@@ -351,7 +483,7 @@ + if (entry->size & -(1<name); ++ error_msg_and_die("bogus file type: %s", entry->name); + } + + if (S_ISREG(st.st_mode) || S_ISLNK(st.st_mode)) { +@@ -378,7 +510,9 @@ + struct cramfs_super *super = (struct cramfs_super *) base; + unsigned int offset = sizeof(struct cramfs_super) + image_length; + +- offset += opt_pad; /* 0 if no padding */ ++ if (opt_pad) { ++ offset += opt_pad; /* 0 if no padding */ ++ } + + super->magic = CRAMFS_MAGIC; + super->flags = CRAMFS_FLAG_FSID_VERSION_2 | CRAMFS_FLAG_SORTED_DIRS; +@@ -414,10 +548,10 @@ + struct cramfs_inode *inode = (struct cramfs_inode *) (base + entry->dir_offset); + + if ((offset & 3) != 0) { +- die(MKFS_ERROR, 0, "illegal offset of %lu bytes", offset); ++ error_msg_and_die("illegal offset of %lu bytes", offset); + } + if (offset >= (1 << (2 + CRAMFS_OFFSET_WIDTH))) { +- die(MKFS_ERROR, 0, "filesystem too big"); ++ error_msg_and_die("filesystem too big"); + } + inode->offset = (offset >> 2); + } +@@ -429,7 +563,7 @@ + */ + static void print_node(struct entry *e) + { +- char info[10]; ++ char info[12]; + char type = '?'; + + if (S_ISREG(e->mode)) type = 'f'; +@@ -442,11 +576,11 @@ + + if (S_ISCHR(e->mode) || (S_ISBLK(e->mode))) { + /* major/minor numbers can be as high as 2^12 or 4096 */ +- snprintf(info, 10, "%4d,%4d", major(e->size), minor(e->size)); ++ snprintf(info, 11, "%4d,%4d", major(e->size), minor(e->size)); + } + else { + /* size be as high as 2^24 or 16777216 */ +- snprintf(info, 10, "%9d", e->size); ++ snprintf(info, 11, "%9d", e->size); + } + + printf("%c %04o %s %5d:%-3d %s\n", +@@ -462,17 +596,9 @@ + { + int stack_entries = 0; + int stack_size = 64; +- struct entry **entry_stack; +- +- entry_stack = malloc(stack_size * sizeof(struct entry *)); +- if (!entry_stack) { +- die(MKFS_ERROR, 1, "malloc failed"); +- } +- +- if (opt_verbose) { +- printf("root:\n"); +- } ++ struct entry **entry_stack = NULL; + ++ entry_stack = xmalloc(stack_size * sizeof(struct entry *)); + for (;;) { + int dir_start = stack_entries; + while (entry) { +@@ -506,10 +632,7 @@ + if (entry->child) { + if (stack_entries >= stack_size) { + stack_size *= 2; +- entry_stack = realloc(entry_stack, stack_size * sizeof(struct entry *)); +- if (!entry_stack) { +- die(MKFS_ERROR, 1, "realloc failed"); +- } ++ entry_stack = xrealloc(entry_stack, stack_size * sizeof(struct entry *)); + } + entry_stack[stack_entries] = entry; + stack_entries++; +@@ -543,7 +666,7 @@ + + set_data_offset(entry, base, offset); + if (opt_verbose) { +- printf("%s:\n", entry->name); ++ printf("'%s':\n", entry->name); + } + entry = entry->child; + } +@@ -553,16 +676,21 @@ + + static int is_zero(char const *begin, unsigned len) + { +- /* Returns non-zero iff the first LEN bytes from BEGIN are all NULs. */ +- return (len-- == 0 || +- (begin[0] == '\0' && +- (len-- == 0 || +- (begin[1] == '\0' && +- (len-- == 0 || +- (begin[2] == '\0' && +- (len-- == 0 || +- (begin[3] == '\0' && +- memcmp(begin, begin + 4, len) == 0)))))))); ++ if (opt_holes) ++ /* Returns non-zero iff the first LEN bytes from BEGIN are ++ all NULs. */ ++ return (len-- == 0 || ++ (begin[0] == '\0' && ++ (len-- == 0 || ++ (begin[1] == '\0' && ++ (len-- == 0 || ++ (begin[2] == '\0' && ++ (len-- == 0 || ++ (begin[3] == '\0' && ++ memcmp(begin, begin + 4, len) == 0)))))))); ++ else ++ /* Never create holes. */ ++ return 0; + } + + /* +@@ -575,37 +703,34 @@ + * Note that size > 0, as a zero-sized file wouldn't ever + * have gotten here in the first place. + */ +-static unsigned int do_compress(char *base, unsigned int offset, char const *name, char *uncompressed, unsigned int size) ++static unsigned int do_compress(char *base, unsigned int offset, struct entry *entry) + { ++ unsigned int size = entry->size; + unsigned long original_size = size; + unsigned long original_offset = offset; + unsigned long new_size; + unsigned long blocks = (size - 1) / blksize + 1; + unsigned long curr = offset + 4 * blocks; + int change; ++ char *uncompressed = entry->uncompressed; + +- total_blocks += blocks; ++ total_blocks += blocks; + + do { + unsigned long len = 2 * blksize; + unsigned int input = size; +- int err; +- + if (input > blksize) + input = blksize; + size -= input; +- if (!(opt_holes && is_zero (uncompressed, input))) { +- err = compress2(base + curr, &len, uncompressed, input, Z_BEST_COMPRESSION); +- if (err != Z_OK) { +- die(MKFS_ERROR, 0, "compression error: %s", zError(err)); +- } ++ if (!is_zero (uncompressed, input)) { ++ compress(base + curr, &len, uncompressed, input); + curr += len; + } + uncompressed += input; + + if (len > blksize*2) { + /* (I don't think this can happen with zlib.) */ +- die(MKFS_ERROR, 0, "AIEEE: block \"compressed\" to > 2*blocklength (%ld)", len); ++ error_msg_and_die("AIEEE: block \"compressed\" to > 2*blocklength (%ld)\n", len); + } + + *(u32 *) (base + offset) = curr; +@@ -618,10 +743,12 @@ + st_blocks * 512. But if you say that then perhaps + administrative data should also be included in both. */ + change = new_size - original_size; +- if (opt_verbose > 1) { +- printf("%6.2f%% (%+d bytes)\t%s\n", +- (change * 100) / (double) original_size, change, name); ++#if 0 ++ if (opt_verbose) { ++ printf("%6.2f%% (%+d bytes)\t%s\n", ++ (change * 100) / (double) original_size, change, entry->name); + } ++#endif + + return curr; + } +@@ -644,7 +771,7 @@ + set_data_offset(entry, base, offset); + entry->offset = offset; + map_entry(entry); +- offset = do_compress(base, offset, entry->name, entry->uncompressed, entry->size); ++ offset = do_compress(base, offset, entry); + unmap_entry(entry); + } + } +@@ -660,13 +787,10 @@ + int fd; + char *buf; + +- fd = open(file, O_RDONLY); +- if (fd < 0) { +- die(MKFS_ERROR, 1, "open failed: %s", file); +- } ++ fd = xopen(file, O_RDONLY, 0); + buf = mmap(NULL, image_length, PROT_READ, MAP_PRIVATE, fd, 0); + if (buf == MAP_FAILED) { +- die(MKFS_ERROR, 1, "mmap failed"); ++ error_msg_and_die("mmap failed"); + } + memcpy(base + offset, buf, image_length); + munmap(buf, image_length); +@@ -679,6 +803,328 @@ + return (offset + image_length); + } + ++static struct entry *find_filesystem_entry(struct entry *dir, char *name, mode_t type) ++{ ++ struct entry *e = dir; ++ ++ if (S_ISDIR(dir->mode)) { ++ e = dir->child; ++ } ++ while (e) { ++ /* Only bother to do the expensive strcmp on matching file types */ ++ if (type == (e->mode & S_IFMT) && e->name) { ++ if (S_ISDIR(e->mode)) { ++ int len = strlen(e->name); ++ ++ /* Check if we are a parent of the correct path */ ++ if (strncmp(e->name, name, len) == 0) { ++ /* Is this an _exact_ match? */ ++ if (strcmp(name, e->name) == 0) { ++ return (e); ++ } ++ /* Looks like we found a parent of the correct path */ ++ if (name[len] == '/') { ++ if (e->child) { ++ return (find_filesystem_entry (e, name + len + 1, type)); ++ } else { ++ return NULL; ++ } ++ } ++ } ++ } else { ++ if (strcmp(name, e->name) == 0) { ++ return (e); ++ } ++ } ++ } ++ e = e->next; ++ } ++ return (NULL); ++} ++ ++void modify_entry(char *full_path, unsigned long uid, unsigned long gid, ++ unsigned long mode, unsigned long rdev, struct entry *root, loff_t *fslen_ub) ++{ ++ char *name, *path, *full; ++ struct entry *curr, *parent, *entry, *prev; ++ ++ full = xstrdup(full_path); ++ path = xstrdup(dirname(full)); ++ name = full_path + strlen(path) + 1; ++ free(full); ++ if (strcmp(path, "/") == 0) { ++ parent = root; ++ name = full_path + 1; ++ } else { ++ if (!(parent = find_filesystem_entry(root, path+1, S_IFDIR))) ++ error_msg_and_die("%s/%s: could not find parent\n", path, name); ++ } ++ if ((entry = find_filesystem_entry(parent, name, (mode & S_IFMT)))) { ++ /* its there, just modify permissions */ ++ entry->mode = mode; ++ entry->uid = uid; ++ entry->gid = gid; ++ } else { /* make a new entry */ ++ ++ /* code partially replicated from parse_directory() */ ++ size_t namelen; ++ if (S_ISREG(mode)) { ++ error_msg_and_die("%s: regular file from device_table file must exist on disk!", full_path); ++ } ++ ++ namelen = strlen(name); ++ if (namelen > MAX_INPUT_NAMELEN) { ++ error_msg_and_die( ++ "Very long (%u bytes) filename `%s' found.\n" ++ " Please increase MAX_INPUT_NAMELEN in mkcramfs.c and recompile. Exiting.\n", ++ namelen, name); ++ } ++ entry = xcalloc(1, sizeof(struct entry)); ++ entry->name = xstrdup(name); ++ /* truncate multi-byte UTF-8 filenames on character boundary */ ++ if (namelen > CRAMFS_MAXPATHLEN) { ++ namelen = CRAMFS_MAXPATHLEN; ++ warn_namelen = 1; ++ /* the first lost byte must not be a trail byte */ ++ while ((entry->name[namelen] & 0xc0) == 0x80) { ++ namelen--; ++ /* are we reasonably certain it was UTF-8 ? */ ++ if (entry->name[namelen] < 0x80 || !namelen) { ++ error_msg_and_die("cannot truncate filenames not encoded in UTF-8"); ++ } ++ } ++ entry->name[namelen] = '\0'; ++ } ++ entry->mode = mode; ++ entry->uid = uid; ++ entry->gid = gid; ++ entry->size = 0; ++ if (S_ISBLK(mode) || S_ISCHR(mode)) { ++ entry->size = rdev; ++ if (entry->size & -(1<size += sizeof(struct cramfs_inode) + ((namelen + 3) & ~3); ++ ++ /* alright, time to link us in */ ++ curr = parent->child; ++ prev = NULL; ++ while (curr && strcmp(name, curr->name) > 0) { ++ prev = curr; ++ curr = curr->next; ++ } ++ if (!prev) parent->child = entry; ++ else prev->next = entry; ++ entry->next = curr; ++ entry->child = NULL; ++ } ++ if (entry->uid >= 1 << CRAMFS_UID_WIDTH) ++ warn_uid = 1; ++ if (entry->gid >= 1 << CRAMFS_GID_WIDTH) { ++ /* TODO: We ought to replace with a default ++ gid instead of truncating; otherwise there ++ are security problems. Maybe mode should ++ be &= ~070. Same goes for uid once Linux ++ supports >16-bit uids. */ ++ warn_gid = 1; ++ } ++ free(path); ++} ++ ++/* the GNU C library has a wonderful scanf("%as", string) which will ++ allocate the string with the right size, good to avoid buffer overruns. ++ the following macros use it if available or use a hacky workaround... ++ */ ++ ++#ifdef __GNUC__ ++#define SCANF_PREFIX "a" ++#define SCANF_STRING(s) (&s) ++#define GETCWD_SIZE 0 ++#else ++#define SCANF_PREFIX "511" ++#define SCANF_STRING(s) (s = xmalloc(512)) ++#define GETCWD_SIZE -1 ++inline int snprintf(char *str, size_t n, const char *fmt, ...) ++{ ++ int ret; ++ va_list ap; ++ ++ va_start(ap, fmt); ++ ret = vsprintf(str, fmt, ap); ++ va_end(ap); ++ return ret; ++} ++#endif ++ ++/* device table entries take the form of: ++ ++ /dev/mem c 640 0 0 1 1 0 0 - ++ ++ type can be one of: ++ f A regular file ++ d Directory ++ c Character special device file ++ b Block special device file ++ p Fifo (named pipe) ++ ++ I don't bother with symlinks (permissions are irrelevant), hard ++ links (special cases of regular files), or sockets (why bother). ++ ++ Regular files must exist in the target root directory. If a char, ++ block, fifo, or directory does not exist, it will be created. ++*/ ++ ++static int interpret_table_entry(char *line, struct entry *root, loff_t *fslen_ub) ++{ ++ char type, *name = NULL; ++ unsigned long mode = 0755, uid = 0, gid = 0, major = 0, minor = 0; ++ unsigned long start = 0, increment = 1, count = 0; ++ ++ if (sscanf (line, "%" SCANF_PREFIX "s %c %lo %lu %lu %lu %lu %lu %lu %lu", ++ SCANF_STRING(name), &type, &mode, &uid, &gid, &major, &minor, ++ &start, &increment, &count) < 0) ++ { ++ return 1; ++ } ++ ++ if (!strcmp(name, "/")) { ++ error_msg_and_die("Device table entries require absolute paths"); ++ } ++ ++ switch (type) { ++ case 'd': ++ mode |= S_IFDIR; ++ modify_entry(name, uid, gid, mode, 0, root, fslen_ub); ++ break; ++ case 'f': ++ mode |= S_IFREG; ++ modify_entry(name, uid, gid, mode, 0, root, fslen_ub); ++ break; ++ case 'p': ++ mode |= S_IFIFO; ++ modify_entry(name, uid, gid, mode, 0, root, fslen_ub); ++ break; ++ case 'c': ++ case 'b': ++ mode |= (type == 'c') ? S_IFCHR : S_IFBLK; ++ if (count > 0) { ++ char *buf; ++ unsigned long i; ++ dev_t rdev; ++ ++ for (i = start; i < count; i++) { ++ asprintf(&buf, "%s%lu", name, i); ++ rdev = makedev(major, minor + (i * increment - start)); ++ modify_entry(buf, uid, gid, mode, rdev, root, fslen_ub); ++ free(buf); ++ } ++ } else { ++ dev_t rdev = makedev(major, minor); ++ modify_entry(name, uid, gid, mode, rdev, root, fslen_ub); ++ } ++ break; ++ default: ++ error_msg_and_die("Unsupported file type"); ++ } ++ free(name); ++ return 0; ++} ++ ++static int parse_device_table(FILE *file, struct entry *root, loff_t *fslen_ub) ++{ ++ char *line; ++ int status = 0; ++ size_t length = 0; ++ ++ /* Turn off squash, since we must ensure that values ++ * entered via the device table are not squashed */ ++ opt_squash = 0; ++ ++ /* Looks ok so far. The general plan now is to read in one ++ * line at a time, check for leading comment delimiters ('#'), ++ * then try and parse the line as a device table. If we fail ++ * to parse things, try and help the poor fool to fix their ++ * device table with a useful error msg... */ ++ line = NULL; ++ while (getline(&line, &length, file) != -1) { ++ /* First trim off any whitespace */ ++ int len = strlen(line); ++ ++ /* trim trailing whitespace */ ++ while (len > 0 && isspace(line[len - 1])) ++ line[--len] = '\0'; ++ /* trim leading whitespace */ ++ memmove(line, &line[strspn(line, " \n\r\t\v")], len); ++ ++ /* How long are we after trimming? */ ++ len = strlen(line); ++ ++ /* If this is NOT a comment line, try to interpret it */ ++ if (len && *line != '#') { ++ if (interpret_table_entry(line, root, fslen_ub)) ++ status = 1; ++ } ++ ++ free(line); ++ line = NULL; ++ } ++ free(line); ++ fclose(file); ++ ++ return status; ++} ++ ++void traverse(struct entry *entry, int depth) ++{ ++ struct entry *curr = entry; ++ int i; ++ ++ while (curr) { ++ for (i = 0; i < depth; i++) putchar(' '); ++ printf("%s: size=%d mode=%d same=%p\n", ++ (curr->name)? (char*)curr->name : "/", ++ curr->size, curr->mode, curr->same); ++ if (curr->child) traverse(curr->child, depth + 4); ++ curr = curr->next; ++ } ++} ++ ++static void free_filesystem_entry(struct entry *dir) ++{ ++ struct entry *e = dir, *last; ++ ++ if (S_ISDIR(dir->mode)) { ++ e = dir->child; ++ } ++ while (e) { ++ if (e->name) ++ free(e->name); ++ if (e->path) ++ free(e->path); ++ if (e->uncompressed) ++ free(e->uncompressed); ++ last = e; ++ if (e->child) { ++ free_filesystem_entry(e); ++ } ++ e = e->next; ++ free(last); ++ } ++} ++ ++ ++/* ++ * Usage: ++ * ++ * mkcramfs directory-name outfile ++ * ++ * where "directory-name" is simply the root of the directory ++ * tree that we want to generate a compressed filesystem out ++ * of. ++ */ + int main(int argc, char **argv) + { + struct stat st; /* used twice... */ +@@ -692,6 +1138,7 @@ + u32 crc; + int c; /* for getopt */ + char *ep; /* for strtoul */ ++ FILE *devtable = NULL; + + total_blocks = 0; + +@@ -699,7 +1146,7 @@ + progname = argv[0]; + + /* command line options */ +- while ((c = getopt(argc, argv, "hEe:i:n:psvz")) != EOF) { ++ while ((c = getopt(argc, argv, "hEe:i:n:psvzD:q")) != EOF) { + switch (c) { + case 'h': + usage(MKFS_OK); +@@ -715,7 +1162,7 @@ + case 'i': + opt_image = optarg; + if (lstat(opt_image, &st) < 0) { +- die(MKFS_ERROR, 1, "lstat failed: %s", opt_image); ++ error_msg_and_die("lstat failed: %s", opt_image); + } + image_length = st.st_size; /* may be padded later */ + fslen_ub += (image_length + 3); /* 3 is for padding */ +@@ -736,6 +1183,16 @@ + case 'z': + opt_holes = 1; + break; ++ case 'q': ++ opt_squash = 1; ++ break; ++ case 'D': ++ devtable = xfopen(optarg, "r"); ++ if (fstat(fileno(devtable), &st) < 0) ++ perror_msg_and_die(optarg); ++ if (st.st_size < 10) ++ error_msg_and_die("%s: not a proper device table file\n", optarg); ++ break; + } + } + +@@ -745,25 +1202,23 @@ + outfile = argv[optind + 1]; + + if (stat(dirname, &st) < 0) { +- die(MKFS_USAGE, 1, "stat failed: %s", dirname); +- } +- fd = open(outfile, O_WRONLY | O_CREAT | O_TRUNC, 0666); +- if (fd < 0) { +- die(MKFS_USAGE, 1, "open failed: %s", outfile); ++ error_msg_and_die("stat failed: %s", dirname); + } ++ fd = xopen(outfile, O_WRONLY | O_CREAT | O_TRUNC, 0666); + +- root_entry = calloc(1, sizeof(struct entry)); +- if (!root_entry) { +- die(MKFS_ERROR, 1, "calloc failed"); +- } ++ root_entry = xcalloc(1, sizeof(struct entry)); + root_entry->mode = st.st_mode; + root_entry->uid = st.st_uid; + root_entry->gid = st.st_gid; + + root_entry->size = parse_directory(root_entry, dirname, &root_entry->child, &fslen_ub); + ++ if (devtable) { ++ parse_device_table(devtable, root_entry, &fslen_ub); ++ } ++ + /* always allocate a multiple of blksize bytes because that's +- what we're going to write later on */ ++ what we're going to write later on */ + fslen_ub = ((fslen_ub - 1) | (blksize - 1)) + 1; + + if (fslen_ub > MAXFSLEN) { +@@ -790,7 +1245,7 @@ + rom_image = mmap(NULL, fslen_ub?fslen_ub:1, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + + if (rom_image == MAP_FAILED) { +- die(MKFS_ERROR, 1, "mmap failed"); ++ error_msg_and_die("mmap failed"); + } + + /* Skip the first opt_pad bytes for boot loader code */ +@@ -807,6 +1262,7 @@ + } + + offset = write_directory_structure(root_entry->child, rom_image, offset); ++ if (opt_verbose) + printf("Directory data: %d bytes\n", offset); + + offset = write_data(root_entry, rom_image, offset); +@@ -814,30 +1270,38 @@ + /* We always write a multiple of blksize bytes, so that + losetup works. */ + offset = ((offset - 1) | (blksize - 1)) + 1; ++ if (opt_verbose) + printf("Everything: %d kilobytes\n", offset >> 10); + + /* Write the superblock now that we can fill in all of the fields. */ + write_superblock(root_entry, rom_image+opt_pad, offset); ++ if (opt_verbose) + printf("Super block: %d bytes\n", sizeof(struct cramfs_super)); + + /* Put the checksum in. */ + crc = crc32(0L, Z_NULL, 0); + crc = crc32(crc, (rom_image+opt_pad), (offset-opt_pad)); + ((struct cramfs_super *) (rom_image+opt_pad))->fsid.crc = crc; ++ if (opt_verbose) + printf("CRC: %x\n", crc); + + /* Check to make sure we allocated enough space. */ + if (fslen_ub < offset) { +- die(MKFS_ERROR, 0, "not enough space allocated for ROM image (%Ld allocated, %d used)", fslen_ub, offset); ++ error_msg_and_die("not enough space allocated for ROM " ++ "image (%Ld allocated, %d used)", fslen_ub, offset); + } + + written = write(fd, rom_image, offset); + if (written < 0) { +- die(MKFS_ERROR, 1, "write failed"); ++ error_msg_and_die("write failed"); + } + if (offset != written) { +- die(MKFS_ERROR, 0, "ROM image write failed (wrote %d of %d bytes)", written, offset); ++ error_msg_and_die("ROM image write failed (wrote %d of %d bytes)", written, offset); + } ++ ++ /* Free up memory */ ++ free_filesystem_entry(root_entry); ++ free(root_entry); + + /* (These warnings used to come at the start, but they scroll off the + screen too quickly.) */ diff --git a/package/cramfs/cramfs-02-endian.patch b/package/cramfs/cramfs-02-endian.patch new file mode 100644 index 0000000000..0da55bfae6 --- /dev/null +++ b/package/cramfs/cramfs-02-endian.patch @@ -0,0 +1,284 @@ +--- cramfs-1.1/mkcramfs.c.orig 2005-04-13 05:55:57.000000000 -0600 ++++ cramfs-1.1/mkcramfs.c 2005-04-13 16:19:57.000000000 -0600 +@@ -117,6 +117,7 @@ + static int opt_squash = 0; + static char *opt_image = NULL; + static char *opt_name = NULL; ++static int swap_endian = 0; + + static int warn_dev, warn_gid, warn_namelen, warn_skip, warn_size, warn_uid; + static const char *const memory_exhausted = "memory exhausted"; +@@ -155,6 +156,8 @@ + " -i file insert a file image into the filesystem (requires >= 2.4.0)\n" + " -n name set name of cramfs filesystem\n" + " -p pad by %d bytes for boot code\n" ++ " -l litte endian filesystem\n" ++ " -b big endian filesystem\n" + " -s sort directory entries (old option, ignored)\n" + " -v be more verbose\n" + " -z make explicit holes (requires >= 2.3.39)\n" +@@ -504,6 +506,50 @@ + return totalsize; + } + ++/* routines to swap endianness/bitfields in inode/superblock block data */ ++static void fix_inode(struct cramfs_inode *inode) ++{ ++#define wswap(x) (((x)>>24) | (((x)>>8)&0xff00) | (((x)&0xff00)<<8) | (((x)&0xff)<<24)) ++ /* attempt #2 */ ++ inode->mode = (inode->mode >> 8) | ((inode->mode&0xff)<<8); ++ inode->uid = (inode->uid >> 8) | ((inode->uid&0xff)<<8); ++ inode->size = (inode->size >> 16) | (inode->size&0xff00) | ++ ((inode->size&0xff)<<16); ++ ((u32*)inode)[2] = wswap(inode->offset | (inode->namelen<<26)); ++} ++ ++static void fix_offset(struct cramfs_inode *inode, u32 offset) ++{ ++ u32 tmp = wswap(((u32*)inode)[2]); ++ ((u32*)inode)[2] = wswap((offset >> 2) | (tmp&0xfc000000)); ++} ++ ++static void fix_block_pointer(u32 *p) ++{ ++ *p = wswap(*p); ++} ++ ++static void fix_super(struct cramfs_super *super) ++{ ++ u32 *p = (u32*)super; ++ ++ /* fix superblock fields */ ++ p[0] = wswap(p[0]); /* magic */ ++ p[1] = wswap(p[1]); /* size */ ++ p[2] = wswap(p[2]); /* flags */ ++ p[3] = wswap(p[3]); /* future */ ++ ++ /* fix filesystem info fields */ ++ p = (u32*)&super->fsid; ++ p[0] = wswap(p[0]); /* crc */ ++ p[1] = wswap(p[1]); /* edition */ ++ p[2] = wswap(p[2]); /* blocks */ ++ p[3] = wswap(p[3]); /* files */ ++ ++ fix_inode(&super->root); ++#undef wswap ++} ++ + /* Returns sizeof(struct cramfs_super), which includes the root inode. */ + static unsigned int write_superblock(struct entry *root, char *base, int size) + { +@@ -539,6 +585,7 @@ + super->root.gid = root->gid; + super->root.size = root->size; + super->root.offset = offset >> 2; ++ if (swap_endian) fix_super(super); + + return offset; + } +@@ -553,7 +600,10 @@ + if (offset >= (1 << (2 + CRAMFS_OFFSET_WIDTH))) { + error_msg_and_die("filesystem too big"); + } +- inode->offset = (offset >> 2); ++ if (swap_endian) ++ fix_offset(inode, offset); ++ else ++ inode->offset = (offset >> 2); + } + + /* +@@ -638,6 +688,7 @@ + stack_entries++; + } + entry = entry->next; ++ if (swap_endian) fix_inode(inode); + } + + /* +@@ -734,6 +785,7 @@ + } + + *(u32 *) (base + offset) = curr; ++ if (swap_endian) fix_block_pointer((u32*)(base + offset)); + offset += 4; + } while (size); + +@@ -1146,7 +1198,7 @@ + progname = argv[0]; + + /* command line options */ +- while ((c = getopt(argc, argv, "hEe:i:n:psvzD:q")) != EOF) { ++ while ((c = getopt(argc, argv, "hEe:i:n:psvzD:qlb")) != EOF) { + switch (c) { + case 'h': + usage(MKFS_OK); +@@ -1174,6 +1227,18 @@ + opt_pad = PAD_SIZE; + fslen_ub += PAD_SIZE; + break; ++ case 'b': ++#if __BYTE_ORDER == __LITTLE_ENDIAN ++ swap_endian = 1; ++ printf("Swapping filesystem endian-ness\n"); ++#endif ++ break; ++ case 'l': ++#if __BYTE_ORDER == __BIG_ENDIAN ++ swap_endian = 1; ++ printf("Swapping filesystem endian-ness\n"); ++#endif ++ break; + case 's': + /* old option, ignored */ + break; +--- cramfs-1.1/cramfsck.c.orig 2005-04-25 11:50:31.000000000 -0700 ++++ cramfs-1.1/cramfsck.c 2005-04-25 16:53:25.000000000 -0700 +@@ -30,6 +30,7 @@ + * 2000/07/15: Daniel Quinlan (initial support for block devices) + * 2002/01/10: Daniel Quinlan (additional checks, test more return codes, + * use read if mmap fails, standardize messages) ++ * 2004/09/01: Alfonso Acosta (Add swapping support) + */ + + /* compile-time options */ +@@ -51,6 +52,7 @@ + #include + #include + #define _LINUX_STRING_H_ ++#include + #include "linux/cramfs_fs.h" + #include + +@@ -74,6 +76,7 @@ + static char *filename; /* ROM image filename */ + struct cramfs_super super; /* just find the cramfs superblock once */ + static int opt_verbose = 0; /* 1 = verbose (-v), 2+ = very verbose (-vv) */ ++static int need_swapping = 0; /* fs and host dont have the same endianness */ + #ifdef INCLUDE_FS_TESTS + static int opt_extract = 0; /* extract cramfs (-x) */ + static char *extract_dir = "/"; /* extraction directory (-x) */ +@@ -85,6 +88,9 @@ + static unsigned long start_data = ~0UL; /* start of the data (256 MB = max) */ + static unsigned long end_data = 0; /* end of the data */ + ++/* access 32 byte variables */ ++#define CRAMFS_32(x) (need_swapping ? bswap_32(x) : x) ++ + /* Guarantee access to at least 8kB at a time */ + #define ROMBUFFER_BITS 13 + #define ROMBUFFERSIZE (1 << ROMBUFFER_BITS) +@@ -166,20 +172,34 @@ + if (super.magic == CRAMFS_MAGIC) { + *start = 0; + } ++ else if (super.magic == bswap_32(CRAMFS_MAGIC)) { ++ *start = 0; ++ need_swapping = 1; ++ } ++ + else if (*length >= (PAD_SIZE + sizeof(super))) { + lseek(fd, PAD_SIZE, SEEK_SET); + if (read(fd, &super, sizeof(super)) != sizeof(super)) { + die(FSCK_ERROR, 1, "read failed: %s", filename); + } +- if (super.magic == CRAMFS_MAGIC) { ++ if (super.magic == CRAMFS_32(CRAMFS_MAGIC)) { + *start = PAD_SIZE; + } + } + + /* superblock tests */ +- if (super.magic != CRAMFS_MAGIC) { ++ if (super.magic != CRAMFS_32(CRAMFS_MAGIC)) { + die(FSCK_UNCORRECTED, 0, "superblock magic not found"); + } ++ if (need_swapping){ ++ super.size = bswap_32(super.size); ++ super.flags = bswap_32(super.flags); ++ super.future = bswap_32(super.future); ++ super.fsid.crc = bswap_32(super.fsid.crc); ++ super.fsid.edition = bswap_32(super.fsid.edition); ++ super.fsid.blocks = bswap_32(super.fsid.blocks); ++ super.fsid.files = bswap_32(super.fsid.files); ++ } + if (super.flags & ~CRAMFS_SUPPORTED_FLAGS) { + die(FSCK_ERROR, 0, "unsupported filesystem features"); + } +@@ -215,7 +235,10 @@ + die(FSCK_USAGE, 0, "unable to test CRC: old cramfs format"); + #endif /* not INCLUDE_FS_TESTS */ + } +- ++ else if (need_swapping) { ++ /* crc checking in this case would mean translating the whole file */ ++ return; ++ } + crc = crc32(0L, Z_NULL, 0); + + buf = mmap(NULL, super.size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); +@@ -300,12 +323,23 @@ + + static struct cramfs_inode *cramfs_iget(struct cramfs_inode * i) + { ++#define wswap(x) (((x)>>24) | (((x)>>8)&0xff00) | (((x)&0xff00)<<8) | (((x)&0xff)<<24)) + struct cramfs_inode *inode = malloc(sizeof(struct cramfs_inode)); + + if (!inode) { + die(FSCK_ERROR, 1, "malloc failed"); + } +- *inode = *i; ++ if(!need_swapping) { ++ *inode = *i; ++ } ++ else { ++ inode->mode=bswap_16(i->mode); ++ inode->uid=bswap_16(i->uid); ++ inode->size=bswap_32(i->size << 8); ++ inode->gid=i->gid; ++ inode->namelen = bswap_32(((u32*)i)[2]) >> 26; ++ inode->offset = bswap_32(((u32*)i)[2]) & 0x3FFFFFFF; ++ } + return inode; + } + +@@ -324,9 +358,9 @@ + */ + static struct cramfs_inode *read_super(void) + { +- unsigned long offset = super.root.offset << 2; +- +- if (!S_ISDIR(super.root.mode)) ++ struct cramfs_inode *root = cramfs_iget(&super.root); ++ unsigned long offset = root->offset << 2; ++ if (!S_ISDIR(root->mode)) + die(FSCK_UNCORRECTED, 0, "root inode is not directory"); + if (!(super.flags & CRAMFS_FLAG_SHIFTED_ROOT_OFFSET) && + ((offset != sizeof(struct cramfs_super)) && +@@ -334,7 +368,7 @@ + { + die(FSCK_UNCORRECTED, 0, "bad root offset (%lu)", offset); + } +- return cramfs_iget(&super.root); ++ return root; + } + + static int uncompress_block(void *src, int len) +@@ -366,7 +400,7 @@ + + do { + unsigned long out = PAGE_CACHE_SIZE; +- unsigned long next = *(u32 *) romfs_read(offset); ++ unsigned long next = CRAMFS_32(*(u32 *) romfs_read(offset)); + + if (next > end_data) { + end_data = next; +@@ -529,7 +563,7 @@ + { + unsigned long offset = i->offset << 2; + unsigned long curr = offset + 4; +- unsigned long next = *(u32 *) romfs_read(offset); ++ unsigned long next = CRAMFS_32(*(u32 *) romfs_read(offset)); + unsigned long size; + + if (offset == 0) { diff --git a/package/cramfs/cramfs-03-cygwin_IO.patch b/package/cramfs/cramfs-03-cygwin_IO.patch new file mode 100644 index 0000000000..4ea358ede3 --- /dev/null +++ b/package/cramfs/cramfs-03-cygwin_IO.patch @@ -0,0 +1,13 @@ +--- cramfs-1.1/cramfsck.c.orig 2006-12-22 22:16:59.328125000 +1100 ++++ cramfs-1.1/cramfsck.c 2006-12-19 01:02:05.531250000 +1100 +@@ -56,6 +56,10 @@ + #include "linux/cramfs_fs.h" + #include + ++#ifdef __CYGWIN__ ++#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0) ++#endif /* __CYGWIN__ */ ++ + #define BLKGETSIZE _IO(0x12,96) /* return device size /512 (long *arg) */ + + /* Exit codes used by fsck-type programs */ diff --git a/package/cramfs/cramfs.mk b/package/cramfs/cramfs.mk new file mode 100644 index 0000000000..7b1924e816 --- /dev/null +++ b/package/cramfs/cramfs.mk @@ -0,0 +1,33 @@ +############################################################# +# +# cramfs +# +############################################################# + +CRAMFS_VERSION=1.1 +CRAMFS_SOURCE=cramfs-$(CRAMFS_VERSION).tar.gz +CRAMFS_SITE=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/cramfs + +CRAMFS_DEPENDENCIES = zlib +HOST_CRAMFS_DEPENDENCIES = host-zlib + +define CRAMFS_BUILD_CMDS + $(TARGET_MAKE_ENV) $(MAKE) CC="$(TARGET_CC)" CFLAGS="$(TARGET_CFLAGS)" LDFLAGS="$(TARGET_LDFLAGS)" -C $(@D) +endef + +define CRAMFS_INSTALL_TARGET_CMDS + install -m 755 $(@D)/mkcramfs $(TARGET_DIR)/usr/bin + install -m 755 $(@D)/cramfsck $(TARGET_DIR)/usr/bin +endef + +define HOST_CRAMFS_BUILD_CMDS + $(HOST_MAKE_ENV) $(MAKE) CFLAGS="$(HOST_CFLAGS) -Wall -O2 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" LDFLAGS="$(HOST_LDFLAGS)" -C $(@D) +endef + +define HOST_CRAMFS_INSTALL_CMDS + install -m 755 $(@D)/mkcramfs $(HOST_DIR)/usr/bin + install -m 755 $(@D)/cramfsck $(HOST_DIR)/usr/bin +endef + +$(eval $(call GENTARGETS,package,cramfs)) +$(eval $(call GENTARGETS,package,cramfs,host)) From c040b2c0105120bcd71046e346842f9917b4445a Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 2 Mar 2010 00:14:33 +0100 Subject: [PATCH 04/44] squashfs: new package Signed-off-by: Thomas Petazzoni --- package/Config.in | 1 + package/squashfs/Config.in | 6 ++ .../squashfs-4.0-build-system-fix.patch | 60 +++++++++++++++++++ ...fs-4.0-mksquashfs-race-condition-fix.patch | 0 package/squashfs/squashfs.mk | 30 ++++++++++ 5 files changed, 97 insertions(+) create mode 100644 package/squashfs/Config.in create mode 100644 package/squashfs/squashfs-4.0-build-system-fix.patch rename {target => package}/squashfs/squashfs-4.0-mksquashfs-race-condition-fix.patch (100%) create mode 100644 package/squashfs/squashfs.mk diff --git a/package/Config.in b/package/Config.in index 5a7bf27894..a742063101 100644 --- a/package/Config.in +++ b/package/Config.in @@ -187,6 +187,7 @@ if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS source "package/sfdisk/Config.in" endif source "package/smartmontools/Config.in" +source "package/squashfs/Config.in" source "package/sshfs/Config.in" source "package/sysstat/Config.in" if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS diff --git a/package/squashfs/Config.in b/package/squashfs/Config.in new file mode 100644 index 0000000000..3080cc3ab6 --- /dev/null +++ b/package/squashfs/Config.in @@ -0,0 +1,6 @@ +config BR2_PACKAGE_SQUASHFS + bool "squashfs" + help + Tools to generate SquashFS filesystems. + + http://squashfs.sourceforge.net/ diff --git a/package/squashfs/squashfs-4.0-build-system-fix.patch b/package/squashfs/squashfs-4.0-build-system-fix.patch new file mode 100644 index 0000000000..9db208bff1 --- /dev/null +++ b/package/squashfs/squashfs-4.0-build-system-fix.patch @@ -0,0 +1,60 @@ +Index: a/squashfs-tools/Makefile +=================================================================== +--- a/squashfs-tools.orig/Makefile 2009-04-19 01:47:43.000000000 +0200 ++++ b/squashfs-tools/Makefile 2009-04-19 01:52:36.000000000 +0200 +@@ -1,36 +1,48 @@ + INSTALL_DIR = /usr/local/bin + + INCLUDEDIR = . ++CFLAGS_R = -I$(INCLUDEDIR) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE ++LIBS = -lz -lpthread + + CFLAGS := -I$(INCLUDEDIR) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -O2 + + all: mksquashfs unsquashfs + + mksquashfs: mksquashfs.o read_fs.o sort.o swap.o pseudo.o +- $(CC) mksquashfs.o read_fs.o sort.o swap.o pseudo.o -lz -lpthread -lm -o $@ ++ $(CC) $(LDFLAGS) mksquashfs.o read_fs.o sort.o swap.o pseudo.o -lz -lpthread -lm -o $@ + + mksquashfs.o: mksquashfs.c squashfs_fs.h mksquashfs.h global.h sort.h squashfs_swap.h Makefile ++ $(CC) $(CFLAGS_R) $(CFLAGS) -c -o $@ $< + + read_fs.o: read_fs.c squashfs_fs.h read_fs.h global.h squashfs_swap.h Makefile ++ $(CC) $(CFLAGS_R) $(CFLAGS) -c -o $@ $< + + sort.o: sort.c squashfs_fs.h global.h sort.h Makefile ++ $(CC) $(CFLAGS_R) $(CFLAGS) -c -o $@ $< + + swap.o: swap.c Makefile ++ $(CC) $(CFLAGS_R) $(CFLAGS) -c -o $@ $< + + pseudo.o: pseudo.c pseudo.h Makefile ++ $(CC) $(CFLAGS_R) $(CFLAGS) -c -o $@ $< + + unsquashfs: unsquashfs.o unsquash-1.o unsquash-2.o unsquash-3.o unsquash-4.o swap.o +- $(CC) unsquashfs.o unsquash-1.o unsquash-2.o unsquash-3.o unsquash-4.o swap.o -lz -lpthread -lm -o $@ ++ $(CC) $(LDFLAGS) unsquashfs.o unsquash-1.o unsquash-2.o unsquash-3.o unsquash-4.o swap.o -lz -lpthread -lm -o $@ + +-unsquashfs.o: unsquashfs.h unsquashfs.c squashfs_fs.h squashfs_swap.h squashfs_compat.h global.h Makefile ++unsquashfs.o: unsquashfs.c unsquashfs.h squashfs_fs.h squashfs_swap.h squashfs_compat.h global.h Makefile ++ $(CC) $(CFLAGS_R) $(CFLAGS) -c -o $@ $< + +-unsquash-1.o: unsquashfs.h unsquash-1.c squashfs_fs.h squashfs_compat.h global.h Makefile ++unsquash-1.o: unsquash-1.c unsquashfs.h squashfs_fs.h squashfs_compat.h global.h Makefile ++ $(CC) $(CFLAGS_R) $(CFLAGS) -c -o $@ $< + +-unsquash-2.o: unsquashfs.h unsquash-2.c unsquashfs.h squashfs_fs.h squashfs_compat.h global.h Makefile ++unsquash-2.o: unsquash-2.c unsquashfs.h unsquashfs.h squashfs_fs.h squashfs_compat.h global.h Makefile ++ $(CC) $(CFLAGS_R) $(CFLAGS) -c -o $@ $< + +-unsquash-3.o: unsquashfs.h unsquash-3.c squashfs_fs.h squashfs_compat.h global.h Makefile ++unsquash-3.o: unsquash-3.c unsquashfs.h squashfs_fs.h squashfs_compat.h global.h Makefile ++ $(CC) $(CFLAGS_R) $(CFLAGS) -c -o $@ $< + +-unsquash-4.o: unsquashfs.h unsquash-4.c squashfs_fs.h squashfs_swap.h global.h Makefile ++unsquash-4.o: unsquash-4.c unsquashfs.h squashfs_fs.h squashfs_swap.h global.h Makefile ++ $(CC) $(CFLAGS_R) $(CFLAGS) -c -o $@ $< + + clean: + -rm -f *.o mksquashfs unsquashfs diff --git a/target/squashfs/squashfs-4.0-mksquashfs-race-condition-fix.patch b/package/squashfs/squashfs-4.0-mksquashfs-race-condition-fix.patch similarity index 100% rename from target/squashfs/squashfs-4.0-mksquashfs-race-condition-fix.patch rename to package/squashfs/squashfs-4.0-mksquashfs-race-condition-fix.patch diff --git a/package/squashfs/squashfs.mk b/package/squashfs/squashfs.mk new file mode 100644 index 0000000000..ab05b06e5e --- /dev/null +++ b/package/squashfs/squashfs.mk @@ -0,0 +1,30 @@ +SQUASHFS_VERSION=4.0 +SQUASHFS_SOURCE=squashfs$(SQUASHFS_VERSION).tar.gz +SQUASHFS_SITE=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/squashfs + +SQUASHFS_DEPENDENCIES = zlib +HOST_SQUASHFS_DEPENDENCIES = host-zlib + +define SQUASHFS_BUILD_CMDS + $(TARGET_MAKE_ENV) $(MAKE) \ + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + -C $(@D)/squashfs-tools/ +endef + +define SQUASHFS_INSTALL_TARGET_CMDS + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/squashfs-tools/ INSTALL_DIR=$(TARGET_DIR)/usr/bin install +endef + +define HOST_SQUASHFS_BUILD_CMDS + $(HOST_MAKE_ENV) $(MAKE) -C $(@D)/squashfs-tools/ +endef + +define HOST_SQUASHFS_INSTALL_CMDS + $(HOST_MAKE_ENV) $(MAKE) -C $(@D)/squashfs-tools/ INSTALL_DIR=$(HOST_DIR)/usr/bin install +endef + +$(eval $(call GENTARGETS,package,squashfs)) +$(eval $(call GENTARGETS,package,squashfs,host)) + From 7ec49b9af7eef4cb43615e58e7f166fddaae94e6 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 2 Mar 2010 22:47:13 +0100 Subject: [PATCH 05/44] libcap: new package Needed as a dependency of cdrkit, which contains genisomage, useful for generating ISO9660 filesystem images. Signed-off-by: Thomas Petazzoni --- package/Config.in | 1 + package/libcap/Config.in | 10 ++++ package/libcap/libcap-2.19-build-system.patch | 55 +++++++++++++++++++ package/libcap/libcap.mk | 27 +++++++++ 4 files changed, 93 insertions(+) create mode 100644 package/libcap/Config.in create mode 100644 package/libcap/libcap-2.19-build-system.patch create mode 100644 package/libcap/libcap.mk diff --git a/package/Config.in b/package/Config.in index a742063101..f3f42139cb 100644 --- a/package/Config.in +++ b/package/Config.in @@ -295,6 +295,7 @@ source "package/libupnp/Config.in" endmenu menu "Other" +source "package/libcap/Config.in" source "package/libdaemon/Config.in" source "package/libelf/Config.in" source "package/libevent/Config.in" diff --git a/package/libcap/Config.in b/package/libcap/Config.in new file mode 100644 index 0000000000..f1fc8fa163 --- /dev/null +++ b/package/libcap/Config.in @@ -0,0 +1,10 @@ +config BR2_PACKAGE_LIBCAP + bool "libcap" + help + This library implements the user-space interfaces to the + POSIX 1003.1e capabilities available in Linux kernels. These + capabilities are a partitioning of the all powerful root + privilege into a set of distinct privileges. + + http://sites.google.com/site/fullycapable/ + diff --git a/package/libcap/libcap-2.19-build-system.patch b/package/libcap/libcap-2.19-build-system.patch new file mode 100644 index 0000000000..42a5518fff --- /dev/null +++ b/package/libcap/libcap-2.19-build-system.patch @@ -0,0 +1,55 @@ +--- + Make.Rules | 15 ++++++++------- + libcap/Makefile | 2 +- + 2 files changed, 9 insertions(+), 8 deletions(-) + +Index: libcap-2.19/Make.Rules +=================================================================== +--- libcap-2.19.orig/Make.Rules ++++ libcap-2.19/Make.Rules +@@ -45,24 +45,25 @@ + KERNEL_HEADERS := $(topdir)/libcap/include + IPATH += -I$(topdir)/libcap/include -I$(KERNEL_HEADERS) + +-CC := gcc +-CFLAGS := -O2 +-BUILD_CC := $(CC) +-BUILD_CFLAGS := $(CFLAGS) $(IPATH) +-AR := ar +-RANLIB := ranlib ++CC ?= gcc ++CFLAGS ?= -O2 ++CC_FOR_BUILD ?= $(CC) ++CFLAGS_FOR_BUILD ?= $(CFLAGS) ++AR ?= ar ++RANLIB ?= ranlib + DEBUG = -g #-DDEBUG + WARNINGS=-fPIC -Wall -Wwrite-strings \ + -Wpointer-arith -Wcast-qual -Wcast-align \ + -Wstrict-prototypes -Wmissing-prototypes \ + -Wnested-externs -Winline -Wshadow + LD=$(CC) -Wl,-x -shared +-LDFLAGS := #-g ++LDFLAGS ?= #-g + + SYSTEM_HEADERS = /usr/include + INCS=$(topdir)/libcap/include/sys/capability.h + LDFLAGS += -L$(topdir)/libcap + CFLAGS += -Dlinux $(WARNINGS) $(DEBUG) $(IPATH) ++CFLAGS_FOR_BUILD += $(IPATH) + PAM_CAP := $(shell if [ -f /usr/include/security/pam_modules.h ]; then echo yes ; else echo no ; fi) + INDENT := $(shell if [ -n "$(which indent 2>/dev/null)" ]; then echo "| indent -kr" ; fi) + DYNAMIC := $(shell if [ ! -d "$(topdir)/.git" ]; then echo yes; fi) +Index: libcap-2.19/libcap/Makefile +=================================================================== +--- libcap-2.19.orig/libcap/Makefile ++++ libcap-2.19/libcap/Makefile +@@ -33,7 +33,7 @@ + endif + + _makenames: _makenames.c cap_names.list.h +- $(BUILD_CC) $(BUILD_CFLAGS) $< -o $@ ++ $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $< -o $@ + + cap_names.h: _makenames + ./_makenames > cap_names.h diff --git a/package/libcap/libcap.mk b/package/libcap/libcap.mk new file mode 100644 index 0000000000..3ea5e51aad --- /dev/null +++ b/package/libcap/libcap.mk @@ -0,0 +1,27 @@ +LIBCAP_VERSION=2.19 +LIBCAP_SOURCE=libcap-$(LIBCAP_VERSION).tar.bz2 +LIBCAP_SITE=http://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/ +LIBCAP_INSTALL_STAGING=YES + +define LIBCAP_BUILD_CMDS + $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) LIBATTR=no +endef + +define LIBCAP_INSTALL_STAGING_CMDS + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) LIBATTR=no DESTDIR=$(STAGING_DIR) install +endef + +define LIBCAP_INSTALL_TARGET_CMDS + install -D $(STAGING_DIR)/usr/lib/libcap.so.* $(TARGET_DIR)/usr/lib +endef + +define HOST_LIBCAP_BUILD_CMDS + $(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) LIBATTR=no +endef + +define HOST_LIBCAP_INSTALL_CMDS + $(HOST_MAKE_ENV) $(MAKE) -C $(@D) LIBATTR=no DESTDIR=$(HOST_DIR) install +endef + +$(eval $(call GENTARGETS,package,libcap)) +$(eval $(call GENTARGETS,package,libcap,host)) From ea448feff70ba79166fc188fd0247b3d7127a6a0 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 2 Mar 2010 22:29:52 +0100 Subject: [PATCH 06/44] bzip2: convert to gentargets, add host package, bump version Signed-off-by: Thomas Petazzoni --- package/bzip2/bzip2.mk | 146 ++++++++++++++++++----------------------- 1 file changed, 63 insertions(+), 83 deletions(-) diff --git a/package/bzip2/bzip2.mk b/package/bzip2/bzip2.mk index 98de5326d4..43ab5f265e 100644 --- a/package/bzip2/bzip2.mk +++ b/package/bzip2/bzip2.mk @@ -3,65 +3,55 @@ # bzip2 # ############################################################# -BZIP2_VERSION:=1.0.4 +BZIP2_VERSION:=1.0.5 BZIP2_SOURCE:=bzip2-$(BZIP2_VERSION).tar.gz BZIP2_SITE:=http://www.bzip.org/$(BZIP2_VERSION) -BZIP2_DIR:=$(BUILD_DIR)/bzip2-$(BZIP2_VERSION) -BZIP2_CAT:=$(ZCAT) -BZIP2_BINARY:=$(BZIP2_DIR)/bzip2 -BZIP2_TARGET_BINARY:=$(TARGET_DIR)/usr/bin/bzmore +BZIP2_STAGING_INSTALL=YES -$(DL_DIR)/$(BZIP2_SOURCE): - $(call DOWNLOAD,$(BZIP2_SITE),$(BZIP2_SOURCE)) - -bzip2-source: $(DL_DIR)/$(BZIP2_SOURCE) - -$(BZIP2_DIR)/.unpacked: $(DL_DIR)/$(BZIP2_SOURCE) - $(BZIP2_CAT) $(DL_DIR)/$(BZIP2_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - - $(SED) "s,ln \$$(,ln -snf \$$(,g" $(BZIP2_DIR)/Makefile +define BZIP2_FIX_MAKEFILE + $(SED) "s,ln \$$(,ln -snf \$$(,g" $(@D)/Makefile $(SED) "s,ln -s (lib.*),ln -snf \$$1; ln -snf libbz2.so.$(BZIP2_VERSION) \ - libbz2.so,g" $(BZIP2_DIR)/Makefile-libbz2_so -ifneq ($(BR2_LARGEFILE),y) - $(SED) "s,^BIGFILES,#BIGFILES,g" $(BZIP2_DIR)/Makefile - $(SED) "s,^BIGFILES,#BIGFILES,g" $(BZIP2_DIR)/Makefile-libbz2_so -endif - $(SED) "s:-O2:$(TARGET_CFLAGS):" $(BZIP2_DIR)/Makefile - $(SED) "s:-O2:$(TARGET_CFLAGS):" $(BZIP2_DIR)/Makefile-libbz2_so - touch $@ + libbz2.so,g" $(@D)/Makefile-libbz2_so + $(SED) "s:-O2:$(TARGET_CFLAGS):" $(@D)/Makefile + $(SED) "s:-O2:$(TARGET_CFLAGS):" $(@D)/Makefile-libbz2_so +endef -$(STAGING_DIR)/usr/lib/libbz2.so.$(BZIP2_VERSION): $(BZIP2_DIR)/.unpacked - $(TARGET_CONFIGURE_OPTS) \ - $(MAKE) CC=$(TARGET_CC) RANLIB=$(TARGET_RANLIB) AR=$(TARGET_AR) \ - -C $(BZIP2_DIR) -f Makefile-libbz2_so - $(TARGET_CONFIGURE_OPTS) \ - $(MAKE) CC=$(TARGET_CC) RANLIB=$(TARGET_RANLIB) AR=$(TARGET_AR) \ - -C $(BZIP2_DIR) libbz2.a - cp $(BZIP2_DIR)/bzlib.h $(STAGING_DIR)/usr/include/ - cp $(BZIP2_DIR)/libbz2.so.$(BZIP2_VERSION) $(STAGING_DIR)/usr/lib/ - cp $(BZIP2_DIR)/libbz2.a $(STAGING_DIR)/usr/lib/ +BZIP2_POST_PATCH_HOOKS += BZIP2_FIX_MAKEFILE + +define BZIP2_NOLARGEFILE_FIX_MAKEFILE + $(SED) "s,^BIGFILES,#BIGFILES,g" $(@D)/Makefile + $(SED) "s,^BIGFILES,#BIGFILES,g" $(@D)/Makefile-libbz2_so +endef + +ifneq ($(BR2_LARGEFILE),y) +BZIP2_POST_PATCH_HOOKS += BZIP2_NOLARGEFILE_FIX_MAKEFILE +endif + +define BZIP2_BUILD_CMDS + $(TARGET_MAKE_ENV) \ + $(MAKE) -C $(@D) -f Makefile-libbz2_so \ + CC="$(TARGET_CC)" RANLIB="$(TARGET_RANLIB)" AR="$(TARGET_AR)" + $(TARGET_MAKE_ENV) \ + $(MAKE) -C $(@D) \ + CC="$(TARGET_CC)" RANLIB="$(TARGET_RANLIB)" AR="$(TARGET_AR)" \ + libbz2.a bzip2 bzip2recover +endef + +define BZIP2_INSTALL_STAGING_CMDS + cp $(@D)/bzlib.h $(STAGING_DIR)/usr/include/ + cp $(@D)/libbz2.so.$(BZIP2_VERSION) $(STAGING_DIR)/usr/lib/ + cp $(@D)/libbz2.a $(STAGING_DIR)/usr/lib/ (cd $(STAGING_DIR)/usr/lib/; \ ln -snf libbz2.so.$(BZIP2_VERSION) libbz2.so; \ - ) - (cd $(STAGING_DIR)/usr/lib; \ ln -snf libbz2.so.$(BZIP2_VERSION) libbz2.so.1.0; \ ln -snf libbz2.so.$(BZIP2_VERSION) libbz2.so.1; \ ) +endef -$(BZIP2_BINARY): $(STAGING_DIR)/usr/lib/libbz2.so.$(BZIP2_VERSION) - $(TARGET_CONFIGURE_OPTS) \ - $(MAKE) CC=$(TARGET_CC) -C $(BZIP2_DIR) bzip2 bzip2recover - touch -c $@ - -$(BZIP2_TARGET_BINARY): $(BZIP2_BINARY) - (cd $(TARGET_DIR)/usr/bin; \ - rm -f bzip2 bunzip2 bzcat bzip2recover \ - bzgrep bzegrep bzfgrep bzmore bzless bzdiff bzcmp; \ - ) - $(TARGET_CONFIGURE_OPTS) \ - $(MAKE) PREFIX=$(TARGET_DIR)/usr -C $(BZIP2_DIR) install - rm -f $(TARGET_DIR)/usr/lib/libbz2.a - rm -f $(TARGET_DIR)/usr/include/bzlib.h - cp $(BZIP2_DIR)/libbz2.so.$(BZIP2_VERSION) $(TARGET_DIR)/usr/lib/ +define B2IP_INSTALL_TARGET_CMDS + $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) \ + $(MAKE) PREFIX=$(TARGET_DIR)/usr -C $(@D) install + cp $(@D)/libbz2.so.$(BZIP2_VERSION) $(TARGET_DIR)/usr/lib/ (cd $(TARGET_DIR)/usr/lib; \ ln -snf libbz2.so.$(BZIP2_VERSION) libbz2.so.1.0; \ ln -snf libbz2.so.$(BZIP2_VERSION) libbz2.so; \ @@ -74,47 +64,37 @@ $(BZIP2_TARGET_BINARY): $(BZIP2_BINARY) ln -snf bzgrep bzegrep; \ ln -snf bzgrep bzfgrep; \ ) -ifneq ($(BR2_HAVE_INFOPAGES),y) - rm -rf $(TARGET_DIR)/usr/info -endif -ifneq ($(BR2_HAVE_MANPAGES),y) - rm -rf $(TARGET_DIR)/usr/man -endif - rm -rf $(TARGET_DIR)/share/locale - rm -rf $(TARGET_DIR)/usr/share/doc +endef -$(TARGET_DIR)/usr/lib/libbz2.a: $(STAGING_DIR)/usr/lib/libbz2.a - mkdir -p $(TARGET_DIR)/usr/include - cp $(STAGING_DIR)/usr/include/bzlib.h $(TARGET_DIR)/usr/include/ - cp $(STAGING_DIR)/usr/lib/libbz2.a $(TARGET_DIR)/usr/lib/ - rm -f $(TARGET_DIR)/lib/libbz2.so - (cd $(TARGET_DIR)/usr/lib; \ - ln -fs /usr/lib/libbz2.so.1.0 libbz2.so; \ - ) - -$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libbz2.so.1.0 - touch -c $@ - -bzip2-headers: $(TARGET_DIR)/usr/lib/libbz2.a - -bzip2: $(BZIP2_TARGET_BINARY) - -bzip2-clean: +define BZIP2_CLEAN_CMDS rm -f $(addprefix $(TARGET_DIR),/lib/libbz2.* \ /usr/lib/libbz2.* \ /usr/include/bzlib.h) rm -f $(addprefix $(STAGING_DIR),/lib/libbz2.* \ /usr/lib/libbz2.* \ /usr/include/bzlib.h) - -$(MAKE) -C $(BZIP2_DIR) clean + -$(MAKE) -C $(@D) clean +endef -bzip2-dirclean: - rm -rf $(BZIP2_DIR) +define HOST_BZIP2_FIX_MAKEFILE + $(SED) "s,ln \$$(,ln -snf \$$(,g" $(@D)/Makefile + $(SED) "s,ln -s (lib.*),ln -snf \$$1; ln -snf libbz2.so.$(BZIP2_VERSION) \ + libbz2.so,g" $(@D)/Makefile-libbz2_so + $(SED) "s:-O2:$(HOST_CFLAGS):" $(@D)/Makefile + $(SED) "s:-O2:$(HOST_CFLAGS):" $(@D)/Makefile-libbz2_so +endef -############################################################# -# -# Toplevel Makefile options -# -############################################################# -ifeq ($(BR2_PACKAGE_BZIP2),y) -TARGETS+=bzip2 -endif +HOST_BZIP2_POST_PATCH_HOOKS += HOST_BZIP2_FIX_MAKEFILE + +define HOST_BZIP2_BUILD_CMDS + $(HOST_MAKE_ENV) $(MAKE) -C $(@D) -f Makefile-libbz2_so + $(HOST_MAKE_ENV) $(MAKE) -C $(@D) libbz2.a bzip2 bzip2recover +endef + +define HOST_BZIP2_INSTALL_CMDS + $(HOST_MAKE_ENV) \ + $(MAKE) PREFIX=$(HOST_DIR)/usr -C $(@D) install +endef + +$(eval $(call GENTARGETS,package,bzip2)) +$(eval $(call GENTARGETS,package,bzip2,host)) \ No newline at end of file From 73b1ab73d7fcbf3c6db46c8e7c6eb612b7a2b27a Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 2 Mar 2010 22:31:26 +0100 Subject: [PATCH 07/44] cmake: new package Only compilation for the host is supported, why explains why we don't have a Config.in and the corresponding BR2_PACKAGE_CMAKE option. Signed-off-by: Thomas Petazzoni --- package/cmake/cmake.mk | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 package/cmake/cmake.mk diff --git a/package/cmake/cmake.mk b/package/cmake/cmake.mk new file mode 100644 index 0000000000..42d4ff5ed7 --- /dev/null +++ b/package/cmake/cmake.mk @@ -0,0 +1,20 @@ +CMAKE_VERSION=2.8.0 +CMAKE_SOURCE=cmake-$(CMAKE_VERSION).tar.gz +CMAKE_SITE=http://www.cmake.org/files/v2.8/ + +define HOST_CMAKE_CONFIGURE_CMDS + (cd $(@D); \ + ./bootstrap --prefix=$(HOST_DIR)/usr --parallel=$(BR2_JLEVEL) \ + ) +endef + +define HOST_CMAKE_BUILD_CMDS + $(HOST_MAKE_ENV) $(MAKE) -C $(@D) +endef + +define HOST_CMAKE_INSTALL_CMDS + $(HOST_MAKE_ENV) $(MAKE) -C $(@D) install +endef + +$(eval $(call GENTARGETS,package,cmake)) +$(eval $(call GENTARGETS,package,cmake,host)) \ No newline at end of file From 1ef21e7bd454e531286d33c720e9f49ace3ecc6a Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 2 Mar 2010 22:32:52 +0100 Subject: [PATCH 08/44] cdrkit: new package Supported both for the target and the host. Will be used by the root filesystem generation code, thanks to genisoimage. Signed-off-by: Thomas Petazzoni --- package/Config.in | 1 + package/cdrkit/Config.in | 11 +++++++ package/cdrkit/cdrkit.mk | 63 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+) create mode 100644 package/cdrkit/Config.in create mode 100644 package/cdrkit/cdrkit.mk diff --git a/package/Config.in b/package/Config.in index f3f42139cb..0dac9498f2 100644 --- a/package/Config.in +++ b/package/Config.in @@ -146,6 +146,7 @@ endmenu menu "Hardware handling" source "package/acpid/Config.in" +source "package/cdrkit/Config.in" source "package/cramfs/Config.in" source "package/dbus/Config.in" source "package/dbus-glib/Config.in" diff --git a/package/cdrkit/Config.in b/package/cdrkit/Config.in new file mode 100644 index 0000000000..2e255819ac --- /dev/null +++ b/package/cdrkit/Config.in @@ -0,0 +1,11 @@ +config BR2_PACKAGE_CDRKIT + # Needed for libbz + select BR2_PACKAGE_BZIP2 + select BR2_PACKAGE_LIBCAP + bool "cdrkit" + help + cdrkit is a suite of programs for recording CDs and DVDs, + blanking CD-RW media, creating ISO-9660 filesystem images, + extracting audio CD data, and more. + + http://www.cdrkit.org/ diff --git a/package/cdrkit/cdrkit.mk b/package/cdrkit/cdrkit.mk new file mode 100644 index 0000000000..a6a2e80c5a --- /dev/null +++ b/package/cdrkit/cdrkit.mk @@ -0,0 +1,63 @@ +CDRKIT_VERSION=1.1.10 +CDRKIT_SOURCE=cdrkit-$(CDRKIT_VERSION).tar.gz +CDRKIT_SITE=http://www.cdrkit.org/releases/ + +CDRKIT_DEPENDENCIES=libcap bzip2 host-cmake +HOST_CDRKIT_DEPENDENCIES=host-libcap host-cmake host-bzip2 + +ifeq ($(BR2_ENDIAN),"BIG") +CMAKE_ENDIAN_OPT=-DBITFIELDS_HTOL=1 +else +CMAKE_ENDIAN_OPT=-DBITFIELDS_HTOL=0 +endif + +define CDRKIT_CONFIGURE_CMDS + -mkdir $(@D)/build + (cd $(@D)/build ; \ + $(HOST_DIR)/usr/bin/cmake .. \ + -Wno-dev \ + -DCMAKE_SYSTEM_NAME:STRING="Linux" \ + -DCMAKE_C_COMPILER:FILEPATH="$(TARGET_CC)" \ + -DCMAKE_CXX_COMPILER:FILEPATH="$(TARGET_CXX)" \ + -DCMAKE_C_FLAGS:STRING="$(TARGET_CFLAGS)" \ + -DCMAKE_EXE_LINKER_FLAGS:STRING="$(TARGET_LDFLAGS)" \ + -DCMAKE_MODULE_LINKER_FLAGS:STRING="$(TARGET_LDFLAGS)" \ + -DCMAKE_SHARED_LINKER_FLAGS:STRING="$(TARGET_LDFLAGS)" \ + -DCMAKE_FIND_ROOT_PATH:PATH="$(STAGING_DIR)" \ + -DCMAKE_INSTALL_PREFIX:PATH="$(TARGET_DIR)/usr" \ + $(CMAKE_ENDIAN_OPT) \ + ) +endef + +define CDRKIT_BUILD_CMDS + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/build +endef + +define CDRKIT_INSTALL_TARGET_CMDS + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/build install +endef + +define HOST_CDRKIT_CONFIGURE_CMDS + -mkdir $(@D)/build + (cd $(@D)/build ; \ + $(HOST_DIR)/usr/bin/cmake .. \ + -Wno-dev \ + -DCMAKE_C_FLAGS="$(HOST_CFLAGS)" \ + -DCMAKE_EXE_LINKER_FLAGS:STRING="$(HOST_LDFLAGS)" \ + -DCMAKE_MODULE_LINKER_FLAGS:STRING="$(HOST_LDFLAGS)" \ + -DCMAKE_SHARED_LINKER_FLAGS:STRING="$(HOST_LDFLAGS)" \ + -DCMAKE_INSTALL_PREFIX:STRING="$(HOST_DIR)/usr" \ + ) +endef + +define HOST_CDRKIT_BUILD_CMDS + $(HOST_MAKE_ENV) $(MAKE) -C $(@D)/build +endef + +define HOST_CDRKIT_INSTALL_CMDS + $(HOST_MAKE_ENV) $(MAKE) -C $(@D)/build install +endef + +$(eval $(call GENTARGETS,package,cdrkit)) +$(eval $(call GENTARGETS,package,cdrkit,host)) + From e7cf05aebeea9485b538f6905818a5e888da2ff5 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 2 Mar 2010 22:33:55 +0100 Subject: [PATCH 09/44] e2fsprogs: add support for host package Host package is needed to get libuuid installed for the host, needed to build the mtd utils for the host. Signed-off-by: Thomas Petazzoni --- package/e2fsprogs/e2fsprogs.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/package/e2fsprogs/e2fsprogs.mk b/package/e2fsprogs/e2fsprogs.mk index 09db99698f..af3c3eda22 100644 --- a/package/e2fsprogs/e2fsprogs.mk +++ b/package/e2fsprogs/e2fsprogs.mk @@ -26,7 +26,12 @@ E2FSPROGS_CONF_OPT = \ E2FSPROGS_MAKE_OPT = \ LDCONFIG=true +define HOST_E2FSPROGS_INSTALL_CMDS + $(HOST_MAKE_ENV) $(MAKE) -C $(@D) install install-libs +endef + $(eval $(call AUTOTARGETS,package,e2fsprogs)) +$(eval $(call AUTOTARGETS,package,e2fsprogs,host)) # binaries to keep or remove E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_BADBLOCKS) += usr/sbin/badblocks From de4cf4e9135e198d4c3beefc8ad63c03870eb78a Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 2 Mar 2010 22:34:58 +0100 Subject: [PATCH 10/44] mtd: convert to gentargets, add host package Signed-off-by: Thomas Petazzoni --- package/mtd/mtd.mk | 142 ++++++++++++++------------------------------- 1 file changed, 45 insertions(+), 97 deletions(-) diff --git a/package/mtd/mtd.mk b/package/mtd/mtd.mk index 3e0fcaf803..5a449f28e0 100644 --- a/package/mtd/mtd.mk +++ b/package/mtd/mtd.mk @@ -6,65 +6,21 @@ MTD_VERSION:=1.3.1 MTD_SOURCE:=mtd-utils-$(MTD_VERSION).tar.bz2 MTD_SITE:=ftp://ftp.infradead.org/pub/mtd-utils -MTD_DIR:=$(BUILD_DIR)/mtd-utils-$(MTD_VERSION) -MTD_HOST_DIR:= $(MTD_DIR)-host -MTD_CAT:=$(BZCAT) -############################################################# -# -# Build mkfs.jffs2 and sumtool for use on the local host system if -# needed by target/jffs2root. -# -############################################################# -MKFS_JFFS2 := $(HOST_DIR)/usr/sbin/mkfs.jffs2 -SUMTOOL := $(HOST_DIR)/usr/sbin/sumtool +HOST_MTD_DEPENDENCIES = host-lzo host-e2fsprogs -$(DL_DIR)/$(MTD_SOURCE): - $(call DOWNLOAD,$(MTD_SITE),$(MTD_SOURCE)) - -$(MTD_HOST_DIR)/.unpacked: $(DL_DIR)/$(MTD_SOURCE) - mkdir -p $(@D) - $(MTD_CAT) $^ | tar $(TAR_STRIP_COMPONENTS)=1 -C $(@D) $(TAR_OPTIONS) - - toolchain/patch-kernel.sh $(MTD_HOST_DIR) \ - package/mtd/ mtd-utils-\*.patch - touch $@ - -$(MTD_HOST_DIR)/mkfs.jffs2: $(MTD_HOST_DIR)/.unpacked +define HOST_MTD_BUILD_CMDS CC="$(HOSTCC)" CFLAGS="$(HOST_CFLAGS)" LDFLAGS="$(HOST_LDFLAGS)" \ - CROSS= $(MAKE) BUILDDIR=$(MTD_HOST_DIR) \ - WITHOUT_XATTR=1 -C $(MTD_HOST_DIR) $@ + CROSS= $(MAKE) BUILDDIR=$(@D) \ + WITHOUT_XATTR=1 -C $(@D) +endef -$(MKFS_JFFS2): $(MTD_HOST_DIR)/mkfs.jffs2 - install -m 0755 -D $^ $@ +define HOST_MTD_INSTALL_CMDS + $(MAKE) BUILDDIR=$(@D) DESTDIR=$(HOST_DIR) -C $(@D) install +endef -$(MTD_HOST_DIR)/sumtool: $(MTD_HOST_DIR)/.unpacked - CC="$(HOSTCC)" CFLAGS="$(HOST_CFLAGS)" LDFLAGS="$(HOST_LDFLAGS)" \ - CROSS= $(MAKE) BUILDDIR=$(MTD_HOST_DIR) \ - WITHOUT_XATTR=1 -C $(MTD_HOST_DIR) $@ - -$(SUMTOOL): $(MTD_HOST_DIR)/sumtool - install -m 0755 $^ $@ - -mtd-host: host-lzo $(MKFS_JFFS2) $(SUMTOOL) - -mtd-host-source: $(DL_DIR)/$(MTD_SOURCE) - -mtd-host-clean: - -$(MAKE) -C $(MTD_HOST_DIR) clean - rm -f $(MKFS_JFFS2) $(SUMTOOL) - -mtd-host-dirclean: - rm -rf $(MTD_HOST_DIR) - -############################################################# -# -# build mtd for use on the target system -# -############################################################# -$(MTD_DIR)/.unpacked: $(DL_DIR)/$(MTD_SOURCE) - $(MTD_CAT) $(DL_DIR)/$(MTD_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - - toolchain/patch-kernel.sh $(MTD_DIR) package/mtd/ mtd-utils-\*.patch - touch $@ +MKFS_JFFS2=$(HOST_DIR)/usr/sbin/mkfs.jffs2 +SUMTOOL=$(HOST_DIR)/usr/sbin/sumtool MTD_TARGETS_$(BR2_PACKAGE_MTD_DOCFDISK) += docfdisk MTD_TARGETS_$(BR2_PACKAGE_MTD_DOC_LOADBIOS) += doc_loadbios @@ -105,50 +61,42 @@ MTD_TARGETS_UBI_$(BR2_PACKAGE_MTD_UBIRMVOL) += ubirmvol MTD_TARGETS_UBI_$(BR2_PACKAGE_MTD_UBIRSVOL) += ubirsvol MTD_TARGETS_UBI_$(BR2_PACKAGE_MTD_UBIUPDATEVOL) += ubiupdatevol -MTD_TARGETS := $(addprefix $(MTD_DIR)/, $(MTD_TARGETS_y)) -MTD_UBI_TARGETS := $(addprefix $(MTD_DIR)/ubi-utils/, $(MTD_TARGETS_UBI_y)) -MTD_BUILD_TARGETS := $(MTD_TARGETS) $(MTD_UBI_TARGETS) +MTD_MAKE_COMMON_FLAGS = \ + $(TARGET_CONFIGURE_ENV) \ + CROSS=$(TARGET_CROSS) CC=$(TARGET_CC) \ + WITHOUT_XATTR=1 WITHOUT_LARGEFILE=1 -$(MTD_BUILD_TARGETS): $(MTD_DIR)/.unpacked -ifneq ($(MTD_TARGETS),) - $(MAKE) $(TARGET_CONFIGURE_ENV) \ - BUILDDIR=$(MTD_DIR) \ - CROSS=$(TARGET_CROSS) CC=$(TARGET_CC) \ - WITHOUT_XATTR=1 WITHOUT_LARGEFILE=1 \ - -C $(MTD_DIR) $(MTD_TARGETS) -endif -ifneq ($(MTD_UBI_TARGETS),) - $(MAKE) $(TARGET_CONFIGURE_ENV) \ - BUILDDIR=$(MTD_DIR)/ubi-utils \ - CROSS=$(TARGET_CROSS) CC=$(TARGET_CC) \ - WITHOUT_XATTR=1 WITHOUT_LARGEFILE=1 \ - -C $(MTD_DIR)/ubi-utils $(MTD_UBI_TARGETS) +ifneq ($(MTD_TARGETS_y),) +define MTD_TARGETS_BUILD + $(MAKE) $(MTD_MAKE_COMMON_FLAGS) \ + BUILDDIR=$(@D) \ + -C $(@D) \ + $(addprefix $(@D)/, $(MTD_TARGETS_y)) +endef endif -MTD_TARGET_BINS := $(addprefix $(TARGET_DIR)/usr/sbin/,\ - $(MTD_TARGETS_y) $(MTD_TARGETS_UBI_y)) - -$(MTD_TARGET_BINS): $(MTD_BUILD_TARGETS) - mkdir -p $(TARGET_DIR)/usr/sbin - $(INSTALL) -m 0755 $^ $(TARGET_DIR)/usr/sbin - -mtd: $(if $(BR2_PACKAGE_MTD_MKFSJFFS2),zlib lzo) $(MTD_TARGET_BINS) - -mtd-source: $(DL_DIR)/$(MTD_SOURCE) - -mtd-clean: - -$(MAKE) -C $(MTD_DIR) clean - rm -f $(MTD_TARGET_BINS) - -mtd-dirclean: - rm -rf $(MTD_DIR) - - -############################################################# -# -# Toplevel Makefile options -# -############################################################# -ifeq ($(BR2_PACKAGE_MTD),y) -TARGETS+=mtd +ifneq ($(MTD_TARGETS_UBI_y),) +define MTD_TARGETS_UBI_BUILD + $(MAKE) $(MTD_MAKE_COMMON_FLAGS) \ + BUILDDIR=$(@D)/ubi-utils/ \ + -C $(@D)/ubi-utils \ + $(addprefix $(@D)/ubi-utils/, $(MTD_TARGETS_UBI_y)) +endef endif + +define MTD_BUILD_CMDS + $(MTD_TARGETS_BUILD) + $(MTD_TARGETS_UBI_BUILD) +endef + +define MTD_INSTALL_TARGET_CMDS + for f in $(MTD_TARGETS_y) ; do \ + install -m 0755 $(@D)/$$f $(TARGET_DIR)/usr/sbin/$$f ; \ + done ; \ + for f in $(MTD_TARGETS_UBI_y) ; do \ + install -m 0755 $(@D)/ubi-utils/$$f $(TARGET_DIR)/usr/sbin/$$f ; \ + done +endef + +$(eval $(call GENTARGETS,package,mtd)) +$(eval $(call GENTARGETS,package,mtd,host)) From ae4c8a81d3ef9736998d157e9e989acab17e9cb2 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 2 Mar 2010 22:35:44 +0100 Subject: [PATCH 11/44] cloop: new package Only the host variant is supported, which explains why there is no Config.in file. Will be used by the filesystem generation code. Signed-off-by: Thomas Petazzoni --- package/cloop/cloop.mk | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 package/cloop/cloop.mk diff --git a/package/cloop/cloop.mk b/package/cloop/cloop.mk new file mode 100644 index 0000000000..f1c1e1c4ec --- /dev/null +++ b/package/cloop/cloop.mk @@ -0,0 +1,18 @@ +CLOOP_VERSION=2.631-1 +CLOOP_SOURCE=cloop_$(CLOOP_VERSION).tar.gz +CLOOP_SITE=http://debian-knoppix.alioth.debian.org/sources/ + +HOST_CLOOP_DEPENDENCIES = host-zlib + +define HOST_CLOOP_BUILD_CMDS + $(HOST_MAKE_ENV) $(MAKE1) \ + CFLAGS="$(HOST_CFLAGS) -Wall -O2 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DUSE_ERROR_SILENT" -C $(@D) APPSONLY=yes +endef + +define HOST_CLOOP_INSTALL_CMDS + install -m 755 $(@D)/create_compressed_fs $(HOST_DIR)/usr/bin + install -m 755 $(@D)/extract_compressed_fs $(HOST_DIR)/usr/bin +endef + +$(eval $(call GENTARGETS,package,cloop)) +$(eval $(call GENTARGETS,package,cloop,host)) \ No newline at end of file From 002a31168eca09af788669ce1510a77220b2be80 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 2 Mar 2010 22:36:43 +0100 Subject: [PATCH 12/44] lzma: convert the host package to the autotools infrastructure Note that we loose the ability to use a lzma command available on the host and we now always build your own if a package needs it. Signed-off-by: Thomas Petazzoni --- package/lzma/lzma.mk | 65 ++------------------------------------------ 1 file changed, 2 insertions(+), 63 deletions(-) diff --git a/package/lzma/lzma.mk b/package/lzma/lzma.mk index c4a735def1..9bdcc35295 100644 --- a/package/lzma/lzma.mk +++ b/package/lzma/lzma.mk @@ -11,67 +11,6 @@ LZMA_INSTALL_TARGET = YES LZMA_CONF_OPT = $(if $(BR2_ENABLE_DEBUG),--enable-debug,--disable-debug) $(eval $(call AUTOTARGETS,package,lzma)) +$(eval $(call AUTOTARGETS,package,lzma,host)) -###################################################################### -# -# lzma host -# -###################################################################### - -LZMA_CAT:=$(ZCAT) -LZMA_HOST_DIR:=$(TOOLCHAIN_DIR)/lzma-$(LZMA_VERSION) - -# lzma binary for use on the host -LZMA=$(TOOLCHAIN_DIR)/bin/lzma -HOST_LZMA_BINARY=$(shell package/lzma/lzmacheck.sh) -HOST_LZMA_IF_ANY=$(shell toolchain/dependencies/check-host-lzma.sh) - -$(DL_DIR)/$(LZMA_SOURCE): - $(call DOWNLOAD,$(LZMA_SITE),$(LZMA_SOURCE)) - -$(LZMA_HOST_DIR)/.unpacked: $(DL_DIR)/$(LZMA_SOURCE) - $(LZMA_CAT) $(DL_DIR)/$(LZMA_SOURCE) | tar -C $(TOOLCHAIN_DIR) $(TAR_OPTIONS) - - toolchain/patch-kernel.sh $(LZMA_HOST_DIR) package/lzma/ lzma\*.patch - touch $@ - -$(LZMA_HOST_DIR)/.configured: $(LZMA_HOST_DIR)/.unpacked - (cd $(LZMA_HOST_DIR); rm -f config.cache;\ - CC="$(HOSTCC)" \ - CXX="$(HOSTCXX)" \ - ./configure $(QUIET) \ - --prefix=/ \ - ) - touch $@ - -$(LZMA_HOST_DIR)/src/lzma/lzma: $(LZMA_HOST_DIR)/.configured - $(MAKE) -C $(LZMA_HOST_DIR) all - touch -c $@ - -$(STAGING_DIR)/bin/lzma: $(LZMA_HOST_DIR)/src/lzma/lzma - $(MAKE) DESTDIR=$(STAGING_DIR) -C $(LZMA_HOST_DIR) install - $(SED) "s,^libdir=.*,libdir=\'$(STAGING_DIR)/lib\',g" \ - $(STAGING_DIR)/lib/liblzmadec.la - -.PHONY: lzma-host use-lzma-host-binary -use-lzma-host-binary: - if [ ! -f "$(TOOLCHAIN_DIR)/bin/lzma" ]; then \ - [ -d $(TOOLCHAIN_DIR)/bin ] || mkdir -p $(TOOLCHAIN_DIR)/bin; \ - ln -sf "$(HOST_LZMA_IF_ANY)" "$(TOOLCHAIN_DIR)/bin/lzma"; \ - fi - -build-lzma-host-binary: $(LZMA_HOST_DIR)/src/lzma/lzma - -rm -f $(TOOLCHAIN_DIR)/bin/lzma - [ -d $(TOOLCHAIN_DIR)/bin ] || mkdir $(TOOLCHAIN_DIR)/bin - cp -pf $(LZMA_HOST_DIR)/src/lzma/lzma $(TOOLCHAIN_DIR)/bin/lzma - -host-lzma: $(HOST_LZMA_BINARY) - -lzma-host: $(STAGING_DIR)/bin/lzma - -lzma-host-clean: - rm -f $(STAGING_DIR)/bin/lzma - -$(MAKE) -C $(LZMA_HOST_DIR) clean -lzma-host-dirclean: - rm -rf $(LZMA_HOST_DIR) - -lzma-host-install: /usr/local/bin/lzma +LZMA=$(HOST_DIR)/usr/bin/lzma From 57579378e1812123c4c120526c05b84e8a79944d Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 2 Mar 2010 22:38:04 +0100 Subject: [PATCH 13/44] target/cloop: cleanup Remove the code to build the cloop utilities for the host (it is now in package/cloop). Use fakeroot instead of ugly sudo. The cloop filesystem generation code is now much more similar to other filesystems code. Remove empty Makefile.in. Signed-off-by: Thomas Petazzoni --- target/cloop/Makefile.in | 3 - target/cloop/cloop.mk | 123 +++++++-------------------------------- 2 files changed, 22 insertions(+), 104 deletions(-) delete mode 100644 target/cloop/Makefile.in diff --git a/target/cloop/Makefile.in b/target/cloop/Makefile.in deleted file mode 100644 index 0afc58f87d..0000000000 --- a/target/cloop/Makefile.in +++ /dev/null @@ -1,3 +0,0 @@ -ifeq ($(BR2_TARGET_ROOTFS_CLOOP),y) -TARGETS+=clooproot -endif diff --git a/target/cloop/cloop.mk b/target/cloop/cloop.mk index 059dd6c4bc..ccdb2b4919 100644 --- a/target/cloop/cloop.mk +++ b/target/cloop/cloop.mk @@ -1,108 +1,29 @@ ############################################################# # -# mkcloop to build to target cloop filesystems -# -############################################################# -CLOOP_VERSION=2.06 -CLOOP_DIR=$(BUILD_DIR)/cloop-$(CLOOP_VERSION) -CLOOP_SOURCE=cloop_$(CLOOP_VERSION)-2.tar.gz -CLOOP_SITE=http://debian-knoppix.alioth.debian.org/sources/ - -CLOOP_TARGET:=$(IMAGE).cloop -### Note: not used yet! ck -### $(DL_DIR)/$(CLOOP_PATCH1): -### $(call DOWNLOAD,$(CLOOP_PATCH1_URL),$(CLOOP_PATCH1)) - -$(DL_DIR)/$(CLOOP_SOURCE): - $(call DOWNLOAD,$(CLOOP_SITE),$(CLOOP_SOURCE)) - -$(CLOOP_DIR)/.unpacked: $(DL_DIR)/$(CLOOP_SOURCE) ### $(DL_DIR)/$(CLOOP_PATCH1) - $(ZCAT) $(DL_DIR)/$(CLOOP_SOURCE) | tar -C $(BUILD_DIR) -xvf - - touch $@ -### $(ZCAT) $(DL_DIR)/$(CLOOP_PATCH1) | patch -p1 -d $(CLOOP_DIR) -### toolchain/patch-kernel.sh $(CLOOP_DIR) target/cloop/ cloop\*.patch - -$(CLOOP_DIR)/create_compressed_fs: $(CLOOP_DIR)/.unpacked - $(MAKE) CFLAGS="-Wall -O2 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DUSE_ERROR_SILENT" -C $(CLOOP_DIR) \ - APPSONLY=yes -j1 - -cloop: $(CLOOP_DIR)/create_compressed_fs - -cloop-source: $(DL_DIR)/$(CLOOP_SOURCE) - -cloop-clean: - -$(MAKE) -C $(CLOOP_DIR) clean - -cloop-dirclean: - rm -rf $(CLOOP_DIR) - -############################################################# -# -# Build the cloop.o kernel module for the HOST +# Build the compressed loop root filesystem image # ############################################################# -$(CLOOP_DIR)/cloop.o: $(CLOOP_DIR)/create_compressed_fs - $(MAKE) CFLAGS="-Wall -O2 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DUSE_ERROR_SILENT" -C $(CLOOP_DIR) -j1 +CLOOP_TARGET=$(IMAGE).cloop +CLOOP_FAKEROOT_SCRIPT=$(BUILD_DIR)/_fakeroot.$(notdir $(CLOOP_TARGET)) -cloop-module: $(CLOOP_DIR)/cloop.o +clooproot: host-cloop host-cdrkit host-fakeroot + rm -f $(CLOOP_FAKEROOT_SCRIPT) + touch $(BUILD_DIR)/.fakeroot.00000 + cat $(BUILD_DIR)/.fakeroot* > $(CLOOP_FAKEROOT_SCRIPT) + # Use fakeroot to pretend all target binaries are owned by root + echo "chown -R 0:0 $(TARGET_DIR)" >> $(CLOOP_FAKEROOT_SCRIPT) +ifneq ($(TARGET_DEVICE_TABLE),) + # Use fakeroot to pretend to create all needed device nodes + echo "$(HOST_DIR)/usr/bin/makedevs -d $(TARGET_DEVICE_TABLE) $(TARGET_DIR)" \ + >> $(CLOOP_FAKEROOT_SCRIPT) +endif + # Use fakeroot so genisoimage believes the previous fakery + echo "$(HOST_DIR)/usr/bin/genisoimage -r $(TARGET_DIR) | $(HOST_DIR)/usr/bin/create_compressed_fs - 65536 > $(CLOOP_TARGET)" >> $(CLOOP_FAKEROOT_SCRIPT) + chmod a+x $(CLOOP_FAKEROOT_SCRIPT) + $(HOST_DIR)/usr/bin/fakeroot -- $(CLOOP_FAKEROOT_SCRIPT) + -@rm -f $(CLOOP_FAKEROOT_SCRIPT) -############################################################# -# -# Build the cloop root filesystem image -# -# Note: we need additionall host tools: -# required: -# mkisofs 2.01a34-unofficial-iconv from http://users.utu.fi/jahhein/mkisofs/ -# optional: -# symlinks: scan/change symbolic links - v1.2 - by Mark Lord -# from ftp://ftp.ibiblio.org/pub/Linux/utils/file/ -# -############################################################# - -### Note: target/default/device_table.txt is not yet supported! ck -# the quickfix is to use sudo to mount the previous created cramroot -check-tools: - - which symlinks && symlinks -r $(TARGET_DIR) - -$(IMAGE).cramfs: cramfsroot - -clooproot: cloop check-tools $(IMAGE).cramfs - ### $(CLOOP_DIR)/create_compressed_fs -q -D target/default/device_table.txt $(TARGET_DIR) $(CLOOP_TARGET) - ## mkisofs -r $(TARGET_DIR) | $(CLOOP_DIR)/create_compressed_fs - 65536 > $(CLOOP_TARGET) - sudo mkdir -p /mnt/compressed - sudo mount -o ro,loop -t cramfs $(IMAGE).cramfs /mnt/compressed - mkisofs -r /mnt/compressed | $(CLOOP_DIR)/create_compressed_fs - 65536 > $(CLOOP_TARGET) - - symlinks -r /mnt/compressed - sudo umount /mnt/compressed - @echo "Mounting a compressed image:" - @echo " sudo mkdir -p /mnt/compressed" - @echo " sudo /sbin/insmod cloop" - @echo " sudo /sbin/losetup /dev/cloop1 $(CLOOP_TARGET)" - @echo " sudo mount -o ro -t iso9660 /dev/cloop1 /mnt/compressed" - -clooproot-source: cloop-source - -clooproot-clean: - -$(MAKE) -C $(CLOOP_DIR) clean - -clooproot-dirclean: - rm -rf $(CLOOP_DIR) - -############################################################# -# symlinks -r /mnt/compressed -# dangling: /mnt/compressed/dev/log -> /tmp/log -# other_fs: /mnt/compressed/etc/mtab -> /proc/mounts -# other_fs: /mnt/compressed/var/lib/pcmcia -> /tmp -# other_fs: /mnt/compressed/var/lock -> /tmp -# other_fs: /mnt/compressed/var/log -> /tmp -# other_fs: /mnt/compressed/var/pcmcia -> /tmp -# other_fs: /mnt/compressed/var/run -> /tmp -# other_fs: /mnt/compressed/var/spool -> /tmp -# other_fs: /mnt/compressed/var/tmp -> /tmp -# -# ls -lrsS root_fs_*.* -# 1296 -rw-r--r-- 1 claus users 1325478 Mar 13 16:52 root_fs_powerpc.cloop -# 1448 -rw-r--r-- 1 claus users 1482752 Mar 13 16:52 root_fs_powerpc.cramfs -# 1840 -rw-r--r-- 1 claus users 1883408 Mar 13 13:14 root_fs_powerpc.jffs2 -############################################################# +ifeq ($(BR2_TARGET_ROOTFS_CLOOP),y) +TARGETS+=clooproot +endif From 4bcefe826bbc1bf550a091e7ae86ad5ee7946909 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 2 Mar 2010 22:39:25 +0100 Subject: [PATCH 14/44] target/cpio: cleanup * Remove the dependency on BR2_HOST_FAKEROOT, since we don't have config option for host tools. * Remove a few useless things. * Check that cpio is available on the host in toolchain/dependencies/dependencies.sh. Signed-off-by: Thomas Petazzoni --- target/cpio/Config.in | 1 - target/cpio/cpioroot.mk | 17 +++-------------- toolchain/dependencies/dependencies.sh | 2 +- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/target/cpio/Config.in b/target/cpio/Config.in index 83bdd21e04..4ee1037d4a 100644 --- a/target/cpio/Config.in +++ b/target/cpio/Config.in @@ -1,6 +1,5 @@ config BR2_TARGET_ROOTFS_CPIO bool "cpio the root filesystem" - select BR2_HOST_FAKEROOT help Build a cpio archive of the root filesystem diff --git a/target/cpio/cpioroot.mk b/target/cpio/cpioroot.mk index 2197d10506..021847ffd5 100644 --- a/target/cpio/cpioroot.mk +++ b/target/cpio/cpioroot.mk @@ -12,17 +12,15 @@ CPIO_ROOTFS_COMPRESSOR_PREREQ:= ifeq ($(BR2_TARGET_ROOTFS_CPIO_GZIP),y) CPIO_ROOTFS_COMPRESSOR:=gzip -9 -c CPIO_ROOTFS_COMPRESSOR_EXT:=gz -#CPIO_ROOTFS_COMPRESSOR_PREREQ:= gzip-host endif ifeq ($(BR2_TARGET_ROOTFS_CPIO_BZIP2),y) CPIO_ROOTFS_COMPRESSOR:=bzip2 -9 -c CPIO_ROOTFS_COMPRESSOR_EXT:=bz2 -#CPIO_ROOTFS_COMPRESSOR_PREREQ:= bzip2-host endif ifeq ($(BR2_TARGET_ROOTFS_CPIO_LZMA),y) -CPIO_ROOTFS_COMPRESSOR:=lzma -9 -c +CPIO_ROOTFS_COMPRESSOR:=$(LZMA) -9 -c CPIO_ROOTFS_COMPRESSOR_EXT:=lzma -CPIO_ROOTFS_COMPRESSOR_PREREQ:= lzma-host +CPIO_ROOTFS_COMPRESSOR_PREREQ:= host-lzma endif ifneq ($(CPIO_ROOTFS_COMPRESSOR),) @@ -32,7 +30,6 @@ CPIO_TARGET := $(CPIO_BASE) endif ROOTFS_CPIO_COPYTO:=$(call qstrip,$(BR2_TARGET_ROOTFS_CPIO_COPYTO)) -# cpioroot-init: rm -f $(TARGET_DIR)/init @@ -54,7 +51,7 @@ endif >> $(BUILD_DIR)/_fakeroot.$(notdir $(CPIO_BASE)) chmod a+x $(BUILD_DIR)/_fakeroot.$(notdir $(CPIO_BASE)) $(HOST_DIR)/usr/bin/fakeroot -- $(BUILD_DIR)/_fakeroot.$(notdir $(CPIO_BASE)) - #-@rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(CPIO_BASE)) + -@rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(CPIO_BASE)) ifeq ($(CPIO_ROOTFS_COMPRESSOR),) ifneq ($(ROOTFS_CPIO_COPYTO),) $(Q)cp -f $(CPIO_BASE) $(ROOTFS_CPIO_COPYTO) @@ -69,14 +66,6 @@ ifneq ($(ROOTFS_CPIO_COPYTO),) endif endif -cpioroot: $(CPIO_TARGET) - -cpioroot-source: - -cpioroot-clean: - -cpioroot-dirclean: - ############################################################# # # Toplevel Makefile options diff --git a/toolchain/dependencies/dependencies.sh b/toolchain/dependencies/dependencies.sh index 68b2751762..013c1d57d3 100755 --- a/toolchain/dependencies/dependencies.sh +++ b/toolchain/dependencies/dependencies.sh @@ -122,7 +122,7 @@ if ! $SHELL --version 2>&1 | grep -q '^GNU bash'; then fi; # Check that a few mandatory programs are installed -for prog in awk bison flex msgfmt makeinfo patch gzip bzip2 perl tar wget ; do +for prog in awk bison flex msgfmt makeinfo patch gzip bzip2 perl tar wget cpio ; do if ! which $prog > /dev/null ; then /bin/echo -e "\nYou must install '$prog' on your build machine"; if test $prog = "makeinfo" ; then From e01de2e7d6b5402a9dd5e9b2754035676a542a1e Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 2 Mar 2010 22:40:45 +0100 Subject: [PATCH 15/44] target/cramfs: cleanup Remove the cramfs host tools building process, which is now in package/cramfs. Signed-off-by: Thomas Petazzoni --- target/cramfs/Config.in | 1 - target/cramfs/cramfs-01-devtable.patch | 1269 ----------------------- target/cramfs/cramfs-02-endian.patch | 284 ----- target/cramfs/cramfs-03-cygwin_IO.patch | 13 - target/cramfs/cramfs.mk | 47 +- 5 files changed, 2 insertions(+), 1612 deletions(-) delete mode 100644 target/cramfs/cramfs-01-devtable.patch delete mode 100644 target/cramfs/cramfs-02-endian.patch delete mode 100644 target/cramfs/cramfs-03-cygwin_IO.patch diff --git a/target/cramfs/Config.in b/target/cramfs/Config.in index 0c1cb7822a..1a4e326472 100644 --- a/target/cramfs/Config.in +++ b/target/cramfs/Config.in @@ -1,6 +1,5 @@ config BR2_TARGET_ROOTFS_CRAMFS bool "cramfs root filesystem" - select BR2_HOST_FAKEROOT help Build a cramfs root filesystem diff --git a/target/cramfs/cramfs-01-devtable.patch b/target/cramfs/cramfs-01-devtable.patch deleted file mode 100644 index 884eb8cb83..0000000000 --- a/target/cramfs/cramfs-01-devtable.patch +++ /dev/null @@ -1,1269 +0,0 @@ ---- cramfs-1.1.orig/cramfsck.c 2002-02-22 17:00:42.000000000 -0700 -+++ cramfs-1.1/cramfsck.c 2002-12-21 01:25:17.000000000 -0700 -@@ -51,10 +51,11 @@ - #include - #include - #define _LINUX_STRING_H_ --#include --#include -+#include "linux/cramfs_fs.h" - #include - -+#define BLKGETSIZE _IO(0x12,96) /* return device size /512 (long *arg) */ -+ - /* Exit codes used by fsck-type programs */ - #define FSCK_OK 0 /* No errors */ - #define FSCK_NONDESTRUCT 1 /* File system errors corrected */ -@@ -75,7 +76,7 @@ - static int opt_verbose = 0; /* 1 = verbose (-v), 2+ = very verbose (-vv) */ - #ifdef INCLUDE_FS_TESTS - static int opt_extract = 0; /* extract cramfs (-x) */ --static char *extract_dir = "root"; /* extraction directory (-x) */ -+static char *extract_dir = "/"; /* extraction directory (-x) */ - static uid_t euid; /* effective UID */ - - /* (cramfs_super + start) <= start_dir < end_dir <= start_data <= end_data */ -@@ -155,7 +156,7 @@ - } - - if (*length < sizeof(struct cramfs_super)) { -- die(FSCK_UNCORRECTED, 0, "file length too short"); -+ die(FSCK_UNCORRECTED, 0, "filesystem smaller than a cramfs superblock!"); - } - - /* find superblock */ -@@ -190,7 +191,8 @@ - die(FSCK_UNCORRECTED, 0, "zero file count"); - } - if (*length < super.size) { -- die(FSCK_UNCORRECTED, 0, "file length too short"); -+ die(FSCK_UNCORRECTED, 0, "file length too short, %lu is smaller than %lu", -+ *length, super.size); - } - else if (*length > super.size) { - fprintf(stderr, "warning: file extends past end of filesystem\n"); -@@ -267,11 +269,11 @@ - #ifdef INCLUDE_FS_TESTS - static void print_node(char type, struct cramfs_inode *i, char *name) - { -- char info[10]; -+ char info[11]; - - if (S_ISCHR(i->mode) || (S_ISBLK(i->mode))) { - /* major/minor numbers can be as high as 2^12 or 4096 */ -- snprintf(info, 10, "%4d,%4d", major(i->size), minor(i->size)); -+ snprintf(info, 11, "%4d,%4d", major(i->size), minor(i->size)); - } - else { - /* size be as high as 2^24 or 16777216 */ -@@ -445,8 +447,10 @@ - } - /* TODO: Do we need to check end_dir for empty case? */ - memcpy(newpath, path, pathlen); -- newpath[pathlen] = '/'; -- pathlen++; -+ if (pathlen > 1) { -+ newpath[pathlen] = '/'; -+ pathlen++; -+ } - if (opt_verbose) { - print_node('d', i, path); - } ---- cramfs-1.1.orig/device_table.txt 1969-12-31 17:00:00.000000000 -0700 -+++ cramfs-1.1/device_table.txt 2003-01-01 05:13:44.000000000 -0700 -@@ -0,0 +1,129 @@ -+# When building a target filesystem, it is desirable to not have to -+# become root and then run 'mknod' a thousand times. Using a device -+# table you can create device nodes and directories "on the fly". -+# -+# This is a sample device table file for use with mkcramfs. You can -+# do all sorts of interesting things with a device table file. For -+# example, if you want to adjust the permissions on a particular file -+# you can just add an entry like: -+# /sbin/foobar f 2755 0 0 - - - - - -+# and (assuming the file /sbin/foobar exists) it will be made setuid -+# root (regardless of what its permissions are on the host filesystem. -+# Furthermore, you can use a single table entry to create a many device -+# minors. For example, if I wanted to create /dev/hda and /dev/hda[0-15] -+# I could just use the following two table entries: -+# /dev/hda b 640 0 0 3 0 0 0 - -+# /dev/hda b 640 0 0 3 1 1 1 15 -+# -+# Device table entries take the form of: -+# -+# where name is the file name, type can be one of: -+# f A regular file -+# d Directory -+# c Character special device file -+# b Block special device file -+# p Fifo (named pipe) -+# uid is the user id for the target file, gid is the group id for the -+# target file. The rest of the entries (major, minor, etc) apply only -+# to device special files. -+ -+# Have fun -+# -Erik Andersen -+# -+ -+# -+/dev d 755 0 0 - - - - - -+/dev/mem c 640 0 0 1 1 0 0 - -+/dev/kmem c 640 0 0 1 2 0 0 - -+/dev/null c 640 0 0 1 3 0 0 - -+/dev/zero c 640 0 0 1 5 0 0 - -+/dev/random c 640 0 0 1 8 0 0 - -+/dev/urandom c 640 0 0 1 9 0 0 - -+/dev/tty c 666 0 0 5 0 0 0 - -+/dev/tty c 666 0 0 4 0 0 1 6 -+/dev/console c 640 0 0 5 1 0 0 - -+/dev/ram b 640 0 0 1 1 0 0 - -+/dev/ram b 640 0 0 1 0 0 1 4 -+/dev/loop b 640 0 0 7 0 0 1 2 -+/dev/ptmx c 666 0 0 5 2 0 0 - -+#/dev/ttyS c 640 0 0 4 64 0 1 4 -+#/dev/psaux c 640 0 0 10 1 0 0 - -+#/dev/rtc c 640 0 0 10 135 0 0 - -+ -+# Adjust permissions on some normal files -+#/etc/shadow f 600 0 0 - - - - - -+#/bin/tinylogin f 4755 0 0 - - - - - -+ -+# User-mode Linux stuff -+/dev/ubda b 640 0 0 98 0 0 0 - -+/dev/ubda b 640 0 0 98 1 1 1 15 -+ -+# IDE Devices -+/dev/hda b 640 0 0 3 0 0 0 - -+/dev/hda b 640 0 0 3 1 1 1 15 -+/dev/hdb b 640 0 0 3 64 0 0 - -+/dev/hdb b 640 0 0 3 65 1 1 15 -+#/dev/hdc b 640 0 0 22 0 0 0 - -+#/dev/hdc b 640 0 0 22 1 1 1 15 -+#/dev/hdd b 640 0 0 22 64 0 0 - -+#/dev/hdd b 640 0 0 22 65 1 1 15 -+#/dev/hde b 640 0 0 33 0 0 0 - -+#/dev/hde b 640 0 0 33 1 1 1 15 -+#/dev/hdf b 640 0 0 33 64 0 0 - -+#/dev/hdf b 640 0 0 33 65 1 1 15 -+#/dev/hdg b 640 0 0 34 0 0 0 - -+#/dev/hdg b 640 0 0 34 1 1 1 15 -+#/dev/hdh b 640 0 0 34 64 0 0 - -+#/dev/hdh b 640 0 0 34 65 1 1 15 -+ -+# SCSI Devices -+#/dev/sda b 640 0 0 8 0 0 0 - -+#/dev/sda b 640 0 0 8 1 1 1 15 -+#/dev/sdb b 640 0 0 8 16 0 0 - -+#/dev/sdb b 640 0 0 8 17 1 1 15 -+#/dev/sdc b 640 0 0 8 32 0 0 - -+#/dev/sdc b 640 0 0 8 33 1 1 15 -+#/dev/sdd b 640 0 0 8 48 0 0 - -+#/dev/sdd b 640 0 0 8 49 1 1 15 -+#/dev/sde b 640 0 0 8 64 0 0 - -+#/dev/sde b 640 0 0 8 65 1 1 15 -+#/dev/sdf b 640 0 0 8 80 0 0 - -+#/dev/sdf b 640 0 0 8 81 1 1 15 -+#/dev/sdg b 640 0 0 8 96 0 0 - -+#/dev/sdg b 640 0 0 8 97 1 1 15 -+#/dev/sdh b 640 0 0 8 112 0 0 - -+#/dev/sdh b 640 0 0 8 113 1 1 15 -+#/dev/sg c 640 0 0 21 0 0 1 15 -+#/dev/scd b 640 0 0 11 0 0 1 15 -+#/dev/st c 640 0 0 9 0 0 1 8 -+#/dev/nst c 640 0 0 9 128 0 1 8 -+#/dev/st c 640 0 0 9 32 1 1 4 -+#/dev/st c 640 0 0 9 64 1 1 4 -+#/dev/st c 640 0 0 9 96 1 1 4 -+ -+# Floppy disk devices -+#/dev/fd b 640 0 0 2 0 0 1 2 -+#/dev/fd0d360 b 640 0 0 2 4 0 0 - -+#/dev/fd1d360 b 640 0 0 2 5 0 0 - -+#/dev/fd0h1200 b 640 0 0 2 8 0 0 - -+#/dev/fd1h1200 b 640 0 0 2 9 0 0 - -+#/dev/fd0u1440 b 640 0 0 2 28 0 0 - -+#/dev/fd1u1440 b 640 0 0 2 29 0 0 - -+#/dev/fd0u2880 b 640 0 0 2 32 0 0 - -+#/dev/fd1u2880 b 640 0 0 2 33 0 0 - -+ -+# All the proprietary cdrom devices in the world -+#/dev/aztcd b 640 0 0 29 0 0 0 - -+#/dev/bpcd b 640 0 0 41 0 0 0 - -+#/dev/capi20 c 640 0 0 68 0 0 1 2 -+#/dev/cdu31a b 640 0 0 15 0 0 0 - -+#/dev/cdu535 b 640 0 0 24 0 0 0 - -+#/dev/cm206cd b 640 0 0 32 0 0 0 - -+#/dev/sjcd b 640 0 0 18 0 0 0 - -+#/dev/sonycd b 640 0 0 15 0 0 0 - -+#/dev/gscd b 640 0 0 16 0 0 0 - -+#/dev/sbpcd b 640 0 0 25 0 0 0 - -+#/dev/sbpcd b 640 0 0 25 0 0 1 4 -+#/dev/mcd b 640 0 0 23 0 0 0 - -+#/dev/optcd b 640 0 0 17 0 0 0 - -+ ---- cramfs-1.1.orig/mkcramfs.c 2002-02-20 01:03:32.000000000 -0700 -+++ cramfs-1.1/mkcramfs.c 2002-12-21 01:25:17.000000000 -0700 -@@ -1,3 +1,4 @@ -+/* vi: set sw=8 ts=8: */ - /* - * mkcramfs - make a cramfs file system - * -@@ -16,12 +17,21 @@ - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -+ * -+ * Added device table support (code taken from mkfs.jffs2.c, credit to -+ * Erik Andersen ) as well as an option to squash -+ * permissions. - Russ Dill September 2002 -+ * -+ * Reworked, cleaned up, and updated for cramfs-1.1, December 2002 -+ * - Erik Andersen -+ * - */ - - /* - * If you change the disk format of cramfs, please update fs/cramfs/README. - */ - -+#define _GNU_SOURCE - #include - #include - #include -@@ -33,8 +43,15 @@ - #include - #include - #include -+#include -+#include -+#include -+#include - #include - #include -+#ifdef DMALLOC -+#include -+#endif - - /* Exit codes used by mkfs-type programs */ - #define MKFS_OK 0 /* No errors */ -@@ -71,11 +88,17 @@ - + (1 << CRAMFS_SIZE_WIDTH) - 1 /* filesize */ \ - + (1 << CRAMFS_SIZE_WIDTH) * 4 / PAGE_CACHE_SIZE /* block pointers */ ) - -+ -+/* The kernel assumes PAGE_CACHE_SIZE as block size. */ -+#define PAGE_CACHE_SIZE (4096) -+ -+ - static const char *progname = "mkcramfs"; - static unsigned int blksize = PAGE_CACHE_SIZE; - static long total_blocks = 0, total_nodes = 1; /* pre-count the root node */ - static int image_length = 0; - -+ - /* - * If opt_holes is set, then mkcramfs can create explicit holes in the - * data, which saves 26 bytes per hole (which is a lot smaller a -@@ -91,10 +114,12 @@ - static int opt_holes = 0; - static int opt_pad = 0; - static int opt_verbose = 0; -+static int opt_squash = 0; - static char *opt_image = NULL; - static char *opt_name = NULL; - - static int warn_dev, warn_gid, warn_namelen, warn_skip, warn_size, warn_uid; -+static const char *const memory_exhausted = "memory exhausted"; - - /* In-core version of inode / directory entry. */ - struct entry { -@@ -123,7 +148,7 @@ - { - FILE *stream = status ? stderr : stdout; - -- fprintf(stream, "usage: %s [-h] [-e edition] [-i file] [-n name] dirname outfile\n" -+ fprintf(stream, "usage: %s [-h] [-e edition] [-i file] [-n name] [-D file] dirname outfile\n" - " -h print this help\n" - " -E make all warnings errors (non-zero exit status)\n" - " -e edition set edition number (part of fsid)\n" -@@ -133,39 +158,157 @@ - " -s sort directory entries (old option, ignored)\n" - " -v be more verbose\n" - " -z make explicit holes (requires >= 2.3.39)\n" -- " dirname root of the directory tree to be compressed\n" -+ " -D Use the named FILE as a device table file\n" -+ " -q squash permissions (make everything owned by root)\n" -+ " dirname root of the filesystem to be compressed\n" - " outfile output file\n", progname, PAD_SIZE); - - exit(status); - } - --static void die(int status, int syserr, const char *fmt, ...) -+static void verror_msg(const char *s, va_list p) -+{ -+ fflush(stdout); -+ fprintf(stderr, "mkcramfs: "); -+ vfprintf(stderr, s, p); -+} -+ -+static void vperror_msg(const char *s, va_list p) -+{ -+ int err = errno; -+ -+ if (s == 0) -+ s = ""; -+ verror_msg(s, p); -+ if (*s) -+ s = ": "; -+ fprintf(stderr, "%s%s\n", s, strerror(err)); -+} -+ -+static void perror_msg(const char *s, ...) -+{ -+ va_list p; -+ -+ va_start(p, s); -+ vperror_msg(s, p); -+ va_end(p); -+} -+ -+static void error_msg_and_die(const char *s, ...) -+{ -+ va_list p; -+ -+ va_start(p, s); -+ verror_msg(s, p); -+ va_end(p); -+ putc('\n', stderr); -+ exit(MKFS_ERROR); -+} -+ -+static void perror_msg_and_die(const char *s, ...) -+{ -+ va_list p; -+ -+ va_start(p, s); -+ vperror_msg(s, p); -+ va_end(p); -+ exit(MKFS_ERROR); -+} -+#ifndef DMALLOC -+extern char *xstrdup(const char *s) -+{ -+ char *t; -+ -+ if (s == NULL) -+ return NULL; -+ t = strdup(s); -+ if (t == NULL) -+ error_msg_and_die(memory_exhausted); -+ return t; -+} -+ -+extern void *xmalloc(size_t size) -+{ -+ void *ptr = malloc(size); -+ -+ if (ptr == NULL && size != 0) -+ error_msg_and_die(memory_exhausted); -+ return ptr; -+} -+ -+extern void *xcalloc(size_t nmemb, size_t size) -+{ -+ void *ptr = calloc(nmemb, size); -+ -+ if (ptr == NULL && nmemb != 0 && size != 0) -+ error_msg_and_die(memory_exhausted); -+ return ptr; -+} -+ -+extern void *xrealloc(void *ptr, size_t size) -+{ -+ ptr = realloc(ptr, size); -+ if (ptr == NULL && size != 0) -+ error_msg_and_die(memory_exhausted); -+ return ptr; -+} -+#endif -+ -+static FILE *xfopen(const char *path, const char *mode) - { -- va_list arg_ptr; -- int save = errno; -+ FILE *fp; -+ -+ if ((fp = fopen(path, mode)) == NULL) -+ perror_msg_and_die("%s", path); -+ return fp; -+} - -- fflush(0); -- va_start(arg_ptr, fmt); -- fprintf(stderr, "%s: ", progname); -- vfprintf(stderr, fmt, arg_ptr); -- if (syserr) { -- fprintf(stderr, ": %s", strerror(save)); -+extern int xopen(const char *pathname, int flags, mode_t mode) -+{ -+ int ret; -+ -+ if (flags & O_CREAT) -+ ret = open(pathname, flags, mode); -+ else -+ ret = open(pathname, flags); -+ if (ret == -1) { -+ perror_msg_and_die("%s", pathname); - } -- fprintf(stderr, "\n"); -- va_end(arg_ptr); -- exit(status); -+ return ret; - } - -+extern char *xreadlink(const char *path) -+{ -+ static const int GROWBY = 80; /* how large we will grow strings by */ -+ -+ char *buf = NULL; -+ int bufsize = 0, readsize = 0; -+ -+ do { -+ buf = xrealloc(buf, bufsize += GROWBY); -+ readsize = readlink(path, buf, bufsize); /* 1st try */ -+ if (readsize == -1) { -+ perror_msg("%s:%s", progname, path); -+ return NULL; -+ } -+ } -+ while (bufsize < readsize + 1); -+ -+ buf[readsize] = '\0'; -+ -+ return buf; -+} -+ - static void map_entry(struct entry *entry) - { - if (entry->path) { - entry->fd = open(entry->path, O_RDONLY); - if (entry->fd < 0) { -- die(MKFS_ERROR, 1, "open failed: %s", entry->path); -+ error_msg_and_die("open failed: %s", entry->path); - } - entry->uncompressed = mmap(NULL, entry->size, PROT_READ, MAP_PRIVATE, entry->fd, 0); - if (entry->uncompressed == MAP_FAILED) { -- die(MKFS_ERROR, 1, "mmap failed: %s", entry->path); -+ error_msg_and_die("mmap failed: %s", entry->path); - } - } - } -@@ -174,8 +317,9 @@ - { - if (entry->path) { - if (munmap(entry->uncompressed, entry->size) < 0) { -- die(MKFS_ERROR, 1, "munmap failed: %s", entry->path); -+ error_msg_and_die("munmap failed: %s", entry->path); - } -+ entry->uncompressed=NULL; - close(entry->fd); - } - } -@@ -204,7 +348,8 @@ - find_identical_file(orig->next, newfile)); - } - --static void eliminate_doubles(struct entry *root, struct entry *orig) { -+static void eliminate_doubles(struct entry *root, struct entry *orig) -+{ - if (orig) { - if (orig->size && (orig->path || orig->uncompressed)) - find_identical_file(root, orig); -@@ -232,10 +377,7 @@ - - /* Set up the path. */ - /* TODO: Reuse the parent's buffer to save memcpy'ing and duplication. */ -- path = malloc(len + 1 + MAX_INPUT_NAMELEN + 1); -- if (!path) { -- die(MKFS_ERROR, 1, "malloc failed"); -- } -+ path = xmalloc(len + 1 + MAX_INPUT_NAMELEN + 1); - memcpy(path, name, len); - endpath = path + len; - *endpath = '/'; -@@ -245,7 +387,7 @@ - dircount = scandir(name, &dirlist, 0, cramsort); - - if (dircount < 0) { -- die(MKFS_ERROR, 1, "scandir failed: %s", name); -+ error_msg_and_die("scandir failed: %s", name); - } - - /* process directory */ -@@ -269,25 +411,20 @@ - } - namelen = strlen(dirent->d_name); - if (namelen > MAX_INPUT_NAMELEN) { -- die(MKFS_ERROR, 0, -- "very long (%u bytes) filename found: %s\n" -- "please increase MAX_INPUT_NAMELEN in mkcramfs.c and recompile", -+ error_msg_and_die( -+ "Very long (%u bytes) filename `%s' found.\n" -+ " Please increase MAX_INPUT_NAMELEN in mkcramfs.c and recompile. Exiting.\n", - namelen, dirent->d_name); - } - memcpy(endpath, dirent->d_name, namelen + 1); - - if (lstat(path, &st) < 0) { -+ perror(endpath); - warn_skip = 1; - continue; - } -- entry = calloc(1, sizeof(struct entry)); -- if (!entry) { -- die(MKFS_ERROR, 1, "calloc failed"); -- } -- entry->name = strdup(dirent->d_name); -- if (!entry->name) { -- die(MKFS_ERROR, 1, "strdup failed"); -- } -+ entry = xcalloc(1, sizeof(struct entry)); -+ entry->name = xstrdup(dirent->d_name); - /* truncate multi-byte UTF-8 filenames on character boundary */ - if (namelen > CRAMFS_MAXPATHLEN) { - namelen = CRAMFS_MAXPATHLEN; -@@ -297,24 +434,25 @@ - namelen--; - /* are we reasonably certain it was UTF-8 ? */ - if (entry->name[namelen] < 0x80 || !namelen) { -- die(MKFS_ERROR, 0, "cannot truncate filenames not encoded in UTF-8"); -+ error_msg_and_die("cannot truncate filenames not encoded in UTF-8"); - } - } - entry->name[namelen] = '\0'; - } - entry->mode = st.st_mode; - entry->size = st.st_size; -- entry->uid = st.st_uid; -+ entry->uid = opt_squash ? 0 : st.st_uid; - if (entry->uid >= 1 << CRAMFS_UID_WIDTH) - warn_uid = 1; -- entry->gid = st.st_gid; -- if (entry->gid >= 1 << CRAMFS_GID_WIDTH) -+ entry->gid = opt_squash ? 0 : st.st_gid; -+ if (entry->gid >= 1 << CRAMFS_GID_WIDTH) { - /* TODO: We ought to replace with a default - gid instead of truncating; otherwise there - are security problems. Maybe mode should - be &= ~070. Same goes for uid once Linux - supports >16-bit uids. */ - warn_gid = 1; -+ } - size = sizeof(struct cramfs_inode) + ((namelen + 3) & ~3); - *fslen_ub += size; - if (S_ISDIR(st.st_mode)) { -@@ -325,21 +463,15 @@ - warn_skip = 1; - continue; - } -- entry->path = strdup(path); -- if (!entry->path) { -- die(MKFS_ERROR, 1, "strdup failed"); -- } -+ entry->path = xstrdup(path); - if ((entry->size >= 1 << CRAMFS_SIZE_WIDTH)) { - warn_size = 1; - entry->size = (1 << CRAMFS_SIZE_WIDTH) - 1; - } - } - } else if (S_ISLNK(st.st_mode)) { -- entry->uncompressed = malloc(entry->size); -+ entry->uncompressed = xreadlink(path); - if (!entry->uncompressed) { -- die(MKFS_ERROR, 1, "malloc failed"); -- } -- if (readlink(path, entry->uncompressed, entry->size) < 0) { - warn_skip = 1; - continue; - } -@@ -351,7 +483,7 @@ - if (entry->size & -(1<name); -+ error_msg_and_die("bogus file type: %s", entry->name); - } - - if (S_ISREG(st.st_mode) || S_ISLNK(st.st_mode)) { -@@ -378,7 +510,9 @@ - struct cramfs_super *super = (struct cramfs_super *) base; - unsigned int offset = sizeof(struct cramfs_super) + image_length; - -- offset += opt_pad; /* 0 if no padding */ -+ if (opt_pad) { -+ offset += opt_pad; /* 0 if no padding */ -+ } - - super->magic = CRAMFS_MAGIC; - super->flags = CRAMFS_FLAG_FSID_VERSION_2 | CRAMFS_FLAG_SORTED_DIRS; -@@ -414,10 +548,10 @@ - struct cramfs_inode *inode = (struct cramfs_inode *) (base + entry->dir_offset); - - if ((offset & 3) != 0) { -- die(MKFS_ERROR, 0, "illegal offset of %lu bytes", offset); -+ error_msg_and_die("illegal offset of %lu bytes", offset); - } - if (offset >= (1 << (2 + CRAMFS_OFFSET_WIDTH))) { -- die(MKFS_ERROR, 0, "filesystem too big"); -+ error_msg_and_die("filesystem too big"); - } - inode->offset = (offset >> 2); - } -@@ -429,7 +563,7 @@ - */ - static void print_node(struct entry *e) - { -- char info[10]; -+ char info[12]; - char type = '?'; - - if (S_ISREG(e->mode)) type = 'f'; -@@ -442,11 +576,11 @@ - - if (S_ISCHR(e->mode) || (S_ISBLK(e->mode))) { - /* major/minor numbers can be as high as 2^12 or 4096 */ -- snprintf(info, 10, "%4d,%4d", major(e->size), minor(e->size)); -+ snprintf(info, 11, "%4d,%4d", major(e->size), minor(e->size)); - } - else { - /* size be as high as 2^24 or 16777216 */ -- snprintf(info, 10, "%9d", e->size); -+ snprintf(info, 11, "%9d", e->size); - } - - printf("%c %04o %s %5d:%-3d %s\n", -@@ -462,17 +596,9 @@ - { - int stack_entries = 0; - int stack_size = 64; -- struct entry **entry_stack; -- -- entry_stack = malloc(stack_size * sizeof(struct entry *)); -- if (!entry_stack) { -- die(MKFS_ERROR, 1, "malloc failed"); -- } -- -- if (opt_verbose) { -- printf("root:\n"); -- } -+ struct entry **entry_stack = NULL; - -+ entry_stack = xmalloc(stack_size * sizeof(struct entry *)); - for (;;) { - int dir_start = stack_entries; - while (entry) { -@@ -506,10 +632,7 @@ - if (entry->child) { - if (stack_entries >= stack_size) { - stack_size *= 2; -- entry_stack = realloc(entry_stack, stack_size * sizeof(struct entry *)); -- if (!entry_stack) { -- die(MKFS_ERROR, 1, "realloc failed"); -- } -+ entry_stack = xrealloc(entry_stack, stack_size * sizeof(struct entry *)); - } - entry_stack[stack_entries] = entry; - stack_entries++; -@@ -543,7 +666,7 @@ - - set_data_offset(entry, base, offset); - if (opt_verbose) { -- printf("%s:\n", entry->name); -+ printf("'%s':\n", entry->name); - } - entry = entry->child; - } -@@ -553,16 +676,21 @@ - - static int is_zero(char const *begin, unsigned len) - { -- /* Returns non-zero iff the first LEN bytes from BEGIN are all NULs. */ -- return (len-- == 0 || -- (begin[0] == '\0' && -- (len-- == 0 || -- (begin[1] == '\0' && -- (len-- == 0 || -- (begin[2] == '\0' && -- (len-- == 0 || -- (begin[3] == '\0' && -- memcmp(begin, begin + 4, len) == 0)))))))); -+ if (opt_holes) -+ /* Returns non-zero iff the first LEN bytes from BEGIN are -+ all NULs. */ -+ return (len-- == 0 || -+ (begin[0] == '\0' && -+ (len-- == 0 || -+ (begin[1] == '\0' && -+ (len-- == 0 || -+ (begin[2] == '\0' && -+ (len-- == 0 || -+ (begin[3] == '\0' && -+ memcmp(begin, begin + 4, len) == 0)))))))); -+ else -+ /* Never create holes. */ -+ return 0; - } - - /* -@@ -575,37 +703,34 @@ - * Note that size > 0, as a zero-sized file wouldn't ever - * have gotten here in the first place. - */ --static unsigned int do_compress(char *base, unsigned int offset, char const *name, char *uncompressed, unsigned int size) -+static unsigned int do_compress(char *base, unsigned int offset, struct entry *entry) - { -+ unsigned int size = entry->size; - unsigned long original_size = size; - unsigned long original_offset = offset; - unsigned long new_size; - unsigned long blocks = (size - 1) / blksize + 1; - unsigned long curr = offset + 4 * blocks; - int change; -+ char *uncompressed = entry->uncompressed; - -- total_blocks += blocks; -+ total_blocks += blocks; - - do { - unsigned long len = 2 * blksize; - unsigned int input = size; -- int err; -- - if (input > blksize) - input = blksize; - size -= input; -- if (!(opt_holes && is_zero (uncompressed, input))) { -- err = compress2(base + curr, &len, uncompressed, input, Z_BEST_COMPRESSION); -- if (err != Z_OK) { -- die(MKFS_ERROR, 0, "compression error: %s", zError(err)); -- } -+ if (!is_zero (uncompressed, input)) { -+ compress(base + curr, &len, uncompressed, input); - curr += len; - } - uncompressed += input; - - if (len > blksize*2) { - /* (I don't think this can happen with zlib.) */ -- die(MKFS_ERROR, 0, "AIEEE: block \"compressed\" to > 2*blocklength (%ld)", len); -+ error_msg_and_die("AIEEE: block \"compressed\" to > 2*blocklength (%ld)\n", len); - } - - *(u32 *) (base + offset) = curr; -@@ -618,10 +743,12 @@ - st_blocks * 512. But if you say that then perhaps - administrative data should also be included in both. */ - change = new_size - original_size; -- if (opt_verbose > 1) { -- printf("%6.2f%% (%+d bytes)\t%s\n", -- (change * 100) / (double) original_size, change, name); -+#if 0 -+ if (opt_verbose) { -+ printf("%6.2f%% (%+d bytes)\t%s\n", -+ (change * 100) / (double) original_size, change, entry->name); - } -+#endif - - return curr; - } -@@ -644,7 +771,7 @@ - set_data_offset(entry, base, offset); - entry->offset = offset; - map_entry(entry); -- offset = do_compress(base, offset, entry->name, entry->uncompressed, entry->size); -+ offset = do_compress(base, offset, entry); - unmap_entry(entry); - } - } -@@ -660,13 +787,10 @@ - int fd; - char *buf; - -- fd = open(file, O_RDONLY); -- if (fd < 0) { -- die(MKFS_ERROR, 1, "open failed: %s", file); -- } -+ fd = xopen(file, O_RDONLY, 0); - buf = mmap(NULL, image_length, PROT_READ, MAP_PRIVATE, fd, 0); - if (buf == MAP_FAILED) { -- die(MKFS_ERROR, 1, "mmap failed"); -+ error_msg_and_die("mmap failed"); - } - memcpy(base + offset, buf, image_length); - munmap(buf, image_length); -@@ -679,6 +803,328 @@ - return (offset + image_length); - } - -+static struct entry *find_filesystem_entry(struct entry *dir, char *name, mode_t type) -+{ -+ struct entry *e = dir; -+ -+ if (S_ISDIR(dir->mode)) { -+ e = dir->child; -+ } -+ while (e) { -+ /* Only bother to do the expensive strcmp on matching file types */ -+ if (type == (e->mode & S_IFMT) && e->name) { -+ if (S_ISDIR(e->mode)) { -+ int len = strlen(e->name); -+ -+ /* Check if we are a parent of the correct path */ -+ if (strncmp(e->name, name, len) == 0) { -+ /* Is this an _exact_ match? */ -+ if (strcmp(name, e->name) == 0) { -+ return (e); -+ } -+ /* Looks like we found a parent of the correct path */ -+ if (name[len] == '/') { -+ if (e->child) { -+ return (find_filesystem_entry (e, name + len + 1, type)); -+ } else { -+ return NULL; -+ } -+ } -+ } -+ } else { -+ if (strcmp(name, e->name) == 0) { -+ return (e); -+ } -+ } -+ } -+ e = e->next; -+ } -+ return (NULL); -+} -+ -+void modify_entry(char *full_path, unsigned long uid, unsigned long gid, -+ unsigned long mode, unsigned long rdev, struct entry *root, loff_t *fslen_ub) -+{ -+ char *name, *path, *full; -+ struct entry *curr, *parent, *entry, *prev; -+ -+ full = xstrdup(full_path); -+ path = xstrdup(dirname(full)); -+ name = full_path + strlen(path) + 1; -+ free(full); -+ if (strcmp(path, "/") == 0) { -+ parent = root; -+ name = full_path + 1; -+ } else { -+ if (!(parent = find_filesystem_entry(root, path+1, S_IFDIR))) -+ error_msg_and_die("%s/%s: could not find parent\n", path, name); -+ } -+ if ((entry = find_filesystem_entry(parent, name, (mode & S_IFMT)))) { -+ /* its there, just modify permissions */ -+ entry->mode = mode; -+ entry->uid = uid; -+ entry->gid = gid; -+ } else { /* make a new entry */ -+ -+ /* code partially replicated from parse_directory() */ -+ size_t namelen; -+ if (S_ISREG(mode)) { -+ error_msg_and_die("%s: regular file from device_table file must exist on disk!", full_path); -+ } -+ -+ namelen = strlen(name); -+ if (namelen > MAX_INPUT_NAMELEN) { -+ error_msg_and_die( -+ "Very long (%u bytes) filename `%s' found.\n" -+ " Please increase MAX_INPUT_NAMELEN in mkcramfs.c and recompile. Exiting.\n", -+ namelen, name); -+ } -+ entry = xcalloc(1, sizeof(struct entry)); -+ entry->name = xstrdup(name); -+ /* truncate multi-byte UTF-8 filenames on character boundary */ -+ if (namelen > CRAMFS_MAXPATHLEN) { -+ namelen = CRAMFS_MAXPATHLEN; -+ warn_namelen = 1; -+ /* the first lost byte must not be a trail byte */ -+ while ((entry->name[namelen] & 0xc0) == 0x80) { -+ namelen--; -+ /* are we reasonably certain it was UTF-8 ? */ -+ if (entry->name[namelen] < 0x80 || !namelen) { -+ error_msg_and_die("cannot truncate filenames not encoded in UTF-8"); -+ } -+ } -+ entry->name[namelen] = '\0'; -+ } -+ entry->mode = mode; -+ entry->uid = uid; -+ entry->gid = gid; -+ entry->size = 0; -+ if (S_ISBLK(mode) || S_ISCHR(mode)) { -+ entry->size = rdev; -+ if (entry->size & -(1<size += sizeof(struct cramfs_inode) + ((namelen + 3) & ~3); -+ -+ /* alright, time to link us in */ -+ curr = parent->child; -+ prev = NULL; -+ while (curr && strcmp(name, curr->name) > 0) { -+ prev = curr; -+ curr = curr->next; -+ } -+ if (!prev) parent->child = entry; -+ else prev->next = entry; -+ entry->next = curr; -+ entry->child = NULL; -+ } -+ if (entry->uid >= 1 << CRAMFS_UID_WIDTH) -+ warn_uid = 1; -+ if (entry->gid >= 1 << CRAMFS_GID_WIDTH) { -+ /* TODO: We ought to replace with a default -+ gid instead of truncating; otherwise there -+ are security problems. Maybe mode should -+ be &= ~070. Same goes for uid once Linux -+ supports >16-bit uids. */ -+ warn_gid = 1; -+ } -+ free(path); -+} -+ -+/* the GNU C library has a wonderful scanf("%as", string) which will -+ allocate the string with the right size, good to avoid buffer overruns. -+ the following macros use it if available or use a hacky workaround... -+ */ -+ -+#ifdef __GNUC__ -+#define SCANF_PREFIX "a" -+#define SCANF_STRING(s) (&s) -+#define GETCWD_SIZE 0 -+#else -+#define SCANF_PREFIX "511" -+#define SCANF_STRING(s) (s = xmalloc(512)) -+#define GETCWD_SIZE -1 -+inline int snprintf(char *str, size_t n, const char *fmt, ...) -+{ -+ int ret; -+ va_list ap; -+ -+ va_start(ap, fmt); -+ ret = vsprintf(str, fmt, ap); -+ va_end(ap); -+ return ret; -+} -+#endif -+ -+/* device table entries take the form of: -+ -+ /dev/mem c 640 0 0 1 1 0 0 - -+ -+ type can be one of: -+ f A regular file -+ d Directory -+ c Character special device file -+ b Block special device file -+ p Fifo (named pipe) -+ -+ I don't bother with symlinks (permissions are irrelevant), hard -+ links (special cases of regular files), or sockets (why bother). -+ -+ Regular files must exist in the target root directory. If a char, -+ block, fifo, or directory does not exist, it will be created. -+*/ -+ -+static int interpret_table_entry(char *line, struct entry *root, loff_t *fslen_ub) -+{ -+ char type, *name = NULL; -+ unsigned long mode = 0755, uid = 0, gid = 0, major = 0, minor = 0; -+ unsigned long start = 0, increment = 1, count = 0; -+ -+ if (sscanf (line, "%" SCANF_PREFIX "s %c %lo %lu %lu %lu %lu %lu %lu %lu", -+ SCANF_STRING(name), &type, &mode, &uid, &gid, &major, &minor, -+ &start, &increment, &count) < 0) -+ { -+ return 1; -+ } -+ -+ if (!strcmp(name, "/")) { -+ error_msg_and_die("Device table entries require absolute paths"); -+ } -+ -+ switch (type) { -+ case 'd': -+ mode |= S_IFDIR; -+ modify_entry(name, uid, gid, mode, 0, root, fslen_ub); -+ break; -+ case 'f': -+ mode |= S_IFREG; -+ modify_entry(name, uid, gid, mode, 0, root, fslen_ub); -+ break; -+ case 'p': -+ mode |= S_IFIFO; -+ modify_entry(name, uid, gid, mode, 0, root, fslen_ub); -+ break; -+ case 'c': -+ case 'b': -+ mode |= (type == 'c') ? S_IFCHR : S_IFBLK; -+ if (count > 0) { -+ char *buf; -+ unsigned long i; -+ dev_t rdev; -+ -+ for (i = start; i < count; i++) { -+ asprintf(&buf, "%s%lu", name, i); -+ rdev = makedev(major, minor + (i * increment - start)); -+ modify_entry(buf, uid, gid, mode, rdev, root, fslen_ub); -+ free(buf); -+ } -+ } else { -+ dev_t rdev = makedev(major, minor); -+ modify_entry(name, uid, gid, mode, rdev, root, fslen_ub); -+ } -+ break; -+ default: -+ error_msg_and_die("Unsupported file type"); -+ } -+ free(name); -+ return 0; -+} -+ -+static int parse_device_table(FILE *file, struct entry *root, loff_t *fslen_ub) -+{ -+ char *line; -+ int status = 0; -+ size_t length = 0; -+ -+ /* Turn off squash, since we must ensure that values -+ * entered via the device table are not squashed */ -+ opt_squash = 0; -+ -+ /* Looks ok so far. The general plan now is to read in one -+ * line at a time, check for leading comment delimiters ('#'), -+ * then try and parse the line as a device table. If we fail -+ * to parse things, try and help the poor fool to fix their -+ * device table with a useful error msg... */ -+ line = NULL; -+ while (getline(&line, &length, file) != -1) { -+ /* First trim off any whitespace */ -+ int len = strlen(line); -+ -+ /* trim trailing whitespace */ -+ while (len > 0 && isspace(line[len - 1])) -+ line[--len] = '\0'; -+ /* trim leading whitespace */ -+ memmove(line, &line[strspn(line, " \n\r\t\v")], len); -+ -+ /* How long are we after trimming? */ -+ len = strlen(line); -+ -+ /* If this is NOT a comment line, try to interpret it */ -+ if (len && *line != '#') { -+ if (interpret_table_entry(line, root, fslen_ub)) -+ status = 1; -+ } -+ -+ free(line); -+ line = NULL; -+ } -+ free(line); -+ fclose(file); -+ -+ return status; -+} -+ -+void traverse(struct entry *entry, int depth) -+{ -+ struct entry *curr = entry; -+ int i; -+ -+ while (curr) { -+ for (i = 0; i < depth; i++) putchar(' '); -+ printf("%s: size=%d mode=%d same=%p\n", -+ (curr->name)? (char*)curr->name : "/", -+ curr->size, curr->mode, curr->same); -+ if (curr->child) traverse(curr->child, depth + 4); -+ curr = curr->next; -+ } -+} -+ -+static void free_filesystem_entry(struct entry *dir) -+{ -+ struct entry *e = dir, *last; -+ -+ if (S_ISDIR(dir->mode)) { -+ e = dir->child; -+ } -+ while (e) { -+ if (e->name) -+ free(e->name); -+ if (e->path) -+ free(e->path); -+ if (e->uncompressed) -+ free(e->uncompressed); -+ last = e; -+ if (e->child) { -+ free_filesystem_entry(e); -+ } -+ e = e->next; -+ free(last); -+ } -+} -+ -+ -+/* -+ * Usage: -+ * -+ * mkcramfs directory-name outfile -+ * -+ * where "directory-name" is simply the root of the directory -+ * tree that we want to generate a compressed filesystem out -+ * of. -+ */ - int main(int argc, char **argv) - { - struct stat st; /* used twice... */ -@@ -692,6 +1138,7 @@ - u32 crc; - int c; /* for getopt */ - char *ep; /* for strtoul */ -+ FILE *devtable = NULL; - - total_blocks = 0; - -@@ -699,7 +1146,7 @@ - progname = argv[0]; - - /* command line options */ -- while ((c = getopt(argc, argv, "hEe:i:n:psvz")) != EOF) { -+ while ((c = getopt(argc, argv, "hEe:i:n:psvzD:q")) != EOF) { - switch (c) { - case 'h': - usage(MKFS_OK); -@@ -715,7 +1162,7 @@ - case 'i': - opt_image = optarg; - if (lstat(opt_image, &st) < 0) { -- die(MKFS_ERROR, 1, "lstat failed: %s", opt_image); -+ error_msg_and_die("lstat failed: %s", opt_image); - } - image_length = st.st_size; /* may be padded later */ - fslen_ub += (image_length + 3); /* 3 is for padding */ -@@ -736,6 +1183,16 @@ - case 'z': - opt_holes = 1; - break; -+ case 'q': -+ opt_squash = 1; -+ break; -+ case 'D': -+ devtable = xfopen(optarg, "r"); -+ if (fstat(fileno(devtable), &st) < 0) -+ perror_msg_and_die(optarg); -+ if (st.st_size < 10) -+ error_msg_and_die("%s: not a proper device table file\n", optarg); -+ break; - } - } - -@@ -745,25 +1202,23 @@ - outfile = argv[optind + 1]; - - if (stat(dirname, &st) < 0) { -- die(MKFS_USAGE, 1, "stat failed: %s", dirname); -- } -- fd = open(outfile, O_WRONLY | O_CREAT | O_TRUNC, 0666); -- if (fd < 0) { -- die(MKFS_USAGE, 1, "open failed: %s", outfile); -+ error_msg_and_die("stat failed: %s", dirname); - } -+ fd = xopen(outfile, O_WRONLY | O_CREAT | O_TRUNC, 0666); - -- root_entry = calloc(1, sizeof(struct entry)); -- if (!root_entry) { -- die(MKFS_ERROR, 1, "calloc failed"); -- } -+ root_entry = xcalloc(1, sizeof(struct entry)); - root_entry->mode = st.st_mode; - root_entry->uid = st.st_uid; - root_entry->gid = st.st_gid; - - root_entry->size = parse_directory(root_entry, dirname, &root_entry->child, &fslen_ub); - -+ if (devtable) { -+ parse_device_table(devtable, root_entry, &fslen_ub); -+ } -+ - /* always allocate a multiple of blksize bytes because that's -- what we're going to write later on */ -+ what we're going to write later on */ - fslen_ub = ((fslen_ub - 1) | (blksize - 1)) + 1; - - if (fslen_ub > MAXFSLEN) { -@@ -790,7 +1245,7 @@ - rom_image = mmap(NULL, fslen_ub?fslen_ub:1, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); - - if (rom_image == MAP_FAILED) { -- die(MKFS_ERROR, 1, "mmap failed"); -+ error_msg_and_die("mmap failed"); - } - - /* Skip the first opt_pad bytes for boot loader code */ -@@ -807,6 +1262,7 @@ - } - - offset = write_directory_structure(root_entry->child, rom_image, offset); -+ if (opt_verbose) - printf("Directory data: %d bytes\n", offset); - - offset = write_data(root_entry, rom_image, offset); -@@ -814,30 +1270,38 @@ - /* We always write a multiple of blksize bytes, so that - losetup works. */ - offset = ((offset - 1) | (blksize - 1)) + 1; -+ if (opt_verbose) - printf("Everything: %d kilobytes\n", offset >> 10); - - /* Write the superblock now that we can fill in all of the fields. */ - write_superblock(root_entry, rom_image+opt_pad, offset); -+ if (opt_verbose) - printf("Super block: %d bytes\n", sizeof(struct cramfs_super)); - - /* Put the checksum in. */ - crc = crc32(0L, Z_NULL, 0); - crc = crc32(crc, (rom_image+opt_pad), (offset-opt_pad)); - ((struct cramfs_super *) (rom_image+opt_pad))->fsid.crc = crc; -+ if (opt_verbose) - printf("CRC: %x\n", crc); - - /* Check to make sure we allocated enough space. */ - if (fslen_ub < offset) { -- die(MKFS_ERROR, 0, "not enough space allocated for ROM image (%Ld allocated, %d used)", fslen_ub, offset); -+ error_msg_and_die("not enough space allocated for ROM " -+ "image (%Ld allocated, %d used)", fslen_ub, offset); - } - - written = write(fd, rom_image, offset); - if (written < 0) { -- die(MKFS_ERROR, 1, "write failed"); -+ error_msg_and_die("write failed"); - } - if (offset != written) { -- die(MKFS_ERROR, 0, "ROM image write failed (wrote %d of %d bytes)", written, offset); -+ error_msg_and_die("ROM image write failed (wrote %d of %d bytes)", written, offset); - } -+ -+ /* Free up memory */ -+ free_filesystem_entry(root_entry); -+ free(root_entry); - - /* (These warnings used to come at the start, but they scroll off the - screen too quickly.) */ diff --git a/target/cramfs/cramfs-02-endian.patch b/target/cramfs/cramfs-02-endian.patch deleted file mode 100644 index 0da55bfae6..0000000000 --- a/target/cramfs/cramfs-02-endian.patch +++ /dev/null @@ -1,284 +0,0 @@ ---- cramfs-1.1/mkcramfs.c.orig 2005-04-13 05:55:57.000000000 -0600 -+++ cramfs-1.1/mkcramfs.c 2005-04-13 16:19:57.000000000 -0600 -@@ -117,6 +117,7 @@ - static int opt_squash = 0; - static char *opt_image = NULL; - static char *opt_name = NULL; -+static int swap_endian = 0; - - static int warn_dev, warn_gid, warn_namelen, warn_skip, warn_size, warn_uid; - static const char *const memory_exhausted = "memory exhausted"; -@@ -155,6 +156,8 @@ - " -i file insert a file image into the filesystem (requires >= 2.4.0)\n" - " -n name set name of cramfs filesystem\n" - " -p pad by %d bytes for boot code\n" -+ " -l litte endian filesystem\n" -+ " -b big endian filesystem\n" - " -s sort directory entries (old option, ignored)\n" - " -v be more verbose\n" - " -z make explicit holes (requires >= 2.3.39)\n" -@@ -504,6 +506,50 @@ - return totalsize; - } - -+/* routines to swap endianness/bitfields in inode/superblock block data */ -+static void fix_inode(struct cramfs_inode *inode) -+{ -+#define wswap(x) (((x)>>24) | (((x)>>8)&0xff00) | (((x)&0xff00)<<8) | (((x)&0xff)<<24)) -+ /* attempt #2 */ -+ inode->mode = (inode->mode >> 8) | ((inode->mode&0xff)<<8); -+ inode->uid = (inode->uid >> 8) | ((inode->uid&0xff)<<8); -+ inode->size = (inode->size >> 16) | (inode->size&0xff00) | -+ ((inode->size&0xff)<<16); -+ ((u32*)inode)[2] = wswap(inode->offset | (inode->namelen<<26)); -+} -+ -+static void fix_offset(struct cramfs_inode *inode, u32 offset) -+{ -+ u32 tmp = wswap(((u32*)inode)[2]); -+ ((u32*)inode)[2] = wswap((offset >> 2) | (tmp&0xfc000000)); -+} -+ -+static void fix_block_pointer(u32 *p) -+{ -+ *p = wswap(*p); -+} -+ -+static void fix_super(struct cramfs_super *super) -+{ -+ u32 *p = (u32*)super; -+ -+ /* fix superblock fields */ -+ p[0] = wswap(p[0]); /* magic */ -+ p[1] = wswap(p[1]); /* size */ -+ p[2] = wswap(p[2]); /* flags */ -+ p[3] = wswap(p[3]); /* future */ -+ -+ /* fix filesystem info fields */ -+ p = (u32*)&super->fsid; -+ p[0] = wswap(p[0]); /* crc */ -+ p[1] = wswap(p[1]); /* edition */ -+ p[2] = wswap(p[2]); /* blocks */ -+ p[3] = wswap(p[3]); /* files */ -+ -+ fix_inode(&super->root); -+#undef wswap -+} -+ - /* Returns sizeof(struct cramfs_super), which includes the root inode. */ - static unsigned int write_superblock(struct entry *root, char *base, int size) - { -@@ -539,6 +585,7 @@ - super->root.gid = root->gid; - super->root.size = root->size; - super->root.offset = offset >> 2; -+ if (swap_endian) fix_super(super); - - return offset; - } -@@ -553,7 +600,10 @@ - if (offset >= (1 << (2 + CRAMFS_OFFSET_WIDTH))) { - error_msg_and_die("filesystem too big"); - } -- inode->offset = (offset >> 2); -+ if (swap_endian) -+ fix_offset(inode, offset); -+ else -+ inode->offset = (offset >> 2); - } - - /* -@@ -638,6 +688,7 @@ - stack_entries++; - } - entry = entry->next; -+ if (swap_endian) fix_inode(inode); - } - - /* -@@ -734,6 +785,7 @@ - } - - *(u32 *) (base + offset) = curr; -+ if (swap_endian) fix_block_pointer((u32*)(base + offset)); - offset += 4; - } while (size); - -@@ -1146,7 +1198,7 @@ - progname = argv[0]; - - /* command line options */ -- while ((c = getopt(argc, argv, "hEe:i:n:psvzD:q")) != EOF) { -+ while ((c = getopt(argc, argv, "hEe:i:n:psvzD:qlb")) != EOF) { - switch (c) { - case 'h': - usage(MKFS_OK); -@@ -1174,6 +1227,18 @@ - opt_pad = PAD_SIZE; - fslen_ub += PAD_SIZE; - break; -+ case 'b': -+#if __BYTE_ORDER == __LITTLE_ENDIAN -+ swap_endian = 1; -+ printf("Swapping filesystem endian-ness\n"); -+#endif -+ break; -+ case 'l': -+#if __BYTE_ORDER == __BIG_ENDIAN -+ swap_endian = 1; -+ printf("Swapping filesystem endian-ness\n"); -+#endif -+ break; - case 's': - /* old option, ignored */ - break; ---- cramfs-1.1/cramfsck.c.orig 2005-04-25 11:50:31.000000000 -0700 -+++ cramfs-1.1/cramfsck.c 2005-04-25 16:53:25.000000000 -0700 -@@ -30,6 +30,7 @@ - * 2000/07/15: Daniel Quinlan (initial support for block devices) - * 2002/01/10: Daniel Quinlan (additional checks, test more return codes, - * use read if mmap fails, standardize messages) -+ * 2004/09/01: Alfonso Acosta (Add swapping support) - */ - - /* compile-time options */ -@@ -51,6 +52,7 @@ - #include - #include - #define _LINUX_STRING_H_ -+#include - #include "linux/cramfs_fs.h" - #include - -@@ -74,6 +76,7 @@ - static char *filename; /* ROM image filename */ - struct cramfs_super super; /* just find the cramfs superblock once */ - static int opt_verbose = 0; /* 1 = verbose (-v), 2+ = very verbose (-vv) */ -+static int need_swapping = 0; /* fs and host dont have the same endianness */ - #ifdef INCLUDE_FS_TESTS - static int opt_extract = 0; /* extract cramfs (-x) */ - static char *extract_dir = "/"; /* extraction directory (-x) */ -@@ -85,6 +88,9 @@ - static unsigned long start_data = ~0UL; /* start of the data (256 MB = max) */ - static unsigned long end_data = 0; /* end of the data */ - -+/* access 32 byte variables */ -+#define CRAMFS_32(x) (need_swapping ? bswap_32(x) : x) -+ - /* Guarantee access to at least 8kB at a time */ - #define ROMBUFFER_BITS 13 - #define ROMBUFFERSIZE (1 << ROMBUFFER_BITS) -@@ -166,20 +172,34 @@ - if (super.magic == CRAMFS_MAGIC) { - *start = 0; - } -+ else if (super.magic == bswap_32(CRAMFS_MAGIC)) { -+ *start = 0; -+ need_swapping = 1; -+ } -+ - else if (*length >= (PAD_SIZE + sizeof(super))) { - lseek(fd, PAD_SIZE, SEEK_SET); - if (read(fd, &super, sizeof(super)) != sizeof(super)) { - die(FSCK_ERROR, 1, "read failed: %s", filename); - } -- if (super.magic == CRAMFS_MAGIC) { -+ if (super.magic == CRAMFS_32(CRAMFS_MAGIC)) { - *start = PAD_SIZE; - } - } - - /* superblock tests */ -- if (super.magic != CRAMFS_MAGIC) { -+ if (super.magic != CRAMFS_32(CRAMFS_MAGIC)) { - die(FSCK_UNCORRECTED, 0, "superblock magic not found"); - } -+ if (need_swapping){ -+ super.size = bswap_32(super.size); -+ super.flags = bswap_32(super.flags); -+ super.future = bswap_32(super.future); -+ super.fsid.crc = bswap_32(super.fsid.crc); -+ super.fsid.edition = bswap_32(super.fsid.edition); -+ super.fsid.blocks = bswap_32(super.fsid.blocks); -+ super.fsid.files = bswap_32(super.fsid.files); -+ } - if (super.flags & ~CRAMFS_SUPPORTED_FLAGS) { - die(FSCK_ERROR, 0, "unsupported filesystem features"); - } -@@ -215,7 +235,10 @@ - die(FSCK_USAGE, 0, "unable to test CRC: old cramfs format"); - #endif /* not INCLUDE_FS_TESTS */ - } -- -+ else if (need_swapping) { -+ /* crc checking in this case would mean translating the whole file */ -+ return; -+ } - crc = crc32(0L, Z_NULL, 0); - - buf = mmap(NULL, super.size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); -@@ -300,12 +323,23 @@ - - static struct cramfs_inode *cramfs_iget(struct cramfs_inode * i) - { -+#define wswap(x) (((x)>>24) | (((x)>>8)&0xff00) | (((x)&0xff00)<<8) | (((x)&0xff)<<24)) - struct cramfs_inode *inode = malloc(sizeof(struct cramfs_inode)); - - if (!inode) { - die(FSCK_ERROR, 1, "malloc failed"); - } -- *inode = *i; -+ if(!need_swapping) { -+ *inode = *i; -+ } -+ else { -+ inode->mode=bswap_16(i->mode); -+ inode->uid=bswap_16(i->uid); -+ inode->size=bswap_32(i->size << 8); -+ inode->gid=i->gid; -+ inode->namelen = bswap_32(((u32*)i)[2]) >> 26; -+ inode->offset = bswap_32(((u32*)i)[2]) & 0x3FFFFFFF; -+ } - return inode; - } - -@@ -324,9 +358,9 @@ - */ - static struct cramfs_inode *read_super(void) - { -- unsigned long offset = super.root.offset << 2; -- -- if (!S_ISDIR(super.root.mode)) -+ struct cramfs_inode *root = cramfs_iget(&super.root); -+ unsigned long offset = root->offset << 2; -+ if (!S_ISDIR(root->mode)) - die(FSCK_UNCORRECTED, 0, "root inode is not directory"); - if (!(super.flags & CRAMFS_FLAG_SHIFTED_ROOT_OFFSET) && - ((offset != sizeof(struct cramfs_super)) && -@@ -334,7 +368,7 @@ - { - die(FSCK_UNCORRECTED, 0, "bad root offset (%lu)", offset); - } -- return cramfs_iget(&super.root); -+ return root; - } - - static int uncompress_block(void *src, int len) -@@ -366,7 +400,7 @@ - - do { - unsigned long out = PAGE_CACHE_SIZE; -- unsigned long next = *(u32 *) romfs_read(offset); -+ unsigned long next = CRAMFS_32(*(u32 *) romfs_read(offset)); - - if (next > end_data) { - end_data = next; -@@ -529,7 +563,7 @@ - { - unsigned long offset = i->offset << 2; - unsigned long curr = offset + 4; -- unsigned long next = *(u32 *) romfs_read(offset); -+ unsigned long next = CRAMFS_32(*(u32 *) romfs_read(offset)); - unsigned long size; - - if (offset == 0) { diff --git a/target/cramfs/cramfs-03-cygwin_IO.patch b/target/cramfs/cramfs-03-cygwin_IO.patch deleted file mode 100644 index 4ea358ede3..0000000000 --- a/target/cramfs/cramfs-03-cygwin_IO.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- cramfs-1.1/cramfsck.c.orig 2006-12-22 22:16:59.328125000 +1100 -+++ cramfs-1.1/cramfsck.c 2006-12-19 01:02:05.531250000 +1100 -@@ -56,6 +56,10 @@ - #include "linux/cramfs_fs.h" - #include - -+#ifdef __CYGWIN__ -+#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0) -+#endif /* __CYGWIN__ */ -+ - #define BLKGETSIZE _IO(0x12,96) /* return device size /512 (long *arg) */ - - /* Exit codes used by fsck-type programs */ diff --git a/target/cramfs/cramfs.mk b/target/cramfs/cramfs.mk index e6d63ed01b..f43162905b 100644 --- a/target/cramfs/cramfs.mk +++ b/target/cramfs/cramfs.mk @@ -1,38 +1,3 @@ -############################################################# -# -# mkcramfs to build to target cramfs filesystems -# -############################################################# -CRAMFS_DIR=$(BUILD_DIR)/cramfs-1.1 -CRAMFS_SOURCE=cramfs-1.1.tar.gz -ifeq ($(call qstrip,$(BR2_SOURCEFORGE_MIRROR)),unc) -# UNC does not seem to have cramfs -CRAMFS_SITE=http://internap.dl.sourceforge.net/sourceforge/cramfs -else -CRAMFS_SITE=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/cramfs -endif - -$(DL_DIR)/$(CRAMFS_SOURCE): - $(call DOWNLOAD,$(CRAMFS_SITE),$(CRAMFS_SOURCE)) - -$(CRAMFS_DIR): $(DL_DIR)/$(CRAMFS_SOURCE) - $(ZCAT) $(DL_DIR)/$(CRAMFS_SOURCE) | tar -C $(BUILD_DIR) -xvf - - toolchain/patch-kernel.sh $(CRAMFS_DIR) target/cramfs/ cramfs\*.patch - -$(CRAMFS_DIR)/mkcramfs: $(CRAMFS_DIR) - $(MAKE) CFLAGS="$(HOST_CFLAGS) -Wall -O2 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" LDFLAGS="$(HOST_LDFLAGS)" -C $(CRAMFS_DIR) - touch -c $@ - -cramfs: host-zlib $(CRAMFS_DIR)/mkcramfs - -cramfs-source: $(DL_DIR)/$(CRAMFS_SOURCE) - -cramfs-clean: - -$(MAKE) -C $(CRAMFS_DIR) clean - -cramfs-dirclean: - rm -rf $(CRAMFS_DIR) - ############################################################# # # Build the cramfs root filesystem image @@ -50,7 +15,7 @@ endif CRAMFS_TARGET=$(IMAGE).cramfs -cramfsroot: host-fakeroot makedevs cramfs +cramfsroot: host-fakeroot host-cramfs makedevs # Use fakeroot to pretend all target binaries are owned by root rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(CRAMFS_TARGET)) touch $(BUILD_DIR)/.fakeroot.00000 @@ -62,20 +27,12 @@ ifneq ($(TARGET_DEVICE_TABLE),) >> $(BUILD_DIR)/_fakeroot.$(notdir $(CRAMFS_TARGET)) endif # Use fakeroot so mkcramfs believes the previous fakery - echo "$(CRAMFS_DIR)/mkcramfs -q $(CRAMFS_OPTS) " \ + echo "$(HOST_DIR)/usr/bin/mkcramfs -q $(CRAMFS_OPTS) " \ "$(TARGET_DIR) $(CRAMFS_TARGET)" >> $(BUILD_DIR)/_fakeroot.$(notdir $(CRAMFS_TARGET)) chmod a+x $(BUILD_DIR)/_fakeroot.$(notdir $(CRAMFS_TARGET)) $(HOST_DIR)/usr/bin/fakeroot -- $(BUILD_DIR)/_fakeroot.$(notdir $(CRAMFS_TARGET)) -@rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(CRAMFS_TARGET)) -cramfsroot-source: cramfs-source - -cramfsroot-clean: - -$(MAKE) -C $(CRAMFS_DIR) clean - -cramfsroot-dirclean: - rm -rf $(CRAMFS_DIR) - ############################################################# # # Toplevel Makefile options From 8e599f7fc6404f290db1e9bebd7823aa46d2b34b Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 2 Mar 2010 22:41:26 +0100 Subject: [PATCH 16/44] target/ext2: cleanup Remove the genext2fs host tools building process, which is now in package/genext2fs. Signed-off-by: Thomas Petazzoni --- target/ext2/Config.in | 1 - target/ext2/ext2root.mk | 56 ++++------------------------------------- 2 files changed, 5 insertions(+), 52 deletions(-) diff --git a/target/ext2/Config.in b/target/ext2/Config.in index e94fb401c3..1b1dc8a215 100644 --- a/target/ext2/Config.in +++ b/target/ext2/Config.in @@ -1,7 +1,6 @@ config BR2_TARGET_ROOTFS_EXT2 bool "ext2 root filesystem" default y - select BR2_HOST_FAKEROOT help Build an ext2 root filesystem diff --git a/target/ext2/ext2root.mk b/target/ext2/ext2root.mk index 622b293296..6c8e02a9ba 100644 --- a/target/ext2/ext2root.mk +++ b/target/ext2/ext2root.mk @@ -1,39 +1,3 @@ -############################################################# -# -# genext2fs to build to target ext2 filesystems -# -############################################################# -GENEXT2_VERSION=1.4 -GENEXT2_DIR=$(BUILD_DIR)/genext2fs-$(GENEXT2_VERSION) -GENEXT2_SOURCE=genext2fs-$(GENEXT2_VERSION).tar.gz -GENEXT2_SITE:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/genext2fs - -$(DL_DIR)/$(GENEXT2_SOURCE): - $(call DOWNLOAD,$(GENEXT2_SITE),$(GENEXT2_SOURCE)) - -$(GENEXT2_DIR)/.unpacked: $(DL_DIR)/$(GENEXT2_SOURCE) - $(ZCAT) $(DL_DIR)/$(GENEXT2_SOURCE) | tar -C $(BUILD_DIR) -xvf - - toolchain/patch-kernel.sh $(GENEXT2_DIR) target/ext2/ genext2fs\*.patch - touch $@ - -$(GENEXT2_DIR)/.configured: $(GENEXT2_DIR)/.unpacked - chmod a+x $(GENEXT2_DIR)/configure - (cd $(GENEXT2_DIR); rm -rf config.cache; \ - ./configure $(QUIET) \ - CC="$(HOSTCC)" \ - --prefix=$(STAGING_DIR) \ - ) - touch $@ - -$(GENEXT2_DIR)/genext2fs: $(GENEXT2_DIR)/.configured - $(MAKE) CFLAGS="-Wall -O2 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE \ - -D_FILE_OFFSET_BITS=64" -C $(GENEXT2_DIR) - touch -c $@ - -genext2fs: $(GENEXT2_DIR)/genext2fs - - - ############################################################# # # Build the ext2 root filesystem image @@ -66,17 +30,15 @@ EXT2_ROOTFS_COMPRESSOR_PREREQ:= ifeq ($(BR2_TARGET_ROOTFS_EXT2_GZIP),y) EXT2_ROOTFS_COMPRESSOR:=gzip -9 -c EXT2_ROOTFS_COMPRESSOR_EXT:=gz -#EXT2_ROOTFS_COMPRESSOR_PREREQ:= gzip-host endif ifeq ($(BR2_TARGET_ROOTFS_EXT2_BZIP2),y) EXT2_ROOTFS_COMPRESSOR:=bzip2 -9 -c EXT2_ROOTFS_COMPRESSOR_EXT:=bz2 -#EXT2_ROOTFS_COMPRESSOR_PREREQ:= bzip2-host endif ifeq ($(BR2_TARGET_ROOTFS_EXT2_LZMA),y) -EXT2_ROOTFS_COMPRESSOR:=lzma -9 -c +EXT2_ROOTFS_COMPRESSOR:=$(LZMA) -9 -c EXT2_ROOTFS_COMPRESSOR_EXT:=lzma -EXT2_ROOTFS_COMPRESSOR_PREREQ:= lzma-host +EXT2_ROOTFS_COMPRESSOR_PREREQ:=host-lzma endif ifneq ($(EXT2_ROOTFS_COMPRESSOR),) @@ -85,7 +47,7 @@ else EXT2_TARGET := $(EXT2_BASE) endif -$(EXT2_BASE): host-fakeroot makedevs genext2fs +$(EXT2_BASE): host-fakeroot host-genext2fs makedevs # Use fakeroot to pretend all target binaries are owned by root rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(EXT2_TARGET)) touch $(BUILD_DIR)/.fakeroot.00000 @@ -104,11 +66,11 @@ ifeq ($(strip $(BR2_TARGET_ROOTFS_EXT2_BLOCKS)),0) GENEXT2_ADDTOINODESIZE=`find $(TARGET_DIR) | wc -l`; \ GENEXT2_INODES=`expr $$GENEXT2_ADDTOINODESIZE + 400`; \ set -x; \ - echo "$(GENEXT2_DIR)/genext2fs -b $$GENEXT2_SIZE " \ + echo "$(HOST_DIR)/usr/bin/genext2fs -b $$GENEXT2_SIZE " \ "-N $$GENEXT2_INODES -d $(TARGET_DIR) " \ "$(EXT2_OPTS) $(EXT2_BASE)" >> $(BUILD_DIR)/_fakeroot.$(notdir $(EXT2_TARGET)) else - echo "$(GENEXT2_DIR)/genext2fs -d $(TARGET_DIR) " \ + echo "$(HOST_DIR)/usr/bin/genext2fs -d $(TARGET_DIR) " \ "$(EXT2_OPTS) $(EXT2_BASE)" >> $(BUILD_DIR)/_fakeroot.$(notdir $(EXT2_TARGET)) endif chmod a+x $(BUILD_DIR)/_fakeroot.$(notdir $(EXT2_TARGET)) @@ -128,14 +90,6 @@ ifneq ($(EXT2_COPYTO),) @cp -f $(EXT2_TARGET) $(EXT2_COPYTO) endif -ext2root-source: $(DL_DIR)/$(GENEXT2_SOURCE) - -ext2root-clean: - -$(MAKE) -C $(GENEXT2_DIR) clean - -ext2root-dirclean: - rm -rf $(GENEXT2_DIR) - ############################################################# # # Toplevel Makefile options From a573150c199028c1d03713ca8c801e8187851544 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 2 Mar 2010 22:42:20 +0100 Subject: [PATCH 17/44] target/iso9660: cleanup Remove the mkisofs host tools building process, which is now in package/cdrkit. Signed-off-by: Thomas Petazzoni --- target/iso9660/Config.in | 1 - target/iso9660/iso9660.mk | 52 ++------------------------------------- 2 files changed, 2 insertions(+), 51 deletions(-) diff --git a/target/iso9660/Config.in b/target/iso9660/Config.in index 0b820630ae..40c93b3f88 100644 --- a/target/iso9660/Config.in +++ b/target/iso9660/Config.in @@ -4,7 +4,6 @@ config BR2_TARGET_ROOTFS_ISO9660 depends on !BR2_KERNEL_none select BR2_TARGET_ROOTFS_EXT2 select BR2_TARGET_GRUB - select BR2_HOST_FAKEROOT help Build a bootable iso9660 image diff --git a/target/iso9660/iso9660.mk b/target/iso9660/iso9660.mk index 9571e4769b..a198c17c1d 100644 --- a/target/iso9660/iso9660.mk +++ b/target/iso9660/iso9660.mk @@ -1,44 +1,3 @@ -############################################################# -# -# mkisofs to build to target iso9660 filesystems -# -############################################################# -MKISOFS_SOURCE:=cdrtools-2.01.tar.bz2 -MKISOFS_CAT:=$(BZCAT) -MKISOFS_SITE:=ftp://ftp.berlios.de/pub/cdrecord/ -MKISOFS_DIR:=$(BUILD_DIR)/cdrtools-2.01 -MKISOFS_TARGET=$(MKISOFS_DIR)/mkisofs/OBJ/$(HOST_ARCH)-linux-cc/mkisofs - -hest: - @echo ARCH=$(BR2_ARCH) HOST_ARCH=$(HOST_ARCH) -$(DL_DIR)/$(MKISOFS_SOURCE): - $(call DOWNLOAD,$(MKISOFS_SITE),$(MKISOFS_SOURCE)) - -mkisofs-source: $(DL_DIR)/$(MKISOFS_SOURCE) - -$(MKISOFS_DIR)/.unpacked: $(DL_DIR)/$(MKISOFS_SOURCE) - $(MKISOFS_CAT) $(DL_DIR)/$(MKISOFS_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - - toolchain/patch-kernel.sh $(MKISOFS_DIR) target/iso9660/ \*.patch - touch $@ - -$(MKISOFS_DIR)/.configured: $(MKISOFS_DIR)/.unpacked - (cd $(MKISOFS_DIR); rm -rf config.cache; \ - ); - touch $@ - -$(MKISOFS_TARGET): $(MKISOFS_DIR)/.configured - $(MAKE) -C $(MKISOFS_DIR) - touch -c $(MKISOFS_DIR)/mkisofs - -mkisofs: $(MKISOFS_TARGET) - -mkisofs-clean: - -$(MAKE) -C $(MKISOFS_DIR) clean - -mkisofs-dirclean: - rm -rf $(MKISOFS_DIR) - - ############################################################# # # Build the iso96600 root filesystem image @@ -54,7 +13,7 @@ ifeq ($(BR2_TARGET_ROOTFS_ISO9660_SQUASH),y) ISO9660_OPTS+=-U endif -$(ISO9660_TARGET): host-fakeroot $(LINUX_KERNEL) $(EXT2_TARGET) grub mkisofs +$(ISO9660_TARGET): host-fakeroot host-cdrkit $(LINUX_KERNEL) $(EXT2_TARGET) grub mkdir -p $(ISO9660_TARGET_DIR) mkdir -p $(ISO9660_TARGET_DIR)/boot/grub cp $(GRUB_DIR)/stage2/stage2_eltorito $(ISO9660_TARGET_DIR)/boot/grub/ @@ -67,7 +26,7 @@ $(ISO9660_TARGET): host-fakeroot $(LINUX_KERNEL) $(EXT2_TARGET) grub mkisofs cat $(BUILD_DIR)/.fakeroot* > $(BUILD_DIR)/_fakeroot.$(notdir $(ISO9660_TARGET)) echo "chown -R 0:0 $(ISO9660_TARGET_DIR)" >> $(BUILD_DIR)/_fakeroot.$(notdir $(ISO9660_TARGET)) # Use fakeroot so mkisofs believes the previous fakery - echo "$(MKISOFS_TARGET) -R -b boot/grub/stage2_eltorito -no-emul-boot " \ + echo "$(HOST_DIR)/usr/bin/genisoimage -R -b boot/grub/stage2_eltorito -no-emul-boot " \ "-boot-load-size 4 -boot-info-table -o $(ISO9660_TARGET) $(ISO9660_TARGET_DIR)" \ >> $(BUILD_DIR)/_fakeroot.$(notdir $(ISO9660_TARGET)) chmod a+x $(BUILD_DIR)/_fakeroot.$(notdir $(ISO9660_TARGET)) @@ -78,13 +37,6 @@ iso9660root: $(ISO9660_TARGET) echo $(ISO9660_TARGET) @ls -l $(ISO9660_TARGET) -iso9660root-source: mkisofs-source - -iso9660root-clean: mkisofs-clean - -iso9660root-dirclean: mkisofs-dirclean - rm -rf $(ISO9660_DIR) - ############################################################# # # Toplevel Makefile options From 16b1d2a734bde48c104eeef7e1a3287785ab2251 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 2 Mar 2010 22:43:01 +0100 Subject: [PATCH 18/44] target/jffs2: cleanup Remove the code to build host MTD utils, since they can now be built using package/mtd. Signed-off-by: Thomas Petazzoni --- target/jffs2/Config.in | 1 - target/jffs2/jffs2root.mk | 10 +--------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/target/jffs2/Config.in b/target/jffs2/Config.in index bcb4d5120e..bf4ac60798 100644 --- a/target/jffs2/Config.in +++ b/target/jffs2/Config.in @@ -1,6 +1,5 @@ config BR2_TARGET_ROOTFS_JFFS2 bool "jffs2 root filesystem" - select BR2_HOST_FAKEROOT help Build a jffs2 root filesystem diff --git a/target/jffs2/jffs2root.mk b/target/jffs2/jffs2root.mk index 7d31417ee6..30ac86ddfe 100644 --- a/target/jffs2/jffs2root.mk +++ b/target/jffs2/jffs2root.mk @@ -44,7 +44,7 @@ endif # value of MKFS_JFFS2 to either the previously installed copy or the one # just built. # -$(JFFS2_TARGET): host-fakeroot makedevs mtd-host +$(JFFS2_TARGET): host-fakeroot host-mtd makedevs # Use fakeroot to pretend all target binaries are owned by root rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(JFFS2_TARGET)) touch $(BUILD_DIR)/.fakeroot.00000 @@ -81,14 +81,6 @@ ifneq ($(JFFS2_COPYTO),) @cp -f $(JFFS2_TARGET) $(JFFS2_COPYTO) endif -jffs2root-source: mtd-host-source - -jffs2root-clean: mtd-host-clean - -rm -f $(JFFS2_TARGET) - -jffs2root-dirclean: mtd-host-dirclean - -rm -f $(JFFS2_TARGET) - ############################################################# # # Toplevel Makefile options From 3cabc6cce153ee1265c477d840fe3887347053ae Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 2 Mar 2010 22:43:21 +0100 Subject: [PATCH 19/44] target/romfs: cleanup Remove the code needed to build host genromfs, since it can now be done using package/genromfs. Signed-off-by: Thomas Petazzoni --- target/romfs/Config.in | 1 - target/romfs/romfs.mk | 42 ++---------------------------------------- 2 files changed, 2 insertions(+), 41 deletions(-) diff --git a/target/romfs/Config.in b/target/romfs/Config.in index 03a23d4132..7a8c663dd4 100644 --- a/target/romfs/Config.in +++ b/target/romfs/Config.in @@ -1,6 +1,5 @@ config BR2_TARGET_ROOTFS_ROMFS bool "romfs root filesystem" - select BR2_HOST_FAKEROOT help Build a romfs image of the root filesystem. diff --git a/target/romfs/romfs.mk b/target/romfs/romfs.mk index 6e7fbeeddf..e4b8ff58bb 100644 --- a/target/romfs/romfs.mk +++ b/target/romfs/romfs.mk @@ -1,33 +1,3 @@ -############################################################# -# -# genromfs to build to target romfs filesystems -# -############################################################# -ROMFS_VERSION=0.5.2 -ROMFS_DIR=$(BUILD_DIR)/genromfs-$(ROMFS_VERSION) -ROMFS_SOURCE=genromfs-$(ROMFS_VERSION).tar.gz -ROMFS_SITE=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/romfs - -$(DL_DIR)/$(ROMFS_SOURCE): - $(call DOWNLOAD,$(ROMFS_SITE),$(ROMFS_SOURCE)) - -$(ROMFS_DIR): $(DL_DIR)/$(ROMFS_SOURCE) - $(ZCAT) $(DL_DIR)/$(ROMFS_SOURCE) | tar -C $(BUILD_DIR) -xvf - - -$(ROMFS_DIR)/genromfs: $(ROMFS_DIR) - $(MAKE) -C $(ROMFS_DIR) - touch -c $@ - -romfs: $(ROMFS_DIR)/genromfs - -romfs-source: $(DL_DIR)/$(ROMFS_SOURCE) - -romfs-clean: - -$(MAKE) -C $(ROMFS_DIR) clean - -romfs-dirclean: - rm -rf $(ROMFS_DIR) - ############################################################# # # Build the romfs root filesystem image @@ -36,7 +6,7 @@ romfs-dirclean: ROMFS_TARGET=$(IMAGE).romfs -romfsroot: host-fakeroot makedevs romfs +romfsroot: host-fakeroot host-genromfs makedevs # Use fakeroot to pretend all target binaries are owned by root rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(ROMFS_TARGET)) touch $(BUILD_DIR)/.fakeroot.00000 @@ -48,19 +18,11 @@ ifneq ($(TARGET_DEVICE_TABLE),) >> $(BUILD_DIR)/_fakeroot.$(notdir $(ROMFS_TARGET)) endif # Use fakeroot so genromfs believes the previous fakery - echo "$(ROMFS_DIR)/genromfs -d $(TARGET_DIR) -f $(ROMFS_TARGET)" >> $(BUILD_DIR)/_fakeroot.$(notdir $(ROMFS_TARGET)) + echo "$(HOST_DIR)/usr/bin/genromfs -d $(TARGET_DIR) -f $(ROMFS_TARGET)" >> $(BUILD_DIR)/_fakeroot.$(notdir $(ROMFS_TARGET)) chmod a+x $(BUILD_DIR)/_fakeroot.$(notdir $(ROMFS_TARGET)) $(HOST_DIR)/usr/bin/fakeroot -- $(BUILD_DIR)/_fakeroot.$(notdir $(ROMFS_TARGET)) -@rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(ROMFS_TARGET)) -romfsroot-source: romfs-source - -romfsroot-clean: - -$(MAKE) -C $(ROMFS_DIR) clean - -romfsroot-dirclean: - rm -rf $(ROMFS_DIR) - ############################################################# # # Toplevel Makefile options From 1f5c3ccdceac58b2a4af6fc22fb49041462cc04f Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 2 Mar 2010 22:43:50 +0100 Subject: [PATCH 20/44] target/squashfs: cleanup, remove support for 3.x Remove the code to build squashfs-tools for the host, since they can now be built using package/squashfs. We also remove support for Squashfs 3.x, because the Squashfs driver merged inside the mainline kernel is a 4.x driver. So 3.x is only useful for old kernels using a Squashfs patch. Signed-off-by: Thomas Petazzoni --- target/squashfs/Config.in | 28 -------- .../squashfs-3.4-build-system-fix.patch | 28 -------- .../squashfs-4.0-build-system-fix.patch | 65 ------------------- target/squashfs/squashfsroot.mk | 52 +-------------- 4 files changed, 2 insertions(+), 171 deletions(-) delete mode 100644 target/squashfs/squashfs-3.4-build-system-fix.patch delete mode 100644 target/squashfs/squashfs-4.0-build-system-fix.patch diff --git a/target/squashfs/Config.in b/target/squashfs/Config.in index 9259ba350e..6cc8fcae00 100644 --- a/target/squashfs/Config.in +++ b/target/squashfs/Config.in @@ -1,32 +1,4 @@ config BR2_TARGET_ROOTFS_SQUASHFS bool "squashfs root filesystem" - select BR2_HOST_FAKEROOT help Build a squashfs root filesystem - -choice - prompt "Squashfs version" - default BR2_TARGET_ROOTFS_SQUASHFS_4 - depends on BR2_TARGET_ROOTFS_SQUASHFS - help - Select squashfs version - This must match what your kernel - supports. Select 3.x if you use the legacy 3.x kernel - patches (pre 2.6.29), and 4.x otherwise. - -config BR2_TARGET_ROOTFS_SQUASHFS_3 - depends on BR2_DEPRECATED || BR2_RECENT - bool "3.x" - help - Select this if you use the legacy 3.x kernel patches (pre 2.6.29) - -config BR2_TARGET_ROOTFS_SQUASHFS_4 - bool "4.x" - help - Select this if you use the squashfs version in mainline (from 2.6.29) - -endchoice - -config BR2_TARGET_ROOTFS_SQUASHFS_VERSION - string - default "3.4" if BR2_TARGET_ROOTFS_SQUASHFS_3 - default "4.0" if BR2_TARGET_ROOTFS_SQUASHFS_4 diff --git a/target/squashfs/squashfs-3.4-build-system-fix.patch b/target/squashfs/squashfs-3.4-build-system-fix.patch deleted file mode 100644 index 5b86b008a0..0000000000 --- a/target/squashfs/squashfs-3.4-build-system-fix.patch +++ /dev/null @@ -1,28 +0,0 @@ -[PATCH]: squashfs-tools: Handle user supplied CFLAGS/LDFLAGS - -Properly handle make CFLAGS=.. LDFLAGS=.. - -Signed-off-by: Peter Korsgaard ---- - squashfs-tools/Makefile | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -Index: squashfs3.4/squashfs-tools/Makefile -=================================================================== ---- squashfs3.4.orig/squashfs-tools/Makefile -+++ squashfs3.4/squashfs-tools/Makefile -@@ -2,12 +2,12 @@ INSTALL_DIR = /usr/local/bin - - INCLUDEDIR = . - --CFLAGS := -I$(INCLUDEDIR) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -O2 -+override CFLAGS += -I$(INCLUDEDIR) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -O2 - - all: mksquashfs unsquashfs - - mksquashfs: mksquashfs.o read_fs.o sort.o -- $(CC) mksquashfs.o read_fs.o sort.o -lz -lpthread -lm -o $@ -+ $(CC) $(LDFLAGS) mksquashfs.o read_fs.o sort.o -lz -lpthread -lm -o $@ - - mksquashfs.o: mksquashfs.c squashfs_fs.h mksquashfs.h global.h sort.h - diff --git a/target/squashfs/squashfs-4.0-build-system-fix.patch b/target/squashfs/squashfs-4.0-build-system-fix.patch deleted file mode 100644 index 7ba0ab94a0..0000000000 --- a/target/squashfs/squashfs-4.0-build-system-fix.patch +++ /dev/null @@ -1,65 +0,0 @@ -Fix the build system so that CFLAGS can be overriden on the command -line to pass additionnal -I options. - -Patch borrowed from OpenEmbedded. - -Index: squashfs-4.0/squashfs-tools/Makefile -=================================================================== ---- squashfs-4.0.orig/squashfs-tools.orig/Makefile 2009-04-19 01:47:43.000000000 +0200 -+++ squashfs-4.0/squashfs-tools/Makefile 2009-04-19 01:52:36.000000000 +0200 -@@ -1,36 +1,48 @@ - INSTALL_DIR = /usr/local/bin - - INCLUDEDIR = . -+CFLAGS_R = -I$(INCLUDEDIR) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -+LIBS = -lz -lpthread - - CFLAGS := -I$(INCLUDEDIR) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -O2 - - all: mksquashfs unsquashfs - - mksquashfs: mksquashfs.o read_fs.o sort.o swap.o pseudo.o -- $(CC) mksquashfs.o read_fs.o sort.o swap.o pseudo.o -lz -lpthread -lm -o $@ -+ $(CC) $(LDFLAGS) mksquashfs.o read_fs.o sort.o swap.o pseudo.o -lz -lpthread -lm -o $@ - - mksquashfs.o: mksquashfs.c squashfs_fs.h mksquashfs.h global.h sort.h squashfs_swap.h Makefile -+ $(CC) $(CFLAGS_R) $(CFLAGS) -c -o $@ $< - - read_fs.o: read_fs.c squashfs_fs.h read_fs.h global.h squashfs_swap.h Makefile -+ $(CC) $(CFLAGS_R) $(CFLAGS) -c -o $@ $< - - sort.o: sort.c squashfs_fs.h global.h sort.h Makefile -+ $(CC) $(CFLAGS_R) $(CFLAGS) -c -o $@ $< - - swap.o: swap.c Makefile -+ $(CC) $(CFLAGS_R) $(CFLAGS) -c -o $@ $< - - pseudo.o: pseudo.c pseudo.h Makefile -+ $(CC) $(CFLAGS_R) $(CFLAGS) -c -o $@ $< - - unsquashfs: unsquashfs.o unsquash-1.o unsquash-2.o unsquash-3.o unsquash-4.o swap.o -- $(CC) unsquashfs.o unsquash-1.o unsquash-2.o unsquash-3.o unsquash-4.o swap.o -lz -lpthread -lm -o $@ -+ $(CC) $(LDFLAGS) unsquashfs.o unsquash-1.o unsquash-2.o unsquash-3.o unsquash-4.o swap.o -lz -lpthread -lm -o $@ - --unsquashfs.o: unsquashfs.h unsquashfs.c squashfs_fs.h squashfs_swap.h squashfs_compat.h global.h Makefile -+unsquashfs.o: unsquashfs.c unsquashfs.h squashfs_fs.h squashfs_swap.h squashfs_compat.h global.h Makefile -+ $(CC) $(CFLAGS_R) $(CFLAGS) -c -o $@ $< - --unsquash-1.o: unsquashfs.h unsquash-1.c squashfs_fs.h squashfs_compat.h global.h Makefile -+unsquash-1.o: unsquash-1.c unsquashfs.h squashfs_fs.h squashfs_compat.h global.h Makefile -+ $(CC) $(CFLAGS_R) $(CFLAGS) -c -o $@ $< - --unsquash-2.o: unsquashfs.h unsquash-2.c unsquashfs.h squashfs_fs.h squashfs_compat.h global.h Makefile -+unsquash-2.o: unsquash-2.c unsquashfs.h unsquashfs.h squashfs_fs.h squashfs_compat.h global.h Makefile -+ $(CC) $(CFLAGS_R) $(CFLAGS) -c -o $@ $< - --unsquash-3.o: unsquashfs.h unsquash-3.c squashfs_fs.h squashfs_compat.h global.h Makefile -+unsquash-3.o: unsquash-3.c unsquashfs.h squashfs_fs.h squashfs_compat.h global.h Makefile -+ $(CC) $(CFLAGS_R) $(CFLAGS) -c -o $@ $< - --unsquash-4.o: unsquashfs.h unsquash-4.c squashfs_fs.h squashfs_swap.h global.h Makefile -+unsquash-4.o: unsquash-4.c unsquashfs.h squashfs_fs.h squashfs_swap.h global.h Makefile -+ $(CC) $(CFLAGS_R) $(CFLAGS) -c -o $@ $< - - clean: - -rm -f *.o mksquashfs unsquashfs diff --git a/target/squashfs/squashfsroot.mk b/target/squashfs/squashfsroot.mk index 63adc5c361..01c4dabf9a 100644 --- a/target/squashfs/squashfsroot.mk +++ b/target/squashfs/squashfsroot.mk @@ -1,52 +1,12 @@ -############################################################# -# -# mksquashfs to build to target squashfs filesystems -# -############################################################# -SQUASHFS_VERSION:=$(call qstrip,$(BR2_TARGET_ROOTFS_SQUASHFS_VERSION)) -SQUASHFS_DIR:=$(BUILD_DIR)/squashfs$(SQUASHFS_VERSION) -SQUASHFS_SOURCE:=squashfs$(SQUASHFS_VERSION).tar.gz -SQUASHFS_SITE:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/squashfs -SQUASHFS_CAT:=$(ZCAT) - -$(DL_DIR)/$(SQUASHFS_SOURCE): - $(call DOWNLOAD,$(SQUASHFS_SITE),$(SQUASHFS_SOURCE)) - -$(SQUASHFS_DIR)/.unpacked: $(DL_DIR)/$(SQUASHFS_SOURCE) #$(SQUASHFS_PATCH) - $(SQUASHFS_CAT) $(DL_DIR)/$(SQUASHFS_SOURCE) | tar -C $(BUILD_DIR) -xvf - - toolchain/patch-kernel.sh $(SQUASHFS_DIR) target/squashfs/ squashfs-$(SQUASHFS_VERSION)-\*.patch - touch $@ - -$(SQUASHFS_DIR)/squashfs-tools/mksquashfs: $(SQUASHFS_DIR)/.unpacked - $(MAKE) CFLAGS="$(HOST_CFLAGS)" LDFLAGS="$(HOST_LDFLAGS)" -C $(SQUASHFS_DIR)/squashfs-tools - -squashfs: host-zlib $(SQUASHFS_DIR)/squashfs-tools/mksquashfs - -squashfs-source: $(DL_DIR)/$(SQUASHFS_SOURCE) - -squashfs-clean: - -$(MAKE) -C $(SQUASHFS_DIR)/squashfs-tools clean - -squashfs-dirclean: - rm -rf $(SQUASHFS_DIR) - ############################################################# # # Build the squashfs root filesystem image # ############################################################# -ifeq ($(BR2_TARGET_ROOTFS_SQUASHFS_3),y) -# 4.x is always little endian -ifeq ($(BR2_ENDIAN),"BIG") -SQUASHFS_ENDIANNESS=-be -else -SQUASHFS_ENDIANNESS=-le -endif -endif SQUASHFS_TARGET:=$(IMAGE).squashfs -squashfsroot: host-fakeroot makedevs squashfs +squashfsroot: host-fakeroot host-squashfs makedevs # Use fakeroot to pretend all target binaries are owned by root rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(SQUASHFS_TARGET)) touch $(BUILD_DIR)/.fakeroot.00000 @@ -58,7 +18,7 @@ ifneq ($(TARGET_DEVICE_TABLE),) >> $(BUILD_DIR)/_fakeroot.$(notdir $(SQUASHFS_TARGET)) endif # Use fakeroot so mksquashfs believes the previous fakery - echo "$(SQUASHFS_DIR)/squashfs-tools/mksquashfs " \ + echo "$(HOST_DIR)/usr/bin/mksquashfs " \ "$(TARGET_DIR) $(SQUASHFS_TARGET) " \ "-noappend $(SQUASHFS_ENDIANNESS)" \ >> $(BUILD_DIR)/_fakeroot.$(notdir $(SQUASHFS_TARGET)) @@ -67,14 +27,6 @@ endif chmod 0644 $(SQUASHFS_TARGET) -@rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(SQUASHFS_TARGET)) -squashfsroot-source: squashfs-source - -squashfsroot-clean: - -$(MAKE) -C $(SQUASHFS_DIR) clean - -squashfsroot-dirclean: - rm -rf $(SQUASHFS_DIR) - ############################################################# # # Toplevel Makefile options From d36ca79149b027db4f4fd8d3a347c919f90e23c6 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 2 Mar 2010 22:45:15 +0100 Subject: [PATCH 21/44] target/tar: cleanup Remove dependency on BR2_HOST_FAKEROOT. Signed-off-by: Thomas Petazzoni --- target/tar/Config.in | 1 - target/tar/tarroot.mk | 6 ------ 2 files changed, 7 deletions(-) diff --git a/target/tar/Config.in b/target/tar/Config.in index 020965480a..ae024094ac 100644 --- a/target/tar/Config.in +++ b/target/tar/Config.in @@ -1,6 +1,5 @@ config BR2_TARGET_ROOTFS_TAR bool "tar the root filesystem" - select BR2_HOST_FAKEROOT help Build a tar archive of the root filesystem diff --git a/target/tar/tarroot.mk b/target/tar/tarroot.mk index a7e95df98e..d082672ced 100644 --- a/target/tar/tarroot.mk +++ b/target/tar/tarroot.mk @@ -48,12 +48,6 @@ ifneq ($(ROOTFS_TAR_COPYTO),) endif -@rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(TAR_TARGET)) -tarroot-source: - -tarroot-clean: - -tarroot-dirclean: - ############################################################# # # Toplevel Makefile options From 58a02b1e43c79543c3c9f46ad88ef68cc5cc70b0 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 2 Mar 2010 22:45:43 +0100 Subject: [PATCH 22/44] target/ubifs: cleanup, unbroken Use package/mtd to build the host mtd-utils, which contains mkfs.ubifs. Remove dependency on BR2_HOST_FAKEROOT. Signed-off-by: Thomas Petazzoni --- target/ubifs/Config.in | 2 -- target/ubifs/ubifsroot.mk | 50 ++++----------------------------------- 2 files changed, 4 insertions(+), 48 deletions(-) diff --git a/target/ubifs/Config.in b/target/ubifs/Config.in index 886c34bfb1..1ce1ab0180 100644 --- a/target/ubifs/Config.in +++ b/target/ubifs/Config.in @@ -1,7 +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 e73d4f926c..b48e10fd14 100644 --- a/target/ubifs/ubifsroot.mk +++ b/target/ubifs/ubifsroot.mk @@ -1,35 +1,3 @@ -############################################################# -# -# mkfs.ubifs to build to target ubifs filesystems -# -############################################################# -#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 - -$(DL_DIR)/$(MKFS_UBIFS_SOURCE): - $(WGET) -O $(DL_DIR)/$(MKFS_UBIFS_SOURCE) "$(MKFS_UBIFS_URL)" - -$(MKFS_UBIFS_DIR)/.unpacked: $(DL_DIR)/$(MKFS_UBIFS_SOURCE) - $(ZCAT) $(DL_DIR)/$(MKFS_UBIFS_SOURCE) | tar -C $(BUILD_DIR) -xvf - - mv $(BUILD_DIR)/$(MKFS_UBIFS_NAME) $(MKFS_UBIFS_DIR) - 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) - touch -c $@ - -mkfs.ubifs-dirclean: - rm -rf $(MKFS_UBIFS_DIR) - -mkfs.ubifs: $(MKFS_UBIFS_DIR)/mkfs.ubifs - ############################################################# # # Build the ubifs root filesystem image @@ -56,17 +24,15 @@ UBIFS_ROOTFS_COMPRESSOR_PREREQ:= ifeq ($(BR2_TARGET_ROOTFS_UBIFS_GZIP),y) UBIFS_ROOTFS_COMPRESSOR:=gzip -9 -c UBIFS_ROOTFS_COMPRESSOR_EXT:=gz -#UBIFS_ROOTFS_COMPRESSOR_PREREQ:= gzip-host endif ifeq ($(BR2_TARGET_ROOTFS_UBIFS_BZIP2),y) UBIFS_ROOTFS_COMPRESSOR:=bzip2 -9 -c UBIFS_ROOTFS_COMPRESSOR_EXT:=bz2 -#UBIFS_ROOTFS_COMPRESSOR_PREREQ:= bzip2-host endif ifeq ($(BR2_TARGET_ROOTFS_UBIFS_LZMA),y) -UBIFS_ROOTFS_COMPRESSOR:=lzma -9 -c +UBIFS_ROOTFS_COMPRESSOR:=$(LZMA) -9 -c UBIFS_ROOTFS_COMPRESSOR_EXT:=lzma -UBIFS_ROOTFS_COMPRESSOR_PREREQ:= lzma-host +UBIFS_ROOTFS_COMPRESSOR_PREREQ:= host-lzma endif ifneq ($(UBIFS_ROOTFS_COMPRESSOR),) @@ -75,7 +41,7 @@ else UBIFS_TARGET := $(UBIFS_BASE) endif -$(UBIFS_BASE): host-fakeroot makedevs mkfs.ubifs +$(UBIFS_BASE): host-fakeroot host-mtd makedevs # Use fakeroot to pretend all target binaries are owned by root rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(UBIFS_TARGET)) touch $(BUILD_DIR)/.fakeroot.00000 @@ -87,7 +53,7 @@ ifneq ($(TARGET_DEVICE_TABLE),) >> $(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 "$(HOST_DIR)/usr/sbin/mkfs.ubifs -d $(TARGET_DIR) " \ "$(UBIFS_OPTS) -o $(UBIFS_BASE)" >> $(BUILD_DIR)/_fakeroot.$(notdir $(UBIFS_TARGET)) chmod a+x $(BUILD_DIR)/_fakeroot.$(notdir $(UBIFS_TARGET)) $(HOST_DIR)/usr/bin/fakeroot -- $(BUILD_DIR)/_fakeroot.$(notdir $(UBIFS_TARGET)) @@ -106,14 +72,6 @@ ifneq ($(UBIFS_COPYTO),) @cp -f $(UBIFS_TARGET) $(UBIFS_COPYTO) endif -ubifsroot-source: $(DL_DIR)/$(MKFS_UBIFS_SOURCE) - -ubifsroot-clean: - -$(MAKE) -C $(MKFS_UBIFS_DIR) clean - -ubifsroot-dirclean: - rm -rf $(MKFS_UBIFS_DIR) - ############################################################# # # Toplevel Makefile options From 0bdaf0679677291ba363e1ac01cb2bb774d55f29 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 2 Mar 2010 22:56:33 +0100 Subject: [PATCH 23/44] fakeroot: convert to the autotools infrastructure Signed-off-by: Thomas Petazzoni --- package/fakeroot/Config.in | 4 -- package/fakeroot/fakeroot.mk | 126 ++++------------------------------- 2 files changed, 13 insertions(+), 117 deletions(-) diff --git a/package/fakeroot/Config.in b/package/fakeroot/Config.in index 679b6b2ca8..186b717d4e 100644 --- a/package/fakeroot/Config.in +++ b/package/fakeroot/Config.in @@ -4,7 +4,3 @@ config BR2_PACKAGE_FAKEROOT Run commands in an environment faking root privileges. http://joostje.op.het.net/fakeroot/ - -# dummy for fakeroot-source -config BR2_HOST_FAKEROOT - bool diff --git a/package/fakeroot/fakeroot.mk b/package/fakeroot/fakeroot.mk index d525a4f620..a8eff52253 100644 --- a/package/fakeroot/fakeroot.mk +++ b/package/fakeroot/fakeroot.mk @@ -6,125 +6,25 @@ FAKEROOT_VERSION:=1.9.5 FAKEROOT_SOURCE:=fakeroot_$(FAKEROOT_VERSION).tar.gz FAKEROOT_SITE:=http://snapshot.debian.net/archive/2008/04/27/debian/pool/main/f/fakeroot/ -FAKEROOT_CAT:=$(ZCAT) -FAKEROOT_SOURCE_DIR:=$(BUILD_DIR)/fakeroot-$(FAKEROOT_VERSION) -FAKEROOT_DIR1:=$(BUILD_DIR)/fakeroot-$(FAKEROOT_VERSION)-host -FAKEROOT_DIR2:=$(BUILD_DIR)/fakeroot-$(FAKEROOT_VERSION)-target +FAKEROOT_LIBTOOL_PATCH=NO +HOST_FAKEROOT_LIBTOOL_PATCH=NO -$(DL_DIR)/$(FAKEROOT_SOURCE): - $(call DOWNLOAD,$(FAKEROOT_SITE),$(FAKEROOT_SOURCE)) - -fakeroot-source: $(DL_DIR)/$(FAKEROOT_SOURCE) - -$(FAKEROOT_SOURCE_DIR)/.unpacked: $(DL_DIR)/$(FAKEROOT_SOURCE) - $(FAKEROOT_CAT) $(DL_DIR)/$(FAKEROOT_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - +define FAKEROOT_PATCH_FAKEROOT_IN # If using busybox getopt, make it be quiet. $(SED) "s,getopt --version,getopt --version 2>/dev/null," \ - $(FAKEROOT_SOURCE_DIR)/scripts/fakeroot.in - toolchain/patch-kernel.sh $(FAKEROOT_SOURCE_DIR) package/fakeroot/ \*.patch - touch $@ + $(@D)/scripts/fakeroot.in +endef +FAKEROOT_POST_PATCH_HOOKS += FAKEROOT_PATCH_FAKEROOT_IN -############################################################# -# -# build fakeroot for use on the host system -# -############################################################# - -$(FAKEROOT_DIR1)/.configured: $(FAKEROOT_SOURCE_DIR)/.unpacked - mkdir -p $(FAKEROOT_DIR1) - (cd $(FAKEROOT_DIR1); rm -rf config.cache; \ - CC="$(HOSTCC)" \ - $(FAKEROOT_SOURCE_DIR)/configure $(QUIET) \ - --prefix=$(HOST_DIR)/usr \ - ) - touch $@ - -$(FAKEROOT_DIR1)/faked: $(FAKEROOT_DIR1)/.configured - $(MAKE) -C $(FAKEROOT_DIR1) - touch -c $@ - -$(HOST_DIR)/usr/bin/fakeroot: $(FAKEROOT_DIR1)/faked - $(MAKE) -C $(FAKEROOT_DIR1) install - touch -c $@ - -host-fakeroot: $(HOST_DIR)/usr/bin/fakeroot - -host-fakeroot-clean: - -$(MAKE) -C $(FAKEROOT_DIR1) clean - -host-fakeroot-dirclean: - rm -rf $(FAKEROOT_DIR1) - - -############################################################# -# -# build fakeroot for use on the target system -# -############################################################# - -$(FAKEROOT_DIR2)/.configured: $(FAKEROOT_SOURCE_DIR)/.unpacked - mkdir -p $(FAKEROOT_DIR2) - (cd $(FAKEROOT_DIR2); rm -rf config.cache; \ - $(TARGET_CONFIGURE_OPTS) \ - $(TARGET_CONFIGURE_ARGS) \ - $(FAKEROOT_SOURCE_DIR)/configure $(QUIET) \ - --target=$(GNU_TARGET_NAME) \ - --host=$(GNU_TARGET_NAME) \ - --build=$(GNU_HOST_NAME) \ - --prefix=/usr \ - --exec-prefix=/usr \ - --bindir=/usr/bin \ - --sbindir=/usr/sbin \ - --libdir=/usr/lib/libfakeroot \ - --sysconfdir=/etc \ - --datadir=/usr/share \ - --localstatedir=/var \ - --mandir=/usr/share/man \ - --infodir=/usr/share/info \ - $(DISABLE_NLS) \ - ) - touch $@ - -$(FAKEROOT_DIR2)/faked: $(FAKEROOT_DIR2)/.configured - $(MAKE) CC=$(TARGET_CC) -C $(FAKEROOT_DIR2) - touch -c $@ - -$(TARGET_DIR)/usr/bin/fakeroot: $(FAKEROOT_DIR2)/faked - $(MAKE) DESTDIR=$(TARGET_DIR) -C $(FAKEROOT_DIR2) install - -mv $(TARGET_DIR)/usr/bin/$(ARCH)-linux-faked \ +define FAKEROOT_RENAME_TARGET_BINARIES + -mv $(TARGET_DIR)/usr/bin/$(ARCH)-*-faked \ $(TARGET_DIR)/usr/bin/faked - -mv $(TARGET_DIR)/usr/bin/$(ARCH)-linux-fakeroot \ + -mv $(TARGET_DIR)/usr/bin/$(ARCH)-*-fakeroot \ $(TARGET_DIR)/usr/bin/fakeroot -ifneq ($(BR2_HAVE_INFOPAGES),y) - rm -rf $(TARGET_DIR)/usr/share/info -endif -ifneq ($(BR2_HAVE_MANPAGES),y) - rm -rf $(TARGET_DIR)/usr/share/man -endif - rm -rf $(TARGET_DIR)/share/locale - rm -rf $(TARGET_DIR)/usr/share/doc - touch -c $@ +endef -fakeroot: $(TARGET_DIR)/usr/bin/fakeroot +FAKEROOT_POST_INSTALL_TARGET_HOOKS += FAKEROOT_RENAME_TARGET_BINARIES -fakeroot-clean: - -$(MAKE) -C $(FAKEROOT_DIR2) clean - rm -f $(TARGET_DIR)/usr/bin/fake{d,root} - -fakeroot-dirclean: - rm -rf $(FAKEROOT_DIR2) - - -############################################################# -# -# Toplevel Makefile options -# -############################################################# -ifeq ($(BR2_PACKAGE_FAKEROOT),y) -TARGETS+=fakeroot -endif - -ifeq ($(BR2_HOST_FAKEROOT),y) -HOST_SOURCE+=fakeroot-source -endif +$(eval $(call AUTOTARGETS,package,fakeroot)) +$(eval $(call AUTOTARGETS,package,fakeroot,host)) From 77ab5443080dd994dd9dbe9c9eec302f83525dde Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 2 Mar 2010 22:57:58 +0100 Subject: [PATCH 24/44] fakeroot: remove all references to BR2_HOST_FAKEROOT Signed-off-by: Thomas Petazzoni --- configs/at91rm9200df_defconfig | 1 - configs/at91rm9200df_ext_defconfig | 1 - configs/at91sam9260dfc_defconfig | 1 - configs/at91sam9260dfc_ext_defconfig | 1 - configs/at91sam9260pf_defconfig | 1 - configs/at91sam9261ek_defconfig | 1 - configs/at91sam9261ek_ext_defconfig | 1 - configs/at91sam9263ek_defconfig | 1 - configs/at91sam9263ek_ext_defconfig | 1 - configs/at91sam9g20dfc_defconfig | 1 - configs/at91sam9g20dfc_ext_defconfig | 1 - configs/atngw100-base_defconfig | 1 - configs/atngw100_defconfig | 1 - configs/atstk1005_defconfig | 1 - configs/atstk100x_defconfig | 1 - configs/i386_defconfig | 1 - configs/i686_defconfig | 1 - configs/integrator926_defconfig | 1 - configs/integrator926_huge_defconfig | 1 - configs/kb9202_defconfig | 1 - configs/v100sc2_defconfig | 1 - scripts/test/Config.in.test.buildall | 1 - target/xtensa/defconfig | 1 - 23 files changed, 23 deletions(-) diff --git a/configs/at91rm9200df_defconfig b/configs/at91rm9200df_defconfig index 3d98b0f6b9..d5c5249068 100644 --- a/configs/at91rm9200df_defconfig +++ b/configs/at91rm9200df_defconfig @@ -353,7 +353,6 @@ BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-1.13.x.config" # BR2_PACKAGE_DISTCC is not set # BR2_PACKAGE_DMALLOC is not set # BR2_PACKAGE_FAKEROOT is not set -BR2_HOST_FAKEROOT=y BR2_PACKAGE_GETTEXT=y # BR2_PACKAGE_GETTEXT_STATIC is not set BR2_PACKAGE_LIBINTL=y diff --git a/configs/at91rm9200df_ext_defconfig b/configs/at91rm9200df_ext_defconfig index 1dea062c9c..ca03b76729 100644 --- a/configs/at91rm9200df_ext_defconfig +++ b/configs/at91rm9200df_ext_defconfig @@ -278,7 +278,6 @@ BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-1.13.x.config" # BR2_PACKAGE_DISTCC is not set # BR2_PACKAGE_DMALLOC is not set # BR2_PACKAGE_FAKEROOT is not set -BR2_HOST_FAKEROOT=y BR2_PACKAGE_GETTEXT=y # BR2_PACKAGE_GETTEXT_STATIC is not set BR2_PACKAGE_LIBINTL=y diff --git a/configs/at91sam9260dfc_defconfig b/configs/at91sam9260dfc_defconfig index 1b4094e42d..2d8961c75d 100644 --- a/configs/at91sam9260dfc_defconfig +++ b/configs/at91sam9260dfc_defconfig @@ -365,7 +365,6 @@ BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-1.13.x.config" # BR2_PACKAGE_DISTCC is not set # BR2_PACKAGE_DMALLOC is not set # BR2_PACKAGE_FAKEROOT is not set -BR2_HOST_FAKEROOT=y BR2_PACKAGE_GETTEXT=y # BR2_PACKAGE_GETTEXT_STATIC is not set BR2_PACKAGE_LIBINTL=y diff --git a/configs/at91sam9260dfc_ext_defconfig b/configs/at91sam9260dfc_ext_defconfig index 14bdc7aeca..ddd4b422b8 100644 --- a/configs/at91sam9260dfc_ext_defconfig +++ b/configs/at91sam9260dfc_ext_defconfig @@ -286,7 +286,6 @@ BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-1.13.x.config" # BR2_PACKAGE_DISTCC is not set # BR2_PACKAGE_DMALLOC is not set # BR2_PACKAGE_FAKEROOT is not set -BR2_HOST_FAKEROOT=y BR2_PACKAGE_GETTEXT=y # BR2_PACKAGE_GETTEXT_STATIC is not set BR2_PACKAGE_LIBINTL=y diff --git a/configs/at91sam9260pf_defconfig b/configs/at91sam9260pf_defconfig index de513a6810..17477d224f 100644 --- a/configs/at91sam9260pf_defconfig +++ b/configs/at91sam9260pf_defconfig @@ -275,7 +275,6 @@ BR2_PACKAGE_DISTCC=y BR2_PACKAGE_DMALLOC=y BR2_PACKAGE_EXPAT=y # BR2_PACKAGE_FAKEROOT is not set -BR2_HOST_FAKEROOT=y BR2_PACKAGE_GETTEXT=y # BR2_PACKAGE_GETTEXT_STATIC is not set BR2_PACKAGE_LIBINTL=y diff --git a/configs/at91sam9261ek_defconfig b/configs/at91sam9261ek_defconfig index 9598085b99..824a503378 100644 --- a/configs/at91sam9261ek_defconfig +++ b/configs/at91sam9261ek_defconfig @@ -359,7 +359,6 @@ BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-1.13.x.config" # BR2_PACKAGE_DISTCC is not set # BR2_PACKAGE_DMALLOC is not set # BR2_PACKAGE_FAKEROOT is not set -BR2_HOST_FAKEROOT=y BR2_PACKAGE_GETTEXT=y # BR2_PACKAGE_GETTEXT_STATIC is not set BR2_PACKAGE_LIBINTL=y diff --git a/configs/at91sam9261ek_ext_defconfig b/configs/at91sam9261ek_ext_defconfig index e7da95ad81..3ee047cdd0 100644 --- a/configs/at91sam9261ek_ext_defconfig +++ b/configs/at91sam9261ek_ext_defconfig @@ -317,7 +317,6 @@ BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-1.13.x.config" # BR2_PACKAGE_DISTCC is not set # BR2_PACKAGE_DMALLOC is not set # BR2_PACKAGE_FAKEROOT is not set -BR2_HOST_FAKEROOT=y BR2_PACKAGE_GETTEXT=y # BR2_PACKAGE_GETTEXT_STATIC is not set BR2_PACKAGE_LIBINTL=y diff --git a/configs/at91sam9263ek_defconfig b/configs/at91sam9263ek_defconfig index 145700da69..8dff3e4b82 100644 --- a/configs/at91sam9263ek_defconfig +++ b/configs/at91sam9263ek_defconfig @@ -358,7 +358,6 @@ BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-1.13.x.config" # BR2_PACKAGE_DISTCC is not set # BR2_PACKAGE_DMALLOC is not set # BR2_PACKAGE_FAKEROOT is not set -BR2_HOST_FAKEROOT=y BR2_PACKAGE_GETTEXT=y # BR2_PACKAGE_GETTEXT_STATIC is not set BR2_PACKAGE_LIBINTL=y diff --git a/configs/at91sam9263ek_ext_defconfig b/configs/at91sam9263ek_ext_defconfig index 15b4d3b172..a84cc7a432 100644 --- a/configs/at91sam9263ek_ext_defconfig +++ b/configs/at91sam9263ek_ext_defconfig @@ -279,7 +279,6 @@ BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-1.13.x.config" # BR2_PACKAGE_DISTCC is not set # BR2_PACKAGE_DMALLOC is not set # BR2_PACKAGE_FAKEROOT is not set -BR2_HOST_FAKEROOT=y BR2_PACKAGE_GETTEXT=y # BR2_PACKAGE_GETTEXT_STATIC is not set BR2_PACKAGE_LIBINTL=y diff --git a/configs/at91sam9g20dfc_defconfig b/configs/at91sam9g20dfc_defconfig index a6ef10c959..3f7da329b6 100644 --- a/configs/at91sam9g20dfc_defconfig +++ b/configs/at91sam9g20dfc_defconfig @@ -358,7 +358,6 @@ BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-1.13.x.config" # BR2_PACKAGE_DISTCC is not set # BR2_PACKAGE_DMALLOC is not set # BR2_PACKAGE_FAKEROOT is not set -BR2_HOST_FAKEROOT=y BR2_PACKAGE_GETTEXT=y # BR2_PACKAGE_GETTEXT_STATIC is not set BR2_PACKAGE_LIBINTL=y diff --git a/configs/at91sam9g20dfc_ext_defconfig b/configs/at91sam9g20dfc_ext_defconfig index 96d9793481..84d703adeb 100644 --- a/configs/at91sam9g20dfc_ext_defconfig +++ b/configs/at91sam9g20dfc_ext_defconfig @@ -286,7 +286,6 @@ BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-1.13.x.config" # BR2_PACKAGE_DISTCC is not set # BR2_PACKAGE_DMALLOC is not set # BR2_PACKAGE_FAKEROOT is not set -BR2_HOST_FAKEROOT=y BR2_PACKAGE_GETTEXT=y # BR2_PACKAGE_GETTEXT_STATIC is not set BR2_PACKAGE_LIBINTL=y diff --git a/configs/atngw100-base_defconfig b/configs/atngw100-base_defconfig index 6fbc0deb9f..adae5c6a96 100644 --- a/configs/atngw100-base_defconfig +++ b/configs/atngw100-base_defconfig @@ -275,7 +275,6 @@ BR2_PACKAGE_BUSYBOX_SKELETON=y # BR2_PACKAGE_DISTCC is not set # BR2_PACKAGE_DMALLOC is not set # BR2_PACKAGE_FAKEROOT is not set -BR2_HOST_FAKEROOT=y # BR2_PACKAGE_GETTEXT is not set # BR2_PACKAGE_LIBINTL is not set # BR2_PACKAGE_LIBGMP is not set diff --git a/configs/atngw100_defconfig b/configs/atngw100_defconfig index 7a6cba41b4..0c7639885d 100644 --- a/configs/atngw100_defconfig +++ b/configs/atngw100_defconfig @@ -286,7 +286,6 @@ BR2_PACKAGE_BUSYBOX_SKELETON=y # BR2_PACKAGE_DISTCC is not set # BR2_PACKAGE_DMALLOC is not set # BR2_PACKAGE_FAKEROOT is not set -BR2_HOST_FAKEROOT=y BR2_PACKAGE_GETTEXT=y BR2_PACKAGE_LIBINTL=y # BR2_PACKAGE_LIBGMP is not set diff --git a/configs/atstk1005_defconfig b/configs/atstk1005_defconfig index 309ac08288..8044b388dc 100644 --- a/configs/atstk1005_defconfig +++ b/configs/atstk1005_defconfig @@ -297,7 +297,6 @@ BR2_PACKAGE_BUSYBOX_SKELETON=y # BR2_PACKAGE_DISTCC is not set # BR2_PACKAGE_DMALLOC is not set # BR2_PACKAGE_FAKEROOT is not set -BR2_HOST_FAKEROOT=y BR2_PACKAGE_GETTEXT=y BR2_PACKAGE_LIBINTL=y # BR2_PACKAGE_LIBGMP is not set diff --git a/configs/atstk100x_defconfig b/configs/atstk100x_defconfig index b4abff9fe2..aac5aa8f85 100644 --- a/configs/atstk100x_defconfig +++ b/configs/atstk100x_defconfig @@ -297,7 +297,6 @@ BR2_PACKAGE_BZIP2=y # BR2_PACKAGE_DISTCC is not set # BR2_PACKAGE_DMALLOC is not set # BR2_PACKAGE_FAKEROOT is not set -BR2_HOST_FAKEROOT=y BR2_PACKAGE_GETTEXT=y BR2_PACKAGE_LIBINTL=y # BR2_PACKAGE_LIBGMP is not set diff --git a/configs/i386_defconfig b/configs/i386_defconfig index 97067c486d..f4506f128c 100644 --- a/configs/i386_defconfig +++ b/configs/i386_defconfig @@ -285,7 +285,6 @@ BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-1.13.x.config" # BR2_PACKAGE_DISTCC is not set # BR2_PACKAGE_DMALLOC is not set # BR2_PACKAGE_FAKEROOT is not set -BR2_HOST_FAKEROOT=y # BR2_PACKAGE_GETTEXT is not set # BR2_PACKAGE_LIBINTL is not set # BR2_PACKAGE_LIBGMP is not set diff --git a/configs/i686_defconfig b/configs/i686_defconfig index a3a26839ab..fc1f2788fe 100644 --- a/configs/i686_defconfig +++ b/configs/i686_defconfig @@ -285,7 +285,6 @@ BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-1.13.x.config" # BR2_PACKAGE_DISTCC is not set # BR2_PACKAGE_DMALLOC is not set # BR2_PACKAGE_FAKEROOT is not set -BR2_HOST_FAKEROOT=y # BR2_PACKAGE_GETTEXT is not set # BR2_PACKAGE_LIBINTL is not set # BR2_PACKAGE_LIBGMP is not set diff --git a/configs/integrator926_defconfig b/configs/integrator926_defconfig index 63bc68dae1..e985df460a 100644 --- a/configs/integrator926_defconfig +++ b/configs/integrator926_defconfig @@ -282,7 +282,6 @@ BR2_PACKAGE_BUSYBOX_SKELETON=y # BR2_PACKAGE_DISTCC is not set # BR2_PACKAGE_DMALLOC is not set # BR2_PACKAGE_FAKEROOT is not set -BR2_HOST_FAKEROOT=y # BR2_PACKAGE_GETTEXT is not set # BR2_PACKAGE_LIBINTL is not set # BR2_PACKAGE_LIBGMP is not set diff --git a/configs/integrator926_huge_defconfig b/configs/integrator926_huge_defconfig index 357e143316..b0d1dfe72b 100644 --- a/configs/integrator926_huge_defconfig +++ b/configs/integrator926_huge_defconfig @@ -286,7 +286,6 @@ BR2_PACKAGE_BISON=y # BR2_PACKAGE_DISTCC is not set # BR2_PACKAGE_DMALLOC is not set # BR2_PACKAGE_FAKEROOT is not set -BR2_HOST_FAKEROOT=y BR2_PACKAGE_GETTEXT=y # BR2_PACKAGE_GETTEXT_STATIC is not set BR2_PACKAGE_LIBINTL=y diff --git a/configs/kb9202_defconfig b/configs/kb9202_defconfig index 608eb86959..3a0dfd691c 100644 --- a/configs/kb9202_defconfig +++ b/configs/kb9202_defconfig @@ -286,7 +286,6 @@ BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y # BR2_PACKAGE_DISTCC is not set # BR2_PACKAGE_DMALLOC is not set # BR2_PACKAGE_FAKEROOT is not set -BR2_HOST_FAKEROOT=y # BR2_PACKAGE_GETTEXT is not set # BR2_PACKAGE_LIBINTL is not set # BR2_PACKAGE_LIBGMP is not set diff --git a/configs/v100sc2_defconfig b/configs/v100sc2_defconfig index 336953ebf1..3c2afa4549 100644 --- a/configs/v100sc2_defconfig +++ b/configs/v100sc2_defconfig @@ -267,7 +267,6 @@ BR2_PACKAGE_BASH=y # BR2_PACKAGE_DISTCC is not set # BR2_PACKAGE_DMALLOC is not set # BR2_PACKAGE_FAKEROOT is not set -BR2_HOST_FAKEROOT=y BR2_PACKAGE_GETTEXT=y BR2_PACKAGE_LIBINTL=y # BR2_PACKAGE_LIBGMP is not set diff --git a/scripts/test/Config.in.test.buildall b/scripts/test/Config.in.test.buildall index b5bb0501f6..1acb466df9 100644 --- a/scripts/test/Config.in.test.buildall +++ b/scripts/test/Config.in.test.buildall @@ -29,7 +29,6 @@ config BR2_TARGET_TEST_PACKAGES select BR2_PACKAGE_DISTCC select BR2_PACKAGE_DMALLOC select BR2_PACKAGE_FAKEROOT - select BR2_HOST_FAKEROOT select BR2_PACKAGE_GETTEXT select BR2_PACKAGE_GETTEXT_STATIC select BR2_PACKAGE_LIBINTL diff --git a/target/xtensa/defconfig b/target/xtensa/defconfig index 07ab10bf41..f9b53a36c9 100644 --- a/target/xtensa/defconfig +++ b/target/xtensa/defconfig @@ -94,7 +94,6 @@ BR2_TOOLCHAIN_BUILDROOT=y # # Other development stuff # -BR2_HOST_FAKEROOT=y # BR2_PACKAGE_LIBINTL is not set # For NFS mount: BR2_PACKAGE_PORTMAP=y From b605699f1f365c55d094c47737d3f5f7e38c1f61 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 2 Mar 2010 23:10:49 +0100 Subject: [PATCH 25/44] target/: remove the COPYTO mess There's no need to provide options to copy the filesystem image after the build. Just use 'cp' outside of Buildroot. Signed-off-by: Thomas Petazzoni --- target/cpio/Config.in | 9 --------- target/cpio/cpioroot.mk | 10 ---------- target/ext2/Config.in | 8 -------- target/ext2/ext2root.mk | 6 ------ target/jffs2/Config.in | 6 ------ target/jffs2/jffs2root.mk | 5 ----- target/tar/Config.in | 11 ----------- target/tar/tarroot.mk | 4 ---- target/ubifs/Config.in | 8 -------- target/ubifs/ubifsroot.mk | 5 ----- 10 files changed, 72 deletions(-) diff --git a/target/cpio/Config.in b/target/cpio/Config.in index 4ee1037d4a..02fd00d342 100644 --- a/target/cpio/Config.in +++ b/target/cpio/Config.in @@ -38,12 +38,3 @@ config BR2_TARGET_ROOTFS_CPIO_LZMA endchoice -config BR2_TARGET_ROOTFS_CPIO_COPYTO - string "also copy the image to..." - depends on BR2_TARGET_ROOTFS_CPIO - default "" - help - Copies the resulting image to a secondary location - like a tftp server's root directory. - - Example: $(IMAGE)-$(DATE).cpio$(CPIO_ROOTFS_COMPRESSOR_EXT) diff --git a/target/cpio/cpioroot.mk b/target/cpio/cpioroot.mk index 021847ffd5..0984b725f0 100644 --- a/target/cpio/cpioroot.mk +++ b/target/cpio/cpioroot.mk @@ -29,8 +29,6 @@ else CPIO_TARGET := $(CPIO_BASE) endif -ROOTFS_CPIO_COPYTO:=$(call qstrip,$(BR2_TARGET_ROOTFS_CPIO_COPYTO)) - cpioroot-init: rm -f $(TARGET_DIR)/init ln -s sbin/init $(TARGET_DIR)/init @@ -52,18 +50,10 @@ endif chmod a+x $(BUILD_DIR)/_fakeroot.$(notdir $(CPIO_BASE)) $(HOST_DIR)/usr/bin/fakeroot -- $(BUILD_DIR)/_fakeroot.$(notdir $(CPIO_BASE)) -@rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(CPIO_BASE)) -ifeq ($(CPIO_ROOTFS_COMPRESSOR),) -ifneq ($(ROOTFS_CPIO_COPYTO),) - $(Q)cp -f $(CPIO_BASE) $(ROOTFS_CPIO_COPYTO) -endif -endif ifneq ($(CPIO_ROOTFS_COMPRESSOR),) $(CPIO_BASE).$(CPIO_ROOTFS_COMPRESSOR_EXT): $(CPIO_ROOTFS_COMPRESSOR_PREREQ) $(CPIO_BASE) $(CPIO_ROOTFS_COMPRESSOR) $(CPIO_BASE) > $(CPIO_TARGET) -ifneq ($(ROOTFS_CPIO_COPYTO),) - $(Q)cp -f $(CPIO_BASE).$(CPIO_ROOTFS_COMPRESSOR_EXT) $(ROOTFS_CPIO_COPYTO).$(CPIO_ROOTFS_COMPRESSOR_EXT) -endif endif ############################################################# diff --git a/target/ext2/Config.in b/target/ext2/Config.in index 1b1dc8a215..0047309040 100644 --- a/target/ext2/Config.in +++ b/target/ext2/Config.in @@ -64,11 +64,3 @@ config BR2_TARGET_ROOTFS_EXT2_LZMA endchoice -config BR2_TARGET_ROOTFS_EXT2_COPYTO - string "also copy the image to..." - depends on BR2_TARGET_ROOTFS_EXT2 - default "" - help - Copies the resulting image to a secondary location - like a tftp server's root directory. - diff --git a/target/ext2/ext2root.mk b/target/ext2/ext2root.mk index 6c8e02a9ba..145b182fe0 100644 --- a/target/ext2/ext2root.mk +++ b/target/ext2/ext2root.mk @@ -82,13 +82,7 @@ $(EXT2_BASE).$(EXT2_ROOTFS_COMPRESSOR_EXT): $(EXT2_ROOTFS_COMPRESSOR_PREREQ) $(E $(EXT2_ROOTFS_COMPRESSOR) $(EXT2_BASE) > $(EXT2_TARGET) endif -EXT2_COPYTO := $(call qstrip,$(BR2_TARGET_ROOTFS_EXT2_COPYTO)) - ext2root: $(EXT2_TARGET) - @ls -l $(EXT2_TARGET) -ifneq ($(EXT2_COPYTO),) - @cp -f $(EXT2_TARGET) $(EXT2_COPYTO) -endif ############################################################# # diff --git a/target/jffs2/Config.in b/target/jffs2/Config.in index bf4ac60798..a216a27f04 100644 --- a/target/jffs2/Config.in +++ b/target/jffs2/Config.in @@ -118,10 +118,4 @@ config BR2_TARGET_ROOTFS_JFFS2_OUTPUT string "Output File" default "$(IMAGE).jffs2" -config BR2_TARGET_ROOTFS_JFFS2_COPYTO - string "also copy the image to..." - default "" - help - Copies the resulting image to a secondary location. - endif diff --git a/target/jffs2/jffs2root.mk b/target/jffs2/jffs2root.mk index 30ac86ddfe..eea0e3a490 100644 --- a/target/jffs2/jffs2root.mk +++ b/target/jffs2/jffs2root.mk @@ -74,12 +74,7 @@ ifeq ($(BR2_JFFS2_TARGET_SREC),y) @ls -l $(JFFS2_TARGET).srec endif -JFFS2_COPYTO := $(call qstrip,$(BR2_TARGET_ROOTFS_JFFS2_COPYTO)) - jffs2root: $(JFFS2_TARGET) -ifneq ($(JFFS2_COPYTO),) - @cp -f $(JFFS2_TARGET) $(JFFS2_COPYTO) -endif ############################################################# # diff --git a/target/tar/Config.in b/target/tar/Config.in index ae024094ac..0adca795f0 100644 --- a/target/tar/Config.in +++ b/target/tar/Config.in @@ -45,14 +45,3 @@ config BR2_TARGET_ROOTFS_TAR_OPTIONS help Any other flags you want to pass to tar Refer to tar --help for details - -config BR2_TARGET_ROOTFS_TAR_COPYTO - string "also copy the image to..." - depends on BR2_TARGET_ROOTFS_TAR - default "" - help - Copies the resulting image to a secondary location - like a tftp server's root directory. - - Example: $(IMAGE)-$(DATE).tar - diff --git a/target/tar/tarroot.mk b/target/tar/tarroot.mk index d082672ced..cd01bc74f7 100644 --- a/target/tar/tarroot.mk +++ b/target/tar/tarroot.mk @@ -21,7 +21,6 @@ ifeq ($(BR2_TARGET_ROOTFS_TAR_LZMA),y) TAR_COMPRESSOR:=lzma -9 -c TAR_COMPRESSOR_EXT:=lzma endif -ROOTFS_TAR_COPYTO:=$(call qstrip,$(BR2_TARGET_ROOTFS_TAR_COPYTO)) tarroot: host-fakeroot makedevs # Use fakeroot to pretend all target binaries are owned by root @@ -42,9 +41,6 @@ endif ifneq ($(TAR_COMPRESSOR),) -rm -f $(TAR_TARGET).$() PATH="$(STAGING_DIR)/sbin:$(STAGING_DIR)/bin:$(STAGING_DIR)/usr/sbin:$(STAGING_DIR)/usr/bin:$(PATH)" $(TAR_COMPRESSOR) $(TAR_TARGET) > $(TAR_TARGET).$(TAR_COMPRESSOR_EXT) -endif -ifneq ($(ROOTFS_TAR_COPYTO),) - $(Q)cp -f $(TAR_TARGET) $(ROOTFS_TAR_COPYTO) endif -@rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(TAR_TARGET)) diff --git a/target/ubifs/Config.in b/target/ubifs/Config.in index 1ce1ab0180..3222fea7b7 100644 --- a/target/ubifs/Config.in +++ b/target/ubifs/Config.in @@ -91,11 +91,3 @@ config BR2_TARGET_ROOTFS_UBIFS_LZMA endchoice -config BR2_TARGET_ROOTFS_UBIFS_COPYTO - string "also copy the image to..." - depends on BR2_TARGET_ROOTFS_UBIFS - default "" - help - Copies the resulting image to a secondary location - like a tftp server's root directory. - diff --git a/target/ubifs/ubifsroot.mk b/target/ubifs/ubifsroot.mk index b48e10fd14..d0f3885f41 100644 --- a/target/ubifs/ubifsroot.mk +++ b/target/ubifs/ubifsroot.mk @@ -64,13 +64,8 @@ $(UBIFS_BASE).$(UBIFS_ROOTFS_COMPRESSOR_EXT): $(UBIFS_ROOTFS_COMPRESSOR_PREREQ) $(UBIFS_ROOTFS_COMPRESSOR) $(UBIFS_BASE) > $(UBIFS_TARGET) endif -UBIFS_COPYTO := $(call qstrip,$(BR2_TARGET_ROOTFS_UBIFS_COPYTO)) - ubifsroot: $(UBIFS_TARGET) @ls -l $(UBIFS_TARGET) -ifneq ($(UBIFS_COPYTO),) - @cp -f $(UBIFS_TARGET) $(UBIFS_COPYTO) -endif ############################################################# # From 21f3bcc1868022e990c0d7ec4171727722b41fd9 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 10 Mar 2010 00:11:58 +0100 Subject: [PATCH 26/44] target: Add new infrastructure for filesystem generation In order to avoid code duplication between the different filesystem generation makefile, we introduce a ROOTFS_TARGET macro. Documentation for this macro is contained in the patch. Signed-off-by: Thomas Petazzoni --- target/Makefile.in | 1 + target/common.mk | 68 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 target/common.mk diff --git a/target/Makefile.in b/target/Makefile.in index df980b4739..38993e5d8e 100644 --- a/target/Makefile.in +++ b/target/Makefile.in @@ -63,6 +63,7 @@ include target/u-boot/Makefile.in endif # and finally build the filesystems/tarballs +include target/common.mk include target/*/*.mk # kernel rules diff --git a/target/common.mk b/target/common.mk new file mode 100644 index 0000000000..c7eff7435a --- /dev/null +++ b/target/common.mk @@ -0,0 +1,68 @@ +# +# Macro that builds the needed Makefile target to create a root +# filesystem image. +# +# The following variable must be defined before calling this macro +# +# ROOTFS_$(FSTYPE)_CMD, the command that generates the root +# filesystem image. A single command is allowed. The filename of the +# filesystem image that it must generate is $$@. +# +# The following variables can optionaly be defined +# +# ROOTFS_$(FSTYPE)_DEPENDENCIES, the list of dependencies needed to +# build the root filesystem (usually host tools) +# +# ROOTFS_$(FSTYPE)_PRE_GEN_HOOKS, a list of hooks to call before +# generating the filesystem image +# +# ROOTFS_$(FSTYPE)_POST_GEN_HOOKS, a list of hooks to call after +# generating the filesystem image +# +# In terms of configuration option, this macro assumes that the +# BR2_TARGET_ROOTFS_$(FSTYPE) config option allows to enable/disable +# the generation of a filesystem image of a particular type. If +# configura options BR2_TARGET_ROOTFS_$(FSTYPE)_GZIP, +# BR2_TARGET_ROOTFS_$(FSTYPE)_BZIP2 or +# BR2_TARGET_ROOTFS_$(FSTYPE)_LZMA exist and are enabled, then the +# macro will automatically generate a compressed filesystem image. + +FAKEROOT_SCRIPT = $(BUILD_DIR)/_fakeroot.fs + +define ROOTFS_TARGET_INTERNAL + +$(IMAGE).$(1): $(ROOTFS_$(2)_DEPENDENCIES) host-fakeroot makedevs $(if $(BR2_TARGET_ROOTFS_$(2)_LZMA),host-lzma) + @$(call MESSAGE,"Generating root filesystem image $(IMAGE).$(1)") + $(foreach hook,$(ROOTFS_$(2)_PRE_GEN_HOOKS),$(call $(hook))$(sep)) + rm -f $(FAKEROOT_SCRIPT) + touch $(BUILD_DIR)/.fakeroot.00000 + cat $(BUILD_DIR)/.fakeroot* > $(FAKEROOT_SCRIPT) + echo "chown -R 0:0 $(TARGET_DIR)" >> $(FAKEROOT_SCRIPT) +ifneq ($(TARGET_DEVICE_TABLE),) + echo "$(HOST_DIR)/usr/bin/makedevs -d $(TARGET_DEVICE_TABLE) $(TARGET_DIR)" >> $(FAKEROOT_SCRIPT) +endif + echo "$(ROOTFS_$(2)_CMD)" >> $(FAKEROOT_SCRIPT) + chmod a+x $(FAKEROOT_SCRIPT) + $(HOST_DIR)/usr/bin/fakeroot -- $(FAKEROOT_SCRIPT) + -@rm -f $(FAKEROOT_SCRIPT) + $(foreach hook,$(ROOTFS_$(2)_POST_GEN_HOOKS),$(call $(hook))$(sep)) +ifeq ($$(BR2_TARGET_ROOTFS_$(2)_GZIP),y) + gzip -9 -c $$@ > $$@.gz +endif +ifeq ($$(BR2_TARGET_ROOTFS_$(2)_BZIP2),y) + bzip2 -9 -c $$@ > $$@.bz2 +endif +ifeq ($$(BR2_TARGET_ROOTFS_$(2)_LZMA),y) + $(LZMA) -9 -c $$@ > $$@.lzma +endif + +$(1)-root: $(IMAGE).$(1) + +ifeq ($$(BR2_TARGET_ROOTFS_$(2)),y) +TARGETS += $(1)-root +endif +endef + +define ROOTFS_TARGET +$(call ROOTFS_TARGET_INTERNAL,$(1),$(call UPPERCASE,$(1))) +endef \ No newline at end of file From f57982ffd5c3e5f9abb63867950b148b0d36cfe3 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 10 Mar 2010 00:13:12 +0100 Subject: [PATCH 27/44] cloop: convert to ROOTFS_TARGET infrastructure Signed-off-by: Thomas Petazzoni --- target/cloop/cloop.mk | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/target/cloop/cloop.mk b/target/cloop/cloop.mk index ccdb2b4919..c1d6abb802 100644 --- a/target/cloop/cloop.mk +++ b/target/cloop/cloop.mk @@ -4,26 +4,10 @@ # ############################################################# -CLOOP_TARGET=$(IMAGE).cloop -CLOOP_FAKEROOT_SCRIPT=$(BUILD_DIR)/_fakeroot.$(notdir $(CLOOP_TARGET)) +ROOTFS_CLOOP_DEPENDENCIES = host-cloop host-cdrkit -clooproot: host-cloop host-cdrkit host-fakeroot - rm -f $(CLOOP_FAKEROOT_SCRIPT) - touch $(BUILD_DIR)/.fakeroot.00000 - cat $(BUILD_DIR)/.fakeroot* > $(CLOOP_FAKEROOT_SCRIPT) - # Use fakeroot to pretend all target binaries are owned by root - echo "chown -R 0:0 $(TARGET_DIR)" >> $(CLOOP_FAKEROOT_SCRIPT) -ifneq ($(TARGET_DEVICE_TABLE),) - # Use fakeroot to pretend to create all needed device nodes - echo "$(HOST_DIR)/usr/bin/makedevs -d $(TARGET_DEVICE_TABLE) $(TARGET_DIR)" \ - >> $(CLOOP_FAKEROOT_SCRIPT) -endif - # Use fakeroot so genisoimage believes the previous fakery - echo "$(HOST_DIR)/usr/bin/genisoimage -r $(TARGET_DIR) | $(HOST_DIR)/usr/bin/create_compressed_fs - 65536 > $(CLOOP_TARGET)" >> $(CLOOP_FAKEROOT_SCRIPT) - chmod a+x $(CLOOP_FAKEROOT_SCRIPT) - $(HOST_DIR)/usr/bin/fakeroot -- $(CLOOP_FAKEROOT_SCRIPT) - -@rm -f $(CLOOP_FAKEROOT_SCRIPT) +define ROOTFS_CLOOP_CMD + $(HOST_DIR)/usr/bin/genisoimage -r $(TARGET_DIR) | $(HOST_DIR)/usr/bin/create_compressed_fs - 65536 > $$@ +endef -ifeq ($(BR2_TARGET_ROOTFS_CLOOP),y) -TARGETS+=clooproot -endif +$(eval $(call ROOTFS_TARGET,cloop)) \ No newline at end of file From 9bda87be1bd68794617e791ac1f01d502e283dd5 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 10 Mar 2010 00:13:24 +0100 Subject: [PATCH 28/44] cpio: convert to ROOTFS_TARGET infrastructure Signed-off-by: Thomas Petazzoni --- target/cpio/cpioroot.mk | 62 +++++------------------------------------ 1 file changed, 7 insertions(+), 55 deletions(-) diff --git a/target/cpio/cpioroot.mk b/target/cpio/cpioroot.mk index 0984b725f0..ab7d546185 100644 --- a/target/cpio/cpioroot.mk +++ b/target/cpio/cpioroot.mk @@ -4,63 +4,15 @@ # ############################################################# -CPIO_BASE:=$(IMAGE).cpio - -CPIO_ROOTFS_COMPRESSOR:= -CPIO_ROOTFS_COMPRESSOR_EXT:= -CPIO_ROOTFS_COMPRESSOR_PREREQ:= -ifeq ($(BR2_TARGET_ROOTFS_CPIO_GZIP),y) -CPIO_ROOTFS_COMPRESSOR:=gzip -9 -c -CPIO_ROOTFS_COMPRESSOR_EXT:=gz -endif -ifeq ($(BR2_TARGET_ROOTFS_CPIO_BZIP2),y) -CPIO_ROOTFS_COMPRESSOR:=bzip2 -9 -c -CPIO_ROOTFS_COMPRESSOR_EXT:=bz2 -endif -ifeq ($(BR2_TARGET_ROOTFS_CPIO_LZMA),y) -CPIO_ROOTFS_COMPRESSOR:=$(LZMA) -9 -c -CPIO_ROOTFS_COMPRESSOR_EXT:=lzma -CPIO_ROOTFS_COMPRESSOR_PREREQ:= host-lzma -endif - -ifneq ($(CPIO_ROOTFS_COMPRESSOR),) -CPIO_TARGET := $(CPIO_BASE).$(CPIO_ROOTFS_COMPRESSOR_EXT) -else -CPIO_TARGET := $(CPIO_BASE) -endif - -cpioroot-init: +define ROOTFS_CPIO_INIT_SYMLINK rm -f $(TARGET_DIR)/init ln -s sbin/init $(TARGET_DIR)/init +endef -$(CPIO_BASE): host-fakeroot makedevs cpioroot-init - # Use fakeroot to pretend all target binaries are owned by root - rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(CPIO_BASE)) - touch $(BUILD_DIR)/.fakeroot.00000 - cat $(BUILD_DIR)/.fakeroot* > $(BUILD_DIR)/_fakeroot.$(notdir $(CPIO_BASE)) - echo "chown -R 0:0 $(TARGET_DIR)" >> $(BUILD_DIR)/_fakeroot.$(notdir $(CPIO_BASE)) -ifneq ($(TARGET_DEVICE_TABLE),) - # Use fakeroot to pretend to create all needed device nodes - echo "$(HOST_DIR)/usr/bin/makedevs -d $(TARGET_DEVICE_TABLE) $(TARGET_DIR)" \ - >> $(BUILD_DIR)/_fakeroot.$(notdir $(CPIO_BASE)) -endif - # Use fakeroot so tar believes the previous fakery - echo "cd $(TARGET_DIR) && find . | cpio --quiet -o -H newc > $(CPIO_BASE)" \ - >> $(BUILD_DIR)/_fakeroot.$(notdir $(CPIO_BASE)) - chmod a+x $(BUILD_DIR)/_fakeroot.$(notdir $(CPIO_BASE)) - $(HOST_DIR)/usr/bin/fakeroot -- $(BUILD_DIR)/_fakeroot.$(notdir $(CPIO_BASE)) - -@rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(CPIO_BASE)) +ROOTFS_CPIO_PRE_GEN_HOOKS += ROOTFS_CPIO_INIT_SYMLINK -ifneq ($(CPIO_ROOTFS_COMPRESSOR),) -$(CPIO_BASE).$(CPIO_ROOTFS_COMPRESSOR_EXT): $(CPIO_ROOTFS_COMPRESSOR_PREREQ) $(CPIO_BASE) - $(CPIO_ROOTFS_COMPRESSOR) $(CPIO_BASE) > $(CPIO_TARGET) -endif +define ROOTFS_CPIO_CMD + cd $(TARGET_DIR) && find . | cpio --quiet -o -H newc > $$@ +endef -############################################################# -# -# Toplevel Makefile options -# -############################################################# -ifeq ($(BR2_TARGET_ROOTFS_CPIO),y) -TARGETS+=cpioroot -endif +$(eval $(call ROOTFS_TARGET,cpio)) \ No newline at end of file From 5e530b7b95535fb6960e68a4ffba015c4c60fbaf Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 10 Mar 2010 00:13:39 +0100 Subject: [PATCH 29/44] cramfs: convert to ROOTFS_TARGET infrastructure Signed-off-by: Thomas Petazzoni --- target/cramfs/cramfs.mk | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/target/cramfs/cramfs.mk b/target/cramfs/cramfs.mk index f43162905b..ccd316f5d6 100644 --- a/target/cramfs/cramfs.mk +++ b/target/cramfs/cramfs.mk @@ -13,31 +13,10 @@ ifneq ($(TARGET_DEVICE_TABLE),) CRAMFS_OPTS += -D $(TARGET_DEVICE_TABLE) endif -CRAMFS_TARGET=$(IMAGE).cramfs +define ROOTFS_CRAMFS_CMD + $(HOST_DIR)/usr/bin/mkcramfs -q $(CRAMFS_OPTS) $(TARGET_DIR) $$@ +endef -cramfsroot: host-fakeroot host-cramfs makedevs - # Use fakeroot to pretend all target binaries are owned by root - rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(CRAMFS_TARGET)) - touch $(BUILD_DIR)/.fakeroot.00000 - cat $(BUILD_DIR)/.fakeroot* > $(BUILD_DIR)/_fakeroot.$(notdir $(CRAMFS_TARGET)) - echo "chown -R 0:0 $(TARGET_DIR)" >> $(BUILD_DIR)/_fakeroot.$(notdir $(CRAMFS_TARGET)) -ifneq ($(TARGET_DEVICE_TABLE),) - # Use fakeroot to pretend to create all needed device nodes - echo "$(HOST_DIR)/usr/bin/makedevs -d $(TARGET_DEVICE_TABLE) $(TARGET_DIR)" \ - >> $(BUILD_DIR)/_fakeroot.$(notdir $(CRAMFS_TARGET)) -endif - # Use fakeroot so mkcramfs believes the previous fakery - echo "$(HOST_DIR)/usr/bin/mkcramfs -q $(CRAMFS_OPTS) " \ - "$(TARGET_DIR) $(CRAMFS_TARGET)" >> $(BUILD_DIR)/_fakeroot.$(notdir $(CRAMFS_TARGET)) - chmod a+x $(BUILD_DIR)/_fakeroot.$(notdir $(CRAMFS_TARGET)) - $(HOST_DIR)/usr/bin/fakeroot -- $(BUILD_DIR)/_fakeroot.$(notdir $(CRAMFS_TARGET)) - -@rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(CRAMFS_TARGET)) +ROOTFS_CRAMFS_DEPENDENCIES = host-cramfs -############################################################# -# -# Toplevel Makefile options -# -############################################################# -ifeq ($(BR2_TARGET_ROOTFS_CRAMFS),y) -TARGETS+=cramfsroot -endif +$(eval $(call ROOTFS_TARGET,cramfs)) \ No newline at end of file From aa50ffdbffde0d6012f50a433d0404186e74eacc Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 10 Mar 2010 00:14:06 +0100 Subject: [PATCH 30/44] romfs: convert to ROOTFS_TARGET infrastructure Signed-off-by: Thomas Petazzoni --- target/romfs/romfs.mk | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/target/romfs/romfs.mk b/target/romfs/romfs.mk index e4b8ff58bb..971947880b 100644 --- a/target/romfs/romfs.mk +++ b/target/romfs/romfs.mk @@ -6,28 +6,10 @@ ROMFS_TARGET=$(IMAGE).romfs -romfsroot: host-fakeroot host-genromfs makedevs - # Use fakeroot to pretend all target binaries are owned by root - rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(ROMFS_TARGET)) - touch $(BUILD_DIR)/.fakeroot.00000 - cat $(BUILD_DIR)/.fakeroot* > $(BUILD_DIR)/_fakeroot.$(notdir $(ROMFS_TARGET)) - echo "chown -R 0:0 $(TARGET_DIR)" >> $(BUILD_DIR)/_fakeroot.$(notdir $(ROMFS_TARGET)) -ifneq ($(TARGET_DEVICE_TABLE),) - # Use fakeroot to pretend to create all needed device nodes - echo "$(HOST_DIR)/usr/bin/makedevs -d $(TARGET_DEVICE_TABLE) $(TARGET_DIR)" \ - >> $(BUILD_DIR)/_fakeroot.$(notdir $(ROMFS_TARGET)) -endif - # Use fakeroot so genromfs believes the previous fakery - echo "$(HOST_DIR)/usr/bin/genromfs -d $(TARGET_DIR) -f $(ROMFS_TARGET)" >> $(BUILD_DIR)/_fakeroot.$(notdir $(ROMFS_TARGET)) - chmod a+x $(BUILD_DIR)/_fakeroot.$(notdir $(ROMFS_TARGET)) - $(HOST_DIR)/usr/bin/fakeroot -- $(BUILD_DIR)/_fakeroot.$(notdir $(ROMFS_TARGET)) - -@rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(ROMFS_TARGET)) +ROOTFS_ROMFS_DEPENDENCIES = host-genromfs -############################################################# -# -# Toplevel Makefile options -# -############################################################# -ifeq ($(BR2_TARGET_ROOTFS_ROMFS),y) -TARGETS+=romfsroot -endif +define ROOTFS_ROMFS_CMD + $(HOST_DIR)/usr/bin/genromfs -d $(TARGET_DIR) -f $$@ +endef + +$(eval $(call ROOTFS_TARGET,romfs)) \ No newline at end of file From 959ee39bf6b00a1f7ecb27936a2d8efb6a4fc103 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 10 Mar 2010 00:14:16 +0100 Subject: [PATCH 31/44] tar: convert to ROOTFS_TARGET infrastructure Signed-off-by: Thomas Petazzoni --- target/tar/tarroot.mk | 49 ++++--------------------------------------- 1 file changed, 4 insertions(+), 45 deletions(-) diff --git a/target/tar/tarroot.mk b/target/tar/tarroot.mk index cd01bc74f7..4d435cb33b 100644 --- a/target/tar/tarroot.mk +++ b/target/tar/tarroot.mk @@ -5,50 +5,9 @@ ############################################################# TAR_OPTS:=$(BR2_TARGET_ROOTFS_TAR_OPTIONS) -TAR_TARGET:=$(IMAGE).tar -TAR_COMPRESSOR:= -TAR_COMPRESSOR_EXT:=.none -ifeq ($(BR2_TARGET_ROOTFS_TAR_GZIP),y) -TAR_COMPRESSOR:=gzip -9 -c -TAR_COMPRESSOR_EXT:=gz -endif -ifeq ($(BR2_TARGET_ROOTFS_TAR_BZIP2),y) -TAR_COMPRESSOR:=bzip2 -9 -c -TAR_COMPRESSOR_EXT:=bz2 -endif -ifeq ($(BR2_TARGET_ROOTFS_TAR_LZMA),y) -TAR_COMPRESSOR:=lzma -9 -c -TAR_COMPRESSOR_EXT:=lzma -endif +define ROOTFS_TAR_CMD + tar -c$(TAR_OPTS)f $$@ -C $(TARGET_DIR) . +endef -tarroot: host-fakeroot makedevs - # Use fakeroot to pretend all target binaries are owned by root - rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(TAR_TARGET)) - touch $(BUILD_DIR)/.fakeroot.00000 - cat $(BUILD_DIR)/.fakeroot* > $(BUILD_DIR)/_fakeroot.$(notdir $(TAR_TARGET)) - echo "chown -R 0:0 $(TARGET_DIR)" >> $(BUILD_DIR)/_fakeroot.$(notdir $(TAR_TARGET)) -ifneq ($(TARGET_DEVICE_TABLE),) - # Use fakeroot to pretend to create all needed device nodes - echo "$(HOST_DIR)/usr/bin/makedevs -d $(TARGET_DEVICE_TABLE) $(TARGET_DIR)" \ - >> $(BUILD_DIR)/_fakeroot.$(notdir $(TAR_TARGET)) -endif - # Use fakeroot so tar believes the previous fakery - echo "tar -c$(TAR_OPTS)f $(TAR_TARGET) -C $(TARGET_DIR) ." \ - >> $(BUILD_DIR)/_fakeroot.$(notdir $(TAR_TARGET)) - chmod a+x $(BUILD_DIR)/_fakeroot.$(notdir $(TAR_TARGET)) - $(HOST_DIR)/usr/bin/fakeroot -- $(BUILD_DIR)/_fakeroot.$(notdir $(TAR_TARGET)) -ifneq ($(TAR_COMPRESSOR),) - -rm -f $(TAR_TARGET).$() - PATH="$(STAGING_DIR)/sbin:$(STAGING_DIR)/bin:$(STAGING_DIR)/usr/sbin:$(STAGING_DIR)/usr/bin:$(PATH)" $(TAR_COMPRESSOR) $(TAR_TARGET) > $(TAR_TARGET).$(TAR_COMPRESSOR_EXT) -endif - -@rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(TAR_TARGET)) - -############################################################# -# -# Toplevel Makefile options -# -############################################################# -ifeq ($(BR2_TARGET_ROOTFS_TAR),y) -TARGETS+=tarroot -endif +$(eval $(call ROOTFS_TARGET,tar)) From 3892493f8ddcc3219b1ce6ee8ebdc25eb999c2c4 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 10 Mar 2010 00:14:29 +0100 Subject: [PATCH 32/44] squashfs: convert to ROOTFS_TARGET infrastructure Signed-off-by: Thomas Petazzoni --- target/squashfs/squashfsroot.mk | 34 +++++---------------------------- 1 file changed, 5 insertions(+), 29 deletions(-) diff --git a/target/squashfs/squashfsroot.mk b/target/squashfs/squashfsroot.mk index 01c4dabf9a..d72388ebf2 100644 --- a/target/squashfs/squashfsroot.mk +++ b/target/squashfs/squashfsroot.mk @@ -4,34 +4,10 @@ # ############################################################# -SQUASHFS_TARGET:=$(IMAGE).squashfs +ROOTFS_SQUASHFS_DEPENDENCIES = host-squashfs -squashfsroot: host-fakeroot host-squashfs makedevs - # Use fakeroot to pretend all target binaries are owned by root - rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(SQUASHFS_TARGET)) - touch $(BUILD_DIR)/.fakeroot.00000 - cat $(BUILD_DIR)/.fakeroot* > $(BUILD_DIR)/_fakeroot.$(notdir $(SQUASHFS_TARGET)) - echo "chown -R 0:0 $(TARGET_DIR)" >> $(BUILD_DIR)/_fakeroot.$(notdir $(SQUASHFS_TARGET)) -ifneq ($(TARGET_DEVICE_TABLE),) - # Use fakeroot to pretend to create all needed device nodes - echo "$(HOST_DIR)/usr/bin/makedevs -d $(TARGET_DEVICE_TABLE) $(TARGET_DIR)" \ - >> $(BUILD_DIR)/_fakeroot.$(notdir $(SQUASHFS_TARGET)) -endif - # Use fakeroot so mksquashfs believes the previous fakery - echo "$(HOST_DIR)/usr/bin/mksquashfs " \ - "$(TARGET_DIR) $(SQUASHFS_TARGET) " \ - "-noappend $(SQUASHFS_ENDIANNESS)" \ - >> $(BUILD_DIR)/_fakeroot.$(notdir $(SQUASHFS_TARGET)) - chmod a+x $(BUILD_DIR)/_fakeroot.$(notdir $(SQUASHFS_TARGET)) - $(HOST_DIR)/usr/bin/fakeroot -- $(BUILD_DIR)/_fakeroot.$(notdir $(SQUASHFS_TARGET)) - chmod 0644 $(SQUASHFS_TARGET) - -@rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(SQUASHFS_TARGET)) +define ROOTFS_SQUASHFS_CMD + $(HOST_DIR)/usr/bin/mksquashfs $(TARGET_DIR) $$@ -noappend +endef -############################################################# -# -# Toplevel Makefile options -# -############################################################# -ifeq ($(BR2_TARGET_ROOTFS_SQUASHFS),y) -TARGETS+=squashfsroot -endif +$(eval $(call ROOTFS_TARGET,squashfs)) \ No newline at end of file From 208d06abf9e3e36d87042c8dc6fe4a6f1e0d9575 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 10 Mar 2010 00:15:15 +0100 Subject: [PATCH 33/44] ext2: convert to ROOTFS_TARGET infrastructure We also remove the BR2_TARGET_ROOTFS_EXT2_OUTPUT option, that could be used to specify an alternate name for the generated image file. Signed-off-by: Thomas Petazzoni --- target/ext2/Config.in | 5 --- target/ext2/ext2root.mk | 76 ++++++----------------------------------- 2 files changed, 11 insertions(+), 70 deletions(-) diff --git a/target/ext2/Config.in b/target/ext2/Config.in index 0047309040..02ec18f406 100644 --- a/target/ext2/Config.in +++ b/target/ext2/Config.in @@ -24,11 +24,6 @@ config BR2_TARGET_ROOTFS_EXT2_SQUASH depends on BR2_TARGET_ROOTFS_EXT2 default y -config BR2_TARGET_ROOTFS_EXT2_OUTPUT - string "Output File" - depends on BR2_TARGET_ROOTFS_EXT2 - default "$(IMAGE).ext2" - choice prompt "Compression method" default BR2_TARGET_ROOTFS_EXT2_NONE diff --git a/target/ext2/ext2root.mk b/target/ext2/ext2root.mk index 145b182fe0..68b3b813c3 100644 --- a/target/ext2/ext2root.mk +++ b/target/ext2/ext2root.mk @@ -22,73 +22,19 @@ ifneq ($(strip $(BR2_TARGET_ROOTFS_EXT2_RESBLKS)),) EXT2_OPTS += -m $(BR2_TARGET_ROOTFS_EXT2_RESBLKS) endif -EXT2_BASE := $(call qstrip,$(BR2_TARGET_ROOTFS_EXT2_OUTPUT)) +ROOTFS_EXT2_DEPENDENCIES = host-genext2fs -EXT2_ROOTFS_COMPRESSOR:= -EXT2_ROOTFS_COMPRESSOR_EXT:= -EXT2_ROOTFS_COMPRESSOR_PREREQ:= -ifeq ($(BR2_TARGET_ROOTFS_EXT2_GZIP),y) -EXT2_ROOTFS_COMPRESSOR:=gzip -9 -c -EXT2_ROOTFS_COMPRESSOR_EXT:=gz -endif -ifeq ($(BR2_TARGET_ROOTFS_EXT2_BZIP2),y) -EXT2_ROOTFS_COMPRESSOR:=bzip2 -9 -c -EXT2_ROOTFS_COMPRESSOR_EXT:=bz2 -endif -ifeq ($(BR2_TARGET_ROOTFS_EXT2_LZMA),y) -EXT2_ROOTFS_COMPRESSOR:=$(LZMA) -9 -c -EXT2_ROOTFS_COMPRESSOR_EXT:=lzma -EXT2_ROOTFS_COMPRESSOR_PREREQ:=host-lzma -endif - -ifneq ($(EXT2_ROOTFS_COMPRESSOR),) -EXT2_TARGET := $(EXT2_BASE).$(EXT2_ROOTFS_COMPRESSOR_EXT) -else -EXT2_TARGET := $(EXT2_BASE) -endif - -$(EXT2_BASE): host-fakeroot host-genext2fs makedevs - # Use fakeroot to pretend all target binaries are owned by root - rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(EXT2_TARGET)) - touch $(BUILD_DIR)/.fakeroot.00000 - cat $(BUILD_DIR)/.fakeroot* > $(BUILD_DIR)/_fakeroot.$(notdir $(EXT2_TARGET)) - echo "chown -R 0:0 $(TARGET_DIR)" >> $(BUILD_DIR)/_fakeroot.$(notdir $(EXT2_TARGET)) -ifneq ($(TARGET_DEVICE_TABLE),) - # Use fakeroot to pretend to create all needed device nodes - echo "$(HOST_DIR)/usr/bin/makedevs -d $(TARGET_DEVICE_TABLE) $(TARGET_DIR)" \ - >> $(BUILD_DIR)/_fakeroot.$(notdir $(EXT2_TARGET)) -endif - # Use fakeroot so genext2fs believes the previous fakery ifeq ($(strip $(BR2_TARGET_ROOTFS_EXT2_BLOCKS)),0) - GENEXT2_REALSIZE=`LC_ALL=C du -s -c -k $(TARGET_DIR) | grep total | sed -e "s/total//"`; \ - GENEXT2_ADDTOROOTSIZE=`if [ $$GENEXT2_REALSIZE -ge 20000 ]; then echo 16384; else echo 2400; fi`; \ - GENEXT2_SIZE=`expr $$GENEXT2_REALSIZE + $$GENEXT2_ADDTOROOTSIZE`; \ - GENEXT2_ADDTOINODESIZE=`find $(TARGET_DIR) | wc -l`; \ - GENEXT2_INODES=`expr $$GENEXT2_ADDTOINODESIZE + 400`; \ - set -x; \ - echo "$(HOST_DIR)/usr/bin/genext2fs -b $$GENEXT2_SIZE " \ - "-N $$GENEXT2_INODES -d $(TARGET_DIR) " \ - "$(EXT2_OPTS) $(EXT2_BASE)" >> $(BUILD_DIR)/_fakeroot.$(notdir $(EXT2_TARGET)) -else - echo "$(HOST_DIR)/usr/bin/genext2fs -d $(TARGET_DIR) " \ - "$(EXT2_OPTS) $(EXT2_BASE)" >> $(BUILD_DIR)/_fakeroot.$(notdir $(EXT2_TARGET)) -endif - chmod a+x $(BUILD_DIR)/_fakeroot.$(notdir $(EXT2_TARGET)) - $(HOST_DIR)/usr/bin/fakeroot -- $(BUILD_DIR)/_fakeroot.$(notdir $(EXT2_TARGET)) - -@rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(EXT2_TARGET)) - -ifneq ($(EXT2_ROOTFS_COMPRESSOR),) -$(EXT2_BASE).$(EXT2_ROOTFS_COMPRESSOR_EXT): $(EXT2_ROOTFS_COMPRESSOR_PREREQ) $(EXT2_BASE) - $(EXT2_ROOTFS_COMPRESSOR) $(EXT2_BASE) > $(EXT2_TARGET) +GENEXT2_REALSIZE=$(shell LC_ALL=C du -s -c -k $(TARGET_DIR) | grep total | sed -e "s/total//") +GENEXT2_ADDTOROOTSIZE=$(shell if [ $(GENEXT2_REALSIZE) -ge 20000 ]; then echo 16384; else echo 2400; fi) +GENEXT2_SIZE=$(shell expr $(GENEXT2_REALSIZE) + $(GENEXT2_ADDTOROOTSIZE)) +GENEXT2_ADDTOINODESIZE=$(shell find $(TARGET_DIR) | wc -l) +GENEXT2_INODES=$(shell expr $(GENEXT2_ADDTOINODESIZE) + 400) +EXT2_OPTS += -b $(GENEXT2_SIZE) -N $(GENEXT2_INODES) endif -ext2root: $(EXT2_TARGET) +define ROOTFS_EXT2_CMD + $(HOST_DIR)/usr/bin/genext2fs -d $(TARGET_DIR) $(EXT2_OPTS) $$@ +endef -############################################################# -# -# Toplevel Makefile options -# -############################################################# -ifeq ($(BR2_TARGET_ROOTFS_EXT2),y) -TARGETS+=ext2root -endif +$(eval $(call ROOTFS_TARGET,ext2)) \ No newline at end of file From bd36a7273a6fa2d21589a1ab6e99bb231e0e868e Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 10 Mar 2010 00:16:01 +0100 Subject: [PATCH 34/44] jffs2: convert to ROOTFS_TARGET infrastructure We also remove the BR2_TARGET_ROOTFS_JFFS2_OUTPUT option, that could be used to specify an alternate name for the generated image file. Signed-off-by: Thomas Petazzoni --- target/jffs2/Config.in | 4 --- target/jffs2/jffs2root.mk | 57 +++++++++++---------------------------- 2 files changed, 16 insertions(+), 45 deletions(-) diff --git a/target/jffs2/Config.in b/target/jffs2/Config.in index a216a27f04..b787ec9d18 100644 --- a/target/jffs2/Config.in +++ b/target/jffs2/Config.in @@ -114,8 +114,4 @@ config BR2_TARGET_ROOTFS_JFFS2_SUMMARY A summarised image can be mounted faster if support is enabled in the kernel (CONFIG_JFFS2_SUMMARY) -config BR2_TARGET_ROOTFS_JFFS2_OUTPUT - string "Output File" - default "$(IMAGE).jffs2" - endif diff --git a/target/jffs2/jffs2root.mk b/target/jffs2/jffs2root.mk index eea0e3a490..a0a563d185 100644 --- a/target/jffs2/jffs2root.mk +++ b/target/jffs2/jffs2root.mk @@ -32,55 +32,30 @@ JFFS2_OPTS += -n SUMTOOL_OPTS += -n endif -JFFS2_TARGET := $(call qstrip,$(BR2_TARGET_ROOTFS_JFFS2_OUTPUT)) ifneq ($(TARGET_DEVICE_TABLE),) JFFS2_OPTS += -D $(TARGET_DEVICE_TABLE) endif +ROOTFS_JFFS2_DEPENDENCIES = host-mtd -# -# mtd-host is a dependency which builds a local copy of mkfs.jffs2 if it is needed. -# the actual build is done from package/mtd/mtd.mk and it sets the -# value of MKFS_JFFS2 to either the previously installed copy or the one -# just built. -# -$(JFFS2_TARGET): host-fakeroot host-mtd makedevs - # Use fakeroot to pretend all target binaries are owned by root - rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(JFFS2_TARGET)) - touch $(BUILD_DIR)/.fakeroot.00000 - cat $(BUILD_DIR)/.fakeroot* > $(BUILD_DIR)/_fakeroot.$(notdir $(JFFS2_TARGET)) - echo "chown -R 0:0 $(TARGET_DIR)" >> $(BUILD_DIR)/_fakeroot.$(notdir $(JFFS2_TARGET)) -ifneq ($(TARGET_DEVICE_TABLE),) - # Use fakeroot to pretend to create all needed device nodes - echo "$(HOST_DIR)/usr/bin/makedevs -d $(TARGET_DEVICE_TABLE) $(TARGET_DIR)" \ - >> $(BUILD_DIR)/_fakeroot.$(notdir $(JFFS2_TARGET)) -endif - # Use fakeroot so mkfs.jffs2 believes the previous fakery ifneq ($(BR2_TARGET_ROOTFS_JFFS2_SUMMARY),) - echo "$(MKFS_JFFS2) $(JFFS2_OPTS) -d $(TARGET_DIR) -o $(JFFS2_TARGET).nosummary && " \ - "$(SUMTOOL) $(SUMTOOL_OPTS) -i $(JFFS2_TARGET).nosummary -o $(JFFS2_TARGET) && " \ - "rm $(JFFS2_TARGET).nosummary" \ - >> $(BUILD_DIR)/_fakeroot.$(notdir $(JFFS2_TARGET)) +define ROOTFS_JFFS2_CMD + $(MKFS_JFFS2) $(JFFS2_OPTS) -d $(TARGET_DIR) -o $$@.nosummary && \ + $(SUMTOOL) $(SUMTOOL_OPTS) -i $$@.nosummary -o $$@ && \ + rm $$@.nosummary +endef else - echo "$(MKFS_JFFS2) $(JFFS2_OPTS) -d $(TARGET_DIR) -o $(JFFS2_TARGET)" \ - >> $(BUILD_DIR)/_fakeroot.$(notdir $(JFFS2_TARGET)) +define ROOTFS_JFFS2_CMD + $(MKFS_JFFS2) $(JFFS2_OPTS) -d $(TARGET_DIR) -o $$@ +endef endif - chmod a+x $(BUILD_DIR)/_fakeroot.$(notdir $(JFFS2_TARGET)) - $(HOST_DIR)/usr/bin/fakeroot -- $(BUILD_DIR)/_fakeroot.$(notdir $(JFFS2_TARGET)) - -@rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(JFFS2_TARGET)) - @ls -l $(JFFS2_TARGET) + +define JFFS2_GEN_SREC + $(TARGET_CROSS)objcopy -I binary -O srec --adjust-vma 0xa1000000 $$@ $$@.srec +endef + ifeq ($(BR2_JFFS2_TARGET_SREC),y) - $(TARGET_CROSS)objcopy -I binary -O srec --adjust-vma 0xa1000000 $(JFFS2_TARGET) $(JFFS2_TARGET).srec - @ls -l $(JFFS2_TARGET).srec +ROOTFS_JFFS2_POST_GEN_HOOKS += JFFS2_GEN_SREC endif -jffs2root: $(JFFS2_TARGET) - -############################################################# -# -# Toplevel Makefile options -# -############################################################# -ifeq ($(BR2_TARGET_ROOTFS_JFFS2),y) -TARGETS+=jffs2root -endif +$(eval $(call ROOTFS_TARGET,jffs2)) \ No newline at end of file From 99eb1dc9690de73d743327ae7976c925aa31af03 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 10 Mar 2010 00:16:30 +0100 Subject: [PATCH 35/44] ubifs: convert to ROOTFS_TARGET infrastructure We also remove the BR2_TARGET_ROOTFS_UBIFS_OUTPUT option, that could be used to specify an alternate name for the generated image file. Signed-off-by: Thomas Petazzoni --- target/ubifs/Config.in | 5 ---- target/ubifs/ubifsroot.mk | 63 ++++----------------------------------- 2 files changed, 5 insertions(+), 63 deletions(-) diff --git a/target/ubifs/Config.in b/target/ubifs/Config.in index 3222fea7b7..9fa510e752 100644 --- a/target/ubifs/Config.in +++ b/target/ubifs/Config.in @@ -22,11 +22,6 @@ config BR2_TARGET_ROOTFS_UBIFS_MAXLEBCNT help Some comment required here -config BR2_TARGET_ROOTFS_UBIFS_OUTPUT - string "Output File" - depends on BR2_TARGET_ROOTFS_UBIFS - default "$(IMAGE).ubifs" - choice prompt "ubifs runtime compression" default BR2_TARGET_ROOTFS_UBIFS_RT_LZO diff --git a/target/ubifs/ubifsroot.mk b/target/ubifs/ubifsroot.mk index d0f3885f41..0fad234212 100644 --- a/target/ubifs/ubifsroot.mk +++ b/target/ubifs/ubifsroot.mk @@ -6,8 +6,6 @@ UBIFS_OPTS := -e $(BR2_TARGET_ROOTFS_UBIFS_LEBSIZE) -c $(BR2_TARGET_ROOTFS_UBIFS_MAXLEBCNT) -m $(BR2_TARGET_ROOTFS_UBIFS_MINIOSIZE) -UBIFS_BASE := $(call qstrip,$(BR2_TARGET_ROOTFS_UBIFS_OUTPUT)) - ifeq ($(BR2_TARGET_ROOTFS_UBIFS_RT_ZLIB),y) UBIFS_OPTS += -x zlib endif @@ -18,61 +16,10 @@ ifeq ($(BR2_TARGET_ROOTFS_UBIFS_RT_NONE),y) UBIFS_OPTS += -x none endif -UBIFS_ROOTFS_COMPRESSOR:= -UBIFS_ROOTFS_COMPRESSOR_EXT:= -UBIFS_ROOTFS_COMPRESSOR_PREREQ:= -ifeq ($(BR2_TARGET_ROOTFS_UBIFS_GZIP),y) -UBIFS_ROOTFS_COMPRESSOR:=gzip -9 -c -UBIFS_ROOTFS_COMPRESSOR_EXT:=gz -endif -ifeq ($(BR2_TARGET_ROOTFS_UBIFS_BZIP2),y) -UBIFS_ROOTFS_COMPRESSOR:=bzip2 -9 -c -UBIFS_ROOTFS_COMPRESSOR_EXT:=bz2 -endif -ifeq ($(BR2_TARGET_ROOTFS_UBIFS_LZMA),y) -UBIFS_ROOTFS_COMPRESSOR:=$(LZMA) -9 -c -UBIFS_ROOTFS_COMPRESSOR_EXT:=lzma -UBIFS_ROOTFS_COMPRESSOR_PREREQ:= host-lzma -endif +ROOTFS_UBIFS_DEPENDENCIES = host-mtd -ifneq ($(UBIFS_ROOTFS_COMPRESSOR),) -UBIFS_TARGET := $(UBIFS_BASE).$(UBIFS_ROOTFS_COMPRESSOR_EXT) -else -UBIFS_TARGET := $(UBIFS_BASE) -endif - -$(UBIFS_BASE): host-fakeroot host-mtd makedevs - # Use fakeroot to pretend all target binaries are owned by root - rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(UBIFS_TARGET)) - touch $(BUILD_DIR)/.fakeroot.00000 - cat $(BUILD_DIR)/.fakeroot* > $(BUILD_DIR)/_fakeroot.$(notdir $(UBIFS_TARGET)) - echo "chown -R 0:0 $(TARGET_DIR)" >> $(BUILD_DIR)/_fakeroot.$(notdir $(UBIFS_TARGET)) -ifneq ($(TARGET_DEVICE_TABLE),) - # Use fakeroot to pretend to create all needed device nodes - echo "$(HOST_DIR)/usr/bin/makedevs -d $(TARGET_DEVICE_TABLE) $(TARGET_DIR)" \ - >> $(BUILD_DIR)/_fakeroot.$(notdir $(UBIFS_TARGET)) -endif - # Use fakeroot so mkfs.ubifs believes the previous fakery - echo "$(HOST_DIR)/usr/sbin/mkfs.ubifs -d $(TARGET_DIR) " \ - "$(UBIFS_OPTS) -o $(UBIFS_BASE)" >> $(BUILD_DIR)/_fakeroot.$(notdir $(UBIFS_TARGET)) - chmod a+x $(BUILD_DIR)/_fakeroot.$(notdir $(UBIFS_TARGET)) - $(HOST_DIR)/usr/bin/fakeroot -- $(BUILD_DIR)/_fakeroot.$(notdir $(UBIFS_TARGET)) - -@rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(UBIFS_TARGET)) - -ifneq ($(UBIFS_ROOTFS_COMPRESSOR),) -$(UBIFS_BASE).$(UBIFS_ROOTFS_COMPRESSOR_EXT): $(UBIFS_ROOTFS_COMPRESSOR_PREREQ) $(UBIFS_BASE) - $(UBIFS_ROOTFS_COMPRESSOR) $(UBIFS_BASE) > $(UBIFS_TARGET) -endif - -ubifsroot: $(UBIFS_TARGET) - @ls -l $(UBIFS_TARGET) - -############################################################# -# -# Toplevel Makefile options -# -############################################################# -ifeq ($(BR2_TARGET_ROOTFS_UBIFS),y) -TARGETS+=ubifsroot -endif +define ROOTFS_UBIFS_CMD + $(HOST_DIR)/usr/sbin/mkfs.ubifs -d $(TARGET_DIR) $(UBIFS_OPTS) -o $$@ +endef +$(eval $(call ROOTFS_TARGET,ubifs)) \ No newline at end of file From 9d8e1b69ab342320c448091f78a3a93da2dbdf82 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 10 Mar 2010 00:23:58 +0100 Subject: [PATCH 36/44] initramfs: convert to ROOTFS_TARGET infrastructure Signed-off-by: Thomas Petazzoni --- target/initramfs/initramfs.mk | 37 ++++++----------------------------- 1 file changed, 6 insertions(+), 31 deletions(-) diff --git a/target/initramfs/initramfs.mk b/target/initramfs/initramfs.mk index 0030278c5f..cf1fcdbae1 100644 --- a/target/initramfs/initramfs.mk +++ b/target/initramfs/initramfs.mk @@ -6,38 +6,13 @@ # ############################################################# -ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y) -INITRAMFS_TARGET:=$(IMAGE).initramfs_list -else -INITRAMFS_TARGET:= #nothing -endif - -TARGETS+=$(INITRAMFS_TARGET) - -$(INITRAMFS_TARGET) initramfs: host-fakeroot makedevs +define ROOTFS_INITRAMFS_INIT_SYMLINK rm -f $(TARGET_DIR)/init ln -s sbin/init $(TARGET_DIR)/init - # Use fakeroot to pretend all target binaries are owned by root - rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(TAR_TARGET)) - touch $(BUILD_DIR)/.fakeroot.00000 - cat $(BUILD_DIR)/.fakeroot* > $(BUILD_DIR)/_fakeroot.$(notdir $(TAR_TARGET)) - echo "chown -R 0:0 $(TARGET_DIR)" >> $(BUILD_DIR)/_fakeroot.$(notdir $(TAR_TARGET)) - # Use fakeroot to pretend to create all needed device nodes - echo "$(HOST_DIR)/usr/bin/makedevs -d $(TARGET_DEVICE_TABLE) $(TARGET_DIR)" \ - >> $(BUILD_DIR)/_fakeroot.$(notdir $(TAR_TARGET)) - # Use fakeroot so gen_initramfs_list.sh believes the previous fakery - echo "$(SHELL) target/initramfs/gen_initramfs_list.sh -u 0 -g 0 $(TARGET_DIR) > $(INITRAMFS_TARGET)" \ - >> $(BUILD_DIR)/_fakeroot.$(notdir $(TAR_TARGET)) - chmod a+x $(BUILD_DIR)/_fakeroot.$(notdir $(TAR_TARGET)) - $(HOST_DIR)/usr/bin/fakeroot -- $(BUILD_DIR)/_fakeroot.$(notdir $(TAR_TARGET)) - -rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(TAR_TARGET)) - -initramfs-source: - -initramfs-clean: -ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y) - -rm -f $(INITRAMFS_TARGET) -endif -initramfs-dirclean: +endef +define ROOTFS_INITRAMFS_CMD + $(SHELL) target/initramfs/gen_initramfs_list.sh -u 0 -g 0 $(TARGET_DIR) > $$@ +endef +$(eval $(call ROOTFS_TARGET,initramfs)) \ No newline at end of file From f840a2b28cf37c63f529fece9e58bed457e684c7 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 10 Mar 2010 22:10:23 +0100 Subject: [PATCH 37/44] busybox initramfs: do not use the IMAGE variable Signed-off-by: Thomas Petazzoni --- package/busybox/initramfs.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/busybox/initramfs.mk b/package/busybox/initramfs.mk index afb80f9f30..394f483e5e 100644 --- a/package/busybox/initramfs.mk +++ b/package/busybox/initramfs.mk @@ -7,7 +7,7 @@ ifeq ($(BR2_PACKAGE_BUSYBOX_INITRAMFS),y) BUSYBOX_INITRAMFS_DIR:=$(BUSYBOX_DIR)-initramfs BR2_INITRAMFS_DIR:=$(BUILD_DIR)/initramfs -BB_INITRAMFS_TARGET:=$(IMAGE).initramfs_lst +BB_INITRAMFS_TARGET:=rootfs.initramfs_lst $(BUSYBOX_INITRAMFS_DIR)/.unpacked: $(DL_DIR)/$(BUSYBOX_SOURCE) rm -rf $(BUILD_DIR)/tmp $(BUSYBOX_INITRAMFS_DIR) From d2b07919ac2ffe94053ac6eef6bf4367b86dc139 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 10 Mar 2010 22:11:21 +0100 Subject: [PATCH 38/44] target/common: do not use IMAGE Signed-off-by: Thomas Petazzoni --- target/common.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/common.mk b/target/common.mk index c7eff7435a..cebe8c34a8 100644 --- a/target/common.mk +++ b/target/common.mk @@ -31,8 +31,8 @@ FAKEROOT_SCRIPT = $(BUILD_DIR)/_fakeroot.fs define ROOTFS_TARGET_INTERNAL -$(IMAGE).$(1): $(ROOTFS_$(2)_DEPENDENCIES) host-fakeroot makedevs $(if $(BR2_TARGET_ROOTFS_$(2)_LZMA),host-lzma) - @$(call MESSAGE,"Generating root filesystem image $(IMAGE).$(1)") +$(BINARIES_DIR)/rootfs.$(1): $(ROOTFS_$(2)_DEPENDENCIES) host-fakeroot makedevs $(if $(BR2_TARGET_ROOTFS_$(2)_LZMA),host-lzma) + @$(call MESSAGE,"Generating root filesystem image rootfs.$(1)") $(foreach hook,$(ROOTFS_$(2)_PRE_GEN_HOOKS),$(call $(hook))$(sep)) rm -f $(FAKEROOT_SCRIPT) touch $(BUILD_DIR)/.fakeroot.00000 @@ -56,7 +56,7 @@ ifeq ($$(BR2_TARGET_ROOTFS_$(2)_LZMA),y) $(LZMA) -9 -c $$@ > $$@.lzma endif -$(1)-root: $(IMAGE).$(1) +$(1)-root: $(BINARIES_DIR)/rootfs.$(1) ifeq ($$(BR2_TARGET_ROOTFS_$(2)),y) TARGETS += $(1)-root @@ -65,4 +65,4 @@ endef define ROOTFS_TARGET $(call ROOTFS_TARGET_INTERNAL,$(1),$(call UPPERCASE,$(1))) -endef \ No newline at end of file +endef From eefa832dff6539f85f1ed9b3be1721da11107df3 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 10 Mar 2010 22:12:24 +0100 Subject: [PATCH 39/44] iso9660: rework in a similar way to ROOTFS_TARGET Unfortunately, it cannot use the ROOTFS_TARGET infrastructure, due to the specifities of the iso9660 build process. Signed-off-by: Thomas Petazzoni --- target/iso9660/Config.in | 5 ----- target/iso9660/iso9660.mk | 30 ++++++++++++++++-------------- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/target/iso9660/Config.in b/target/iso9660/Config.in index 40c93b3f88..ceee52ff9d 100644 --- a/target/iso9660/Config.in +++ b/target/iso9660/Config.in @@ -7,11 +7,6 @@ config BR2_TARGET_ROOTFS_ISO9660 help Build a bootable iso9660 image -config BR2_TARGET_ROOTFS_ISO9660_OUTPUT - string "Output File" - depends on BR2_TARGET_ROOTFS_ISO9660 - default "$(IMAGE).iso" - config BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU string "Boot menu.lst file" depends on BR2_TARGET_ROOTFS_ISO9660 diff --git a/target/iso9660/iso9660.mk b/target/iso9660/iso9660.mk index a198c17c1d..66e2de20b4 100644 --- a/target/iso9660/iso9660.mk +++ b/target/iso9660/iso9660.mk @@ -2,10 +2,12 @@ # # Build the iso96600 root filesystem image # +# Cannot be converted to the ROOTFS_TARGET infrastructure, because of +# the temporary construction in ISO9660_TARGET_DIR. +# ############################################################# ISO9660_TARGET_DIR=$(BUILD_DIR)/iso9660 -ISO9660_TARGET:=$(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_OUTPUT)) ISO9660_BOOT_MENU:=$(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU)) ISO9660_OPTS:= @@ -13,7 +15,8 @@ ifeq ($(BR2_TARGET_ROOTFS_ISO9660_SQUASH),y) ISO9660_OPTS+=-U endif -$(ISO9660_TARGET): host-fakeroot host-cdrkit $(LINUX_KERNEL) $(EXT2_TARGET) grub +$(BINARIES_DIR)/rootfs.iso9660: host-cdrkit host-fakeroot $(LINUX_KERNEL) $(BINARIES_DIR)/rootfs.ext2 grub + @$(call MESSAGE,"Generating root filesystem image rootfs.iso9660") mkdir -p $(ISO9660_TARGET_DIR) mkdir -p $(ISO9660_TARGET_DIR)/boot/grub cp $(GRUB_DIR)/stage2/stage2_eltorito $(ISO9660_TARGET_DIR)/boot/grub/ @@ -21,21 +24,20 @@ $(ISO9660_TARGET): host-fakeroot host-cdrkit $(LINUX_KERNEL) $(EXT2_TARGET) grub cp $(LINUX_KERNEL) $(ISO9660_TARGET_DIR)/kernel cp $(EXT2_TARGET) $(ISO9660_TARGET_DIR)/initrd # Use fakeroot to pretend all target binaries are owned by root - rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(ISO9660_TARGET)) + rm -f $(FAKEROOT_SCRIPT) touch $(BUILD_DIR)/.fakeroot.00000 - cat $(BUILD_DIR)/.fakeroot* > $(BUILD_DIR)/_fakeroot.$(notdir $(ISO9660_TARGET)) - echo "chown -R 0:0 $(ISO9660_TARGET_DIR)" >> $(BUILD_DIR)/_fakeroot.$(notdir $(ISO9660_TARGET)) + cat $(BUILD_DIR)/.fakeroot* > $(FAKEROOT_SCRIPT) + echo "chown -R 0:0 $(ISO9660_TARGET_DIR)" >> $(FAKEROOT_SCRIPT) # Use fakeroot so mkisofs believes the previous fakery echo "$(HOST_DIR)/usr/bin/genisoimage -R -b boot/grub/stage2_eltorito -no-emul-boot " \ - "-boot-load-size 4 -boot-info-table -o $(ISO9660_TARGET) $(ISO9660_TARGET_DIR)" \ - >> $(BUILD_DIR)/_fakeroot.$(notdir $(ISO9660_TARGET)) - chmod a+x $(BUILD_DIR)/_fakeroot.$(notdir $(ISO9660_TARGET)) - $(HOST_DIR)/usr/bin/fakeroot -- $(BUILD_DIR)/_fakeroot.$(notdir $(ISO9660_TARGET)) - -@rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(ISO9660_TARGET)) + "-boot-load-size 4 -boot-info-table -o $@ $(ISO9660_TARGET_DIR)" \ + >> $(FAKEROOT_SCRIPT) + chmod a+x $(FAKEROOT_SCRIPT) + $(HOST_DIR)/usr/bin/fakeroot -- $(FAKEROOT_SCRIPT) + -@rm -f $(FAKEROOT_SCRIPT) + -@rm -rf $(ISO9660_TARGET_DIR) -iso9660root: $(ISO9660_TARGET) - echo $(ISO9660_TARGET) - @ls -l $(ISO9660_TARGET) +iso9660-root: $(BINARIES_DIR)/rootfs.iso9660 ############################################################# # @@ -43,5 +45,5 @@ iso9660root: $(ISO9660_TARGET) # ############################################################# ifeq ($(BR2_TARGET_ROOTFS_ISO9660),y) -TARGETS+=iso9660root +TARGETS+=iso9660-root endif From 325bfd1cbae03fe286796d3fa7de7c0a3227f7a5 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 10 Mar 2010 22:13:47 +0100 Subject: [PATCH 40/44] Remove IMAGE and related configuration options Now, we just hardcode the image filenames to be rootfs.$(FSTYPE), in the $(BINARIES_DIR). Signed-off-by: Thomas Petazzoni --- package/Makefile.in | 4 ---- target/Config.in | 12 ------------ 2 files changed, 16 deletions(-) diff --git a/package/Makefile.in b/package/Makefile.in index 2bd3640135..efb4dec34b 100644 --- a/package/Makefile.in +++ b/package/Makefile.in @@ -109,7 +109,6 @@ TOOLCHAIN_DIR=$(BASE_DIR)/toolchain # Quotes are needed for spaces et al in path components. TARGET_PATH="$(TOOLCHAIN_DIR)/bin:$(HOST_DIR)/bin:$(HOST_DIR)/usr/bin:$(HOST_DIR)/usr/sbin/:$(STAGING_DIR)/bin:$(STAGING_DIR)/usr/bin:$(PATH)" -IMAGE:=$(BINARIES_DIR)/$(BR2_ROOTFS_PREFIX).$(ARCH)$(ROOTFS_SUFFIX) GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)-linux REAL_GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)$(GNU_TARGET_SUFFIX) TARGET_CROSS=$(STAGING_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)- @@ -119,9 +118,6 @@ TOOLCHAIN_EXTERNAL_PREFIX:=$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PREFIX)) TOOLCHAIN_EXTERNAL_PATH:=$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PATH)) TOOLCHAIN_DIR=$(BASE_DIR)/toolchain TARGET_PATH="$(HOST_DIR)/bin:$(HOST_DIR)/usr/bin:$(HOST_DIR)/usr/sbin/:$(TOOLCHAIN_DIR)/bin:$(TOOLCHAIN_EXTERNAL_PATH)/bin:$(PATH)" -#IMAGE:=$(BINARIES_DIR)/$(BR2_ROOTFS_PREFIX).$(TOOLCHAIN_EXTERNAL_PREFIX)$(ROOTFS_SUFFIX) -IMAGE:=$(BINARIES_DIR)/$(BR2_ROOTFS_PREFIX).$(ARCH)$(ROOTFS_SUFFIX) - REAL_GNU_TARGET_NAME=$(TOOLCHAIN_EXTERNAL_PREFIX) GNU_TARGET_NAME=$(TOOLCHAIN_EXTERNAL_PREFIX) KERNEL_CROSS=$(TOOLCHAIN_EXTERNAL_PATH)/bin/$(TOOLCHAIN_EXTERNAL_PREFIX)- diff --git a/target/Config.in b/target/Config.in index 4cae66cf77..5d634ca2a3 100644 --- a/target/Config.in +++ b/target/Config.in @@ -1,17 +1,5 @@ menu "Target filesystem options" -config BR2_ROOTFS_PREFIX - string "Custom root fs prefix" - default "rootfs" - help - Add a custom string to the beginning of the root file system name. - -config BR2_ROOTFS_SUFFIX - string "Custom root fs suffix" - default "" - help - Add a custom string to the end of the root file system name. - config BR2_ROOTFS_POST_BUILD_SCRIPT string "Custom script to run before packing files" default "" From 0585241505cfaddc9db6ae92739bdfb5ce5f9794 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 10 Mar 2010 22:30:06 +0100 Subject: [PATCH 41/44] Move all filesystem generation code to fs/ Signed-off-by: Thomas Petazzoni --- Config.in | 2 ++ Makefile | 2 ++ fs/Config.in | 30 +++++++++++++++++ {target => fs}/cloop/Config.in | 0 {target => fs}/cloop/cloop.mk | 0 {target => fs}/common.mk | 2 ++ {target => fs}/cpio/Config.in | 0 {target => fs}/cpio/cpioroot.mk | 0 {target => fs}/cramfs/Config.in | 0 {target => fs}/cramfs/cramfs.mk | 0 {target => fs}/ext2/Config.in | 0 {target => fs}/ext2/ext2root.mk | 0 {target => fs}/initramfs/Config.in | 0 .../initramfs/gen_initramfs_list.sh | 0 {target => fs}/initramfs/initramfs.mk | 0 {target => fs}/iso9660/Config.in | 0 {target => fs}/iso9660/iso9660.mk | 0 {target => fs}/iso9660/menu.lst | 0 {target => fs}/jffs2/Config.in | 0 {target => fs}/jffs2/jffs2root.mk | 0 {target => fs}/romfs/Config.in | 0 {target => fs}/romfs/romfs.mk | 0 {target => fs}/squashfs/Config.in | 0 {target => fs}/squashfs/squashfsroot.mk | 0 {target => fs}/tar/Config.in | 0 {target => fs}/tar/tarroot.mk | 0 {target => fs}/ubifs/Config.in | 0 {target => fs}/ubifs/ubifsroot.mk | 0 target/Config.in | 33 +------------------ target/Makefile.in | 2 -- 30 files changed, 37 insertions(+), 34 deletions(-) create mode 100644 fs/Config.in rename {target => fs}/cloop/Config.in (100%) rename {target => fs}/cloop/cloop.mk (100%) rename {target => fs}/common.mk (99%) rename {target => fs}/cpio/Config.in (100%) rename {target => fs}/cpio/cpioroot.mk (100%) rename {target => fs}/cramfs/Config.in (100%) rename {target => fs}/cramfs/cramfs.mk (100%) rename {target => fs}/ext2/Config.in (100%) rename {target => fs}/ext2/ext2root.mk (100%) rename {target => fs}/initramfs/Config.in (100%) rename {target => fs}/initramfs/gen_initramfs_list.sh (100%) rename {target => fs}/initramfs/initramfs.mk (100%) rename {target => fs}/iso9660/Config.in (100%) rename {target => fs}/iso9660/iso9660.mk (100%) rename {target => fs}/iso9660/menu.lst (100%) rename {target => fs}/jffs2/Config.in (100%) rename {target => fs}/jffs2/jffs2root.mk (100%) rename {target => fs}/romfs/Config.in (100%) rename {target => fs}/romfs/romfs.mk (100%) rename {target => fs}/squashfs/Config.in (100%) rename {target => fs}/squashfs/squashfsroot.mk (100%) rename {target => fs}/tar/Config.in (100%) rename {target => fs}/tar/tarroot.mk (100%) rename {target => fs}/ubifs/Config.in (100%) rename {target => fs}/ubifs/ubifsroot.mk (100%) diff --git a/Config.in b/Config.in index 4f567d0078..224a44ae2f 100644 --- a/Config.in +++ b/Config.in @@ -346,4 +346,6 @@ source "toolchain/Config.in" source "package/Config.in" +source "fs/Config.in" + source "target/Config.in" diff --git a/Makefile b/Makefile index b47c0b0dd4..ce6bf3d4cf 100644 --- a/Makefile +++ b/Makefile @@ -323,6 +323,8 @@ ifeq ($(BR2_ENABLE_LOCALE_PURGE),y) TARGETS+=target-purgelocales endif +include fs/common.mk + # target stuff is last so it can override anything else include target/Makefile.in diff --git a/fs/Config.in b/fs/Config.in new file mode 100644 index 0000000000..f885c52e7c --- /dev/null +++ b/fs/Config.in @@ -0,0 +1,30 @@ +menu "Target filesystem options" + +config BR2_ROOTFS_POST_BUILD_SCRIPT + string "Custom script to run before packing files" + default "" + help + Specify a script to be run after the build has finished and before + the BR2 starts packing the files into selected packages. + + This gives users the oportunity to do board-specific cleanups, + add-ons and the like, so the generated files can be used directly + without further processing. + + The script is called with the target directory name as first and + only argument. Make sure the exit code of that script is 0, + otherwise make will stop after calling it. + +source "fs/cramfs/Config.in" +source "fs/cloop/Config.in" +source "fs/ext2/Config.in" +source "fs/jffs2/Config.in" +source "fs/ubifs/Config.in" +source "fs/squashfs/Config.in" +source "fs/tar/Config.in" +source "fs/cpio/Config.in" +source "fs/iso9660/Config.in" +source "fs/initramfs/Config.in" +source "fs/romfs/Config.in" + +endmenu diff --git a/target/cloop/Config.in b/fs/cloop/Config.in similarity index 100% rename from target/cloop/Config.in rename to fs/cloop/Config.in diff --git a/target/cloop/cloop.mk b/fs/cloop/cloop.mk similarity index 100% rename from target/cloop/cloop.mk rename to fs/cloop/cloop.mk diff --git a/target/common.mk b/fs/common.mk similarity index 99% rename from target/common.mk rename to fs/common.mk index cebe8c34a8..fa6afd94d0 100644 --- a/target/common.mk +++ b/fs/common.mk @@ -66,3 +66,5 @@ endef define ROOTFS_TARGET $(call ROOTFS_TARGET_INTERNAL,$(1),$(call UPPERCASE,$(1))) endef + +include fs/*/*.mk diff --git a/target/cpio/Config.in b/fs/cpio/Config.in similarity index 100% rename from target/cpio/Config.in rename to fs/cpio/Config.in diff --git a/target/cpio/cpioroot.mk b/fs/cpio/cpioroot.mk similarity index 100% rename from target/cpio/cpioroot.mk rename to fs/cpio/cpioroot.mk diff --git a/target/cramfs/Config.in b/fs/cramfs/Config.in similarity index 100% rename from target/cramfs/Config.in rename to fs/cramfs/Config.in diff --git a/target/cramfs/cramfs.mk b/fs/cramfs/cramfs.mk similarity index 100% rename from target/cramfs/cramfs.mk rename to fs/cramfs/cramfs.mk diff --git a/target/ext2/Config.in b/fs/ext2/Config.in similarity index 100% rename from target/ext2/Config.in rename to fs/ext2/Config.in diff --git a/target/ext2/ext2root.mk b/fs/ext2/ext2root.mk similarity index 100% rename from target/ext2/ext2root.mk rename to fs/ext2/ext2root.mk diff --git a/target/initramfs/Config.in b/fs/initramfs/Config.in similarity index 100% rename from target/initramfs/Config.in rename to fs/initramfs/Config.in diff --git a/target/initramfs/gen_initramfs_list.sh b/fs/initramfs/gen_initramfs_list.sh similarity index 100% rename from target/initramfs/gen_initramfs_list.sh rename to fs/initramfs/gen_initramfs_list.sh diff --git a/target/initramfs/initramfs.mk b/fs/initramfs/initramfs.mk similarity index 100% rename from target/initramfs/initramfs.mk rename to fs/initramfs/initramfs.mk diff --git a/target/iso9660/Config.in b/fs/iso9660/Config.in similarity index 100% rename from target/iso9660/Config.in rename to fs/iso9660/Config.in diff --git a/target/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk similarity index 100% rename from target/iso9660/iso9660.mk rename to fs/iso9660/iso9660.mk diff --git a/target/iso9660/menu.lst b/fs/iso9660/menu.lst similarity index 100% rename from target/iso9660/menu.lst rename to fs/iso9660/menu.lst diff --git a/target/jffs2/Config.in b/fs/jffs2/Config.in similarity index 100% rename from target/jffs2/Config.in rename to fs/jffs2/Config.in diff --git a/target/jffs2/jffs2root.mk b/fs/jffs2/jffs2root.mk similarity index 100% rename from target/jffs2/jffs2root.mk rename to fs/jffs2/jffs2root.mk diff --git a/target/romfs/Config.in b/fs/romfs/Config.in similarity index 100% rename from target/romfs/Config.in rename to fs/romfs/Config.in diff --git a/target/romfs/romfs.mk b/fs/romfs/romfs.mk similarity index 100% rename from target/romfs/romfs.mk rename to fs/romfs/romfs.mk diff --git a/target/squashfs/Config.in b/fs/squashfs/Config.in similarity index 100% rename from target/squashfs/Config.in rename to fs/squashfs/Config.in diff --git a/target/squashfs/squashfsroot.mk b/fs/squashfs/squashfsroot.mk similarity index 100% rename from target/squashfs/squashfsroot.mk rename to fs/squashfs/squashfsroot.mk diff --git a/target/tar/Config.in b/fs/tar/Config.in similarity index 100% rename from target/tar/Config.in rename to fs/tar/Config.in diff --git a/target/tar/tarroot.mk b/fs/tar/tarroot.mk similarity index 100% rename from target/tar/tarroot.mk rename to fs/tar/tarroot.mk diff --git a/target/ubifs/Config.in b/fs/ubifs/Config.in similarity index 100% rename from target/ubifs/Config.in rename to fs/ubifs/Config.in diff --git a/target/ubifs/ubifsroot.mk b/fs/ubifs/ubifsroot.mk similarity index 100% rename from target/ubifs/ubifsroot.mk rename to fs/ubifs/ubifsroot.mk diff --git a/target/Config.in b/target/Config.in index 5d634ca2a3..5d53635386 100644 --- a/target/Config.in +++ b/target/Config.in @@ -1,35 +1,4 @@ -menu "Target filesystem options" - -config BR2_ROOTFS_POST_BUILD_SCRIPT - string "Custom script to run before packing files" - default "" - help - Specify a script to be run after the build has finished and before - the BR2 starts packing the files into selected packages. - - This gives users the oportunity to do board-specific cleanups, - add-ons and the like, so the generated files can be used directly - without further processing. - - The script is called with the target directory name as first and - only argument. Make sure the exit code of that script is 0, - otherwise make will stop after calling it. - -comment "filesystem for target device" - -source "target/cramfs/Config.in" -source "target/cloop/Config.in" -source "target/ext2/Config.in" -source "target/jffs2/Config.in" -source "target/ubifs/Config.in" -source "target/squashfs/Config.in" -source "target/tar/Config.in" -source "target/cpio/Config.in" -source "target/iso9660/Config.in" -source "target/initramfs/Config.in" -source "target/romfs/Config.in" - -comment "bootloader for target device" +menu "Bootloaders" source "target/x86/grub/Config.in" #source "target/x86/grub2/Config.in" diff --git a/target/Makefile.in b/target/Makefile.in index 38993e5d8e..48396d5d86 100644 --- a/target/Makefile.in +++ b/target/Makefile.in @@ -62,8 +62,6 @@ ifeq ($(BR2_TARGET_UBOOT),y) include target/u-boot/Makefile.in endif -# and finally build the filesystems/tarballs -include target/common.mk include target/*/*.mk # kernel rules From 3474716bff31a3d287d0d3813eb7e107cedfa3ef Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 10 Mar 2010 22:31:32 +0100 Subject: [PATCH 42/44] Coherent naming for .mk files in fs/ Signed-off-by: Thomas Petazzoni --- fs/cpio/{cpioroot.mk => cpio.mk} | 0 fs/ext2/{ext2root.mk => ext2.mk} | 0 fs/jffs2/{jffs2root.mk => jffs2.mk} | 0 fs/squashfs/{squashfsroot.mk => squashfs.mk} | 0 fs/tar/{tarroot.mk => tar.mk} | 0 fs/ubifs/{ubifsroot.mk => ubifs.mk} | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename fs/cpio/{cpioroot.mk => cpio.mk} (100%) rename fs/ext2/{ext2root.mk => ext2.mk} (100%) rename fs/jffs2/{jffs2root.mk => jffs2.mk} (100%) rename fs/squashfs/{squashfsroot.mk => squashfs.mk} (100%) rename fs/tar/{tarroot.mk => tar.mk} (100%) rename fs/ubifs/{ubifsroot.mk => ubifs.mk} (100%) diff --git a/fs/cpio/cpioroot.mk b/fs/cpio/cpio.mk similarity index 100% rename from fs/cpio/cpioroot.mk rename to fs/cpio/cpio.mk diff --git a/fs/ext2/ext2root.mk b/fs/ext2/ext2.mk similarity index 100% rename from fs/ext2/ext2root.mk rename to fs/ext2/ext2.mk diff --git a/fs/jffs2/jffs2root.mk b/fs/jffs2/jffs2.mk similarity index 100% rename from fs/jffs2/jffs2root.mk rename to fs/jffs2/jffs2.mk diff --git a/fs/squashfs/squashfsroot.mk b/fs/squashfs/squashfs.mk similarity index 100% rename from fs/squashfs/squashfsroot.mk rename to fs/squashfs/squashfs.mk diff --git a/fs/tar/tarroot.mk b/fs/tar/tar.mk similarity index 100% rename from fs/tar/tarroot.mk rename to fs/tar/tar.mk diff --git a/fs/ubifs/ubifsroot.mk b/fs/ubifs/ubifs.mk similarity index 100% rename from fs/ubifs/ubifsroot.mk rename to fs/ubifs/ubifs.mk From c1d601afff4ca569933e60281b363ead9f15a1f4 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 10 Mar 2010 22:56:06 +0100 Subject: [PATCH 43/44] Update defconfigs after fs cleanup Signed-off-by: Thomas Petazzoni --- configs/at91rm9200df_defconfig | 8 ++++---- configs/at91rm9200df_ext_defconfig | 8 ++++---- configs/at91sam9260dfc_defconfig | 8 ++++---- configs/at91sam9260dfc_ext_defconfig | 8 ++++---- configs/at91sam9260pf_defconfig | 4 ++-- configs/at91sam9261ek_defconfig | 8 ++++---- configs/at91sam9261ek_ext_defconfig | 8 ++++---- configs/at91sam9263ek_defconfig | 8 ++++---- configs/at91sam9263ek_ext_defconfig | 8 ++++---- configs/at91sam9g20dfc_defconfig | 8 ++++---- configs/at91sam9g20dfc_ext_defconfig | 8 ++++---- configs/atngw100-base_defconfig | 6 +++--- configs/atngw100_defconfig | 6 +++--- configs/atstk1005_defconfig | 6 +++--- configs/atstk100x_defconfig | 6 +++--- configs/i386_defconfig | 4 ++-- configs/i686_defconfig | 4 ++-- configs/integrator926_defconfig | 6 +++--- configs/integrator926_huge_defconfig | 6 +++--- configs/kb9202_defconfig | 2 +- configs/v100sc2_defconfig | 2 +- 21 files changed, 66 insertions(+), 66 deletions(-) diff --git a/configs/at91rm9200df_defconfig b/configs/at91rm9200df_defconfig index d5c5249068..1fe6e3f0d1 100644 --- a/configs/at91rm9200df_defconfig +++ b/configs/at91rm9200df_defconfig @@ -853,12 +853,12 @@ BR2_TARGET_ROOTFS_EXT2_BLOCKS=0 BR2_TARGET_ROOTFS_EXT2_INODES=0 BR2_TARGET_ROOTFS_EXT2_RESBLKS=0 BR2_TARGET_ROOTFS_EXT2_SQUASH=y -BR2_TARGET_ROOTFS_EXT2_OUTPUT="$(IMAGE).ext2" + BR2_TARGET_ROOTFS_EXT2_NONE=y # BR2_TARGET_ROOTFS_EXT2_GZIP is not set # BR2_TARGET_ROOTFS_EXT2_BZIP2 is not set # BR2_TARGET_ROOTFS_EXT2_LZMA is not set -BR2_TARGET_ROOTFS_EXT2_COPYTO="/tftpboot" + BR2_TARGET_ROOTFS_JFFS2=y BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_1056=y # BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_528 is not set @@ -875,8 +875,8 @@ BR2_TARGET_ROOTFS_JFFS2_LE=y # BR2_TARGET_ROOTFS_JFFS2_BE is not set # BR2_TARGET_ROOTFS_JFFS2_SQUASH is not set # BR2_TARGET_ROOTFS_JFFS2_SUMMARY is not set -BR2_TARGET_ROOTFS_JFFS2_OUTPUT="$(IMAGE).jffs2" -BR2_TARGET_ROOTFS_JFFS2_COPYTO="/tftpboot" + + # BR2_TARGET_ROOTFS_UBIFS is not set # BR2_TARGET_ROOTFS_SQUASHFS is not set # BR2_TARGET_ROOTFS_TAR is not set diff --git a/configs/at91rm9200df_ext_defconfig b/configs/at91rm9200df_ext_defconfig index ca03b76729..32843bafa0 100644 --- a/configs/at91rm9200df_ext_defconfig +++ b/configs/at91rm9200df_ext_defconfig @@ -778,12 +778,12 @@ BR2_TARGET_ROOTFS_EXT2_BLOCKS=0 BR2_TARGET_ROOTFS_EXT2_INODES=0 BR2_TARGET_ROOTFS_EXT2_RESBLKS=0 BR2_TARGET_ROOTFS_EXT2_SQUASH=y -BR2_TARGET_ROOTFS_EXT2_OUTPUT="$(IMAGE).ext2" + BR2_TARGET_ROOTFS_EXT2_NONE=y # BR2_TARGET_ROOTFS_EXT2_GZIP is not set # BR2_TARGET_ROOTFS_EXT2_BZIP2 is not set # BR2_TARGET_ROOTFS_EXT2_LZMA is not set -BR2_TARGET_ROOTFS_EXT2_COPYTO="/tftpboot" + BR2_TARGET_ROOTFS_JFFS2=y BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_1056=y # BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_528 is not set @@ -800,8 +800,8 @@ BR2_TARGET_ROOTFS_JFFS2_LE=y # BR2_TARGET_ROOTFS_JFFS2_BE is not set # BR2_TARGET_ROOTFS_JFFS2_SQUASH is not set # BR2_TARGET_ROOTFS_JFFS2_SUMMARY is not set -BR2_TARGET_ROOTFS_JFFS2_OUTPUT="$(IMAGE).jffs2" -BR2_TARGET_ROOTFS_JFFS2_COPYTO="/tftpboot" + + # BR2_TARGET_ROOTFS_UBIFS is not set # BR2_TARGET_ROOTFS_SQUASHFS is not set # BR2_TARGET_ROOTFS_TAR is not set diff --git a/configs/at91sam9260dfc_defconfig b/configs/at91sam9260dfc_defconfig index 2d8961c75d..46166e0662 100644 --- a/configs/at91sam9260dfc_defconfig +++ b/configs/at91sam9260dfc_defconfig @@ -867,12 +867,12 @@ BR2_TARGET_ROOTFS_EXT2_BLOCKS=0 BR2_TARGET_ROOTFS_EXT2_INODES=0 BR2_TARGET_ROOTFS_EXT2_RESBLKS=0 BR2_TARGET_ROOTFS_EXT2_SQUASH=y -BR2_TARGET_ROOTFS_EXT2_OUTPUT="$(IMAGE).ext2" + BR2_TARGET_ROOTFS_EXT2_NONE=y # BR2_TARGET_ROOTFS_EXT2_GZIP is not set # BR2_TARGET_ROOTFS_EXT2_BZIP2 is not set # BR2_TARGET_ROOTFS_EXT2_LZMA is not set -BR2_TARGET_ROOTFS_EXT2_COPYTO="/tftpboot" + BR2_TARGET_ROOTFS_JFFS2=y BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_1056=y # BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_528 is not set @@ -889,8 +889,8 @@ BR2_TARGET_ROOTFS_JFFS2_LE=y # BR2_TARGET_ROOTFS_JFFS2_BE is not set # BR2_TARGET_ROOTFS_JFFS2_SQUASH is not set # BR2_TARGET_ROOTFS_JFFS2_SUMMARY is not set -BR2_TARGET_ROOTFS_JFFS2_OUTPUT="$(IMAGE).jffs2" -BR2_TARGET_ROOTFS_JFFS2_COPYTO="/tftpboot" + + # BR2_TARGET_ROOTFS_UBIFS is not set # BR2_TARGET_ROOTFS_SQUASHFS is not set # BR2_TARGET_ROOTFS_TAR is not set diff --git a/configs/at91sam9260dfc_ext_defconfig b/configs/at91sam9260dfc_ext_defconfig index ddd4b422b8..7f12884383 100644 --- a/configs/at91sam9260dfc_ext_defconfig +++ b/configs/at91sam9260dfc_ext_defconfig @@ -786,12 +786,12 @@ BR2_TARGET_ROOTFS_EXT2_BLOCKS=0 BR2_TARGET_ROOTFS_EXT2_INODES=0 BR2_TARGET_ROOTFS_EXT2_RESBLKS=0 BR2_TARGET_ROOTFS_EXT2_SQUASH=y -BR2_TARGET_ROOTFS_EXT2_OUTPUT="$(IMAGE).ext2" + BR2_TARGET_ROOTFS_EXT2_NONE=y # BR2_TARGET_ROOTFS_EXT2_GZIP is not set # BR2_TARGET_ROOTFS_EXT2_BZIP2 is not set # BR2_TARGET_ROOTFS_EXT2_LZMA is not set -BR2_TARGET_ROOTFS_EXT2_COPYTO="/tftpboot" + BR2_TARGET_ROOTFS_JFFS2=y BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_1056=y # BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_528 is not set @@ -808,8 +808,8 @@ BR2_TARGET_ROOTFS_JFFS2_LE=y # BR2_TARGET_ROOTFS_JFFS2_BE is not set # BR2_TARGET_ROOTFS_JFFS2_SQUASH is not set # BR2_TARGET_ROOTFS_JFFS2_SUMMARY is not set -BR2_TARGET_ROOTFS_JFFS2_OUTPUT="$(IMAGE).jffs2" -BR2_TARGET_ROOTFS_JFFS2_COPYTO="/tftpboot" + + # BR2_TARGET_ROOTFS_UBIFS is not set # BR2_TARGET_ROOTFS_SQUASHFS is not set # BR2_TARGET_ROOTFS_TAR is not set diff --git a/configs/at91sam9260pf_defconfig b/configs/at91sam9260pf_defconfig index 17477d224f..b9e8a28a67 100644 --- a/configs/at91sam9260pf_defconfig +++ b/configs/at91sam9260pf_defconfig @@ -558,12 +558,12 @@ BR2_TARGET_ROOTFS_EXT2_BLOCKS=0 BR2_TARGET_ROOTFS_EXT2_INODES=0 BR2_TARGET_ROOTFS_EXT2_RESBLKS=0 BR2_TARGET_ROOTFS_EXT2_SQUASH=y -BR2_TARGET_ROOTFS_EXT2_OUTPUT="$(IMAGE).ext2" + BR2_TARGET_ROOTFS_EXT2_NONE=y # BR2_TARGET_ROOTFS_EXT2_GZIP is not set # BR2_TARGET_ROOTFS_EXT2_BZIP2 is not set # BR2_TARGET_ROOTFS_EXT2_LZMA is not set -BR2_TARGET_ROOTFS_EXT2_COPYTO="" + # BR2_TARGET_ROOTFS_JFFS2 is not set # BR2_TARGET_ROOTFS_SQUASHFS is not set # BR2_TARGET_ROOTFS_TAR is not set diff --git a/configs/at91sam9261ek_defconfig b/configs/at91sam9261ek_defconfig index 824a503378..1073e78d26 100644 --- a/configs/at91sam9261ek_defconfig +++ b/configs/at91sam9261ek_defconfig @@ -918,12 +918,12 @@ BR2_TARGET_ROOTFS_EXT2_BLOCKS=0 BR2_TARGET_ROOTFS_EXT2_INODES=0 BR2_TARGET_ROOTFS_EXT2_RESBLKS=0 BR2_TARGET_ROOTFS_EXT2_SQUASH=y -BR2_TARGET_ROOTFS_EXT2_OUTPUT="$(IMAGE).ext2" + BR2_TARGET_ROOTFS_EXT2_NONE=y # BR2_TARGET_ROOTFS_EXT2_GZIP is not set # BR2_TARGET_ROOTFS_EXT2_BZIP2 is not set # BR2_TARGET_ROOTFS_EXT2_LZMA is not set -BR2_TARGET_ROOTFS_EXT2_COPYTO="" + BR2_TARGET_ROOTFS_JFFS2=y # BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_1056 is not set # BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_528 is not set @@ -941,8 +941,8 @@ BR2_TARGET_ROOTFS_JFFS2_LE=y # BR2_TARGET_ROOTFS_JFFS2_BE is not set # BR2_TARGET_ROOTFS_JFFS2_SQUASH is not set # BR2_TARGET_ROOTFS_JFFS2_SUMMARY is not set -BR2_TARGET_ROOTFS_JFFS2_OUTPUT="$(IMAGE).jffs2" -BR2_TARGET_ROOTFS_JFFS2_COPYTO="" + + # BR2_TARGET_ROOTFS_UBIFS is not set # BR2_TARGET_ROOTFS_SQUASHFS is not set # BR2_TARGET_ROOTFS_TAR is not set diff --git a/configs/at91sam9261ek_ext_defconfig b/configs/at91sam9261ek_ext_defconfig index 3ee047cdd0..d7f9f4ad43 100644 --- a/configs/at91sam9261ek_ext_defconfig +++ b/configs/at91sam9261ek_ext_defconfig @@ -874,12 +874,12 @@ BR2_TARGET_ROOTFS_EXT2_BLOCKS=0 BR2_TARGET_ROOTFS_EXT2_INODES=0 BR2_TARGET_ROOTFS_EXT2_RESBLKS=0 BR2_TARGET_ROOTFS_EXT2_SQUASH=y -BR2_TARGET_ROOTFS_EXT2_OUTPUT="$(IMAGE).ext2" + BR2_TARGET_ROOTFS_EXT2_NONE=y # BR2_TARGET_ROOTFS_EXT2_GZIP is not set # BR2_TARGET_ROOTFS_EXT2_BZIP2 is not set # BR2_TARGET_ROOTFS_EXT2_LZMA is not set -BR2_TARGET_ROOTFS_EXT2_COPYTO="" + BR2_TARGET_ROOTFS_JFFS2=y # BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_1056 is not set # BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_528 is not set @@ -897,8 +897,8 @@ BR2_TARGET_ROOTFS_JFFS2_LE=y # BR2_TARGET_ROOTFS_JFFS2_BE is not set # BR2_TARGET_ROOTFS_JFFS2_SQUASH is not set # BR2_TARGET_ROOTFS_JFFS2_SUMMARY is not set -BR2_TARGET_ROOTFS_JFFS2_OUTPUT="$(IMAGE).jffs2" -BR2_TARGET_ROOTFS_JFFS2_COPYTO="" + + # BR2_TARGET_ROOTFS_UBIFS is not set # BR2_TARGET_ROOTFS_SQUASHFS is not set # BR2_TARGET_ROOTFS_TAR is not set diff --git a/configs/at91sam9263ek_defconfig b/configs/at91sam9263ek_defconfig index 8dff3e4b82..74dbfcdbbd 100644 --- a/configs/at91sam9263ek_defconfig +++ b/configs/at91sam9263ek_defconfig @@ -915,12 +915,12 @@ BR2_TARGET_ROOTFS_EXT2_BLOCKS=0 BR2_TARGET_ROOTFS_EXT2_INODES=0 BR2_TARGET_ROOTFS_EXT2_RESBLKS=0 BR2_TARGET_ROOTFS_EXT2_SQUASH=y -BR2_TARGET_ROOTFS_EXT2_OUTPUT="$(IMAGE).ext2" + BR2_TARGET_ROOTFS_EXT2_NONE=y # BR2_TARGET_ROOTFS_EXT2_GZIP is not set # BR2_TARGET_ROOTFS_EXT2_BZIP2 is not set # BR2_TARGET_ROOTFS_EXT2_LZMA is not set -BR2_TARGET_ROOTFS_EXT2_COPYTO="" + BR2_TARGET_ROOTFS_JFFS2=y # BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_1056 is not set # BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_528 is not set @@ -938,8 +938,8 @@ BR2_TARGET_ROOTFS_JFFS2_LE=y # BR2_TARGET_ROOTFS_JFFS2_BE is not set # BR2_TARGET_ROOTFS_JFFS2_SQUASH is not set # BR2_TARGET_ROOTFS_JFFS2_SUMMARY is not set -BR2_TARGET_ROOTFS_JFFS2_OUTPUT="$(IMAGE).jffs2" -BR2_TARGET_ROOTFS_JFFS2_COPYTO="" + + # BR2_TARGET_ROOTFS_UBIFS is not set # BR2_TARGET_ROOTFS_SQUASHFS is not set # BR2_TARGET_ROOTFS_TAR is not set diff --git a/configs/at91sam9263ek_ext_defconfig b/configs/at91sam9263ek_ext_defconfig index a84cc7a432..44c30e22e0 100644 --- a/configs/at91sam9263ek_ext_defconfig +++ b/configs/at91sam9263ek_ext_defconfig @@ -836,12 +836,12 @@ BR2_TARGET_ROOTFS_EXT2_BLOCKS=0 BR2_TARGET_ROOTFS_EXT2_INODES=0 BR2_TARGET_ROOTFS_EXT2_RESBLKS=0 BR2_TARGET_ROOTFS_EXT2_SQUASH=y -BR2_TARGET_ROOTFS_EXT2_OUTPUT="$(IMAGE).ext2" + BR2_TARGET_ROOTFS_EXT2_NONE=y # BR2_TARGET_ROOTFS_EXT2_GZIP is not set # BR2_TARGET_ROOTFS_EXT2_BZIP2 is not set # BR2_TARGET_ROOTFS_EXT2_LZMA is not set -BR2_TARGET_ROOTFS_EXT2_COPYTO="" + BR2_TARGET_ROOTFS_JFFS2=y # BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_1056 is not set # BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_528 is not set @@ -859,8 +859,8 @@ BR2_TARGET_ROOTFS_JFFS2_LE=y # BR2_TARGET_ROOTFS_JFFS2_BE is not set # BR2_TARGET_ROOTFS_JFFS2_SQUASH is not set # BR2_TARGET_ROOTFS_JFFS2_SUMMARY is not set -BR2_TARGET_ROOTFS_JFFS2_OUTPUT="$(IMAGE).jffs2" -BR2_TARGET_ROOTFS_JFFS2_COPYTO="" + + # BR2_TARGET_ROOTFS_UBIFS is not set # BR2_TARGET_ROOTFS_SQUASHFS is not set # BR2_TARGET_ROOTFS_TAR is not set diff --git a/configs/at91sam9g20dfc_defconfig b/configs/at91sam9g20dfc_defconfig index 3f7da329b6..9b3af76927 100644 --- a/configs/at91sam9g20dfc_defconfig +++ b/configs/at91sam9g20dfc_defconfig @@ -783,12 +783,12 @@ BR2_TARGET_ROOTFS_EXT2_BLOCKS=0 BR2_TARGET_ROOTFS_EXT2_INODES=0 BR2_TARGET_ROOTFS_EXT2_RESBLKS=0 BR2_TARGET_ROOTFS_EXT2_SQUASH=y -BR2_TARGET_ROOTFS_EXT2_OUTPUT="$(IMAGE).ext2" + BR2_TARGET_ROOTFS_EXT2_NONE=y # BR2_TARGET_ROOTFS_EXT2_GZIP is not set # BR2_TARGET_ROOTFS_EXT2_BZIP2 is not set # BR2_TARGET_ROOTFS_EXT2_LZMA is not set -BR2_TARGET_ROOTFS_EXT2_COPYTO="/tftpboot" + BR2_TARGET_ROOTFS_JFFS2=y BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_1056=y # BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_528 is not set @@ -805,8 +805,8 @@ BR2_TARGET_ROOTFS_JFFS2_LE=y # BR2_TARGET_ROOTFS_JFFS2_BE is not set # BR2_TARGET_ROOTFS_JFFS2_SQUASH is not set # BR2_TARGET_ROOTFS_JFFS2_SUMMARY is not set -BR2_TARGET_ROOTFS_JFFS2_OUTPUT="$(IMAGE).jffs2" -BR2_TARGET_ROOTFS_JFFS2_COPYTO="/tftpboot" + + # BR2_TARGET_ROOTFS_UBIFS is not set # BR2_TARGET_ROOTFS_SQUASHFS is not set # BR2_TARGET_ROOTFS_TAR is not set diff --git a/configs/at91sam9g20dfc_ext_defconfig b/configs/at91sam9g20dfc_ext_defconfig index 84d703adeb..5bf6ea7d0e 100644 --- a/configs/at91sam9g20dfc_ext_defconfig +++ b/configs/at91sam9g20dfc_ext_defconfig @@ -786,12 +786,12 @@ BR2_TARGET_ROOTFS_EXT2_BLOCKS=0 BR2_TARGET_ROOTFS_EXT2_INODES=0 BR2_TARGET_ROOTFS_EXT2_RESBLKS=0 BR2_TARGET_ROOTFS_EXT2_SQUASH=y -BR2_TARGET_ROOTFS_EXT2_OUTPUT="$(IMAGE).ext2" + BR2_TARGET_ROOTFS_EXT2_NONE=y # BR2_TARGET_ROOTFS_EXT2_GZIP is not set # BR2_TARGET_ROOTFS_EXT2_BZIP2 is not set # BR2_TARGET_ROOTFS_EXT2_LZMA is not set -BR2_TARGET_ROOTFS_EXT2_COPYTO="/tftpboot" + BR2_TARGET_ROOTFS_JFFS2=y BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_1056=y # BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_528 is not set @@ -808,8 +808,8 @@ BR2_TARGET_ROOTFS_JFFS2_LE=y # BR2_TARGET_ROOTFS_JFFS2_BE is not set # BR2_TARGET_ROOTFS_JFFS2_SQUASH is not set # BR2_TARGET_ROOTFS_JFFS2_SUMMARY is not set -BR2_TARGET_ROOTFS_JFFS2_OUTPUT="$(IMAGE).jffs2" -BR2_TARGET_ROOTFS_JFFS2_COPYTO="/tftpboot" + + # BR2_TARGET_ROOTFS_UBIFS is not set # BR2_TARGET_ROOTFS_SQUASHFS is not set # BR2_TARGET_ROOTFS_TAR is not set diff --git a/configs/atngw100-base_defconfig b/configs/atngw100-base_defconfig index adae5c6a96..fe3498936a 100644 --- a/configs/atngw100-base_defconfig +++ b/configs/atngw100-base_defconfig @@ -723,8 +723,8 @@ BR2_TARGET_ROOTFS_JFFS2_PADSIZE=0x0 # BR2_TARGET_ROOTFS_JFFS2_LE is not set BR2_TARGET_ROOTFS_JFFS2_BE=y # BR2_TARGET_ROOTFS_JFFS2_SUMMARY is not set -BR2_TARGET_ROOTFS_JFFS2_OUTPUT="$(IMAGE).jffs2" -BR2_TARGET_ROOTFS_JFFS2_COPYTO="" + + # BR2_TARGET_ROOTFS_UBIFS is not set # BR2_TARGET_ROOTFS_SQUASHFS is not set BR2_TARGET_ROOTFS_TAR=y @@ -733,7 +733,7 @@ BR2_TARGET_ROOTFS_TAR_NONE=y # BR2_TARGET_ROOTFS_TAR_BZIP2 is not set # BR2_TARGET_ROOTFS_TAR_LZMA is not set BR2_TARGET_ROOTFS_TAR_OPTIONS="" -BR2_TARGET_ROOTFS_TAR_COPYTO="" + # BR2_TARGET_ROOTFS_CPIO is not set # BR2_TARGET_ROOTFS_INITRAMFS is not set # BR2_TARGET_ROOTFS_ROMFS is not set diff --git a/configs/atngw100_defconfig b/configs/atngw100_defconfig index 0c7639885d..4a702a593c 100644 --- a/configs/atngw100_defconfig +++ b/configs/atngw100_defconfig @@ -713,8 +713,8 @@ BR2_TARGET_ROOTFS_JFFS2_NOCLEANMARKER=y # BR2_TARGET_ROOTFS_JFFS2_LE is not set BR2_TARGET_ROOTFS_JFFS2_BE=y # BR2_TARGET_ROOTFS_JFFS2_SUMMARY is not set -BR2_TARGET_ROOTFS_JFFS2_OUTPUT="$(IMAGE).jffs2" -BR2_TARGET_ROOTFS_JFFS2_COPYTO="/tftpboot" + + # BR2_TARGET_ROOTFS_UBIFS is not set # BR2_TARGET_ROOTFS_SQUASHFS is not set BR2_TARGET_ROOTFS_TAR=y @@ -723,7 +723,7 @@ BR2_TARGET_ROOTFS_TAR_NONE=y # BR2_TARGET_ROOTFS_TAR_BZIP2 is not set # BR2_TARGET_ROOTFS_TAR_LZMA is not set BR2_TARGET_ROOTFS_TAR_OPTIONS="" -BR2_TARGET_ROOTFS_TAR_COPYTO="" + # BR2_TARGET_ROOTFS_CPIO is not set # BR2_TARGET_ROOTFS_INITRAMFS is not set # BR2_TARGET_ROOTFS_ROMFS is not set diff --git a/configs/atstk1005_defconfig b/configs/atstk1005_defconfig index 8044b388dc..c829495a86 100644 --- a/configs/atstk1005_defconfig +++ b/configs/atstk1005_defconfig @@ -757,8 +757,8 @@ BR2_TARGET_ROOTFS_JFFS2_NOCLEANMARKER=y BR2_TARGET_ROOTFS_JFFS2_BE=y # BR2_TARGET_ROOTFS_JFFS2_SQUASH is not set # BR2_TARGET_ROOTFS_JFFS2_SUMMARY is not set -BR2_TARGET_ROOTFS_JFFS2_OUTPUT="$(IMAGE).jffs2" -BR2_TARGET_ROOTFS_JFFS2_COPYTO="/tftpboot" + + # BR2_TARGET_ROOTFS_UBIFS is not set # BR2_TARGET_ROOTFS_SQUASHFS is not set BR2_TARGET_ROOTFS_TAR=y @@ -767,7 +767,7 @@ BR2_TARGET_ROOTFS_TAR_NONE=y # BR2_TARGET_ROOTFS_TAR_BZIP2 is not set # BR2_TARGET_ROOTFS_TAR_LZMA is not set BR2_TARGET_ROOTFS_TAR_OPTIONS="" -BR2_TARGET_ROOTFS_TAR_COPYTO="" + # BR2_TARGET_ROOTFS_CPIO is not set # BR2_TARGET_ROOTFS_INITRAMFS is not set # BR2_TARGET_ROOTFS_ROMFS is not set diff --git a/configs/atstk100x_defconfig b/configs/atstk100x_defconfig index aac5aa8f85..c1398d4eba 100644 --- a/configs/atstk100x_defconfig +++ b/configs/atstk100x_defconfig @@ -848,12 +848,12 @@ BR2_TARGET_ROOTFS_EXT2_BLOCKS=0 BR2_TARGET_ROOTFS_EXT2_INODES=0 BR2_TARGET_ROOTFS_EXT2_RESBLKS=0 BR2_TARGET_ROOTFS_EXT2_SQUASH=y -BR2_TARGET_ROOTFS_EXT2_OUTPUT="$(IMAGE).ext2" + # BR2_TARGET_ROOTFS_EXT2_NONE is not set # BR2_TARGET_ROOTFS_EXT2_GZIP is not set BR2_TARGET_ROOTFS_EXT2_BZIP2=y # BR2_TARGET_ROOTFS_EXT2_LZMA is not set -BR2_TARGET_ROOTFS_EXT2_COPYTO="/tftpboot" + # BR2_TARGET_ROOTFS_JFFS2 is not set # BR2_TARGET_ROOTFS_UBIFS is not set # BR2_TARGET_ROOTFS_SQUASHFS is not set @@ -863,7 +863,7 @@ BR2_TARGET_ROOTFS_TAR_NONE=y # BR2_TARGET_ROOTFS_TAR_BZIP2 is not set # BR2_TARGET_ROOTFS_TAR_LZMA is not set BR2_TARGET_ROOTFS_TAR_OPTIONS="" -BR2_TARGET_ROOTFS_TAR_COPYTO="" + # BR2_TARGET_ROOTFS_CPIO is not set # BR2_TARGET_ROOTFS_INITRAMFS is not set # BR2_TARGET_ROOTFS_ROMFS is not set diff --git a/configs/i386_defconfig b/configs/i386_defconfig index f4506f128c..4c2d092cd7 100644 --- a/configs/i386_defconfig +++ b/configs/i386_defconfig @@ -701,8 +701,8 @@ BR2_TARGET_ROOTFS_JFFS2_EBSIZE=0x20000 BR2_TARGET_ROOTFS_JFFS2_LE=y # BR2_TARGET_ROOTFS_JFFS2_BE is not set # BR2_TARGET_ROOTFS_JFFS2_SUMMARY is not set -BR2_TARGET_ROOTFS_JFFS2_OUTPUT="$(IMAGE).jffs2" -BR2_TARGET_ROOTFS_JFFS2_COPYTO="" + + # BR2_TARGET_ROOTFS_UBIFS is not set # BR2_TARGET_ROOTFS_SQUASHFS is not set # BR2_TARGET_ROOTFS_TAR is not set diff --git a/configs/i686_defconfig b/configs/i686_defconfig index fc1f2788fe..dcf35d7644 100644 --- a/configs/i686_defconfig +++ b/configs/i686_defconfig @@ -701,8 +701,8 @@ BR2_TARGET_ROOTFS_JFFS2_EBSIZE=0x20000 BR2_TARGET_ROOTFS_JFFS2_LE=y # BR2_TARGET_ROOTFS_JFFS2_BE is not set # BR2_TARGET_ROOTFS_JFFS2_SUMMARY is not set -BR2_TARGET_ROOTFS_JFFS2_OUTPUT="$(IMAGE).jffs2" -BR2_TARGET_ROOTFS_JFFS2_COPYTO="" + + # BR2_TARGET_ROOTFS_UBIFS is not set # BR2_TARGET_ROOTFS_SQUASHFS is not set # BR2_TARGET_ROOTFS_TAR is not set diff --git a/configs/integrator926_defconfig b/configs/integrator926_defconfig index e985df460a..e537b40947 100644 --- a/configs/integrator926_defconfig +++ b/configs/integrator926_defconfig @@ -687,12 +687,12 @@ BR2_TARGET_ROOTFS_EXT2_BLOCKS=0 BR2_TARGET_ROOTFS_EXT2_INODES=0 BR2_TARGET_ROOTFS_EXT2_RESBLKS=0 BR2_TARGET_ROOTFS_EXT2_SQUASH=y -BR2_TARGET_ROOTFS_EXT2_OUTPUT="$(IMAGE).ext2" + BR2_TARGET_ROOTFS_EXT2_NONE=y # BR2_TARGET_ROOTFS_EXT2_GZIP is not set # BR2_TARGET_ROOTFS_EXT2_BZIP2 is not set # BR2_TARGET_ROOTFS_EXT2_LZMA is not set -BR2_TARGET_ROOTFS_EXT2_COPYTO="" + # BR2_TARGET_ROOTFS_JFFS2 is not set # BR2_TARGET_ROOTFS_UBIFS is not set # BR2_TARGET_ROOTFS_SQUASHFS is not set @@ -702,7 +702,7 @@ BR2_TARGET_ROOTFS_TAR_NONE=y # BR2_TARGET_ROOTFS_TAR_BZIP2 is not set # BR2_TARGET_ROOTFS_TAR_LZMA is not set BR2_TARGET_ROOTFS_TAR_OPTIONS="" -BR2_TARGET_ROOTFS_TAR_COPYTO="" + # BR2_TARGET_ROOTFS_CPIO is not set # BR2_TARGET_ROOTFS_INITRAMFS is not set # BR2_TARGET_ROOTFS_ROMFS is not set diff --git a/configs/integrator926_huge_defconfig b/configs/integrator926_huge_defconfig index b0d1dfe72b..276d69a41e 100644 --- a/configs/integrator926_huge_defconfig +++ b/configs/integrator926_huge_defconfig @@ -664,12 +664,12 @@ BR2_TARGET_ROOTFS_EXT2_BLOCKS=0 BR2_TARGET_ROOTFS_EXT2_INODES=0 BR2_TARGET_ROOTFS_EXT2_RESBLKS=0 BR2_TARGET_ROOTFS_EXT2_SQUASH=y -BR2_TARGET_ROOTFS_EXT2_OUTPUT="$(IMAGE).ext2" + BR2_TARGET_ROOTFS_EXT2_NONE=y # BR2_TARGET_ROOTFS_EXT2_GZIP is not set # BR2_TARGET_ROOTFS_EXT2_BZIP2 is not set # BR2_TARGET_ROOTFS_EXT2_LZMA is not set -BR2_TARGET_ROOTFS_EXT2_COPYTO="" + # BR2_TARGET_ROOTFS_JFFS2 is not set # BR2_TARGET_ROOTFS_UBIFS is not set # BR2_TARGET_ROOTFS_SQUASHFS is not set @@ -679,7 +679,7 @@ BR2_TARGET_ROOTFS_CPIO_NONE=y # BR2_TARGET_ROOTFS_CPIO_GZIP is not set # BR2_TARGET_ROOTFS_CPIO_BZIP2 is not set # BR2_TARGET_ROOTFS_CPIO_LZMA is not set -BR2_TARGET_ROOTFS_CPIO_COPYTO="" + # BR2_TARGET_ROOTFS_INITRAMFS is not set # BR2_TARGET_ROOTFS_ROMFS is not set diff --git a/configs/kb9202_defconfig b/configs/kb9202_defconfig index 3a0dfd691c..67e6d6840a 100644 --- a/configs/kb9202_defconfig +++ b/configs/kb9202_defconfig @@ -672,7 +672,7 @@ BR2_TARGET_ROOTFS_TAR_NONE=y # BR2_TARGET_ROOTFS_TAR_BZIP2 is not set # BR2_TARGET_ROOTFS_TAR_LZMA is not set BR2_TARGET_ROOTFS_TAR_OPTIONS="" -BR2_TARGET_ROOTFS_TAR_COPYTO="" + # BR2_TARGET_ROOTFS_CPIO is not set # BR2_TARGET_ROOTFS_INITRAMFS is not set # BR2_TARGET_ROOTFS_ROMFS is not set diff --git a/configs/v100sc2_defconfig b/configs/v100sc2_defconfig index 3c2afa4549..836321aa2a 100644 --- a/configs/v100sc2_defconfig +++ b/configs/v100sc2_defconfig @@ -703,7 +703,7 @@ BR2_TARGET_ROOTFS_TAR_NONE=y # BR2_TARGET_ROOTFS_TAR_BZIP2 is not set # BR2_TARGET_ROOTFS_TAR_LZMA is not set BR2_TARGET_ROOTFS_TAR_OPTIONS="" -BR2_TARGET_ROOTFS_TAR_COPYTO="" + # BR2_TARGET_ROOTFS_CPIO is not set # BR2_TARGET_ROOTFS_INITRAMFS is not set # BR2_TARGET_ROOTFS_ROMFS is not set From 0b79c5022d32b15180a18087a0fba5a2f1af5cc7 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 10 Mar 2010 23:05:14 +0100 Subject: [PATCH 44/44] fs/*/Config.in: remove useless configuration comments The dependency on gzip, bzip2 and lzma are properly handled automatically. No need to tell the user about this. Signed-off-by: Thomas Petazzoni --- fs/cpio/Config.in | 6 ------ fs/ext2/Config.in | 6 ------ fs/tar/Config.in | 6 ------ fs/ubifs/Config.in | 9 --------- 4 files changed, 27 deletions(-) diff --git a/fs/cpio/Config.in b/fs/cpio/Config.in index 02fd00d342..374cfe0cd5 100644 --- a/fs/cpio/Config.in +++ b/fs/cpio/Config.in @@ -19,22 +19,16 @@ config BR2_TARGET_ROOTFS_CPIO_GZIP bool "gzip" help Do compress the cpio filesystem with gzip. - Note that you either have to have gzip installed on your host - or select to build a gzip for your host. See the packages submenu. config BR2_TARGET_ROOTFS_CPIO_BZIP2 bool "bzip2" help Do compress the cpio filesystem with bzip2. - Note that you either have to have bzip2 installed on your host - or select to build a bzip2 for your host. See the packages submenu. config BR2_TARGET_ROOTFS_CPIO_LZMA bool "lzma" help Do compress the cpio filesystem with lzma. - Note that you either have to have lzma installed on your host - or select to build a lzma for your host. See the packages submenu. endchoice diff --git a/fs/ext2/Config.in b/fs/ext2/Config.in index 02ec18f406..5c041d95d7 100644 --- a/fs/ext2/Config.in +++ b/fs/ext2/Config.in @@ -40,22 +40,16 @@ config BR2_TARGET_ROOTFS_EXT2_GZIP bool "gzip" help Do compress the ext2 filesystem with gzip. - Note that you either have to have gzip installed on your host - or select to build a gzip for your host. See the packages submenu. config BR2_TARGET_ROOTFS_EXT2_BZIP2 bool "bzip2" help Do compress the ext2 filesystem with bzip2. - Note that you either have to have bzip2 installed on your host - or select to build a bzip2 for your host. See the packages submenu. config BR2_TARGET_ROOTFS_EXT2_LZMA bool "lzma" help Do compress the ext2 filesystem with lzma. - Note that you either have to have lzma installed on your host - or select to build a lzma for your host. See the packages submenu. endchoice diff --git a/fs/tar/Config.in b/fs/tar/Config.in index 0adca795f0..5aaf9bd55c 100644 --- a/fs/tar/Config.in +++ b/fs/tar/Config.in @@ -19,22 +19,16 @@ config BR2_TARGET_ROOTFS_TAR_GZIP bool "gzip" help Do compress the tarball with gzip. - Note that you either have to have gzip installed on your host - or select to build a gzip for your host. See the packages submenu. config BR2_TARGET_ROOTFS_TAR_BZIP2 bool "bzip2" help Do compress the tarball with bzip2. - Note that you either have to have bzip2 installed on your host - or select to build a bzip2 for your host. See the packages submenu. config BR2_TARGET_ROOTFS_TAR_LZMA bool "lzma" help Do compress the tarball with lzma. - Note that you either have to have lzma installed on your host - or select to build a lzma for your host. See the packages submenu. endchoice diff --git a/fs/ubifs/Config.in b/fs/ubifs/Config.in index 9fa510e752..bcf409cad6 100644 --- a/fs/ubifs/Config.in +++ b/fs/ubifs/Config.in @@ -64,25 +64,16 @@ config BR2_TARGET_ROOTFS_UBIFS_GZIP bool "gzip" help Do compress the ubifs filesystem with gzip. - Note that you either have to have gzip installed on your - host or select to build a gzip for your host. See the - packages submenu. config BR2_TARGET_ROOTFS_UBIFS_BZIP2 bool "bzip2" help Do compress the ubifs filesystem with bzip2. - Note that you either have to have bzip2 installed on your - host or select to build a bzip2 for your host. See the - packages submenu. config BR2_TARGET_ROOTFS_UBIFS_LZMA bool "lzma" help Do compress the ubifs filesystem with lzma. - Note that you either have to have lzma installed on your - host or select to build a lzma for your host. See the - packages submenu. endchoice