Re: armel/marvell kernel size
- To: Federico Pietro Briata <federico@briata.org>, Ben Hutchings <ben@decadent.org.uk>, Rick Thomas <rbthomas@pobox.com>, Rogério Brito <rbrito@ime.usp.br>, Martin Michlmayr <tbm@cyrius.com>
- Cc: Stefan Monnier <monnier@iro.umontreal.ca>, Arm List Debian <debian-arm@lists.debian.org>, Debian kernel maintainers <debian-kernel@lists.debian.org>
- Subject: Re: armel/marvell kernel size
- From: Roger Shimizu <rogershimizu@gmail.com>
- Date: Sun, 1 Apr 2018 22:25:40 +0900
- Message-id: <[🔎] CAEQ9gEk3P40oh3Jg6QQPHRqQbQ1TJ4g6X2rxtKSc7readcsxAA@mail.gmail.com>
- In-reply-to: <CA+KKcbmfYPwksFxQq=N6Yg7NyjHnoK9VG+0i0NMJiMc2y7M+pQ@mail.gmail.com>
- References: <1508508423.2721.34.camel@decadent.org.uk> <1516249342.5097.25.camel@decadent.org.uk> <CAEQ9gEnGTv+VhBMw4K2dvvcVJQsJWZHkwy_To7hF87_R+oqqwg@mail.gmail.com> <1516732223.5097.105.camel@decadent.org.uk> <20180217124851.GA1056@eldamar.local> <20180322031228.GA14629@ime.usp.br> <20180323211530.GA19598@ime.usp.br> <1521856248.2495.257.camel@decadent.org.uk> <CAOtrxKN1WxkZAWBgD-HfkgD2FzPofSj-2GtfnPaP0benC72fzg@mail.gmail.com> <jwvo9j9r95r.fsf-monnier+gmane.linux.debian.ports.arm@gnu.org> <5c79d8f3-a590-4a5e-aa71-1947657d70aa@ime.usp.br> <46C3CC97-3210-423E-AC36-C865B76005F7@pobox.com> <9334f91d-e66c-2d33-686e-21339c36e65b@ime.usp.br> <81FCE08E-1EA1-4D42-806E-40D0090501D9@pobox.com> <CA+KKcbmfYPwksFxQq=N6Yg7NyjHnoK9VG+0i0NMJiMc2y7M+pQ@mail.gmail.com>
Dear Ben, and other arm/kernel folks,
On Wed, Jan 24, 2018 at 3:30 AM, Ben Hutchings <ben@decadent.org.uk> wrote:
> On Mon, 2018-01-22 at 22:38 +0900, Roger Shimizu wrote:
>
> There's an upstream change in cfg80211 that enables direct-loading of
> wireless rules, which requires public key crypto in the kernel. There
> doesn't appear to be any option to disable that mode, even though we
> don't need it because crda still works. Maybe you could disable
> wireless networking completely?
I finally settled a solution, by introducing a new armel flavour:
mini, which doesn't support wireless.
There're still some users that need wireless, so I didn't remove
wireless from armel/marvell directly.
So here I propose to have:
- marvell to support all generic feature and being able to tuned for
performance.
- mini without wireless and being minimum.
Patches are all enclosed, and pushed to salsa rosh/armel_mini branch.
- 0001: Bring back qnap support by a new armel flavour: mini (Disable
WIRELESS, WLAN, etc)
- 0002: [armel/mini] Add flavour mini to installer
- 0003: [armel/mini] Further change a few features as module (I2C,
I2C_CHARDEV, I2C_MV64XXX,
MTD, MTD_CMDLINE_PARTS, RTC_DRV_MV, and SPI_ORION)
I tested on stretch by cross compiling, here's generated kernel size.
- original 4.16~rc6-1~exp2: 2142704
- After patch 0001: 2017088
- After patch 0002: 2017088
- After patch 0003: 1985896
Here's my testing result regarding those features that changed to module:
(tested under stretch)
> Some options that could possibly be changed from y to m:
>
> - I2C, I2C_CHARDEV, I2C_MV64XXX. initramfs-tools should include I2C
> drivers to the initramfs if needed, but I'm not certain.
No, i2c nor i2c_mv64xxx will be loaded. But my armel box seems fine
without them.
Of course, manually "modprobe i2c_mv64xxx" will load the module well.
> - MTD, MTD_CMDLINE_PARTS, etc. But I'm pretty sure this will break
> some systems unless initramfs-tools is updated to include and load the
> cmdlinepart module.
>
> - RTC_DRV_MV (and disable RTC_HCTOSYS). There's a udev rule that
> should load the system clock from the first RTC if its driver is a
> module.
>
> - SPI_ORION. initramfs-tools should include this in the initramfs if
> needed, but I'm not certain.
Yes, above 3 modules are loaded without glitch.
> Some options that could possibly be disabled:
>
> - AUDIT. This is quite a niche feature.
I tried, but couldn't. Maybe next time.
So armel/mini image now reduced 150KB compared to marvell, which now
has enough room for Buster.
Any concern for merging these patches?
Cheers,
--
Roger Shimizu, GMT +9 Tokyo
PGP/GPG: 4096R/6C6ACD6417B3ACB1
From 713af1924e35a0587da2aa22d2d538b424955524 Mon Sep 17 00:00:00 2001
From: Roger Shimizu <rogershimizu@gmail.com>
Date: Sun, 1 Apr 2018 00:27:00 +0900
Subject: [PATCH 1/3] Bring back qnap support by a new armel flavour: mini
[armel/marvell] For flavour marvell, set CC_OPTIMIZE_FOR_PERFORMANCE,
which is default for other Arch.
[armel/mini] Add a new flavour mini to bring back qnap support, which
uses config.marvell as base, with some additional settings in
config-reduced:
- Set CC_OPTIMIZE_FOR_SIZE, which as set in config.marvell before
- Change CRYPTO_MANAGER as module
- Set CRYPTO_MANAGER_DISABLE_TESTS=y
- Disable ZSWAP
- Disable WIRELESS
- Disable RD_BZIP2 and RD_LZMA
---
debian/changelog | 11 +++++++++++
debian/config/armel/config-reduced | 33 +++++++++++++++++++++++++++++++++
debian/config/armel/config.marvell | 3 ---
debian/config/armel/defines | 29 +++++++++++++++++++++++------
4 files changed, 67 insertions(+), 9 deletions(-)
create mode 100644 debian/config/armel/config-reduced
diff --git a/debian/changelog b/debian/changelog
index a30befbd9..7a0f7f7df 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,17 @@ linux (4.16~rc6-1~exp2) UNRELEASED; urgency=medium
Also revert two commits that disabled armel previously:
- [2ed70eb] "Add empty featuresets for armel to help abiupdate script"
- [5f62872] "(Temporarily) disable armel kernel image build"
+ * [armel/marvell] For flavour marvell, set CC_OPTIMIZE_FOR_PERFORMANCE,
+ which is default for other Arch.
+ * [armel/mini] Add a new flavour mini to bring back qnap support, which
+ uses config.marvell as base, with some additional settings in
+ config-reduced:
+ - Set CC_OPTIMIZE_FOR_SIZE, which as set in config.marvell before
+ - Change CRYPTO_MANAGER as module
+ - Set CRYPTO_MANAGER_DISABLE_TESTS=y
+ - Disable ZSWAP
+ - Disable WIRELESS
+ - Disable RD_BZIP2 and RD_LZMA
-- Roger Shimizu <rogershimizu@gmail.com> Fri, 23 Mar 2018 21:10:34 +0900
diff --git a/debian/config/armel/config-reduced b/debian/config/armel/config-reduced
new file mode 100644
index 000000000..3d6e3bfbc
--- /dev/null
+++ b/debian/config/armel/config-reduced
@@ -0,0 +1,33 @@
+##
+## file: crypto/Kconfig
+##
+CONFIG_CRYPTO_MANAGER=m
+CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
+
+##
+## file: drivers/net/wireless/Kconfig
+##
+# CONFIG_WLAN is not set
+
+##
+## file: init/Kconfig
+##
+## choice: Compiler optimization level
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+## end choice
+
+##
+## file: mm/Kconfig
+##
+# CONFIG_ZSWAP is not set
+
+##
+## file: net/Kconfig
+##
+# CONFIG_WIRELESS is not set
+
+##
+## file: usr/Kconfig
+##
+# CONFIG_RD_BZIP2 is not set
+# CONFIG_RD_LZMA is not set
diff --git a/debian/config/armel/config.marvell b/debian/config/armel/config.marvell
index c5703aeeb..6e18a7fa0 100644
--- a/debian/config/armel/config.marvell
+++ b/debian/config/armel/config.marvell
@@ -725,9 +725,6 @@ CONFIG_NLS=m
# CONFIG_MEMCG is not set
# CONFIG_CFS_BANDWIDTH is not set
# CONFIG_CGROUP_BPF is not set
-## choice: Compiler optimization level
-CONFIG_CC_OPTIMIZE_FOR_SIZE=y
-## end choice
# CONFIG_CHECKPOINT_RESTORE is not set
# CONFIG_USERFAULTFD is not set
# CONFIG_SLUB_DEBUG is not set
diff --git a/debian/config/armel/defines b/debian/config/armel/defines
index f40c4038e..693187769 100644
--- a/debian/config/armel/defines
+++ b/debian/config/armel/defines
@@ -1,6 +1,7 @@
[base]
flavours:
marvell
+ mini
kernel-arch: arm
[build]
@@ -20,17 +21,13 @@ headers%gcc-7: linux-compiler-gcc-7-arm
[marvell_description]
hardware: Marvell Kirkwood/Orion
-hardware-long: Marvell Kirkwood based systems (SheevaPlug, QNAP TS-119/TS-219, etc)
- and Orion 5181, 5182 and 5281 based systems (QNAP TS-109/TS-209, etc)
+hardware-long: Marvell Kirkwood based systems (SheevaPlug, Linstation LS-WVL, etc)
+ and Orion 5181, 5182 and 5281 based systems (KuroBox-Pro, Linstation LS-GL, etc)
[marvell_image]
recommends: u-boot-tools
## Maximum kernel size for supported devices (64 bytes is the u-boot header)
# SheevaPlug: 4194304 - 64 = 4194240
-# QNAP TS-119/TS-219: 2097152 - 64 = 2097088
-# D-Link DNS-323: 1572864 - 8 - 64 = 1572792 (too small, no longer supported)
-# HP Media Vault mv2120: 2097152 - 8 - 64 = 2097080
-# QNAP TS-109/TS-209 & TS-409: 2097152 - 8 - 64 = 2097080
# Buffalo Linkstation LS-WSXL/WXL/WVL (from stock kernel): 2729776 - 64 = 2729712
check-size: 2729712
check-size-with-dtb: true
@@ -38,3 +35,23 @@ check-size-with-dtb: true
# Buffalo Linkstation LS-WSXL/WXL/WVL: 7340032
check-uncompressed-size: 7340032
breaks: flash-kernel (<< 3.57~)
+
+[mini_description]
+hardware: Mini Marvell Kirkwood/Orion
+hardware-long: Marvell Kirkwood/Orion based systems with strict kernel size limit
+ such as Kirkwood based QNAP TS-119/TS-219, and Orion based QNAP TS-109/TS-209, etc
+
+[mini_image]
+recommends: u-boot-tools
+## Maximum kernel size for supported devices (64 bytes is the u-boot header)
+# QNAP TS-119/TS-219: 2097152 - 64 = 2097088
+# D-Link DNS-323: 1572864 - 8 - 64 = 1572792 (too small, no longer supported)
+# HP Media Vault mv2120: 2097152 - 8 - 64 = 2097080
+# QNAP TS-109/TS-209 & TS-409: 2097152 - 8 - 64 = 2097080
+check-size: 2097080
+check-size-with-dtb: true
+check-uncompressed-size: 7340032
+breaks: flash-kernel (<< 3.57~)
+configs:
+ armel/config.marvell
+ armel/config-reduced
--
2.11.0
From aefdad38243866549e0b67e8a1c82213a8c052e0 Mon Sep 17 00:00:00 2001
From: Roger Shimizu <rogershimizu@gmail.com>
Date: Sun, 1 Apr 2018 18:10:11 +0900
Subject: [PATCH 2/3] [armel/mini] Add flavour mini to installer
---
debian/changelog | 1 +
debian/installer/armel/kernel-versions | 1 +
debian/installer/armel/modules/armel-mini | 1 +
debian/installer/armel/package-list | 2 +-
4 files changed, 4 insertions(+), 1 deletion(-)
create mode 120000 debian/installer/armel/modules/armel-mini
diff --git a/debian/changelog b/debian/changelog
index 7a0f7f7df..000ec10d2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -18,6 +18,7 @@ linux (4.16~rc6-1~exp2) UNRELEASED; urgency=medium
- Disable ZSWAP
- Disable WIRELESS
- Disable RD_BZIP2 and RD_LZMA
+ * [armel/mini] Add flavour mini to installer
-- Roger Shimizu <rogershimizu@gmail.com> Fri, 23 Mar 2018 21:10:34 +0900
diff --git a/debian/installer/armel/kernel-versions b/debian/installer/armel/kernel-versions
index 49eb64629..8d584a289 100644
--- a/debian/installer/armel/kernel-versions
+++ b/debian/installer/armel/kernel-versions
@@ -1,2 +1,3 @@
# arch version flavour installedname suffix build-depends
armel - marvell - y -
+armel - mini - y -
diff --git a/debian/installer/armel/modules/armel-mini b/debian/installer/armel/modules/armel-mini
new file mode 120000
index 000000000..e7057ad28
--- /dev/null
+++ b/debian/installer/armel/modules/armel-mini
@@ -0,0 +1 @@
+armel-marvell
\ No newline at end of file
diff --git a/debian/installer/armel/package-list b/debian/installer/armel/package-list
index d975323d3..1dac23169 100644
--- a/debian/installer/armel/package-list
+++ b/debian/installer/armel/package-list
@@ -5,7 +5,7 @@
#
Package: kernel-image
Provides_marvell: rtc-modules
-Provides_versatile: rtc-modules
+Provides_mini: rtc-modules
Package: fb-modules
Depends: kernel-image, usb-modules
--
2.11.0
From ce61976b4810abb7e88f0bf08dc8efc7e6a19dc5 Mon Sep 17 00:00:00 2001
From: Roger Shimizu <rogershimizu@gmail.com>
Date: Sun, 1 Apr 2018 18:25:48 +0900
Subject: [PATCH 3/3] [armel/mini] Further change a few features as module
Change the following as module:
- I2C
- I2C_CHARDEV
- I2C_MV64XXX
- MTD
- MTD_CMDLINE_PARTS
- RTC_DRV_MV
- SPI_ORION
---
debian/changelog | 2 ++
debian/config/armel/config-reduced | 27 +++++++++++++++++++++++++++
2 files changed, 29 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 000ec10d2..0bae2b210 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -18,6 +18,8 @@ linux (4.16~rc6-1~exp2) UNRELEASED; urgency=medium
- Disable ZSWAP
- Disable WIRELESS
- Disable RD_BZIP2 and RD_LZMA
+ - Change a few features as module: I2C, I2C_CHARDEV, I2C_MV64XXX, MTD,
+ MTD_CMDLINE_PARTS, RTC_DRV_MV, and SPI_ORION
* [armel/mini] Add flavour mini to installer
-- Roger Shimizu <rogershimizu@gmail.com> Fri, 23 Mar 2018 21:10:34 +0900
diff --git a/debian/config/armel/config-reduced b/debian/config/armel/config-reduced
index 3d6e3bfbc..c848653f5 100644
--- a/debian/config/armel/config-reduced
+++ b/debian/config/armel/config-reduced
@@ -5,11 +5,38 @@ CONFIG_CRYPTO_MANAGER=m
CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
##
+## file: drivers/i2c/Kconfig
+##
+CONFIG_I2C=m
+CONFIG_I2C_CHARDEV=m
+
+##
+## file: drivers/i2c/busses/Kconfig
+##
+CONFIG_I2C_MV64XXX=m
+
+##
+## file: drivers/mtd/Kconfig
+##
+CONFIG_MTD=m
+CONFIG_MTD_CMDLINE_PARTS=m
+
+##
## file: drivers/net/wireless/Kconfig
##
# CONFIG_WLAN is not set
##
+## file: drivers/rtc/Kconfig
+##
+CONFIG_RTC_DRV_MV=m
+
+##
+## file: drivers/spi/Kconfig
+##
+CONFIG_SPI_ORION=m
+
+##
## file: init/Kconfig
##
## choice: Compiler optimization level
--
2.11.0
Reply to: