From e01de2e7d6b5402a9dd5e9b2754035676a542a1e Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 2 Mar 2010 22:40:45 +0100 Subject: 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 (limited to 'target/cramfs') diff --git a/target/cramfs/Config.in b/target/cramfs/Config.in index 0c1cb7822..1a4e32647 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 884eb8cb8..000000000 --- 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 0da55bfae..000000000 --- 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 4ea358ede..000000000 --- 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 e6d63ed01..f43162905 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 -- cgit v1.2.3 From 5e530b7b95535fb6960e68a4ffba015c4c60fbaf Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 10 Mar 2010 00:13:39 +0100 Subject: cramfs: convert to ROOTFS_TARGET infrastructure Signed-off-by: Thomas Petazzoni --- target/cramfs/cramfs.mk | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) (limited to 'target/cramfs') diff --git a/target/cramfs/cramfs.mk b/target/cramfs/cramfs.mk index f43162905..ccd316f5d 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 -- cgit v1.2.3 From 0585241505cfaddc9db6ae92739bdfb5ce5f9794 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 10 Mar 2010 22:30:06 +0100 Subject: Move all filesystem generation code to fs/ Signed-off-by: Thomas Petazzoni --- Config.in | 2 + Makefile | 2 + fs/Config.in | 30 +++++ fs/cloop/Config.in | 10 ++ fs/cloop/cloop.mk | 13 +++ fs/common.mk | 70 ++++++++++++ fs/cpio/Config.in | 40 +++++++ fs/cpio/cpioroot.mk | 18 +++ fs/cramfs/Config.in | 6 + fs/cramfs/cramfs.mk | 22 ++++ fs/ext2/Config.in | 61 ++++++++++ fs/ext2/ext2root.mk | 40 +++++++ fs/initramfs/Config.in | 15 +++ fs/initramfs/gen_initramfs_list.sh | 203 +++++++++++++++++++++++++++++++++ fs/initramfs/initramfs.mk | 18 +++ fs/iso9660/Config.in | 16 +++ fs/iso9660/iso9660.mk | 49 ++++++++ fs/iso9660/menu.lst | 11 ++ fs/jffs2/Config.in | 117 +++++++++++++++++++ fs/jffs2/jffs2root.mk | 61 ++++++++++ fs/romfs/Config.in | 5 + fs/romfs/romfs.mk | 15 +++ fs/squashfs/Config.in | 4 + fs/squashfs/squashfsroot.mk | 13 +++ fs/tar/Config.in | 47 ++++++++ fs/tar/tarroot.mk | 13 +++ fs/ubifs/Config.in | 88 ++++++++++++++ fs/ubifs/ubifsroot.mk | 25 ++++ target/Config.in | 33 +----- target/Makefile.in | 2 - target/cloop/Config.in | 10 -- target/cloop/cloop.mk | 13 --- target/common.mk | 68 ----------- target/cpio/Config.in | 40 ------- target/cpio/cpioroot.mk | 18 --- target/cramfs/Config.in | 6 - target/cramfs/cramfs.mk | 22 ---- target/ext2/Config.in | 61 ---------- target/ext2/ext2root.mk | 40 ------- target/initramfs/Config.in | 15 --- target/initramfs/gen_initramfs_list.sh | 203 --------------------------------- target/initramfs/initramfs.mk | 18 --- target/iso9660/Config.in | 16 --- target/iso9660/iso9660.mk | 49 -------- target/iso9660/menu.lst | 11 -- target/jffs2/Config.in | 117 ------------------- target/jffs2/jffs2root.mk | 61 ---------- target/romfs/Config.in | 5 - target/romfs/romfs.mk | 15 --- target/squashfs/Config.in | 4 - target/squashfs/squashfsroot.mk | 13 --- target/tar/Config.in | 47 -------- target/tar/tarroot.mk | 13 --- target/ubifs/Config.in | 88 -------------- target/ubifs/ubifsroot.mk | 25 ---- 55 files changed, 1015 insertions(+), 1012 deletions(-) create mode 100644 fs/Config.in create mode 100644 fs/cloop/Config.in create mode 100644 fs/cloop/cloop.mk create mode 100644 fs/common.mk create mode 100644 fs/cpio/Config.in create mode 100644 fs/cpio/cpioroot.mk create mode 100644 fs/cramfs/Config.in create mode 100644 fs/cramfs/cramfs.mk create mode 100644 fs/ext2/Config.in create mode 100644 fs/ext2/ext2root.mk create mode 100644 fs/initramfs/Config.in create mode 100644 fs/initramfs/gen_initramfs_list.sh create mode 100644 fs/initramfs/initramfs.mk create mode 100644 fs/iso9660/Config.in create mode 100644 fs/iso9660/iso9660.mk create mode 100644 fs/iso9660/menu.lst create mode 100644 fs/jffs2/Config.in create mode 100644 fs/jffs2/jffs2root.mk create mode 100644 fs/romfs/Config.in create mode 100644 fs/romfs/romfs.mk create mode 100644 fs/squashfs/Config.in create mode 100644 fs/squashfs/squashfsroot.mk create mode 100644 fs/tar/Config.in create mode 100644 fs/tar/tarroot.mk create mode 100644 fs/ubifs/Config.in create mode 100644 fs/ubifs/ubifsroot.mk delete mode 100644 target/cloop/Config.in delete mode 100644 target/cloop/cloop.mk delete mode 100644 target/common.mk delete mode 100644 target/cpio/Config.in delete mode 100644 target/cpio/cpioroot.mk delete mode 100644 target/cramfs/Config.in delete mode 100644 target/cramfs/cramfs.mk delete mode 100644 target/ext2/Config.in delete mode 100644 target/ext2/ext2root.mk delete mode 100644 target/initramfs/Config.in delete mode 100644 target/initramfs/gen_initramfs_list.sh delete mode 100644 target/initramfs/initramfs.mk delete mode 100644 target/iso9660/Config.in delete mode 100644 target/iso9660/iso9660.mk delete mode 100644 target/iso9660/menu.lst delete mode 100644 target/jffs2/Config.in delete mode 100644 target/jffs2/jffs2root.mk delete mode 100644 target/romfs/Config.in delete mode 100644 target/romfs/romfs.mk delete mode 100644 target/squashfs/Config.in delete mode 100644 target/squashfs/squashfsroot.mk delete mode 100644 target/tar/Config.in delete mode 100644 target/tar/tarroot.mk delete mode 100644 target/ubifs/Config.in delete mode 100644 target/ubifs/ubifsroot.mk (limited to 'target/cramfs') diff --git a/Config.in b/Config.in index 4f567d007..224a44ae2 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 b47c0b0dd..ce6bf3d4c 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 000000000..f885c52e7 --- /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/fs/cloop/Config.in b/fs/cloop/Config.in new file mode 100644 index 000000000..3e01067a1 --- /dev/null +++ b/fs/cloop/Config.in @@ -0,0 +1,10 @@ +config BR2_TARGET_ROOTFS_CLOOP + bool "cloop root filesystem for the target device" + help + Build a cloop root filesystem + + cloop is a Linux kernel module that enables compressed + loopback filesystem support. With it you can mount a + compressed filesystem like a block device and seamlessly + decompress its data while accessing it. The majority of the + software on an LNX-BBC is accessed in this fashion. diff --git a/fs/cloop/cloop.mk b/fs/cloop/cloop.mk new file mode 100644 index 000000000..c1d6abb80 --- /dev/null +++ b/fs/cloop/cloop.mk @@ -0,0 +1,13 @@ +############################################################# +# +# Build the compressed loop root filesystem image +# +############################################################# + +ROOTFS_CLOOP_DEPENDENCIES = host-cloop host-cdrkit + +define ROOTFS_CLOOP_CMD + $(HOST_DIR)/usr/bin/genisoimage -r $(TARGET_DIR) | $(HOST_DIR)/usr/bin/create_compressed_fs - 65536 > $$@ +endef + +$(eval $(call ROOTFS_TARGET,cloop)) \ No newline at end of file diff --git a/fs/common.mk b/fs/common.mk new file mode 100644 index 000000000..fa6afd94d --- /dev/null +++ b/fs/common.mk @@ -0,0 +1,70 @@ +# +# 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 + +$(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 + 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: $(BINARIES_DIR)/rootfs.$(1) + +ifeq ($$(BR2_TARGET_ROOTFS_$(2)),y) +TARGETS += $(1)-root +endif +endef + +define ROOTFS_TARGET +$(call ROOTFS_TARGET_INTERNAL,$(1),$(call UPPERCASE,$(1))) +endef + +include fs/*/*.mk diff --git a/fs/cpio/Config.in b/fs/cpio/Config.in new file mode 100644 index 000000000..02fd00d34 --- /dev/null +++ b/fs/cpio/Config.in @@ -0,0 +1,40 @@ +config BR2_TARGET_ROOTFS_CPIO + bool "cpio the root filesystem" + help + Build a cpio archive of the root filesystem + +choice + prompt "Compression method" + default BR2_TARGET_ROOTFS_CPIO_NONE + depends on BR2_TARGET_ROOTFS_CPIO + help + Select compressor for cpio filesystem of the root filesystem + +config BR2_TARGET_ROOTFS_CPIO_NONE + bool "no compression" + help + Do not compress the cpio filesystem. + +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/cpio/cpioroot.mk b/fs/cpio/cpioroot.mk new file mode 100644 index 000000000..ab7d54618 --- /dev/null +++ b/fs/cpio/cpioroot.mk @@ -0,0 +1,18 @@ +############################################################# +# +# cpio to archive target filesystem +# +############################################################# + +define ROOTFS_CPIO_INIT_SYMLINK + rm -f $(TARGET_DIR)/init + ln -s sbin/init $(TARGET_DIR)/init +endef + +ROOTFS_CPIO_PRE_GEN_HOOKS += ROOTFS_CPIO_INIT_SYMLINK + +define ROOTFS_CPIO_CMD + cd $(TARGET_DIR) && find . | cpio --quiet -o -H newc > $$@ +endef + +$(eval $(call ROOTFS_TARGET,cpio)) \ No newline at end of file diff --git a/fs/cramfs/Config.in b/fs/cramfs/Config.in new file mode 100644 index 000000000..1a4e32647 --- /dev/null +++ b/fs/cramfs/Config.in @@ -0,0 +1,6 @@ +config BR2_TARGET_ROOTFS_CRAMFS + bool "cramfs root filesystem" + help + Build a cramfs root filesystem + + http://sourceforge.net/projects/cramfs/ diff --git a/fs/cramfs/cramfs.mk b/fs/cramfs/cramfs.mk new file mode 100644 index 000000000..ccd316f5d --- /dev/null +++ b/fs/cramfs/cramfs.mk @@ -0,0 +1,22 @@ +############################################################# +# +# Build the cramfs root filesystem image +# +############################################################# +ifeq ($(BR2_ENDIAN),"BIG") +CRAMFS_OPTS=-b +else +CRAMFS_OPTS=-l +endif + +ifneq ($(TARGET_DEVICE_TABLE),) +CRAMFS_OPTS += -D $(TARGET_DEVICE_TABLE) +endif + +define ROOTFS_CRAMFS_CMD + $(HOST_DIR)/usr/bin/mkcramfs -q $(CRAMFS_OPTS) $(TARGET_DIR) $$@ +endef + +ROOTFS_CRAMFS_DEPENDENCIES = host-cramfs + +$(eval $(call ROOTFS_TARGET,cramfs)) \ No newline at end of file diff --git a/fs/ext2/Config.in b/fs/ext2/Config.in new file mode 100644 index 000000000..02ec18f40 --- /dev/null +++ b/fs/ext2/Config.in @@ -0,0 +1,61 @@ +config BR2_TARGET_ROOTFS_EXT2 + bool "ext2 root filesystem" + default y + help + Build an ext2 root filesystem + +config BR2_TARGET_ROOTFS_EXT2_BLOCKS + int "size in blocks (leave at 0 for auto calculation)" + depends on BR2_TARGET_ROOTFS_EXT2 + default 0 + +config BR2_TARGET_ROOTFS_EXT2_INODES + int "inodes (leave at 0 for auto calculation)" + depends on BR2_TARGET_ROOTFS_EXT2 + default 0 + +config BR2_TARGET_ROOTFS_EXT2_RESBLKS + int "reserved blocks percentage" + depends on BR2_TARGET_ROOTFS_EXT2 + default 0 + +config BR2_TARGET_ROOTFS_EXT2_SQUASH + bool "Make all files be owned by root" + depends on BR2_TARGET_ROOTFS_EXT2 + default y + +choice + prompt "Compression method" + default BR2_TARGET_ROOTFS_EXT2_NONE + depends on BR2_TARGET_ROOTFS_EXT2 + help + Select compressor for ext2 filesystem of the root filesystem + +config BR2_TARGET_ROOTFS_EXT2_NONE + bool "no compression" + help + Do not compress the ext2 filesystem. + +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/ext2/ext2root.mk b/fs/ext2/ext2root.mk new file mode 100644 index 000000000..68b3b813c --- /dev/null +++ b/fs/ext2/ext2root.mk @@ -0,0 +1,40 @@ +############################################################# +# +# Build the ext2 root filesystem image +# +############################################################# + +EXT2_OPTS := + +ifeq ($(BR2_TARGET_ROOTFS_EXT2_SQUASH),y) +EXT2_OPTS += -U +endif + +ifneq ($(strip $(BR2_TARGET_ROOTFS_EXT2_BLOCKS)),0) +EXT2_OPTS += -b $(BR2_TARGET_ROOTFS_EXT2_BLOCKS) +endif + +ifneq ($(strip $(BR2_TARGET_ROOTFS_EXT2_INODES)),0) +EXT2_OPTS += -N $(BR2_TARGET_ROOTFS_EXT2_INODES) +endif + +ifneq ($(strip $(BR2_TARGET_ROOTFS_EXT2_RESBLKS)),) +EXT2_OPTS += -m $(BR2_TARGET_ROOTFS_EXT2_RESBLKS) +endif + +ROOTFS_EXT2_DEPENDENCIES = host-genext2fs + +ifeq ($(strip $(BR2_TARGET_ROOTFS_EXT2_BLOCKS)),0) +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 + +define ROOTFS_EXT2_CMD + $(HOST_DIR)/usr/bin/genext2fs -d $(TARGET_DIR) $(EXT2_OPTS) $$@ +endef + +$(eval $(call ROOTFS_TARGET,ext2)) \ No newline at end of file diff --git a/fs/initramfs/Config.in b/fs/initramfs/Config.in new file mode 100644 index 000000000..d53982cb9 --- /dev/null +++ b/fs/initramfs/Config.in @@ -0,0 +1,15 @@ +config BR2_TARGET_ROOTFS_INITRAMFS + bool "initramfs for initial ramdisk of linux kernel" + help + Build a file which is usable for the gen_init_cpio tool + at linux kernel build. + This file is normally called initramfs_list and can be + generated with gen_initramfs_list.sh script from the root + directory structure. + The file is then used in the kernel build process to generate + the cpio filesystem for the initial ramdisk. Make sure that + you configure this file in kernel build configuration. + The location in the kernel build configuration menu is + Device Drivers -> Block devices -> Initramfs source file(s). + The configuration variable is CONFIG_INITRAMFS_SOURCE + diff --git a/fs/initramfs/gen_initramfs_list.sh b/fs/initramfs/gen_initramfs_list.sh new file mode 100644 index 000000000..26252b619 --- /dev/null +++ b/fs/initramfs/gen_initramfs_list.sh @@ -0,0 +1,203 @@ +#!/bin/sh +# Copyright (C) Martin Schlemmer +# Released under the terms of the GNU GPL +# +# Generate a newline separated list of entries from the file/directory +# supplied as an argument. +# +# If a file/directory is not supplied then generate a small dummy file. +# +# The output is suitable for gen_init_cpio built from usr/gen_init_cpio.c. +# + +default_initramfs() { + cat <<-EOF + # This is a very simple, default initramfs + + dir /dev 0755 0 0 + nod /dev/console 0600 0 0 c 5 1 + dir /root 0700 0 0 + EOF +} + +filetype() { + local argv1="$1" + + # symlink test must come before file test + if [ -L "$argv1" ]; then + echo "slink" + elif [ -f "$argv1" ]; then + echo "file" + elif [ -d "$argv1" ]; then + echo "dir" + elif [ -b "$argv1" -o -c "$argv1" ]; then + echo "nod" + elif [ -p "$argv1" ]; then + echo "pipe" + elif [ -S "$argv1" ]; then + echo "sock" + else + echo "invalid" + fi + return 0 +} + +print_mtime() { + local argv1="$1" + local mymtime="0" + + if [ -e "$argv1" ]; then + mymtime=$(find "$argv1" -printf "%T@\n" | sort -r | head -n 1) + fi + + echo "# Last modified: $mymtime" + echo +} + +parse() { + local location="$1" + local name=$(echo "$location" | sed -e "s,$srcdir,,") + # change '//' into '/' + name=$(echo $name | sed -e 's,/[/]*,/,g') + local mode="$2" + local uid="$3" + local gid="$4" + local ftype=$(filetype "$location") + # remap uid/gid to 0 if necessary + [ "x$uid" != "x" ] && [ $uid -eq $root_uid ] && uid=0 + [ "x$gid" != "x" ] && [ $gid -eq $root_gid ] && gid=0 + local str="$mode $uid $gid" + + [ "$ftype" = "invalid" ] && return 0 + [ "$location" = "$srcdir" ] && return 0 + + case "$ftype" in + "file") + str="$ftype $name $location $str" + ;; + "nod") + local devtype= + local maj=$(LC_ALL=C ls -l "$location" | \ + awk '{sub(/,/, "", $5); print $5}') + local min=$(LC_ALL=C ls -l "$location" | \ + awk '{print $6}') + + if [ -b "$location" ]; then + devtype="b" + else + devtype="c" + fi + str="$ftype $name $str $devtype $maj $min" + ;; + "slink") + local target=$(LC_ALL=C ls -l "$location" | \ + awk '{print $11}') + str="$ftype $name $target $str" + ;; + *) + str="$ftype $name $str" + ;; + esac + + echo "$str" + + return 0 +} + +usage() { + printf "Usage:\n" + printf "$0 [ [-u ] [-g ] [-d | ] ] . . .\n" + printf "\n" + printf -- "-u User ID to map to user ID 0 (root).\n" + printf " is only meaningful if \n" + printf " is a directory.\n" + printf -- "-g Group ID to map to group ID 0 (root).\n" + printf " is only meaningful if \n" + printf " is a directory.\n" + printf " File list or directory for cpio archive.\n" + printf " If is not provided then a\n" + printf " a default list will be output.\n" + printf -- "-d Output the default cpio list. If no \n" + printf " is given then the default cpio list will be output.\n" + printf "\n" + printf "All options may be repeated and are interpreted sequentially\n" + printf "and immediately. -u and -g states are preserved across\n" + printf " options so an explicit \"-u 0 -g 0\" is required\n" + printf "to reset the root/group mapping.\n" +} + +build_list() { + printf "\n#####################\n# $cpio_source\n" + + if [ -f "$cpio_source" ]; then + print_mtime "$cpio_source" + cat "$cpio_source" + elif [ -d "$cpio_source" ]; then + srcdir=$(echo "$cpio_source" | sed -e 's://*:/:g;s:/$::') + dirlist=$(find "$srcdir" -printf "%p %m %U %G\n" 2>/dev/null) + + # If $dirlist is only one line, then the directory is empty + if [ "$(echo "$dirlist" | wc -l)" -gt 1 ]; then + print_mtime "$cpio_source" + + echo "$dirlist" | \ + while read x; do + parse $x + done + else + # Failsafe in case directory is empty + default_initramfs + fi + else + echo " $0: Cannot open '$cpio_source'" >&2 + exit 1 + fi +} + + +root_uid=0 +root_gid=0 + +while [ $# -gt 0 ]; do + arg="$1" + shift + case "$arg" in + "-u") + root_uid="$1" + shift + ;; + "-g") + root_gid="$1" + shift + ;; + "-d") + default_list="$arg" + default_initramfs + ;; + "-h") + usage + exit 0 + ;; + *) + case "$arg" in + "-"*) + printf "ERROR: unknown option \"$arg\"\n" >&2 + printf "If the filename validly begins with '-', then it must be prefixed\n" >&2 + printf "by './' so that it won't be interpreted as an option." >&2 + printf "\n" >&2 + usage >&2 + exit 1 + ;; + *) + cpio_source="$arg" + build_list + ;; + esac + ;; + esac +done + +# spit out the default cpio list if a source hasn't been specified +[ -z "$cpio_source" -a -z "$default_list" ] && default_initramfs + +exit 0 diff --git a/fs/initramfs/initramfs.mk b/fs/initramfs/initramfs.mk new file mode 100644 index 000000000..cf1fcdbae --- /dev/null +++ b/fs/initramfs/initramfs.mk @@ -0,0 +1,18 @@ +############################################################# +# +# Make a initramfs_list file to be used by gen_init_cpio +# gen_init_cpio is part of the 2.6 linux kernels to build an +# initial ramdisk filesystem based on cpio +# +############################################################# + +define ROOTFS_INITRAMFS_INIT_SYMLINK + rm -f $(TARGET_DIR)/init + ln -s sbin/init $(TARGET_DIR)/init +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 diff --git a/fs/iso9660/Config.in b/fs/iso9660/Config.in new file mode 100644 index 000000000..ceee52ff9 --- /dev/null +++ b/fs/iso9660/Config.in @@ -0,0 +1,16 @@ +config BR2_TARGET_ROOTFS_ISO9660 + bool "iso image" + depends on BR2_i386 + depends on !BR2_KERNEL_none + select BR2_TARGET_ROOTFS_EXT2 + select BR2_TARGET_GRUB + help + Build a bootable iso9660 image + +config BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU + string "Boot menu.lst file" + depends on BR2_TARGET_ROOTFS_ISO9660 + default "target/iso9660/menu.lst" + +comment "iso image requires a Linux kernel to be built" + depends on BR2_i386 && BR2_KERNEL_none diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk new file mode 100644 index 000000000..66e2de20b --- /dev/null +++ b/fs/iso9660/iso9660.mk @@ -0,0 +1,49 @@ +############################################################# +# +# 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_BOOT_MENU:=$(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU)) +ISO9660_OPTS:= + +ifeq ($(BR2_TARGET_ROOTFS_ISO9660_SQUASH),y) +ISO9660_OPTS+=-U +endif + +$(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/ + cp $(ISO9660_BOOT_MENU) $(ISO9660_TARGET_DIR)/boot/grub/menu.lst + 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 $(FAKEROOT_SCRIPT) + touch $(BUILD_DIR)/.fakeroot.00000 + 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_DIR)" \ + >> $(FAKEROOT_SCRIPT) + chmod a+x $(FAKEROOT_SCRIPT) + $(HOST_DIR)/usr/bin/fakeroot -- $(FAKEROOT_SCRIPT) + -@rm -f $(FAKEROOT_SCRIPT) + -@rm -rf $(ISO9660_TARGET_DIR) + +iso9660-root: $(BINARIES_DIR)/rootfs.iso9660 + +############################################################# +# +# Toplevel Makefile options +# +############################################################# +ifeq ($(BR2_TARGET_ROOTFS_ISO9660),y) +TARGETS+=iso9660-root +endif diff --git a/fs/iso9660/menu.lst b/fs/iso9660/menu.lst new file mode 100644 index 000000000..d78caebe1 --- /dev/null +++ b/fs/iso9660/menu.lst @@ -0,0 +1,11 @@ +default 0 +timeout 10 +color cyan/blue white/blue + +title Hard Drive (first partition) +rootnoverify (hd0) +chainloader +1 + +title BuildRoot ISO9660 image +kernel /kernel +initrd /initrd diff --git a/fs/jffs2/Config.in b/fs/jffs2/Config.in new file mode 100644 index 000000000..b787ec9d1 --- /dev/null +++ b/fs/jffs2/Config.in @@ -0,0 +1,117 @@ +config BR2_TARGET_ROOTFS_JFFS2 + bool "jffs2 root filesystem" + help + Build a jffs2 root filesystem + +if BR2_TARGET_ROOTFS_JFFS2 + +choice + prompt "Flash Type" + default BR2_TARGET_ROOTFS_JFFS2_FLASH_128 + +config BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_1056 + bool "AT45 dataflash with 1056 byte pagesize" + select BR2_TARGET_ROOTFS_JFFS2_NOCLEANMARKER + +config BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_528 + bool "AT45 dataflash with 528 byte pagesize" + select BR2_TARGET_ROOTFS_JFFS2_NOCLEANMARKER + +config BR2_TARGET_ROOTFS_JFFS2_NANDFLASH_512_16K + bool "NAND flash with 512B Page and 16 kB erasesize" + select BR2_TARGET_ROOTFS_JFFS2_NOCLEANMARKER + +config BR2_TARGET_ROOTFS_JFFS2_NANDFLASH_2K_128K + bool "NAND flash with 2kB Page and 128 kB erasesize" + select BR2_TARGET_ROOTFS_JFFS2_NOCLEANMARKER + +config BR2_TARGET_ROOTFS_JFFS2_FLASH_128 + bool "Parallel flash with 4 kB pagesize and 128 kB erase size" + +config BR2_TARGET_ROOTFS_JFFS2_FLASH_64 + bool "Parallel flash with 4 kB pagesize and 64 kB erase size" + +config BR2_TARGET_ROOTFS_JFFS2_CUSTOM + bool "Select custom page and erase size" + +endchoice + +config BR2_TARGET_ROOTFS_JFFS2_CUSTOM_PAGESIZE + hex "Page Size" + depends on BR2_TARGET_ROOTFS_JFFS2_CUSTOM + default 0x1000 + help + Set to pagesize of memory + +config BR2_TARGET_ROOTFS_JFFS2_CUSTOM_EBSIZE + hex "Erase block size" + depends on BR2_TARGET_ROOTFS_JFFS2_CUSTOM + default 0x20000 + help + Set to erase size of memory + +config BR2_TARGET_ROOTFS_JFFS2_PAGESIZE + hex + default 0x420 if BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_1056 + default 0x210 if BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_528 + default 0x200 if BR2_TARGET_ROOTFS_JFFS2_NANDFLASH_512_16K + default 0x800 if BR2_TARGET_ROOTFS_JFFS2_NANDFLASH_2K_128K + default 0x1000 if BR2_TARGET_ROOTFS_JFFS2_FLASH_128 + default 0x1000 if BR2_TARGET_ROOTFS_JFFS2_FLASH_64 + default $(BR2_TARGET_ROOTFS_JFFS2_CUSTOM_PAGESIZE) if BR2_TARGET_ROOTFS_JFFS2_CUSTOM + +config BR2_TARGET_ROOTFS_JFFS2_EBSIZE + hex + default 0x2100 if BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_1056 + default 0x1080 if BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_528 + default 0x4000 if BR2_TARGET_ROOTFS_JFFS2_NANDFLASH_512_16K + default 0x20000 if BR2_TARGET_ROOTFS_JFFS2_NANDFLASH_2K_128K + default 0x20000 if BR2_TARGET_ROOTFS_JFFS2_FLASH_128 + default 0x10000 if BR2_TARGET_ROOTFS_JFFS2_FLASH_64 + default $(BR2_TARGET_ROOTFS_JFFS2_CUSTOM_EBSIZE) if BR2_TARGET_ROOTFS_JFFS2_CUSTOM + +config BR2_TARGET_ROOTFS_JFFS2_NOCLEANMARKER + bool "Do not use Cleanmarker" + default y if BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_1056 + default y if BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_528 + default y if BR2_TARGET_ROOTFS_JFFS2_NANDFLASH_512_16K + default y if BR2_TARGET_ROOTFS_JFFS2_NANDFLASH_2K_128K + help + Do not use cleanmarkers if using NAND flash or Dataflash where + the pagesize is not a power of 2 + +config BR2_JFFS2_TARGET_SREC + bool "RootFS in SREC file formet" + +config BR2_TARGET_ROOTFS_JFFS2_PAD + bool "Pad output" + +config BR2_TARGET_ROOTFS_JFFS2_PADSIZE + hex "Pad output size (0x0 = to end of EB)" + depends on BR2_TARGET_ROOTFS_JFFS2_PAD + default 0x0 + help + Set to 0x0 to pad to end of erase block. + +choice + prompt "Endianess" + default BR2_TARGET_ROOTFS_JFFS2_BE if BR2_alpha || BR2_armeb || \ + BR2_avr32 || BR2_m68k || BR2_mips || \ + BR2_powerpc || BR2_sh2a_nofpueb || BR2_sh2eb || \ + BR2_sh3eb || BR2_sh4eb || BR2_sparc || BR2_sparc64 + +config BR2_TARGET_ROOTFS_JFFS2_LE + bool "little-endian" + +config BR2_TARGET_ROOTFS_JFFS2_BE + bool "big-endian" + +endchoice + +config BR2_TARGET_ROOTFS_JFFS2_SUMMARY + bool "Produce a summarized JFFS2 image" + help + A summarised image can be mounted faster if support is + enabled in the kernel (CONFIG_JFFS2_SUMMARY) + +endif diff --git a/fs/jffs2/jffs2root.mk b/fs/jffs2/jffs2root.mk new file mode 100644 index 000000000..a0a563d18 --- /dev/null +++ b/fs/jffs2/jffs2root.mk @@ -0,0 +1,61 @@ +############################################################# +# +# Build the jffs2 root filesystem image +# +############################################################# + +JFFS2_OPTS := -e $(BR2_TARGET_ROOTFS_JFFS2_EBSIZE) +SUMTOOL_OPTS := $(JFFS2_OPTS) + +ifeq ($(BR2_TARGET_ROOTFS_JFFS2_PAD),y) +ifneq ($(strip $(BR2_TARGET_ROOTFS_JFFS2_PADSIZE)),0x0) +JFFS2_OPTS += --pad=$(strip $(BR2_TARGET_ROOTFS_JFFS2_PADSIZE)) +else +JFFS2_OPTS += -p +endif +SUMTOOL_OPTS += -p +endif + +ifeq ($(BR2_TARGET_ROOTFS_JFFS2_LE),y) +JFFS2_OPTS += -l +SUMTOOL_OPTS += -l +endif + +ifeq ($(BR2_TARGET_ROOTFS_JFFS2_BE),y) +JFFS2_OPTS += -b +SUMTOOL_OPTS += -b +endif + +JFFS2_OPTS += -s $(BR2_TARGET_ROOTFS_JFFS2_PAGESIZE) +ifeq ($(BR2_TARGET_ROOTFS_JFFS2_NOCLEANMARKER),y) +JFFS2_OPTS += -n +SUMTOOL_OPTS += -n +endif + +ifneq ($(TARGET_DEVICE_TABLE),) +JFFS2_OPTS += -D $(TARGET_DEVICE_TABLE) +endif + +ROOTFS_JFFS2_DEPENDENCIES = host-mtd + +ifneq ($(BR2_TARGET_ROOTFS_JFFS2_SUMMARY),) +define ROOTFS_JFFS2_CMD + $(MKFS_JFFS2) $(JFFS2_OPTS) -d $(TARGET_DIR) -o $$@.nosummary && \ + $(SUMTOOL) $(SUMTOOL_OPTS) -i $$@.nosummary -o $$@ && \ + rm $$@.nosummary +endef +else +define ROOTFS_JFFS2_CMD + $(MKFS_JFFS2) $(JFFS2_OPTS) -d $(TARGET_DIR) -o $$@ +endef +endif + +define JFFS2_GEN_SREC + $(TARGET_CROSS)objcopy -I binary -O srec --adjust-vma 0xa1000000 $$@ $$@.srec +endef + +ifeq ($(BR2_JFFS2_TARGET_SREC),y) +ROOTFS_JFFS2_POST_GEN_HOOKS += JFFS2_GEN_SREC +endif + +$(eval $(call ROOTFS_TARGET,jffs2)) \ No newline at end of file diff --git a/fs/romfs/Config.in b/fs/romfs/Config.in new file mode 100644 index 000000000..7a8c663dd --- /dev/null +++ b/fs/romfs/Config.in @@ -0,0 +1,5 @@ +config BR2_TARGET_ROOTFS_ROMFS + bool "romfs root filesystem" + help + Build a romfs image of the root filesystem. + diff --git a/fs/romfs/romfs.mk b/fs/romfs/romfs.mk new file mode 100644 index 000000000..971947880 --- /dev/null +++ b/fs/romfs/romfs.mk @@ -0,0 +1,15 @@ +############################################################# +# +# Build the romfs root filesystem image +# +############################################################# + +ROMFS_TARGET=$(IMAGE).romfs + +ROOTFS_ROMFS_DEPENDENCIES = host-genromfs + +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 diff --git a/fs/squashfs/Config.in b/fs/squashfs/Config.in new file mode 100644 index 000000000..6cc8fcae0 --- /dev/null +++ b/fs/squashfs/Config.in @@ -0,0 +1,4 @@ +config BR2_TARGET_ROOTFS_SQUASHFS + bool "squashfs root filesystem" + help + Build a squashfs root filesystem diff --git a/fs/squashfs/squashfsroot.mk b/fs/squashfs/squashfsroot.mk new file mode 100644 index 000000000..d72388ebf --- /dev/null +++ b/fs/squashfs/squashfsroot.mk @@ -0,0 +1,13 @@ +############################################################# +# +# Build the squashfs root filesystem image +# +############################################################# + +ROOTFS_SQUASHFS_DEPENDENCIES = host-squashfs + +define ROOTFS_SQUASHFS_CMD + $(HOST_DIR)/usr/bin/mksquashfs $(TARGET_DIR) $$@ -noappend +endef + +$(eval $(call ROOTFS_TARGET,squashfs)) \ No newline at end of file diff --git a/fs/tar/Config.in b/fs/tar/Config.in new file mode 100644 index 000000000..0adca795f --- /dev/null +++ b/fs/tar/Config.in @@ -0,0 +1,47 @@ +config BR2_TARGET_ROOTFS_TAR + bool "tar the root filesystem" + help + Build a tar archive of the root filesystem + +choice + prompt "Compression method" + default BR2_TARGET_ROOTFS_TAR_NONE + depends on BR2_TARGET_ROOTFS_TAR + help + Select compressor for tar archive of the root filesystem + +config BR2_TARGET_ROOTFS_TAR_NONE + bool "no compression" + help + Do not compress the tarball. + +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 + +config BR2_TARGET_ROOTFS_TAR_OPTIONS + string "other random options to pass to tar" + depends on BR2_TARGET_ROOTFS_TAR + default "" + help + Any other flags you want to pass to tar + Refer to tar --help for details diff --git a/fs/tar/tarroot.mk b/fs/tar/tarroot.mk new file mode 100644 index 000000000..4d435cb33 --- /dev/null +++ b/fs/tar/tarroot.mk @@ -0,0 +1,13 @@ +############################################################# +# +# tar to archive target filesystem +# +############################################################# + +TAR_OPTS:=$(BR2_TARGET_ROOTFS_TAR_OPTIONS) + +define ROOTFS_TAR_CMD + tar -c$(TAR_OPTS)f $$@ -C $(TARGET_DIR) . +endef + +$(eval $(call ROOTFS_TARGET,tar)) diff --git a/fs/ubifs/Config.in b/fs/ubifs/Config.in new file mode 100644 index 000000000..9fa510e75 --- /dev/null +++ b/fs/ubifs/Config.in @@ -0,0 +1,88 @@ +config BR2_TARGET_ROOTFS_UBIFS + bool "ubifs root filesystem" + help + Build a ubifs root filesystem + +config BR2_TARGET_ROOTFS_UBIFS_LEBSIZE + hex "UBI logical erase block size" + depends on BR2_TARGET_ROOTFS_UBIFS + default 0x1f800 + +config BR2_TARGET_ROOTFS_UBIFS_MINIOSIZE + hex "UBI minimum I/O size" + depends on BR2_TARGET_ROOTFS_UBIFS + default 0x800 + help + Some comment required here + +config BR2_TARGET_ROOTFS_UBIFS_MAXLEBCNT + int "Maximum LEB count" + depends on BR2_TARGET_ROOTFS_UBIFS + default 2048 + help + Some comment required here + +choice + prompt "ubifs runtime compression" + default BR2_TARGET_ROOTFS_UBIFS_RT_LZO + depends on BR2_TARGET_ROOTFS_UBIFS + help + Select which compression format to use at run-time within + the ubifs file system. + +config BR2_TARGET_ROOTFS_UBIFS_RT_NONE + bool "no compression" + help + Don't use run-time compression. + +config BR2_TARGET_ROOTFS_UBIFS_RT_ZLIB + bool "gzip" + help + Use zlib compression at run-time. + +config BR2_TARGET_ROOTFS_UBIFS_RT_LZO + bool "lzo" + help + Use lzo compression at run-time. + +endchoice + +choice + prompt "Compression method" + default BR2_TARGET_ROOTFS_UBIFS_NONE + depends on BR2_TARGET_ROOTFS_UBIFS + help + Select which compression format to compress the final image + into. + +config BR2_TARGET_ROOTFS_UBIFS_NONE + bool "no compression" + help + Do not compress the ubifs filesystem. + +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 + diff --git a/fs/ubifs/ubifsroot.mk b/fs/ubifs/ubifsroot.mk new file mode 100644 index 000000000..0fad23421 --- /dev/null +++ b/fs/ubifs/ubifsroot.mk @@ -0,0 +1,25 @@ +############################################################# +# +# Build the ubifs root filesystem image +# +############################################################# + +UBIFS_OPTS := -e $(BR2_TARGET_ROOTFS_UBIFS_LEBSIZE) -c $(BR2_TARGET_ROOTFS_UBIFS_MAXLEBCNT) -m $(BR2_TARGET_ROOTFS_UBIFS_MINIOSIZE) + +ifeq ($(BR2_TARGET_ROOTFS_UBIFS_RT_ZLIB),y) +UBIFS_OPTS += -x zlib +endif +ifeq ($(BR2_TARGET_ROOTFS_UBIFS_RT_LZI),y) +UBIFS_OPTS += -x lzo +endif +ifeq ($(BR2_TARGET_ROOTFS_UBIFS_RT_NONE),y) +UBIFS_OPTS += -x none +endif + +ROOTFS_UBIFS_DEPENDENCIES = host-mtd + +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 diff --git a/target/Config.in b/target/Config.in index 5d634ca2a..5d5363538 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 38993e5d8..48396d5d8 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 diff --git a/target/cloop/Config.in b/target/cloop/Config.in deleted file mode 100644 index 3e01067a1..000000000 --- a/target/cloop/Config.in +++ /dev/null @@ -1,10 +0,0 @@ -config BR2_TARGET_ROOTFS_CLOOP - bool "cloop root filesystem for the target device" - help - Build a cloop root filesystem - - cloop is a Linux kernel module that enables compressed - loopback filesystem support. With it you can mount a - compressed filesystem like a block device and seamlessly - decompress its data while accessing it. The majority of the - software on an LNX-BBC is accessed in this fashion. diff --git a/target/cloop/cloop.mk b/target/cloop/cloop.mk deleted file mode 100644 index c1d6abb80..000000000 --- a/target/cloop/cloop.mk +++ /dev/null @@ -1,13 +0,0 @@ -############################################################# -# -# Build the compressed loop root filesystem image -# -############################################################# - -ROOTFS_CLOOP_DEPENDENCIES = host-cloop host-cdrkit - -define ROOTFS_CLOOP_CMD - $(HOST_DIR)/usr/bin/genisoimage -r $(TARGET_DIR) | $(HOST_DIR)/usr/bin/create_compressed_fs - 65536 > $$@ -endef - -$(eval $(call ROOTFS_TARGET,cloop)) \ No newline at end of file diff --git a/target/common.mk b/target/common.mk deleted file mode 100644 index cebe8c34a..000000000 --- a/target/common.mk +++ /dev/null @@ -1,68 +0,0 @@ -# -# 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 - -$(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 - 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: $(BINARIES_DIR)/rootfs.$(1) - -ifeq ($$(BR2_TARGET_ROOTFS_$(2)),y) -TARGETS += $(1)-root -endif -endef - -define ROOTFS_TARGET -$(call ROOTFS_TARGET_INTERNAL,$(1),$(call UPPERCASE,$(1))) -endef diff --git a/target/cpio/Config.in b/target/cpio/Config.in deleted file mode 100644 index 02fd00d34..000000000 --- a/target/cpio/Config.in +++ /dev/null @@ -1,40 +0,0 @@ -config BR2_TARGET_ROOTFS_CPIO - bool "cpio the root filesystem" - help - Build a cpio archive of the root filesystem - -choice - prompt "Compression method" - default BR2_TARGET_ROOTFS_CPIO_NONE - depends on BR2_TARGET_ROOTFS_CPIO - help - Select compressor for cpio filesystem of the root filesystem - -config BR2_TARGET_ROOTFS_CPIO_NONE - bool "no compression" - help - Do not compress the cpio filesystem. - -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/target/cpio/cpioroot.mk b/target/cpio/cpioroot.mk deleted file mode 100644 index ab7d54618..000000000 --- a/target/cpio/cpioroot.mk +++ /dev/null @@ -1,18 +0,0 @@ -############################################################# -# -# cpio to archive target filesystem -# -############################################################# - -define ROOTFS_CPIO_INIT_SYMLINK - rm -f $(TARGET_DIR)/init - ln -s sbin/init $(TARGET_DIR)/init -endef - -ROOTFS_CPIO_PRE_GEN_HOOKS += ROOTFS_CPIO_INIT_SYMLINK - -define ROOTFS_CPIO_CMD - cd $(TARGET_DIR) && find . | cpio --quiet -o -H newc > $$@ -endef - -$(eval $(call ROOTFS_TARGET,cpio)) \ No newline at end of file diff --git a/target/cramfs/Config.in b/target/cramfs/Config.in deleted file mode 100644 index 1a4e32647..000000000 --- a/target/cramfs/Config.in +++ /dev/null @@ -1,6 +0,0 @@ -config BR2_TARGET_ROOTFS_CRAMFS - bool "cramfs root filesystem" - help - Build a cramfs root filesystem - - http://sourceforge.net/projects/cramfs/ diff --git a/target/cramfs/cramfs.mk b/target/cramfs/cramfs.mk deleted file mode 100644 index ccd316f5d..000000000 --- a/target/cramfs/cramfs.mk +++ /dev/null @@ -1,22 +0,0 @@ -############################################################# -# -# Build the cramfs root filesystem image -# -############################################################# -ifeq ($(BR2_ENDIAN),"BIG") -CRAMFS_OPTS=-b -else -CRAMFS_OPTS=-l -endif - -ifneq ($(TARGET_DEVICE_TABLE),) -CRAMFS_OPTS += -D $(TARGET_DEVICE_TABLE) -endif - -define ROOTFS_CRAMFS_CMD - $(HOST_DIR)/usr/bin/mkcramfs -q $(CRAMFS_OPTS) $(TARGET_DIR) $$@ -endef - -ROOTFS_CRAMFS_DEPENDENCIES = host-cramfs - -$(eval $(call ROOTFS_TARGET,cramfs)) \ No newline at end of file diff --git a/target/ext2/Config.in b/target/ext2/Config.in deleted file mode 100644 index 02ec18f40..000000000 --- a/target/ext2/Config.in +++ /dev/null @@ -1,61 +0,0 @@ -config BR2_TARGET_ROOTFS_EXT2 - bool "ext2 root filesystem" - default y - help - Build an ext2 root filesystem - -config BR2_TARGET_ROOTFS_EXT2_BLOCKS - int "size in blocks (leave at 0 for auto calculation)" - depends on BR2_TARGET_ROOTFS_EXT2 - default 0 - -config BR2_TARGET_ROOTFS_EXT2_INODES - int "inodes (leave at 0 for auto calculation)" - depends on BR2_TARGET_ROOTFS_EXT2 - default 0 - -config BR2_TARGET_ROOTFS_EXT2_RESBLKS - int "reserved blocks percentage" - depends on BR2_TARGET_ROOTFS_EXT2 - default 0 - -config BR2_TARGET_ROOTFS_EXT2_SQUASH - bool "Make all files be owned by root" - depends on BR2_TARGET_ROOTFS_EXT2 - default y - -choice - prompt "Compression method" - default BR2_TARGET_ROOTFS_EXT2_NONE - depends on BR2_TARGET_ROOTFS_EXT2 - help - Select compressor for ext2 filesystem of the root filesystem - -config BR2_TARGET_ROOTFS_EXT2_NONE - bool "no compression" - help - Do not compress the ext2 filesystem. - -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/target/ext2/ext2root.mk b/target/ext2/ext2root.mk deleted file mode 100644 index 68b3b813c..000000000 --- a/target/ext2/ext2root.mk +++ /dev/null @@ -1,40 +0,0 @@ -############################################################# -# -# Build the ext2 root filesystem image -# -############################################################# - -EXT2_OPTS := - -ifeq ($(BR2_TARGET_ROOTFS_EXT2_SQUASH),y) -EXT2_OPTS += -U -endif - -ifneq ($(strip $(BR2_TARGET_ROOTFS_EXT2_BLOCKS)),0) -EXT2_OPTS += -b $(BR2_TARGET_ROOTFS_EXT2_BLOCKS) -endif - -ifneq ($(strip $(BR2_TARGET_ROOTFS_EXT2_INODES)),0) -EXT2_OPTS += -N $(BR2_TARGET_ROOTFS_EXT2_INODES) -endif - -ifneq ($(strip $(BR2_TARGET_ROOTFS_EXT2_RESBLKS)),) -EXT2_OPTS += -m $(BR2_TARGET_ROOTFS_EXT2_RESBLKS) -endif - -ROOTFS_EXT2_DEPENDENCIES = host-genext2fs - -ifeq ($(strip $(BR2_TARGET_ROOTFS_EXT2_BLOCKS)),0) -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 - -define ROOTFS_EXT2_CMD - $(HOST_DIR)/usr/bin/genext2fs -d $(TARGET_DIR) $(EXT2_OPTS) $$@ -endef - -$(eval $(call ROOTFS_TARGET,ext2)) \ No newline at end of file diff --git a/target/initramfs/Config.in b/target/initramfs/Config.in deleted file mode 100644 index d53982cb9..000000000 --- a/target/initramfs/Config.in +++ /dev/null @@ -1,15 +0,0 @@ -config BR2_TARGET_ROOTFS_INITRAMFS - bool "initramfs for initial ramdisk of linux kernel" - help - Build a file which is usable for the gen_init_cpio tool - at linux kernel build. - This file is normally called initramfs_list and can be - generated with gen_initramfs_list.sh script from the root - directory structure. - The file is then used in the kernel build process to generate - the cpio filesystem for the initial ramdisk. Make sure that - you configure this file in kernel build configuration. - The location in the kernel build configuration menu is - Device Drivers -> Block devices -> Initramfs source file(s). - The configuration variable is CONFIG_INITRAMFS_SOURCE - diff --git a/target/initramfs/gen_initramfs_list.sh b/target/initramfs/gen_initramfs_list.sh deleted file mode 100644 index 26252b619..000000000 --- a/target/initramfs/gen_initramfs_list.sh +++ /dev/null @@ -1,203 +0,0 @@ -#!/bin/sh -# Copyright (C) Martin Schlemmer -# Released under the terms of the GNU GPL -# -# Generate a newline separated list of entries from the file/directory -# supplied as an argument. -# -# If a file/directory is not supplied then generate a small dummy file. -# -# The output is suitable for gen_init_cpio built from usr/gen_init_cpio.c. -# - -default_initramfs() { - cat <<-EOF - # This is a very simple, default initramfs - - dir /dev 0755 0 0 - nod /dev/console 0600 0 0 c 5 1 - dir /root 0700 0 0 - EOF -} - -filetype() { - local argv1="$1" - - # symlink test must come before file test - if [ -L "$argv1" ]; then - echo "slink" - elif [ -f "$argv1" ]; then - echo "file" - elif [ -d "$argv1" ]; then - echo "dir" - elif [ -b "$argv1" -o -c "$argv1" ]; then - echo "nod" - elif [ -p "$argv1" ]; then - echo "pipe" - elif [ -S "$argv1" ]; then - echo "sock" - else - echo "invalid" - fi - return 0 -} - -print_mtime() { - local argv1="$1" - local mymtime="0" - - if [ -e "$argv1" ]; then - mymtime=$(find "$argv1" -printf "%T@\n" | sort -r | head -n 1) - fi - - echo "# Last modified: $mymtime" - echo -} - -parse() { - local location="$1" - local name=$(echo "$location" | sed -e "s,$srcdir,,") - # change '//' into '/' - name=$(echo $name | sed -e 's,/[/]*,/,g') - local mode="$2" - local uid="$3" - local gid="$4" - local ftype=$(filetype "$location") - # remap uid/gid to 0 if necessary - [ "x$uid" != "x" ] && [ $uid -eq $root_uid ] && uid=0 - [ "x$gid" != "x" ] && [ $gid -eq $root_gid ] && gid=0 - local str="$mode $uid $gid" - - [ "$ftype" = "invalid" ] && return 0 - [ "$location" = "$srcdir" ] && return 0 - - case "$ftype" in - "file") - str="$ftype $name $location $str" - ;; - "nod") - local devtype= - local maj=$(LC_ALL=C ls -l "$location" | \ - awk '{sub(/,/, "", $5); print $5}') - local min=$(LC_ALL=C ls -l "$location" | \ - awk '{print $6}') - - if [ -b "$location" ]; then - devtype="b" - else - devtype="c" - fi - str="$ftype $name $str $devtype $maj $min" - ;; - "slink") - local target=$(LC_ALL=C ls -l "$location" | \ - awk '{print $11}') - str="$ftype $name $target $str" - ;; - *) - str="$ftype $name $str" - ;; - esac - - echo "$str" - - return 0 -} - -usage() { - printf "Usage:\n" - printf "$0 [ [-u ] [-g ] [-d | ] ] . . .\n" - printf "\n" - printf -- "-u User ID to map to user ID 0 (root).\n" - printf " is only meaningful if \n" - printf " is a directory.\n" - printf -- "-g Group ID to map to group ID 0 (root).\n" - printf " is only meaningful if \n" - printf " is a directory.\n" - printf " File list or directory for cpio archive.\n" - printf " If is not provided then a\n" - printf " a default list will be output.\n" - printf -- "-d Output the default cpio list. If no \n" - printf " is given then the default cpio list will be output.\n" - printf "\n" - printf "All options may be repeated and are interpreted sequentially\n" - printf "and immediately. -u and -g states are preserved across\n" - printf " options so an explicit \"-u 0 -g 0\" is required\n" - printf "to reset the root/group mapping.\n" -} - -build_list() { - printf "\n#####################\n# $cpio_source\n" - - if [ -f "$cpio_source" ]; then - print_mtime "$cpio_source" - cat "$cpio_source" - elif [ -d "$cpio_source" ]; then - srcdir=$(echo "$cpio_source" | sed -e 's://*:/:g;s:/$::') - dirlist=$(find "$srcdir" -printf "%p %m %U %G\n" 2>/dev/null) - - # If $dirlist is only one line, then the directory is empty - if [ "$(echo "$dirlist" | wc -l)" -gt 1 ]; then - print_mtime "$cpio_source" - - echo "$dirlist" | \ - while read x; do - parse $x - done - else - # Failsafe in case directory is empty - default_initramfs - fi - else - echo " $0: Cannot open '$cpio_source'" >&2 - exit 1 - fi -} - - -root_uid=0 -root_gid=0 - -while [ $# -gt 0 ]; do - arg="$1" - shift - case "$arg" in - "-u") - root_uid="$1" - shift - ;; - "-g") - root_gid="$1" - shift - ;; - "-d") - default_list="$arg" - default_initramfs - ;; - "-h") - usage - exit 0 - ;; - *) - case "$arg" in - "-"*) - printf "ERROR: unknown option \"$arg\"\n" >&2 - printf "If the filename validly begins with '-', then it must be prefixed\n" >&2 - printf "by './' so that it won't be interpreted as an option." >&2 - printf "\n" >&2 - usage >&2 - exit 1 - ;; - *) - cpio_source="$arg" - build_list - ;; - esac - ;; - esac -done - -# spit out the default cpio list if a source hasn't been specified -[ -z "$cpio_source" -a -z "$default_list" ] && default_initramfs - -exit 0 diff --git a/target/initramfs/initramfs.mk b/target/initramfs/initramfs.mk deleted file mode 100644 index cf1fcdbae..000000000 --- a/target/initramfs/initramfs.mk +++ /dev/null @@ -1,18 +0,0 @@ -############################################################# -# -# Make a initramfs_list file to be used by gen_init_cpio -# gen_init_cpio is part of the 2.6 linux kernels to build an -# initial ramdisk filesystem based on cpio -# -############################################################# - -define ROOTFS_INITRAMFS_INIT_SYMLINK - rm -f $(TARGET_DIR)/init - ln -s sbin/init $(TARGET_DIR)/init -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 diff --git a/target/iso9660/Config.in b/target/iso9660/Config.in deleted file mode 100644 index ceee52ff9..000000000 --- a/target/iso9660/Config.in +++ /dev/null @@ -1,16 +0,0 @@ -config BR2_TARGET_ROOTFS_ISO9660 - bool "iso image" - depends on BR2_i386 - depends on !BR2_KERNEL_none - select BR2_TARGET_ROOTFS_EXT2 - select BR2_TARGET_GRUB - help - Build a bootable iso9660 image - -config BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU - string "Boot menu.lst file" - depends on BR2_TARGET_ROOTFS_ISO9660 - default "target/iso9660/menu.lst" - -comment "iso image requires a Linux kernel to be built" - depends on BR2_i386 && BR2_KERNEL_none diff --git a/target/iso9660/iso9660.mk b/target/iso9660/iso9660.mk deleted file mode 100644 index 66e2de20b..000000000 --- a/target/iso9660/iso9660.mk +++ /dev/null @@ -1,49 +0,0 @@ -############################################################# -# -# 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_BOOT_MENU:=$(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU)) -ISO9660_OPTS:= - -ifeq ($(BR2_TARGET_ROOTFS_ISO9660_SQUASH),y) -ISO9660_OPTS+=-U -endif - -$(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/ - cp $(ISO9660_BOOT_MENU) $(ISO9660_TARGET_DIR)/boot/grub/menu.lst - 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 $(FAKEROOT_SCRIPT) - touch $(BUILD_DIR)/.fakeroot.00000 - 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_DIR)" \ - >> $(FAKEROOT_SCRIPT) - chmod a+x $(FAKEROOT_SCRIPT) - $(HOST_DIR)/usr/bin/fakeroot -- $(FAKEROOT_SCRIPT) - -@rm -f $(FAKEROOT_SCRIPT) - -@rm -rf $(ISO9660_TARGET_DIR) - -iso9660-root: $(BINARIES_DIR)/rootfs.iso9660 - -############################################################# -# -# Toplevel Makefile options -# -############################################################# -ifeq ($(BR2_TARGET_ROOTFS_ISO9660),y) -TARGETS+=iso9660-root -endif diff --git a/target/iso9660/menu.lst b/target/iso9660/menu.lst deleted file mode 100644 index d78caebe1..000000000 --- a/target/iso9660/menu.lst +++ /dev/null @@ -1,11 +0,0 @@ -default 0 -timeout 10 -color cyan/blue white/blue - -title Hard Drive (first partition) -rootnoverify (hd0) -chainloader +1 - -title BuildRoot ISO9660 image -kernel /kernel -initrd /initrd diff --git a/target/jffs2/Config.in b/target/jffs2/Config.in deleted file mode 100644 index b787ec9d1..000000000 --- a/target/jffs2/Config.in +++ /dev/null @@ -1,117 +0,0 @@ -config BR2_TARGET_ROOTFS_JFFS2 - bool "jffs2 root filesystem" - help - Build a jffs2 root filesystem - -if BR2_TARGET_ROOTFS_JFFS2 - -choice - prompt "Flash Type" - default BR2_TARGET_ROOTFS_JFFS2_FLASH_128 - -config BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_1056 - bool "AT45 dataflash with 1056 byte pagesize" - select BR2_TARGET_ROOTFS_JFFS2_NOCLEANMARKER - -config BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_528 - bool "AT45 dataflash with 528 byte pagesize" - select BR2_TARGET_ROOTFS_JFFS2_NOCLEANMARKER - -config BR2_TARGET_ROOTFS_JFFS2_NANDFLASH_512_16K - bool "NAND flash with 512B Page and 16 kB erasesize" - select BR2_TARGET_ROOTFS_JFFS2_NOCLEANMARKER - -config BR2_TARGET_ROOTFS_JFFS2_NANDFLASH_2K_128K - bool "NAND flash with 2kB Page and 128 kB erasesize" - select BR2_TARGET_ROOTFS_JFFS2_NOCLEANMARKER - -config BR2_TARGET_ROOTFS_JFFS2_FLASH_128 - bool "Parallel flash with 4 kB pagesize and 128 kB erase size" - -config BR2_TARGET_ROOTFS_JFFS2_FLASH_64 - bool "Parallel flash with 4 kB pagesize and 64 kB erase size" - -config BR2_TARGET_ROOTFS_JFFS2_CUSTOM - bool "Select custom page and erase size" - -endchoice - -config BR2_TARGET_ROOTFS_JFFS2_CUSTOM_PAGESIZE - hex "Page Size" - depends on BR2_TARGET_ROOTFS_JFFS2_CUSTOM - default 0x1000 - help - Set to pagesize of memory - -config BR2_TARGET_ROOTFS_JFFS2_CUSTOM_EBSIZE - hex "Erase block size" - depends on BR2_TARGET_ROOTFS_JFFS2_CUSTOM - default 0x20000 - help - Set to erase size of memory - -config BR2_TARGET_ROOTFS_JFFS2_PAGESIZE - hex - default 0x420 if BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_1056 - default 0x210 if BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_528 - default 0x200 if BR2_TARGET_ROOTFS_JFFS2_NANDFLASH_512_16K - default 0x800 if BR2_TARGET_ROOTFS_JFFS2_NANDFLASH_2K_128K - default 0x1000 if BR2_TARGET_ROOTFS_JFFS2_FLASH_128 - default 0x1000 if BR2_TARGET_ROOTFS_JFFS2_FLASH_64 - default $(BR2_TARGET_ROOTFS_JFFS2_CUSTOM_PAGESIZE) if BR2_TARGET_ROOTFS_JFFS2_CUSTOM - -config BR2_TARGET_ROOTFS_JFFS2_EBSIZE - hex - default 0x2100 if BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_1056 - default 0x1080 if BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_528 - default 0x4000 if BR2_TARGET_ROOTFS_JFFS2_NANDFLASH_512_16K - default 0x20000 if BR2_TARGET_ROOTFS_JFFS2_NANDFLASH_2K_128K - default 0x20000 if BR2_TARGET_ROOTFS_JFFS2_FLASH_128 - default 0x10000 if BR2_TARGET_ROOTFS_JFFS2_FLASH_64 - default $(BR2_TARGET_ROOTFS_JFFS2_CUSTOM_EBSIZE) if BR2_TARGET_ROOTFS_JFFS2_CUSTOM - -config BR2_TARGET_ROOTFS_JFFS2_NOCLEANMARKER - bool "Do not use Cleanmarker" - default y if BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_1056 - default y if BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_528 - default y if BR2_TARGET_ROOTFS_JFFS2_NANDFLASH_512_16K - default y if BR2_TARGET_ROOTFS_JFFS2_NANDFLASH_2K_128K - help - Do not use cleanmarkers if using NAND flash or Dataflash where - the pagesize is not a power of 2 - -config BR2_JFFS2_TARGET_SREC - bool "RootFS in SREC file formet" - -config BR2_TARGET_ROOTFS_JFFS2_PAD - bool "Pad output" - -config BR2_TARGET_ROOTFS_JFFS2_PADSIZE - hex "Pad output size (0x0 = to end of EB)" - depends on BR2_TARGET_ROOTFS_JFFS2_PAD - default 0x0 - help - Set to 0x0 to pad to end of erase block. - -choice - prompt "Endianess" - default BR2_TARGET_ROOTFS_JFFS2_BE if BR2_alpha || BR2_armeb || \ - BR2_avr32 || BR2_m68k || BR2_mips || \ - BR2_powerpc || BR2_sh2a_nofpueb || BR2_sh2eb || \ - BR2_sh3eb || BR2_sh4eb || BR2_sparc || BR2_sparc64 - -config BR2_TARGET_ROOTFS_JFFS2_LE - bool "little-endian" - -config BR2_TARGET_ROOTFS_JFFS2_BE - bool "big-endian" - -endchoice - -config BR2_TARGET_ROOTFS_JFFS2_SUMMARY - bool "Produce a summarized JFFS2 image" - help - A summarised image can be mounted faster if support is - enabled in the kernel (CONFIG_JFFS2_SUMMARY) - -endif diff --git a/target/jffs2/jffs2root.mk b/target/jffs2/jffs2root.mk deleted file mode 100644 index a0a563d18..000000000 --- a/target/jffs2/jffs2root.mk +++ /dev/null @@ -1,61 +0,0 @@ -############################################################# -# -# Build the jffs2 root filesystem image -# -############################################################# - -JFFS2_OPTS := -e $(BR2_TARGET_ROOTFS_JFFS2_EBSIZE) -SUMTOOL_OPTS := $(JFFS2_OPTS) - -ifeq ($(BR2_TARGET_ROOTFS_JFFS2_PAD),y) -ifneq ($(strip $(BR2_TARGET_ROOTFS_JFFS2_PADSIZE)),0x0) -JFFS2_OPTS += --pad=$(strip $(BR2_TARGET_ROOTFS_JFFS2_PADSIZE)) -else -JFFS2_OPTS += -p -endif -SUMTOOL_OPTS += -p -endif - -ifeq ($(BR2_TARGET_ROOTFS_JFFS2_LE),y) -JFFS2_OPTS += -l -SUMTOOL_OPTS += -l -endif - -ifeq ($(BR2_TARGET_ROOTFS_JFFS2_BE),y) -JFFS2_OPTS += -b -SUMTOOL_OPTS += -b -endif - -JFFS2_OPTS += -s $(BR2_TARGET_ROOTFS_JFFS2_PAGESIZE) -ifeq ($(BR2_TARGET_ROOTFS_JFFS2_NOCLEANMARKER),y) -JFFS2_OPTS += -n -SUMTOOL_OPTS += -n -endif - -ifneq ($(TARGET_DEVICE_TABLE),) -JFFS2_OPTS += -D $(TARGET_DEVICE_TABLE) -endif - -ROOTFS_JFFS2_DEPENDENCIES = host-mtd - -ifneq ($(BR2_TARGET_ROOTFS_JFFS2_SUMMARY),) -define ROOTFS_JFFS2_CMD - $(MKFS_JFFS2) $(JFFS2_OPTS) -d $(TARGET_DIR) -o $$@.nosummary && \ - $(SUMTOOL) $(SUMTOOL_OPTS) -i $$@.nosummary -o $$@ && \ - rm $$@.nosummary -endef -else -define ROOTFS_JFFS2_CMD - $(MKFS_JFFS2) $(JFFS2_OPTS) -d $(TARGET_DIR) -o $$@ -endef -endif - -define JFFS2_GEN_SREC - $(TARGET_CROSS)objcopy -I binary -O srec --adjust-vma 0xa1000000 $$@ $$@.srec -endef - -ifeq ($(BR2_JFFS2_TARGET_SREC),y) -ROOTFS_JFFS2_POST_GEN_HOOKS += JFFS2_GEN_SREC -endif - -$(eval $(call ROOTFS_TARGET,jffs2)) \ No newline at end of file diff --git a/target/romfs/Config.in b/target/romfs/Config.in deleted file mode 100644 index 7a8c663dd..000000000 --- a/target/romfs/Config.in +++ /dev/null @@ -1,5 +0,0 @@ -config BR2_TARGET_ROOTFS_ROMFS - bool "romfs root filesystem" - help - Build a romfs image of the root filesystem. - diff --git a/target/romfs/romfs.mk b/target/romfs/romfs.mk deleted file mode 100644 index 971947880..000000000 --- a/target/romfs/romfs.mk +++ /dev/null @@ -1,15 +0,0 @@ -############################################################# -# -# Build the romfs root filesystem image -# -############################################################# - -ROMFS_TARGET=$(IMAGE).romfs - -ROOTFS_ROMFS_DEPENDENCIES = host-genromfs - -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 diff --git a/target/squashfs/Config.in b/target/squashfs/Config.in deleted file mode 100644 index 6cc8fcae0..000000000 --- a/target/squashfs/Config.in +++ /dev/null @@ -1,4 +0,0 @@ -config BR2_TARGET_ROOTFS_SQUASHFS - bool "squashfs root filesystem" - help - Build a squashfs root filesystem diff --git a/target/squashfs/squashfsroot.mk b/target/squashfs/squashfsroot.mk deleted file mode 100644 index d72388ebf..000000000 --- a/target/squashfs/squashfsroot.mk +++ /dev/null @@ -1,13 +0,0 @@ -############################################################# -# -# Build the squashfs root filesystem image -# -############################################################# - -ROOTFS_SQUASHFS_DEPENDENCIES = host-squashfs - -define ROOTFS_SQUASHFS_CMD - $(HOST_DIR)/usr/bin/mksquashfs $(TARGET_DIR) $$@ -noappend -endef - -$(eval $(call ROOTFS_TARGET,squashfs)) \ No newline at end of file diff --git a/target/tar/Config.in b/target/tar/Config.in deleted file mode 100644 index 0adca795f..000000000 --- a/target/tar/Config.in +++ /dev/null @@ -1,47 +0,0 @@ -config BR2_TARGET_ROOTFS_TAR - bool "tar the root filesystem" - help - Build a tar archive of the root filesystem - -choice - prompt "Compression method" - default BR2_TARGET_ROOTFS_TAR_NONE - depends on BR2_TARGET_ROOTFS_TAR - help - Select compressor for tar archive of the root filesystem - -config BR2_TARGET_ROOTFS_TAR_NONE - bool "no compression" - help - Do not compress the tarball. - -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 - -config BR2_TARGET_ROOTFS_TAR_OPTIONS - string "other random options to pass to tar" - depends on BR2_TARGET_ROOTFS_TAR - default "" - help - Any other flags you want to pass to tar - Refer to tar --help for details diff --git a/target/tar/tarroot.mk b/target/tar/tarroot.mk deleted file mode 100644 index 4d435cb33..000000000 --- a/target/tar/tarroot.mk +++ /dev/null @@ -1,13 +0,0 @@ -############################################################# -# -# tar to archive target filesystem -# -############################################################# - -TAR_OPTS:=$(BR2_TARGET_ROOTFS_TAR_OPTIONS) - -define ROOTFS_TAR_CMD - tar -c$(TAR_OPTS)f $$@ -C $(TARGET_DIR) . -endef - -$(eval $(call ROOTFS_TARGET,tar)) diff --git a/target/ubifs/Config.in b/target/ubifs/Config.in deleted file mode 100644 index 9fa510e75..000000000 --- a/target/ubifs/Config.in +++ /dev/null @@ -1,88 +0,0 @@ -config BR2_TARGET_ROOTFS_UBIFS - bool "ubifs root filesystem" - help - Build a ubifs root filesystem - -config BR2_TARGET_ROOTFS_UBIFS_LEBSIZE - hex "UBI logical erase block size" - depends on BR2_TARGET_ROOTFS_UBIFS - default 0x1f800 - -config BR2_TARGET_ROOTFS_UBIFS_MINIOSIZE - hex "UBI minimum I/O size" - depends on BR2_TARGET_ROOTFS_UBIFS - default 0x800 - help - Some comment required here - -config BR2_TARGET_ROOTFS_UBIFS_MAXLEBCNT - int "Maximum LEB count" - depends on BR2_TARGET_ROOTFS_UBIFS - default 2048 - help - Some comment required here - -choice - prompt "ubifs runtime compression" - default BR2_TARGET_ROOTFS_UBIFS_RT_LZO - depends on BR2_TARGET_ROOTFS_UBIFS - help - Select which compression format to use at run-time within - the ubifs file system. - -config BR2_TARGET_ROOTFS_UBIFS_RT_NONE - bool "no compression" - help - Don't use run-time compression. - -config BR2_TARGET_ROOTFS_UBIFS_RT_ZLIB - bool "gzip" - help - Use zlib compression at run-time. - -config BR2_TARGET_ROOTFS_UBIFS_RT_LZO - bool "lzo" - help - Use lzo compression at run-time. - -endchoice - -choice - prompt "Compression method" - default BR2_TARGET_ROOTFS_UBIFS_NONE - depends on BR2_TARGET_ROOTFS_UBIFS - help - Select which compression format to compress the final image - into. - -config BR2_TARGET_ROOTFS_UBIFS_NONE - bool "no compression" - help - Do not compress the ubifs filesystem. - -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 - diff --git a/target/ubifs/ubifsroot.mk b/target/ubifs/ubifsroot.mk deleted file mode 100644 index 0fad23421..000000000 --- a/target/ubifs/ubifsroot.mk +++ /dev/null @@ -1,25 +0,0 @@ -############################################################# -# -# Build the ubifs root filesystem image -# -############################################################# - -UBIFS_OPTS := -e $(BR2_TARGET_ROOTFS_UBIFS_LEBSIZE) -c $(BR2_TARGET_ROOTFS_UBIFS_MAXLEBCNT) -m $(BR2_TARGET_ROOTFS_UBIFS_MINIOSIZE) - -ifeq ($(BR2_TARGET_ROOTFS_UBIFS_RT_ZLIB),y) -UBIFS_OPTS += -x zlib -endif -ifeq ($(BR2_TARGET_ROOTFS_UBIFS_RT_LZI),y) -UBIFS_OPTS += -x lzo -endif -ifeq ($(BR2_TARGET_ROOTFS_UBIFS_RT_NONE),y) -UBIFS_OPTS += -x none -endif - -ROOTFS_UBIFS_DEPENDENCIES = host-mtd - -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 -- cgit v1.2.3