From f4605de83a14c6f89a47509b71fd5f92fdb7d3c6 Mon Sep 17 00:00:00 2001 From: kszaq Date: Thu, 2 May 2019 21:18:00 +0200 Subject: [PATCH 1/6] Generic: don't use initramfs compression Kernel image is already compressed with bzip2, there is no point in having compressed initramfs inside a compressed image. Initramfs compression is discouraged: https://github.com/torvalds/linux/blob/v5.0/usr/Kconfig#L137-L143 --- projects/Generic/linux/linux.x86_64.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/Generic/linux/linux.x86_64.conf b/projects/Generic/linux/linux.x86_64.conf index 1103460cc35..477a8298561 100644 --- a/projects/Generic/linux/linux.x86_64.conf +++ b/projects/Generic/linux/linux.x86_64.conf @@ -156,13 +156,13 @@ CONFIG_NET_NS=y CONFIG_RELAY=y CONFIG_BLK_DEV_INITRD=y CONFIG_INITRAMFS_SOURCE="" -CONFIG_RD_GZIP=y +# CONFIG_RD_GZIP is not set # CONFIG_RD_BZIP2 is not set # CONFIG_RD_LZMA is not set # CONFIG_RD_XZ is not set # CONFIG_RD_LZO is not set # CONFIG_RD_LZ4 is not set -CONFIG_INITRAMFS_COMPRESSION=".gz" +CONFIG_INITRAMFS_COMPRESSION="" CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_SYSCTL=y From ef346f244b1ad17784087e6200dfce43d3c2f65d Mon Sep 17 00:00:00 2001 From: kszaq Date: Thu, 2 May 2019 21:18:38 +0200 Subject: [PATCH 2/6] RPi: don't use initramfs compression Kernel image is already compressed with gzip, there is no point in having compressed initramfs inside a compressed image. Initramfs compression is discouraged: https://github.com/torvalds/linux/blob/v5.0/usr/Kconfig#L137-L143 --- projects/RPi/devices/RPi/linux/linux.arm.conf | 4 ++-- projects/RPi/devices/RPi2/linux/linux.arm.conf | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/projects/RPi/devices/RPi/linux/linux.arm.conf b/projects/RPi/devices/RPi/linux/linux.arm.conf index 1fd60bd1934..f5b7fed549c 100644 --- a/projects/RPi/devices/RPi/linux/linux.arm.conf +++ b/projects/RPi/devices/RPi/linux/linux.arm.conf @@ -128,13 +128,13 @@ CONFIG_RELAY=y CONFIG_BLK_DEV_INITRD=y CONFIG_INITRAMFS_SOURCE="" # CONFIG_INITRAMFS_FORCE is not set -CONFIG_RD_GZIP=y +# CONFIG_RD_GZIP is not set # CONFIG_RD_BZIP2 is not set # CONFIG_RD_LZMA is not set # CONFIG_RD_XZ is not set # CONFIG_RD_LZO is not set # CONFIG_RD_LZ4 is not set -CONFIG_INITRAMFS_COMPRESSION=".gz" +CONFIG_INITRAMFS_COMPRESSION="" CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_SYSCTL=y diff --git a/projects/RPi/devices/RPi2/linux/linux.arm.conf b/projects/RPi/devices/RPi2/linux/linux.arm.conf index 2e3ed09419b..bad58631c0e 100644 --- a/projects/RPi/devices/RPi2/linux/linux.arm.conf +++ b/projects/RPi/devices/RPi2/linux/linux.arm.conf @@ -137,13 +137,13 @@ CONFIG_RELAY=y CONFIG_BLK_DEV_INITRD=y CONFIG_INITRAMFS_SOURCE="" # CONFIG_INITRAMFS_FORCE is not set -CONFIG_RD_GZIP=y +# CONFIG_RD_GZIP is not set # CONFIG_RD_BZIP2 is not set # CONFIG_RD_LZMA is not set # CONFIG_RD_XZ is not set # CONFIG_RD_LZO is not set # CONFIG_RD_LZ4 is not set -CONFIG_INITRAMFS_COMPRESSION=".gz" +CONFIG_INITRAMFS_COMPRESSION="" CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_SYSCTL=y From 07e99d2ceb79bac2ca070fe629a35a7b916b41ed Mon Sep 17 00:00:00 2001 From: kszaq Date: Fri, 3 May 2019 00:17:52 +0200 Subject: [PATCH 3/6] Allwinner: use lz4 to compress initramfs for aarch64 --- projects/Allwinner/linux/linux.aarch64.conf | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/projects/Allwinner/linux/linux.aarch64.conf b/projects/Allwinner/linux/linux.aarch64.conf index 9a18ebe855f..43978f63cfe 100644 --- a/projects/Allwinner/linux/linux.aarch64.conf +++ b/projects/Allwinner/linux/linux.aarch64.conf @@ -147,13 +147,13 @@ CONFIG_SCHED_AUTOGROUP=y # CONFIG_RELAY is not set CONFIG_BLK_DEV_INITRD=y CONFIG_INITRAMFS_SOURCE="" -CONFIG_RD_GZIP=y -CONFIG_RD_BZIP2=y -CONFIG_RD_LZMA=y -CONFIG_RD_XZ=y -CONFIG_RD_LZO=y +# CONFIG_RD_GZIP is not set +# CONFIG_RD_BZIP2 is not set +# CONFIG_RD_LZMA is not set +# CONFIG_RD_XZ is not set +# CONFIG_RD_LZO is not set CONFIG_RD_LZ4=y -CONFIG_INITRAMFS_COMPRESSION=".gz" +CONFIG_INITRAMFS_COMPRESSION=".lz4" CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_SYSCTL=y @@ -5391,11 +5391,6 @@ CONFIG_XZ_DEC_ARMTHUMB=y CONFIG_XZ_DEC_SPARC=y CONFIG_XZ_DEC_BCJ=y # CONFIG_XZ_DEC_TEST is not set -CONFIG_DECOMPRESS_GZIP=y -CONFIG_DECOMPRESS_BZIP2=y -CONFIG_DECOMPRESS_LZMA=y -CONFIG_DECOMPRESS_XZ=y -CONFIG_DECOMPRESS_LZO=y CONFIG_DECOMPRESS_LZ4=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_XARRAY_MULTI=y From bc1944bac62bc56e6ead747fe4a1e463b8dbf377 Mon Sep 17 00:00:00 2001 From: kszaq Date: Fri, 3 May 2019 00:20:02 +0200 Subject: [PATCH 4/6] Allwinner: don't use initramfs compression Kernel image is already compressed with bzip2, there is no point in having compressed initramfs inside a compressed image. Initramfs compression is discouraged: https://github.com/torvalds/linux/blob/v5.0/usr/Kconfig#L137-L143 --- projects/Allwinner/linux/linux.arm.conf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/projects/Allwinner/linux/linux.arm.conf b/projects/Allwinner/linux/linux.arm.conf index cdb175ae282..6d2ab076d8b 100644 --- a/projects/Allwinner/linux/linux.arm.conf +++ b/projects/Allwinner/linux/linux.arm.conf @@ -148,7 +148,9 @@ CONFIG_RD_GZIP=y # CONFIG_RD_XZ is not set # CONFIG_RD_LZO is not set # CONFIG_RD_LZ4 is not set -CONFIG_INITRAMFS_COMPRESSION=".gz" +CONFIG_INITRAMFS_COMPRESSION_NONE=y +# CONFIG_INITRAMFS_COMPRESSION_GZIP is not set +CONFIG_INITRAMFS_COMPRESSION="" CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_SYSCTL=y From 4a5d8db8bd0e15ddbadf1f27927fc83261ac3bd0 Mon Sep 17 00:00:00 2001 From: kszaq Date: Fri, 3 May 2019 00:21:06 +0200 Subject: [PATCH 5/6] Allwinner: use lz4 to compress kernel for arm --- projects/Allwinner/linux/linux.arm.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/Allwinner/linux/linux.arm.conf b/projects/Allwinner/linux/linux.arm.conf index 6d2ab076d8b..a2a6548133c 100644 --- a/projects/Allwinner/linux/linux.arm.conf +++ b/projects/Allwinner/linux/linux.arm.conf @@ -26,11 +26,11 @@ CONFIG_HAVE_KERNEL_LZMA=y CONFIG_HAVE_KERNEL_XZ=y CONFIG_HAVE_KERNEL_LZO=y CONFIG_HAVE_KERNEL_LZ4=y -CONFIG_KERNEL_GZIP=y +# CONFIG_KERNEL_GZIP is not set # CONFIG_KERNEL_LZMA is not set # CONFIG_KERNEL_XZ is not set # CONFIG_KERNEL_LZO is not set -# CONFIG_KERNEL_LZ4 is not set +CONFIG_KERNEL_LZ4=y CONFIG_DEFAULT_HOSTNAME="@DISTRONAME@" CONFIG_SWAP=y CONFIG_SYSVIPC=y From 066d6574f73d06b24ebf2bd5a3fd19f8cc7783be Mon Sep 17 00:00:00 2001 From: kszaq Date: Fri, 3 May 2019 14:51:38 +0200 Subject: [PATCH 6/6] Allwinner: add lz4:host to kernel dependencies It is required to compress kernel image and initramfs. --- projects/Allwinner/options | 3 +++ 1 file changed, 3 insertions(+) diff --git a/projects/Allwinner/options b/projects/Allwinner/options index db028ec6df3..bc5690cb934 100644 --- a/projects/Allwinner/options +++ b/projects/Allwinner/options @@ -20,6 +20,9 @@ # Additional kernel make parameters (for example to specify the u-boot loadaddress) KERNEL_MAKE_EXTRACMD="dtbs" + # Additional kernel dependencies + KERNEL_EXTRA_DEPENDS_TARGET="lz4:host" + # Kernel to use. values can be: # default: default mainline kernel LINUX="default"