[OpenWrt-Devel] [PATCH v2] config: extend small_flash feature

Alex Maclean monkeh at monkeh.net
Mon Jul 9 13:09:05 EDT 2018


Extend the small_flash feature to disable swap, core dumps, and
kernel debug info, and change the squashfs block size to 1024KiB.

Also change squashfs fragment cache to 2 for small_flash to ease memory
usage.

Signed-off-by: Alex Maclean <monkeh at monkeh.net>
---
 config/Config-images.in          |  1 +
 config/Config-kernel.in          | 11 ++++++++---
 target/linux/generic/config-3.18 |  2 +-
 target/linux/generic/config-4.14 |  2 +-
 target/linux/generic/config-4.9  |  2 +-
 5 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/config/Config-images.in b/config/Config-images.in
index 90e873edb8..07ef619e70 100644
--- a/config/Config-images.in
+++ b/config/Config-images.in
@@ -149,6 +149,7 @@ menu "Target Images"
 			int "Block size (in KiB)"
 			depends on TARGET_ROOTFS_SQUASHFS
 			default 64 if LOW_MEMORY_FOOTPRINT
+			default 1024 if (SMALL_FLASH && !LOW_MEMORY_FOOTPRINT)
 			default 256
 
 	menuconfig TARGET_ROOTFS_UBIFS
diff --git a/config/Config-kernel.in b/config/Config-kernel.in
index d2d1909956..4edccebea3 100644
--- a/config/Config-kernel.in
+++ b/config/Config-kernel.in
@@ -31,7 +31,7 @@ config KERNEL_CRASHLOG
 
 config KERNEL_SWAP
 	bool "Support for paging of anonymous memory (swap)"
-	default y
+	default y if !SMALL_FLASH
 
 config KERNEL_DEBUG_FS
 	bool "Compile the kernel with debug filesystem enabled"
@@ -133,7 +133,7 @@ config KERNEL_DEBUG_KERNEL
 
 config KERNEL_DEBUG_INFO
 	bool "Compile the kernel with debug information"
-	default y
+	default y if !SMALL_FLASH
 	select KERNEL_DEBUG_KERNEL
 	help
 	  This will compile your kernel and modules with debug information.
@@ -226,7 +226,7 @@ config KERNEL_COREDUMP
 config KERNEL_ELF_CORE
 	bool "Enable process core dump support"
 	select KERNEL_COREDUMP
-	default y
+	default y if !SMALL_FLASH
 
 config KERNEL_PROVE_LOCKING
 	bool "Enable kernel lock checking"
@@ -806,3 +806,8 @@ config KERNEL_DEVKMEM
 	  Say Y here if you want to support the /dev/kmem device. The
 	  /dev/kmem device is rarely used, but can be used for certain
 	  kind of kernel debugging operations.
+
+config KERNEL_SQUASHFS_FRAGMENT_CACHE_SIZE
+	int "Number of squashfs fragments cached"
+	default 2 if (SMALL_FLASH && !LOW_MEMORY_FOOTPRINT)
+	default 3
diff --git a/target/linux/generic/config-3.18 b/target/linux/generic/config-3.18
index 0f66960fdc..41f68cd582 100644
--- a/target/linux/generic/config-3.18
+++ b/target/linux/generic/config-3.18
@@ -3817,7 +3817,7 @@ CONFIG_SQUASHFS=y
 # CONFIG_SQUASHFS_DECOMP_MULTI is not set
 CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y
 # CONFIG_SQUASHFS_DECOMP_SINGLE is not set
-# CONFIG_SQUASHFS_EMBEDDED is not set
+CONFIG_SQUASHFS_EMBEDDED=y
 # CONFIG_SQUASHFS_FILE_CACHE is not set
 CONFIG_SQUASHFS_FILE_DIRECT=y
 CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
diff --git a/target/linux/generic/config-4.14 b/target/linux/generic/config-4.14
index 3ed2fed7a6..6843ef3a56 100644
--- a/target/linux/generic/config-4.14
+++ b/target/linux/generic/config-4.14
@@ -4685,7 +4685,7 @@ CONFIG_SQUASHFS=y
 # CONFIG_SQUASHFS_DECOMP_MULTI is not set
 CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y
 # CONFIG_SQUASHFS_DECOMP_SINGLE is not set
-# CONFIG_SQUASHFS_EMBEDDED is not set
+CONFIG_SQUASHFS_EMBEDDED=y
 # CONFIG_SQUASHFS_FILE_CACHE is not set
 CONFIG_SQUASHFS_FILE_DIRECT=y
 CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
diff --git a/target/linux/generic/config-4.9 b/target/linux/generic/config-4.9
index 83abfdc8ff..e7cf5e4361 100644
--- a/target/linux/generic/config-4.9
+++ b/target/linux/generic/config-4.9
@@ -4403,7 +4403,7 @@ CONFIG_SQUASHFS=y
 # CONFIG_SQUASHFS_DECOMP_MULTI is not set
 CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y
 # CONFIG_SQUASHFS_DECOMP_SINGLE is not set
-# CONFIG_SQUASHFS_EMBEDDED is not set
+CONFIG_SQUASHFS_EMBEDDED=y
 # CONFIG_SQUASHFS_FILE_CACHE is not set
 CONFIG_SQUASHFS_FILE_DIRECT=y
 CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
-- 
2.18.0


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list