Skip to contentSkip to conversation

cramfs: new maintainer, repo and XIP feature

PATCH New Chris Brandt 2 participants 5 messages Apr 7, 2018 – Apr 9, 2018 Cramfs filesystem

lore
Share & tools
lore
#0 lore raw

v3 cover cramfs: new maintainer, repo and XIP feature

As of linux-4.15, cramfs is maintained again and the source repository has moved. Additionaly, there is a new XIP option.

v3:
- Added note about cramfsck not supporting endian swap
- Added Reviewed-by
v2:
- Update hash to include new endian support

Chris Brandt (2):
cramfs: change to new site location
cramfs: add xip option

 fs/cramfs/Config.in                         |  19 +-
 fs/cramfs/cramfs.mk                         |  12 +-
 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, 33 insertions(+), 328 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
Signature · 1 line
2.16.1
#1 lore raw

PATCH v3 1/2 cramfs: change to new site location

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.

Patches 0001-endian.patch and 0003-fix-missing-types.patch are no longer needed because they have been upstreamed.

However, since patch 0002-cygwin_IO.patch is so old, it is being removed until someone that needs it can reapply and test it. At that point, they should submit the changes to the new cramfs-tools maintainer instead of adding the patches back here.

Please note that cross-endian support for cramfsck is not supported at this time.

---
v3:
- Added note about cramfsck not supporting endian swap
- Added Reviewed-by
v2:
- Update hash to include new endian support

---
 fs/cramfs/Config.in                         |   2 +-
 fs/cramfs/cramfs.mk                         |   4 +-
 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, 8 insertions(+), 328 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
fs/cramfs/Config.in +1 -1
index 1a4e326472..b11885b4f4 100644
@@ -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
fs/cramfs/cramfs.mk +2 -2
index f880871935..8745c78031 100644
@@ -5,9 +5,9 @@
 ################################################################################
 
 ifeq ($(BR2_ENDIAN),"BIG")
-CRAMFS_OPTS = -b
+CRAMFS_OPTS = -B
 else
-CRAMFS_OPTS = -l
+CRAMFS_OPTS = -L
 endif
 
 define ROOTFS_CRAMFS_CMD
package/cramfs/0001-endian.patch deleted +0 -288

288 lines not on this page · raw message

package/cramfs/0002-cygwin_IO.patch deleted +0 -15
deleted file mode 100644
index 8be333f01b..0000000000
@@ -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 */
package/cramfs/0003-fix-missing-types.patch deleted +0 -17
deleted file mode 100644
index 896110011e..0000000000
@@ -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" <[email protected]>
-
-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>
package/cramfs/Config.in +1 -1
index b2a0c6c516..a177004ca9 100644
@@ -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
package/cramfs/Config.in.host +1 -1
index 53b43d4420..e594d5c820 100644
@@ -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
package/cramfs/cramfs.hash +1 -1
index b8c5f5fbcb..c6c18b073c 100644
@@ -1,2 +1,2 @@
 # Locally computed:
-sha256  133caca2c4e7c64106555154ee0ff693f5cf5beb9421ce2eb86baee997d22368  cramfs-1.1.tar.gz
+sha256  99d87aa5874f4a34c219275e0297b0f4c710895f9c87295267aeabe6a752add1  cramfs-1a1e65f2a049.tar.gz
package/cramfs/cramfs.mk +2 -2
index 70010e8e2f..18bef80bd2 100644
@@ -4,8 +4,8 @@
 #
 ################################################################################
 
-CRAMFS_VERSION = 1.1
-CRAMFS_SITE = http://downloads.sourceforge.net/project/cramfs/cramfs/$(CRAMFS_VERSION)
+CRAMFS_VERSION = 1a1e65f2a049
+CRAMFS_SITE = $(call github,npitre,cramfs-tools,$(CRAMFS_VERSION))
 CRAMFS_LICENSE = GPL-2.0+
 CRAMFS_LICENSE_FILES = COPYING
 
Signature · 1 line
2.16.1
#2 lore raw

PATCH v3 1/2 cramfs: change to new site location

Hello,

Quoted 24 lines · Chris Brandt

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.

Patches 0001-endian.patch and 0003-fix-missing-types.patch are no longer needed because they have been upstreamed.

However, since patch 0002-cygwin_IO.patch is so old, it is being removed until someone that needs it can reapply and test it. At that point, they should submit the changes to the new cramfs-tools maintainer instead of adding the patches back here.

Please note that cross-endian support for cramfsck is not supported at this time.

---
v3:
- Added note about cramfsck not supporting endian swap
- Added Reviewed-by
v2:
- Update hash to include new endian support

Quoted 14 lines
---
 fs/cramfs/Config.in                         |   2 +-
 fs/cramfs/cramfs.mk                         |   4 +-
 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, 8 insertions(+), 328 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

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

PATCH v3 2/2 cramfs: add xip option

In reply to Chris Brandt

Cramfs now has the ability to XIP all ELF files.

---
 fs/cramfs/Config.in | 17 +++++++++++++++++
 fs/cramfs/cramfs.mk |  8 ++++++++
 2 files changed, 25 insertions(+)
fs/cramfs/Config.in +17 -0
index b11885b4f4..5b97479c85 100644
@@ -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
fs/cramfs/cramfs.mk +8 -0
index 8745c78031..9250638887 100644
@@ -10,6 +10,14 @@ else
 CRAMFS_OPTS = -L
 endif
 
+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
Signature · 1 line
2.16.1
#4 lore raw

PATCH v3 2/2 cramfs: add xip option

Hello,

fs/cramfs/Config.in config BR2_TARGET_ROOTFS_CRAMFS · line 21

Quoted 12 lines · Chris Brandt
fs/cramfs/Config.in +12 -0
+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.

These lines were way too long, so I rewrapped them. You can use ./utils/check-package to verify your changes: it would have complained on this change due to the length of the lines.

Applied with this fixed.

Thanks for this cramfs update!

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com