Skip to content

Commit

Permalink
fs/cramfs: add xip option
Browse files Browse the repository at this point in the history
Cramfs now has the ability to XIP all ELF files.

Cc: Nicolas Pitre <[email protected]>
Signed-off-by: Chris Brandt <[email protected]>
Signed-off-by: Thomas Petazzoni <[email protected]>
  • Loading branch information
seebe authored and tpetazzoni committed Apr 9, 2018
1 parent 2cf4871 commit 265aee8
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
20 changes: 20 additions & 0 deletions fs/cramfs/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,23 @@ 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
8 changes: 8 additions & 0 deletions fs/cramfs/cramfs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 265aee8

Please sign in to comment.