Re: armel/marvell kernel size

2018-04-01 Thread Rick Thomas

On Mar 28, 2018, at 2:22 AM, Rick Thomas  wrote:

>> What filesystems do you use? Do you use any (para)virtualization? What
>> about addon hardware that you have? Any USB dongles? Anything that you
>> can think of? Sound?
>> 
>> Do you use NFS? (I do) What kind of compressed ramdisk do you use? The
>> loaded modules that you have with lsmod would be nice to know.
> 

Filesystems:  ext2 and ext4

Vitrualization: Nope.  These are way too small for anything fancy like that.

Addon hardware:
USB2 ports useful for disk and/or flash drives and other stuff (I don’t 
do the “other stuff” myself but I suppose there are folks who might).
They have 1000BaseT ports.  Two ports on the OpenRD Client, one on the 
SheevaPlug.
They each have a mini-USB serial port that they use for serial console.
The Client has a headphone jack.  I’ve used it in the past for 
listening to streaming radio.  The SheevaPlug has no audio i/o.
Both machines have SD-card slots that can be used in booting or as aux 
data storage.
Both get their uboot from mtd, not mmc, so updating uboot requires 
re-flashing.
The Client has 512MB RAM.  The SheevaPlug has the same.

CPU info for SheevaPlug —
> root@sheeva:~# cat /proc/cpuinfo
> processor : 0
> model name: Feroceon 88FR131 rev 1 (v5l)
> BogoMIPS  : 1185.79
> Features  : swp half thumb fastmult edsp 
> CPU implementer   : 0x56
> CPU architecture: 5TE
> CPU variant   : 0x2
> CPU part  : 0x131
> CPU revision  : 1
> 
> Hardware  : Marvell Kirkwood (Flattened Device Tree)
> Revision  : 
> Serial: 

CPU info for OpenRD Client —
> rbthomas@client:~$ cat /proc/cpuinfo 

> processor : 0
> model name: Feroceon 88FR131 rev 1 (v5l)
> BogoMIPS  : 1191.93
> Features  : swp half thumb fastmult edsp 
> CPU implementer   : 0x56
> CPU architecture: 5TE
> CPU variant   : 0x2
> CPU part  : 0x131
> CPU revision  : 1
> 
> Hardware  : Marvell Kirkwood (Flattened Device Tree)
> Revision  : 
> Serial: 

Uboot details on SheevaPlug —
> U-Boot 2016.01-rc3+dfsg1-3 (Jan 02 2016 - 23:19:11 +)
> Marvell-Sheevaplug
> 
> SoC:   Kirkwood 88F6281_A0
> DRAM:  512 MiB (ECC not enabled)
> WARNING: Caches not enabled
> NAND:  512 MiB
> MMC:   MVEBU_MMC: 0
> In:serial
> Out:   serial
> Err:   serial
> Net:   egiga0

and on OpenRD Client —
> U-Boot 2016.11+dfsg1-4~20170308~1 (Mar 09 2017 - 01:27:49 +)
> OpenRD-Client
> 
> SoC:   Kirkwood 88F6281_A0
> DRAM:  512 MiB
> WARNING: Caches not enabled
> NAND:  512 MiB
> MMC:   MVEBU_MMC: 0
> In:serial
> Out:   serial
> Err:   serial
> Net:   egiga0, egiga1
> 


I use the SheevaPlug as a backup DHCP/DNS server for my home network.  The 
Client is reserved for experimenting.

I don’t currently use NFS on either, but I have in the past.

I’m not sure what you mean by “What kind of compressed ramdisk do you use?”.  
As a stab in the dark —

> rbthomas@client:~$ file /boot/initrd.img-4.9.0-6-marvell
> /boot/initrd.img-4.9.0-6-marvell: gzip compressed data, last modified: Sun 
> Mar  4 14:29:43 2018, from Unix

and

> root@sheeva:~# file /boot/initrd.img-4.9.0-6-marvell
> /boot/initrd.img-4.9.0-6-marvell: gzip compressed data, last modified: Sat 
> Mar 10 10:12:39 2018, from Unix

In other words, nothing fancy!

Does that help?
Rick




Re: armel/marvell kernel size

2018-04-01 Thread Roger Shimizu
Dear Ben, and other arm/kernel folks,

On Wed, Jan 24, 2018 at 3:30 AM, Ben Hutchings  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 
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   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 0..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