* [Buildroot] [PATCH 0/2] cramfs: new maintainer, repo and XIP feature @ 2018-02-13 19:54 Chris Brandt 2018-02-13 19:54 ` [Buildroot] [PATCH 1/2] cramfs: change to new site location Chris Brandt 2018-02-13 19:54 ` [Buildroot] [PATCH 2/2] cramfs: add xip option Chris Brandt 0 siblings, 2 replies; 19+ messages in thread From: Chris Brandt @ 2018-02-13 19:54 UTC (permalink / raw) To: buildroot As of linux-4.15, cramfs is maintained again and the source repository has moved. Additionaly, there is a new XIP option. Chris Brandt (2): cramfs: change to new site location cramfs: add xip option fs/cramfs/Config.in | 19 +- fs/cramfs/cramfs.mk | 8 +- package/cramfs/0001-endian.patch | 288 ---------------------------- package/cramfs/0002-cygwin_IO.patch | 15 -- package/cramfs/0003-fix-missing-types.patch | 17 -- package/cramfs/Config.in | 2 +- package/cramfs/Config.in.host | 2 +- package/cramfs/cramfs.hash | 2 +- package/cramfs/cramfs.mk | 4 +- 9 files changed, 28 insertions(+), 329 deletions(-) delete mode 100644 package/cramfs/0001-endian.patch delete mode 100644 package/cramfs/0002-cygwin_IO.patch delete mode 100644 package/cramfs/0003-fix-missing-types.patch -- 2.16.1 ^ permalink raw reply [flat|nested] 19+ messages in thread
* [Buildroot] [PATCH 1/2] cramfs: change to new site location 2018-02-13 19:54 [Buildroot] [PATCH 0/2] cramfs: new maintainer, repo and XIP feature Chris Brandt @ 2018-02-13 19:54 ` Chris Brandt 2018-02-13 20:14 ` Thomas Petazzoni 2018-02-13 19:54 ` [Buildroot] [PATCH 2/2] cramfs: add xip option Chris Brandt 1 sibling, 1 reply; 19+ messages in thread From: Chris Brandt @ 2018-02-13 19:54 UTC (permalink / raw) To: buildroot As of Linux-4.15, cramfs now has a official maintainer again. Additionally, that person is hosting and maintaining a new version of cramfs-tools. The 0003-fix-missing-types.patch is no longer needed because that fix is already included. However, since patches 0001-endian.patch and 0002-cygwin_IO.patch are so old, they are being removed until someone that needs them can reapply and test them. At that point, they should submit the changes to the new cramfs-tools maintainer instead of adding the patches back here. Cc: Nicolas Pitre <nico@linaro.org> Signed-off-by: Chris Brandt <chris.brandt@renesas.com> --- fs/cramfs/Config.in | 2 +- fs/cramfs/cramfs.mk | 6 - package/cramfs/0001-endian.patch | 288 ---------------------------- package/cramfs/0002-cygwin_IO.patch | 15 -- package/cramfs/0003-fix-missing-types.patch | 17 -- package/cramfs/Config.in | 2 +- package/cramfs/Config.in.host | 2 +- package/cramfs/cramfs.hash | 2 +- package/cramfs/cramfs.mk | 4 +- 9 files changed, 6 insertions(+), 332 deletions(-) delete mode 100644 package/cramfs/0001-endian.patch delete mode 100644 package/cramfs/0002-cygwin_IO.patch delete mode 100644 package/cramfs/0003-fix-missing-types.patch diff --git a/fs/cramfs/Config.in b/fs/cramfs/Config.in index 1a4e326472..b11885b4f4 100644 --- a/fs/cramfs/Config.in +++ b/fs/cramfs/Config.in @@ -3,4 +3,4 @@ config BR2_TARGET_ROOTFS_CRAMFS help Build a cramfs root filesystem - http://sourceforge.net/projects/cramfs/ + https://github.com/npitre/cramfs-tools diff --git a/fs/cramfs/cramfs.mk b/fs/cramfs/cramfs.mk index f880871935..fe2b458c0e 100644 --- a/fs/cramfs/cramfs.mk +++ b/fs/cramfs/cramfs.mk @@ -4,12 +4,6 @@ # ################################################################################ -ifeq ($(BR2_ENDIAN),"BIG") -CRAMFS_OPTS = -b -else -CRAMFS_OPTS = -l -endif - define ROOTFS_CRAMFS_CMD $(HOST_DIR)/bin/mkcramfs $(CRAMFS_OPTS) $(TARGET_DIR) $@ endef diff --git a/package/cramfs/0001-endian.patch b/package/cramfs/0001-endian.patch deleted file mode 100644 index b2eda5a1db..0000000000 --- a/package/cramfs/0001-endian.patch +++ /dev/null @@ -1,288 +0,0 @@ -Index: cramfs-1.1/mkcramfs.c -=================================================================== ---- cramfs-1.1.orig/mkcramfs.c 2002-02-20 09:03:32.000000000 +0100 -+++ cramfs-1.1/mkcramfs.c 2011-09-09 15:11:00.980895119 +0200 -@@ -93,6 +93,7 @@ - static int opt_verbose = 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; - -@@ -130,6 +131,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" -@@ -372,6 +375,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) - { -@@ -405,6 +452,7 @@ - super->root.gid = root->gid; - super->root.size = root->size; - super->root.offset = offset >> 2; -+ if (swap_endian) fix_super(super); - - return offset; - } -@@ -419,7 +467,10 @@ - if (offset >= (1 << (2 + CRAMFS_OFFSET_WIDTH))) { - die(MKFS_ERROR, 0, "filesystem too big"); - } -- inode->offset = (offset >> 2); -+ if (swap_endian) -+ fix_offset(inode, offset); -+ else -+ inode->offset = (offset >> 2); - } - - /* -@@ -515,6 +566,7 @@ - stack_entries++; - } - entry = entry->next; -+ if (swap_endian) fix_inode(inode); - } - - /* -@@ -609,6 +661,7 @@ - } - - *(u32 *) (base + offset) = curr; -+ if (swap_endian) fix_block_pointer((u32*)(base + offset)); - offset += 4; - } while (size); - -@@ -699,7 +752,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:psvzlb")) != EOF) { - switch (c) { - case 'h': - usage(MKFS_OK); -@@ -727,6 +780,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; -Index: cramfs-1.1/cramfsck.c -=================================================================== ---- cramfs-1.1.orig/cramfsck.c 2002-02-23 01:00:42.000000000 +0100 -+++ cramfs-1.1/cramfsck.c 2011-09-09 15:10:06.810894275 +0200 -@@ -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 */ -@@ -53,6 +54,7 @@ - #define _LINUX_STRING_H_ - #include <linux/fs.h> - #include <linux/cramfs_fs.h> -+#include <byteswap.h> - #include <zlib.h> - - /* Exit codes used by fsck-type programs */ -@@ -73,6 +75,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 = "root"; /* extraction directory (-x) */ -@@ -84,6 +87,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) -@@ -165,20 +171,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"); - } -@@ -213,7 +233,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); -@@ -298,12 +321,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; - } - -@@ -322,9 +356,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)) && -@@ -332,7 +366,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) -@@ -364,7 +398,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; -@@ -525,7 +559,7 @@ - { - unsigned long offset = i->offset << 2; - unsigned long curr = offset + 4; -- unsigned long next = *(u32 *) romfs_read(offset); -+ unsigned long next = CRAMFS_32(*(u32 *) romfs_read(offset)); - unsigned long size; - - if (offset == 0) { diff --git a/package/cramfs/0002-cygwin_IO.patch b/package/cramfs/0002-cygwin_IO.patch deleted file mode 100644 index 8be333f01b..0000000000 --- a/package/cramfs/0002-cygwin_IO.patch +++ /dev/null @@ -1,15 +0,0 @@ -Index: cramfs-1.1/cramfsck.c -=================================================================== ---- cramfs-1.1.orig/cramfsck.c 2011-09-09 15:10:06.000000000 +0200 -+++ cramfs-1.1/cramfsck.c 2011-09-09 15:13:49.950897747 +0200 -@@ -57,6 +57,10 @@ - #include <byteswap.h> - #include <zlib.h> - -+#ifdef __CYGWIN__ -+#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0) -+#endif /* __CYGWIN__ */ -+ - /* Exit codes used by fsck-type programs */ - #define FSCK_OK 0 /* No errors */ - #define FSCK_NONDESTRUCT 1 /* File system errors corrected */ diff --git a/package/cramfs/0003-fix-missing-types.patch b/package/cramfs/0003-fix-missing-types.patch deleted file mode 100644 index 896110011e..0000000000 --- a/package/cramfs/0003-fix-missing-types.patch +++ /dev/null @@ -1,17 +0,0 @@ -mkcramfs; loff_t is guarded by _GNU_SOURCE - -Although already properly done in cramfsck, it was missing in mkcramfs. - -Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> - -diff -durN cramfs-1.1.orig/mkcramfs.c cramfs-1.1/mkcramfs.c ---- cramfs-1.1.orig/mkcramfs.c 2015-08-05 22:31:16.830543096 +0200 -+++ cramfs-1.1/mkcramfs.c 2015-08-05 22:33:33.136289744 +0200 -@@ -22,6 +22,7 @@ - * If you change the disk format of cramfs, please update fs/cramfs/README. - */ - -+#define _GNU_SOURCE - #include <sys/types.h> - #include <stdio.h> - #include <sys/stat.h> diff --git a/package/cramfs/Config.in b/package/cramfs/Config.in index b2a0c6c516..a177004ca9 100644 --- a/package/cramfs/Config.in +++ b/package/cramfs/Config.in @@ -5,4 +5,4 @@ config BR2_PACKAGE_CRAMFS cramfs is a compressed read-only filesystem. This package contains the tools to generate and check a cramfs filesystem. - http://sourceforge.net/projects/cramfs/ + https://github.com/npitre/cramfs-tools diff --git a/package/cramfs/Config.in.host b/package/cramfs/Config.in.host index 53b43d4420..e594d5c820 100644 --- a/package/cramfs/Config.in.host +++ b/package/cramfs/Config.in.host @@ -4,4 +4,4 @@ config BR2_PACKAGE_HOST_CRAMFS cramfs is a compressed read-only filesystem. This package contains the tools to generate and check a cramfs filesystem. - http://sourceforge.net/projects/cramfs/ + https://github.com/npitre/cramfs-tools diff --git a/package/cramfs/cramfs.hash b/package/cramfs/cramfs.hash index b8c5f5fbcb..acc8b4368f 100644 --- a/package/cramfs/cramfs.hash +++ b/package/cramfs/cramfs.hash @@ -1,2 +1,2 @@ # Locally computed: -sha256 133caca2c4e7c64106555154ee0ff693f5cf5beb9421ce2eb86baee997d22368 cramfs-1.1.tar.gz +sha256 1db1e5b6dd6439a7a969338ecce1d4f34b9f85fb3cef2984ad3b53159eb5ad46 cramfs-5aea81001ac6.tar.gz diff --git a/package/cramfs/cramfs.mk b/package/cramfs/cramfs.mk index 70010e8e2f..643c7bce03 100644 --- a/package/cramfs/cramfs.mk +++ b/package/cramfs/cramfs.mk @@ -4,8 +4,8 @@ # ################################################################################ -CRAMFS_VERSION = 1.1 -CRAMFS_SITE = http://downloads.sourceforge.net/project/cramfs/cramfs/$(CRAMFS_VERSION) +CRAMFS_VERSION = 5aea81001ac6 +CRAMFS_SITE = $(call github,npitre,cramfs-tools,$(CRAMFS_VERSION)) CRAMFS_LICENSE = GPL-2.0+ CRAMFS_LICENSE_FILES = COPYING -- 2.16.1 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Buildroot] [PATCH 1/2] cramfs: change to new site location 2018-02-13 19:54 ` [Buildroot] [PATCH 1/2] cramfs: change to new site location Chris Brandt @ 2018-02-13 20:14 ` Thomas Petazzoni 2018-02-13 20:24 ` Chris Brandt 0 siblings, 1 reply; 19+ messages in thread From: Thomas Petazzoni @ 2018-02-13 20:14 UTC (permalink / raw) To: buildroot Hello, Thanks for doing this work on cramfs! On Tue, 13 Feb 2018 14:54:48 -0500, Chris Brandt wrote: > As of Linux-4.15, cramfs now has a official maintainer again. > Additionally, that person is hosting and maintaining a new version of > cramfs-tools. > > The 0003-fix-missing-types.patch is no longer needed because that fix > is already included. > > However, since patches 0001-endian.patch and 0002-cygwin_IO.patch are > so old, they are being removed until someone that needs them can > reapply and test them. At that point, they should submit the changes > to the new cramfs-tools maintainer instead of adding the patches back > here. Do you know how endianess if handled by cramfs with the more recent version of the cramfs tools ? Other than that, the patches look good to me. Thanks! Thomas -- Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering http://bootlin.com ^ permalink raw reply [flat|nested] 19+ messages in thread
* [Buildroot] [PATCH 1/2] cramfs: change to new site location 2018-02-13 20:14 ` Thomas Petazzoni @ 2018-02-13 20:24 ` Chris Brandt 2018-02-13 20:26 ` Thomas Petazzoni 2018-04-05 19:07 ` Matthew Weber 0 siblings, 2 replies; 19+ messages in thread From: Chris Brandt @ 2018-02-13 20:24 UTC (permalink / raw) To: buildroot On Tuesday, February 13, 2018, Thomas Petassoni wrote: > Do you know how endianess if handled by cramfs with the more recent > version of the cramfs tools ? All I can tell you is that there is not a command line option for it. So, I assume it's not supported. $ output/build/host-cramfs-5aea81001ac6/mkcramfs usage: output/build/host-cramfs-5aea81001ac6/mkcramfs [-h] [-e edition] [-i file] [-n name] [-D file] dirname outfile -h print this help -E make all warnings errors (non-zero exit status) -e edition set edition number (part of fsid) -i file insert a file image into the filesystem (requires >= 2.4.0) -n name set name of cramfs filesystem -p pad by 512 bytes for boot code -s sort directory entries (old option, ignored) -v be more verbose -x use extended block pointers (requires >= 4.15) -X allow XIP of ELF files (imply -x) -z make explicit holes (requires >= 2.3.39) -D Use the named FILE as a device table file -q squash permissions (make everything owned by root) dirname root of the filesystem to be compressed outfile output file I don't have any big endian systems, so I can't test it either. But, Nicolas said that if someone is willing to test it and sign off on it, he would add it to his repository. Chris ^ permalink raw reply [flat|nested] 19+ messages in thread
* [Buildroot] [PATCH 1/2] cramfs: change to new site location 2018-02-13 20:24 ` Chris Brandt @ 2018-02-13 20:26 ` Thomas Petazzoni 2018-02-13 21:08 ` Chris Brandt 2018-02-14 17:37 ` Chris Brandt 2018-04-05 19:07 ` Matthew Weber 1 sibling, 2 replies; 19+ messages in thread From: Thomas Petazzoni @ 2018-02-13 20:26 UTC (permalink / raw) To: buildroot Hello, On Tue, 13 Feb 2018 20:24:21 +0000, Chris Brandt wrote: > All I can tell you is that there is not a command line option for it. > So, I assume it's not supported. > > $ output/build/host-cramfs-5aea81001ac6/mkcramfs > usage: output/build/host-cramfs-5aea81001ac6/mkcramfs [-h] [-e edition] [-i file] [-n name] [-D file] dirname outfile > -h print this help > -E make all warnings errors (non-zero exit status) > -e edition set edition number (part of fsid) > -i file insert a file image into the filesystem (requires >= 2.4.0) > -n name set name of cramfs filesystem > -p pad by 512 bytes for boot code > -s sort directory entries (old option, ignored) > -v be more verbose > -x use extended block pointers (requires >= 4.15) > -X allow XIP of ELF files (imply -x) > -z make explicit holes (requires >= 2.3.39) > -D Use the named FILE as a device table file > -q squash permissions (make everything owned by root) > dirname root of the filesystem to be compressed > outfile output file > > I don't have any big endian systems, so I can't test it either. We have a number of Qemu defconfigs, including for big-endian systems such as PowerPC. It should be doable to perform a test :) Thomas -- Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering http://bootlin.com ^ permalink raw reply [flat|nested] 19+ messages in thread
* [Buildroot] [PATCH 1/2] cramfs: change to new site location 2018-02-13 20:26 ` Thomas Petazzoni @ 2018-02-13 21:08 ` Chris Brandt 2018-02-14 17:37 ` Chris Brandt 1 sibling, 0 replies; 19+ messages in thread From: Chris Brandt @ 2018-02-13 21:08 UTC (permalink / raw) To: buildroot Hello Thomas, On Tuesday, February 13, 2018, Thomas Petazzoni wrote: > > I don't have any big endian systems, so I can't test it either. > > We have a number of Qemu defconfigs, including for big-endian systems > such as PowerPC. It should be doable to perform a test :) But....there's more to the story. I had asked Nicolas if he thought this patch would just magically work if I applied it to his current tree. He had this to say: On Monday, January 08, 2018, Nicolas Pitre wrote: > > Could you have a quick look at 0001-endian.patch and see if anything > > jumps out at you before I try to merge it with you existing repo? > > It is missing the new case where the compressed block length is stored > as an u16 at the beginning of the block. That's pretty much the only use > of u16 in the code so easy to locate. > > Also I'd prefer if the swapping functions had the bswap_ prefix rather > than fix_ which is a bit too generic. > > And would be a good idea to use bswap_32() rather than open coding > wswap(). You'll also need bswap_16() too anyway. So, the patch does need a little bit of fixing up. I could probably rework the patch as Nicolas suggested as long as someone else gives it a try. And then, it could get submitted to go back into the cramfs-tools repo instead of living as a patch in Buildroot forever. Chris ^ permalink raw reply [flat|nested] 19+ messages in thread
* [Buildroot] [PATCH 1/2] cramfs: change to new site location 2018-02-13 20:26 ` Thomas Petazzoni 2018-02-13 21:08 ` Chris Brandt @ 2018-02-14 17:37 ` Chris Brandt 1 sibling, 0 replies; 19+ messages in thread From: Chris Brandt @ 2018-02-14 17:37 UTC (permalink / raw) To: buildroot Hello, On Tuesday, February 13, 2018, Thomas Petazzoni wrote: > > I don't have any big endian systems, so I can't test it either. > > We have a number of Qemu defconfigs, including for big-endian systems > such as PowerPC. It should be doable to perform a test :) Since I've never used QEMU before, what config would you suggest I use in order to make the simplest system to test a cramfs rootfs? All I want to do is just confirm it boots. Should I just pick one with BR2_powerpc=y? qemu_ppc64le_pseries_defconfig:BR2_powerpc_power8=y qemu_ppc64_pseries_defconfig:BR2_powerpc64=y qemu_ppc64_pseries_defconfig:BR2_powerpc_power7=y qemu_ppc_g3beige_defconfig:BR2_powerpc=y qemu_ppc_g3beige_defconfig:BR2_powerpc_750=y qemu_ppc_mpc8544ds_defconfig:BR2_powerpc=y qemu_ppc_mpc8544ds_defconfig:BR2_powerpc_8548=y qemu_ppc_virtex_ml507_defconfig:BR2_powerpc=y qemu_ppc_virtex_ml507_defconfig:BR2_powerpc_440=y Thank you, Chris ^ permalink raw reply [flat|nested] 19+ messages in thread
* [Buildroot] [PATCH 1/2] cramfs: change to new site location 2018-02-13 20:24 ` Chris Brandt 2018-02-13 20:26 ` Thomas Petazzoni @ 2018-04-05 19:07 ` Matthew Weber 2018-04-06 15:02 ` Chris Brandt 1 sibling, 1 reply; 19+ messages in thread From: Matthew Weber @ 2018-04-05 19:07 UTC (permalink / raw) To: buildroot All, On Tue, Feb 13, 2018 at 2:24 PM, Chris Brandt <Chris.Brandt@renesas.com> wrote: > > On Tuesday, February 13, 2018, Thomas Petassoni wrote: > > Do you know how endianess if handled by cramfs with the more recent > > version of the cramfs tools ? > > All I can tell you is that there is not a command line option for it. > So, I assume it's not supported. > > > $ output/build/host-cramfs-5aea81001ac6/mkcramfs > usage: output/build/host-cramfs-5aea81001ac6/mkcramfs [-h] [-e edition] [-i file] [-n name] [-D file] dirname outfile > -h print this help > -E make all warnings errors (non-zero exit status) > -e edition set edition number (part of fsid) > -i file insert a file image into the filesystem (requires >= 2.4.0) > -n name set name of cramfs filesystem > -p pad by 512 bytes for boot code > -s sort directory entries (old option, ignored) > -v be more verbose > -x use extended block pointers (requires >= 4.15) > -X allow XIP of ELF files (imply -x) > -z make explicit holes (requires >= 2.3.39) > -D Use the named FILE as a device table file > -q squash permissions (make everything owned by root) > dirname root of the filesystem to be compressed > outfile output file > > > > I don't have any big endian systems, so I can't test it either. > > But, Nicolas said that if someone is willing to test it and sign off on > it, he would add it to his repository. Hi, I ran into a bug in the existing buildroot cramfs fs support for big endian and Thomas pointed me at this patchset. I've updated/tested my local build with your patches and included the big endian fix. Feel free to pull this patch into your patchset (or hopefully upstream merges first :-) ) https://patchwork.ozlabs.org/patch/895499/ Upstream of an updated big endian support patch https://github.com/npitre/cramfs-tools/pull/1 Tested-by: Matt Weber <matthew.weber@rockwellcollins.com> ^ permalink raw reply [flat|nested] 19+ messages in thread
* [Buildroot] [PATCH 1/2] cramfs: change to new site location 2018-04-05 19:07 ` Matthew Weber @ 2018-04-06 15:02 ` Chris Brandt 2018-04-06 15:13 ` Thomas Petazzoni 2018-04-06 15:36 ` Matthew Weber 0 siblings, 2 replies; 19+ messages in thread From: Chris Brandt @ 2018-04-06 15:02 UTC (permalink / raw) To: buildroot Hello Matthew, On Thursday, April 05, 2018, Matthew Weber wrote: > > I don't have any big endian systems, so I can't test it either. > > > > But, Nicolas said that if someone is willing to test it and sign off on > > it, he would add it to his repository. > > Hi, I ran into a bug in the existing buildroot cramfs fs support for > big endian and Thomas pointed me at this patchset. I've > updated/tested my local build with your patches and included the big > endian fix. > > Feel free to pull this patch into your patchset (or hopefully upstream > merges first :-) ) > https://patchwork.ozlabs.org/patch/895499/ > > Upstream of an updated big endian support patch > https://github.com/npitre/cramfs-tools/pull/1 > > Tested-by: Matt Weber <matthew.weber@rockwellcollins.com> Great! I struggled with trying to get a PowerPC QEMU up and running, so I never completed this task. However, I will say this: When discussing to incorporate that old endian patch back into Nicolas's repo, he requested that the new functions have a more proper prefix like swap_xxx. The names "fix_xxx" are not really good names to describe what they are doing. Also, Nicolas mentioned this about the original patch: > It is missing the new case where the compressed block length is stored > as an u16 at the beginning of the block. That's pretty much the only use > of u16 in the code so easy to locate. So then in that case, you would need a bswap_32() and a bswap_16() macro. However...that code is currently inside a "} else if (0) {" block, so it looks like it will never get executed anyway. So, maybe that point is irrelevant at the moment??? I would prefer to get this pulled into upstream instead of going back to adding external patches to Buildroot. So, let's wait to see what Nicolas has to say. Chris ^ permalink raw reply [flat|nested] 19+ messages in thread
* [Buildroot] [PATCH 1/2] cramfs: change to new site location 2018-04-06 15:02 ` Chris Brandt @ 2018-04-06 15:13 ` Thomas Petazzoni 2018-04-06 15:19 ` Chris Brandt 2018-04-06 15:38 ` Matthew Weber 2018-04-06 15:36 ` Matthew Weber 1 sibling, 2 replies; 19+ messages in thread From: Thomas Petazzoni @ 2018-04-06 15:13 UTC (permalink / raw) To: buildroot Hello, On Fri, 6 Apr 2018 15:02:55 +0000, Chris Brandt wrote: > > It is missing the new case where the compressed block length is stored > > as an u16 at the beginning of the block. That's pretty much the only use > > of u16 in the code so easy to locate. > > So then in that case, you would need a bswap_32() and a bswap_16() macro. > > However...that code is currently inside a "} else if (0) {" block, so it > looks like it will never get executed anyway. I don't see where this else if (0) block is. Where do you see that ? Matthew: the current patch in Buildroot also fixes cramfsck, but not your contribution on the new version of the cramfs tools. Best regards, Thomas -- Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com ^ permalink raw reply [flat|nested] 19+ messages in thread
* [Buildroot] [PATCH 1/2] cramfs: change to new site location 2018-04-06 15:13 ` Thomas Petazzoni @ 2018-04-06 15:19 ` Chris Brandt 2018-04-06 15:29 ` Thomas Petazzoni 2018-04-06 15:38 ` Matthew Weber 1 sibling, 1 reply; 19+ messages in thread From: Chris Brandt @ 2018-04-06 15:19 UTC (permalink / raw) To: buildroot On Friday, April 06, 2018 1, Thomas Petazzoni wrote: > > However...that code is currently inside a "} else if (0) {" block, so it > > looks like it will never get executed anyway. > > I don't see where this else if (0) block is. Where do you see that ? https://github.com/npitre/cramfs-tools/blob/master/mkcramfs.c#L814 Chris ^ permalink raw reply [flat|nested] 19+ messages in thread
* [Buildroot] [PATCH 1/2] cramfs: change to new site location 2018-04-06 15:19 ` Chris Brandt @ 2018-04-06 15:29 ` Thomas Petazzoni 2018-04-06 15:41 ` Matthew Weber 0 siblings, 1 reply; 19+ messages in thread From: Thomas Petazzoni @ 2018-04-06 15:29 UTC (permalink / raw) To: buildroot Hello, On Fri, 6 Apr 2018 15:19:34 +0000, Chris Brandt wrote: > On Friday, April 06, 2018 1, Thomas Petazzoni wrote: > > > However...that code is currently inside a "} else if (0) {" block, so it > > > looks like it will never get executed anyway. > > > > I don't see where this else if (0) block is. Where do you see that ? > > https://github.com/npitre/cramfs-tools/blob/master/mkcramfs.c#L814 Ah, ok, it's the "compressed block" mechanism that is between if (0), not the big endian support code that Matthew proposed. Thomas -- Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com ^ permalink raw reply [flat|nested] 19+ messages in thread
* [Buildroot] [PATCH 1/2] cramfs: change to new site location 2018-04-06 15:29 ` Thomas Petazzoni @ 2018-04-06 15:41 ` Matthew Weber 0 siblings, 0 replies; 19+ messages in thread From: Matthew Weber @ 2018-04-06 15:41 UTC (permalink / raw) To: buildroot Chris / Nicolas, On Fri, Apr 6, 2018 at 10:29 AM, Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote: > Hello, > > On Fri, 6 Apr 2018 15:19:34 +0000, Chris Brandt wrote: >> On Friday, April 06, 2018 1, Thomas Petazzoni wrote: >> > > However...that code is currently inside a "} else if (0) {" block, so it >> > > looks like it will never get executed anyway. >> > >> > I don't see where this else if (0) block is. Where do you see that ? >> >> https://github.com/npitre/cramfs-tools/blob/master/mkcramfs.c#L814 > > Ah, ok, it's the "compressed block" mechanism that is between if (0), > not the big endian support code that Matthew proposed. > I'm not familiar enough with cramfs to make the change in that block of code and/or have a test to verify it. I'll get my other changes updated first and would gladly take suggests on this change. ^ permalink raw reply [flat|nested] 19+ messages in thread
* [Buildroot] [PATCH 1/2] cramfs: change to new site location 2018-04-06 15:13 ` Thomas Petazzoni 2018-04-06 15:19 ` Chris Brandt @ 2018-04-06 15:38 ` Matthew Weber 1 sibling, 0 replies; 19+ messages in thread From: Matthew Weber @ 2018-04-06 15:38 UTC (permalink / raw) To: buildroot Thomas, On Fri, Apr 6, 2018 at 10:13 AM, Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote: > Hello, > > On Fri, 6 Apr 2018 15:02:55 +0000, Chris Brandt wrote: > >> > It is missing the new case where the compressed block length is stored >> > as an u16 at the beginning of the block. That's pretty much the only use >> > of u16 in the code so easy to locate. >> >> So then in that case, you would need a bswap_32() and a bswap_16() macro. >> >> However...that code is currently inside a "} else if (0) {" block, so it >> looks like it will never get executed anyway. > > I don't see where this else if (0) block is. Where do you see that ? > > Matthew: the current patch in Buildroot also fixes cramfsck, but not > your contribution on the new version of the cramfs tools. > Oh good catch, I missed that. I'll update that in v2 and refresh my upstream pull request. ^ permalink raw reply [flat|nested] 19+ messages in thread
* [Buildroot] [PATCH 1/2] cramfs: change to new site location 2018-04-06 15:02 ` Chris Brandt 2018-04-06 15:13 ` Thomas Petazzoni @ 2018-04-06 15:36 ` Matthew Weber [not found] ` <nycvar.YSQ.7.76.1804061138320.28462@knanqh.ubzr> 1 sibling, 1 reply; 19+ messages in thread From: Matthew Weber @ 2018-04-06 15:36 UTC (permalink / raw) To: buildroot Chris, On Fri, Apr 6, 2018 at 10:02 AM, Chris Brandt <Chris.Brandt@renesas.com> wrote: > Hello Matthew, > > On Thursday, April 05, 2018, Matthew Weber wrote: >> > I don't have any big endian systems, so I can't test it either. >> > >> > But, Nicolas said that if someone is willing to test it and sign off on >> > it, he would add it to his repository. >> >> Hi, I ran into a bug in the existing buildroot cramfs fs support for >> big endian and Thomas pointed me at this patchset. I've >> updated/tested my local build with your patches and included the big >> endian fix. >> >> Feel free to pull this patch into your patchset (or hopefully upstream >> merges first :-) ) >> https://patchwork.ozlabs.org/patch/895499/ >> >> Upstream of an updated big endian support patch >> https://github.com/npitre/cramfs-tools/pull/1 >> >> Tested-by: Matt Weber <matthew.weber@rockwellcollins.com> > > > Great! I struggled with trying to get a PowerPC QEMU up and running, so > I never completed this task. > > However, I will say this: When discussing to incorporate that old endian > patch back into Nicolas's repo, he requested that the new functions > have a more proper prefix like swap_xxx. The names "fix_xxx" are not really > good names to describe what they are doing. > Wanted to comment my patch is a newer version of an upstream patch and not the old Buildroot patch. However I do see that naming is similar in this patch. I'll update fix -> swap. Matt ^ permalink raw reply [flat|nested] 19+ messages in thread
[parent not found: <nycvar.YSQ.7.76.1804061138320.28462@knanqh.ubzr>]
* [Buildroot] [PATCH 1/2] cramfs: change to new site location [not found] ` <nycvar.YSQ.7.76.1804061138320.28462@knanqh.ubzr> @ 2018-04-06 15:43 ` Matthew Weber [not found] ` <nycvar.YSQ.7.76.1804061305080.28462@knanqh.ubzr> 0 siblings, 1 reply; 19+ messages in thread From: Matthew Weber @ 2018-04-06 15:43 UTC (permalink / raw) To: buildroot Nicolas, On Fri, Apr 6, 2018 at 10:41 AM, Nicolas Pitre <nicolas.pitre@linaro.org> wrote: > On Fri, 6 Apr 2018, Matthew Weber wrote: > > > Please hold off for the moment. > > I don't like the original patch at all and would like a completely > different approach to keep the code saner. I'll commit it in a moment > but I will need someone to test it. > Perfect, I can do a test when you're ready. ^ permalink raw reply [flat|nested] 19+ messages in thread
[parent not found: <nycvar.YSQ.7.76.1804061305080.28462@knanqh.ubzr>]
* [Buildroot] [PATCH 1/2] cramfs: change to new site location [not found] ` <nycvar.YSQ.7.76.1804061305080.28462@knanqh.ubzr> @ 2018-04-06 18:29 ` Matthew Weber [not found] ` <nycvar.YSQ.7.76.1804061446470.28462@knanqh.ubzr> 0 siblings, 1 reply; 19+ messages in thread From: Matthew Weber @ 2018-04-06 18:29 UTC (permalink / raw) To: buildroot Nicolas, On Fri, Apr 6, 2018 at 12:06 PM, Nicolas Pitre <nicolas.pitre@linaro.org> wrote: > > On Fri, 6 Apr 2018, Matthew Weber wrote: > > > Nicolas, > > > > On Fri, Apr 6, 2018 at 10:41 AM, Nicolas Pitre <nicolas.pitre@linaro.org> wrote: > > > On Fri, 6 Apr 2018, Matthew Weber wrote: > > > > > > > > > > > Please hold off for the moment. > > > > > > I don't like the original patch at all and would like a completely > > > different approach to keep the code saner. I'll commit it in a moment > > > but I will need someone to test it. > > > > > > > Perfect, I can do a test when you're ready. > > Please test the cross-endian branch and let me know how it works. > If it works then I'll move it to the main branch. Tested successfully on a big endian powerpc target. Chris, I can retest if you like when you rev your hash? Matt ^ permalink raw reply [flat|nested] 19+ messages in thread
[parent not found: <nycvar.YSQ.7.76.1804061446470.28462@knanqh.ubzr>]
* [Buildroot] [PATCH 1/2] cramfs: change to new site location [not found] ` <nycvar.YSQ.7.76.1804061446470.28462@knanqh.ubzr> @ 2018-04-06 19:07 ` Chris Brandt 0 siblings, 0 replies; 19+ messages in thread From: Chris Brandt @ 2018-04-06 19:07 UTC (permalink / raw) To: buildroot On Friday, April 06, 2018, Nicolas Pitre wrote: > On Fri, 6 Apr 2018, Matthew Weber wrote: > > On Fri, Apr 6, 2018 at 12:06 PM, Nicolas Pitre > <nicolas.pitre@linaro.org> wrote: > > > On Fri, 6 Apr 2018, Matthew Weber wrote: > > > > On Fri, Apr 6, 2018 at 10:41 AM, Nicolas Pitre > <nicolas.pitre@linaro.org> wrote: > > > > > I don't like the original patch at all and would like a completely > > > > > different approach to keep the code saner. I'll commit it in a > moment > > > > > but I will need someone to test it. > > > > > > > > > > > > > Perfect, I can do a test when you're ready. > > > > > > Please test the cross-endian branch and let me know how it works. > > > If it works then I'll move it to the main branch. > > > > Tested successfully on a big endian powerpc target. > > Good! I moved it to the master branch. So, it looks like the ball is back in my court to update the hash and put the endian command line options back in. Except, looks like they changed from lower case "-b, -l" in the original patch to upper case "-B, -L". I'll update the original patch series and re-post to the Buildroot mailing list. Chris ^ permalink raw reply [flat|nested] 19+ messages in thread
* [Buildroot] [PATCH 2/2] cramfs: add xip option 2018-02-13 19:54 [Buildroot] [PATCH 0/2] cramfs: new maintainer, repo and XIP feature Chris Brandt 2018-02-13 19:54 ` [Buildroot] [PATCH 1/2] cramfs: change to new site location Chris Brandt @ 2018-02-13 19:54 ` Chris Brandt 1 sibling, 0 replies; 19+ messages in thread From: Chris Brandt @ 2018-02-13 19:54 UTC (permalink / raw) To: buildroot Cramfs now has the ability to XIP all ELF files. Cc: Nicolas Pitre <nico@linaro.org> Signed-off-by: Chris Brandt <chris.brandt@renesas.com> --- fs/cramfs/Config.in | 17 +++++++++++++++++ fs/cramfs/cramfs.mk | 8 ++++++++ 2 files changed, 25 insertions(+) diff --git a/fs/cramfs/Config.in b/fs/cramfs/Config.in index b11885b4f4..5b97479c85 100644 --- a/fs/cramfs/Config.in +++ b/fs/cramfs/Config.in @@ -4,3 +4,20 @@ config BR2_TARGET_ROOTFS_CRAMFS Build a cramfs root filesystem https://github.com/npitre/cramfs-tools + +if BR2_TARGET_ROOTFS_CRAMFS + +config BR2_TARGET_ROOTFS_CRAMFS_XIP + bool "Support XIP of all ELF files" + help + For ELF files, uncompressed and properly aligned data blocks will be + automatically be mapped directly into user space whenever possible providing + eXecute-In-Place (XIP) from ROM of read-only segments. Data segments mapped + read-write (hence they have to be copied to RAM) may still be compressed in + the cramfs image in the same file along with non compressed read-only + segments. Both MMU and no-MMU systems are supported. This is particularly + handy for tiny embedded systems with very tight memory constraints. + + The CRAMFS_MTD Kconfig option must also be enabled in a 4.15+ kernel. + +endif # BR2_TARGET_ROOTFS_CRAMFS diff --git a/fs/cramfs/cramfs.mk b/fs/cramfs/cramfs.mk index fe2b458c0e..68b776f298 100644 --- a/fs/cramfs/cramfs.mk +++ b/fs/cramfs/cramfs.mk @@ -4,6 +4,14 @@ # ################################################################################ +ifeq ($(BR2_TARGET_ROOTFS_CRAMFS_XIP),y) +ifeq ($(BR2_USE_MMU),y) +CRAMFS_OPTS = -X -X +else +CRAMFS_OPTS = -X +endif +endif + define ROOTFS_CRAMFS_CMD $(HOST_DIR)/bin/mkcramfs $(CRAMFS_OPTS) $(TARGET_DIR) $@ endef -- 2.16.1 ^ permalink raw reply related [flat|nested] 19+ messages in thread
end of thread, other threads:[~2018-04-06 19:07 UTC | newest] Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2018-02-13 19:54 [Buildroot] [PATCH 0/2] cramfs: new maintainer, repo and XIP feature Chris Brandt 2018-02-13 19:54 ` [Buildroot] [PATCH 1/2] cramfs: change to new site location Chris Brandt 2018-02-13 20:14 ` Thomas Petazzoni 2018-02-13 20:24 ` Chris Brandt 2018-02-13 20:26 ` Thomas Petazzoni 2018-02-13 21:08 ` Chris Brandt 2018-02-14 17:37 ` Chris Brandt 2018-04-05 19:07 ` Matthew Weber 2018-04-06 15:02 ` Chris Brandt 2018-04-06 15:13 ` Thomas Petazzoni 2018-04-06 15:19 ` Chris Brandt 2018-04-06 15:29 ` Thomas Petazzoni 2018-04-06 15:41 ` Matthew Weber 2018-04-06 15:38 ` Matthew Weber 2018-04-06 15:36 ` Matthew Weber [not found] ` <nycvar.YSQ.7.76.1804061138320.28462@knanqh.ubzr> 2018-04-06 15:43 ` Matthew Weber [not found] ` <nycvar.YSQ.7.76.1804061305080.28462@knanqh.ubzr> 2018-04-06 18:29 ` Matthew Weber [not found] ` <nycvar.YSQ.7.76.1804061446470.28462@knanqh.ubzr> 2018-04-06 19:07 ` Chris Brandt 2018-02-13 19:54 ` [Buildroot] [PATCH 2/2] cramfs: add xip option Chris Brandt
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.