Instruction how to update Debian kernel with a .deb patch (remove raid6 bench at boot -1 sec)

  1. Make some environment if you already haven’t one. Be careful - building kernel uses lot of resources (use minimum 15GB virtual HDD space, 2-3GB RAM and as many CPU cores as you can).
  2. Install some packages:

sudo su
apt-get install u-boot-tools
apt-get install rsync

  1. Follow official instruction (Thanks to Radxa developers for it!) until Build Kernel step.
  2. Edit radxa_zero_defconfig file to turn off raid6 bench at boot process:

cd kernel
sed -i ‘s/CONFIG_ASYNC_RAID6_TEST=m/CONFIG_ASYNC_RAID6_TEST=n/’ arch/arm64/configs/radxa_zero_defconfig
sed -i ‘s/CONFIG_BTRFS_FS=y/CONFIG_BTRFS_FS=n/’ arch/arm64/configs/radxa_zero_defconfig
echo ‘CONFIG_RAID6_PQ=n’ >> arch/arm64/configs/radxa_zero_defconfig

  1. Proceed official instruction from Build Kernel step.
  2. You are good to go without raid6 benchmark at each boot so boot time is reduced.
dmesg before patch

$ dmesg

[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[ 0.000000] Linux version 5.10.69-999-amlogic (root@debian) (aarch64-linux-gnu-gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #amlogic SMP PREEMPT Mon Nov 22 10:22:30 EST 2021
[ 0.000000] Machine model: Radxa Zero
[ 0.000000] efi: UEFI not found.
[ 0.000000] OF: fdt: Reserved memory: failed to reserve memory for node ‘secmon@5000000’: base 0x0000000005000000, size 3 MiB
[ 0.000000] Reserved memory: created CMA memory pool at 0x0000000070000000, size 256 MiB
[ 0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[ 0.000000] NUMA: No NUMA configuration found
[ 0.000000] NUMA: Faking a node at [mem 0x0000000000000000-0x000000007fffffff]
[ 0.000000] NUMA: NODE_DATA [mem 0x6fba6100-0x6fba7fff]
[ 0.000000] Zone ranges:
[ 0.000000] DMA [mem 0x0000000000000000-0x000000007fffffff]
[ 0.000000] DMA32 empty
[ 0.000000] Normal empty
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000000000000-0x000000007fffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000007fffffff]
[ 0.000000] On node 0 totalpages: 524288
[ 0.000000] DMA zone: 8192 pages used for memmap
[ 0.000000] DMA zone: 0 pages reserved
[ 0.000000] DMA zone: 524288 pages, LIFO batch:63
[ 0.000000] psci: probing for conduit method from DT.
[ 0.000000] psci: PSCIv1.0 detected in firmware.
[ 0.000000] psci: Using standard PSCI v0.2 function IDs
[ 0.000000] psci: MIGRATE_INFO_TYPE not supported.
[ 0.000000] psci: SMC Calling Convention v1.1
[ 0.000000] percpu: Embedded 23 pages/cpu s56920 r8192 d29096 u94208
[ 0.000000] pcpu-alloc: s56920 r8192 d29096 u94208 alloc=23*4096
[ 0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
[ 0.000000] Detected VIPT I-cache on CPU0
[ 0.000000] CPU features: detected: ARM erratum 845719
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 516096
[ 0.000000] Policy zone: DMA
[ 0.000000] Kernel command line: initrd=initrd.img-5.10.69-999-amlogic root=UUID=30422831-c223-492f-959c-0fc18139c228 rootwait rw rootfstype=ext4 console=tty1 console=ttyAML0,115200 panic=10 consoleblank=0 loglevel=7 cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1
[ 0.000000] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[ 0.000000] mem auto-init: stack:off, heap alloc:on, heap free:off
[ 0.000000] Memory: 1754284K/2097152K available (14336K kernel code, 1662K rwdata, 5384K rodata, 2880K init, 587K bss, 80724K reserved, 262144K cma-reserved)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[ 0.000000] rcu: Preemptible hierarchical RCU implementation.
[ 0.000000] rcu: RCU event tracing is enabled.
[ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=4.
[ 0.000000] Trampoline variant of Tasks RCU enabled.
[ 0.000000] Rude variant of Tasks RCU enabled.
[ 0.000000] Tracing variant of Tasks RCU enabled.
[ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[ 0.000000] GIC: Using split EOI/Deactivate mode
[ 0.000000] irq_meson_gpio: 100 to 8 gpio interrupt mux initialized
[ 0.000000] random: get_random_bytes called from start_kernel+0x364/0x528 with crng_init=0
[ 0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (phys).
[ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[ 0.000004] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[ 0.000169] Console: colour dummy device 80x25
[ 0.000563] printk: console [tty1] enabled
[ 0.000648] Calibrating delay loop (skipped), value calculated using timer frequency… 48.00 BogoMIPS (lpj=96000)
[ 0.000672] pid_max: default: 32768 minimum: 301
[ 0.000752] LSM: Security Framework initializing
[ 0.000782] Yama: becoming mindful.
[ 0.000873] AppArmor: AppArmor initialized
[ 0.000923] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
[ 0.000948] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
[ 0.002553] rcu: Hierarchical SRCU implementation.
[ 0.004672] EFI services will not be available.
[ 0.004995] smp: Bringing up secondary CPUs …
[ 0.005511] Detected VIPT I-cache on CPU1
[ 0.005579] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[ 0.006108] Detected VIPT I-cache on CPU2
[ 0.006137] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
[ 0.006620] Detected VIPT I-cache on CPU3
[ 0.006646] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
[ 0.006706] smp: Brought up 1 node, 4 CPUs
[ 0.006765] SMP: Total of 4 processors activated.
[ 0.006776] CPU features: detected: 32-bit EL0 Support
[ 0.006788] CPU features: detected: CRC32 instructions
[ 0.006800] CPU features: detected: 32-bit EL1 Support
[ 0.015026] CPU: All CPU(s) started at EL2
[ 0.015088] alternatives: patching kernel code
[ 0.016764] devtmpfs: initialized
[ 0.027468] Registered cp15_barrier emulation handler
[ 0.027505] Registered setend emulation handler
[ 0.027698] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[ 0.027741] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[ 0.034275] pinctrl core: initialized pinctrl subsystem
[ 0.035172] DMI not present or invalid.
[ 0.035686] NET: Registered protocol family 16
[ 0.037258] DMA: preallocated 256 KiB GFP_KERNEL pool for atomic allocations
[ 0.037385] DMA: preallocated 256 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[ 0.037546] DMA: preallocated 256 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[ 0.037651] audit: initializing netlink subsys (disabled)
[ 0.037833] audit: type=2000 audit(0.036:1): state=initialized audit_enabled=0 res=1
[ 0.038995] thermal_sys: Registered thermal governor ‘fair_share’
[ 0.039006] thermal_sys: Registered thermal governor ‘bang_bang’
[ 0.039034] thermal_sys: Registered thermal governor ‘step_wise’
[ 0.039046] thermal_sys: Registered thermal governor ‘user_space’
[ 0.039620] cpuidle: using governor menu
[ 0.040003] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[ 0.040106] ASID allocator initialised with 65536 entries
[ 0.041412] Serial: AMBA PL011 UART driver
[ 0.082896] HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages
[ 0.082932] HugeTLB registered 32.0 MiB page size, pre-allocated 0 pages
[ 0.082945] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[ 0.082958] HugeTLB registered 64.0 KiB page size, pre-allocated 0 pages
[ 0.084870] cryptd: max_cpu_qlen set to 1000
[ 0.157149] raid6: neonx8 gen() 2143 MB/s
[ 0.225196] raid6: neonx8 xor() 1599 MB/s
[ 0.293250] raid6: neonx4 gen() 2196 MB/s
[ 0.361300] raid6: neonx4 xor() 1569 MB/s
[ 0.429382] raid6: neonx2 gen() 2081 MB/s
[ 0.497429] raid6: neonx2 xor() 1441 MB/s
[ 0.565511] raid6: neonx1 gen() 1794 MB/s
[ 0.633575] raid6: neonx1 xor() 1220 MB/s
[ 0.701650] raid6: int64x8 gen() 1438 MB/s
[ 0.769710] raid6: int64x8 xor() 771 MB/s
[ 0.837821] raid6: int64x4 gen() 1598 MB/s
[ 0.905855] raid6: int64x4 xor() 818 MB/s
[ 0.973940] raid6: int64x2 gen() 1397 MB/s
[ 1.041995] raid6: int64x2 xor() 750 MB/s
[ 1.110082] raid6: int64x1 gen() 1033 MB/s
[ 1.178134] raid6: int64x1 xor() 517 MB/s
[ 1.178145] raid6: using algorithm neonx4 gen() 2196 MB/s
[ 1.178155] raid6: … xor() 1569 MB/s, rmw enabled
[ 1.178165] raid6: using neon recovery algorithm
[ 1.178805] ACPI: Interpreter disabled.
[ 1.179228] reg-fixed-voltage regulator-flash_1v8: Failed to register regulator: -517
[ 1.179573] reg-fixed-voltage regulator-vcc_1v8: Failed to register regulator: -517
[ 1.179661] reg-fixed-voltage regulator-vcc_3v3: Failed to register regulator: -517
[ 1.179801] reg-fixed-voltage regulator-vddao_1v8: Failed to register regulator: -517
[ 1.179881] VDDAO_3V3: supplied by DC_IN
[ 1.180692] iommu: Default domain type: Translated
[ 1.180885] vgaarb: loaded
[ 1.182438] SCSI subsystem initialized

dmesg after patch

$ dmesg
[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[ 0.000000] Linux version 5.10.69-1000-amlogic (root@debian) (aarch64-none-elf-gcc (GNU Toolchain for the A-profile Architecture 10.3-2021.07 (arm-10.29)) 10.3.1 20210621, GNU ld (GNU Toolchain for the A-profile Architecture 10.3-2021.07 (arm-10.29)) 2.36.1.20210621) #amlogic SMP PREEMPT Mon Nov 22 11:07:42 EST 2021
[ 0.000000] Machine model: Radxa Zero
[ 0.000000] efi: UEFI not found.
[ 0.000000] OF: fdt: Reserved memory: failed to reserve memory for node ‘secmon@5000000’: base 0x0000000005000000, size 3 MiB
[ 0.000000] Reserved memory: created CMA memory pool at 0x0000000070000000, size 256 MiB
[ 0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[ 0.000000] NUMA: No NUMA configuration found
[ 0.000000] NUMA: Faking a node at [mem 0x0000000000000000-0x000000007fffffff]
[ 0.000000] NUMA: NODE_DATA [mem 0x6fba6100-0x6fba7fff]
[ 0.000000] Zone ranges:
[ 0.000000] DMA [mem 0x0000000000000000-0x000000007fffffff]
[ 0.000000] DMA32 empty
[ 0.000000] Normal empty
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000000000000-0x000000007fffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000007fffffff]
[ 0.000000] On node 0 totalpages: 524288
[ 0.000000] DMA zone: 8192 pages used for memmap
[ 0.000000] DMA zone: 0 pages reserved
[ 0.000000] DMA zone: 524288 pages, LIFO batch:63
[ 0.000000] psci: probing for conduit method from DT.
[ 0.000000] psci: PSCIv1.0 detected in firmware.
[ 0.000000] psci: Using standard PSCI v0.2 function IDs
[ 0.000000] psci: MIGRATE_INFO_TYPE not supported.
[ 0.000000] psci: SMC Calling Convention v1.1
[ 0.000000] percpu: Embedded 23 pages/cpu s56920 r8192 d29096 u94208
[ 0.000000] pcpu-alloc: s56920 r8192 d29096 u94208 alloc=23*4096
[ 0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
[ 0.000000] Detected VIPT I-cache on CPU0
[ 0.000000] CPU features: detected: ARM erratum 845719
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 516096
[ 0.000000] Policy zone: DMA
[ 0.000000] Kernel command line: initrd=initrd.img-5.10.69-1000-amlogic root=UUID=30422831-c223-492f-959c-0fc18139c228 rootwait rw rootfstype=ext4 console=tty1 console=ttyAML0,115200 panic=10 consoleblank=0 loglevel=7 cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1
[ 0.000000] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[ 0.000000] mem auto-init: stack:off, heap alloc:on, heap free:off
[ 0.000000] Memory: 1755532K/2097152K available (13440K kernel code, 1632K rwdata, 5180K rodata, 2816K init, 574K bss, 79476K reserved, 262144K cma-reserved)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[ 0.000000] rcu: Preemptible hierarchical RCU implementation.
[ 0.000000] rcu: RCU event tracing is enabled.
[ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=4.
[ 0.000000] Trampoline variant of Tasks RCU enabled.
[ 0.000000] Rude variant of Tasks RCU enabled.
[ 0.000000] Tracing variant of Tasks RCU enabled.
[ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[ 0.000000] GIC: Using split EOI/Deactivate mode
[ 0.000000] irq_meson_gpio: 100 to 8 gpio interrupt mux initialized
[ 0.000000] random: get_random_bytes called from start_kernel+0x364/0x528 with crng_init=0
[ 0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (phys).
[ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[ 0.000004] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[ 0.000167] Console: colour dummy device 80x25
[ 0.000566] printk: console [tty1] enabled
[ 0.000649] Calibrating delay loop (skipped), value calculated using timer frequency… 48.00 BogoMIPS (lpj=96000)
[ 0.000672] pid_max: default: 32768 minimum: 301
[ 0.000752] LSM: Security Framework initializing
[ 0.000782] Yama: becoming mindful.
[ 0.000874] AppArmor: AppArmor initialized
[ 0.000924] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
[ 0.000949] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
[ 0.002558] rcu: Hierarchical SRCU implementation.
[ 0.004675] EFI services will not be available.
[ 0.005000] smp: Bringing up secondary CPUs …
[ 0.005514] Detected VIPT I-cache on CPU1
[ 0.005581] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[ 0.006113] Detected VIPT I-cache on CPU2
[ 0.006145] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
[ 0.006632] Detected VIPT I-cache on CPU3
[ 0.006660] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
[ 0.006719] smp: Brought up 1 node, 4 CPUs
[ 0.006778] SMP: Total of 4 processors activated.
[ 0.006790] CPU features: detected: 32-bit EL0 Support
[ 0.006802] CPU features: detected: CRC32 instructions
[ 0.006814] CPU features: detected: 32-bit EL1 Support
[ 0.014410] CPU: All CPU(s) started at EL2
[ 0.014469] alternatives: patching kernel code
[ 0.016080] devtmpfs: initialized
[ 0.026745] Registered cp15_barrier emulation handler
[ 0.026781] Registered setend emulation handler
[ 0.026967] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[ 0.027010] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[ 0.033554] pinctrl core: initialized pinctrl subsystem
[ 0.034453] DMI not present or invalid.
[ 0.034964] NET: Registered protocol family 16
[ 0.036595] DMA: preallocated 256 KiB GFP_KERNEL pool for atomic allocations
[ 0.036724] DMA: preallocated 256 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[ 0.036886] DMA: preallocated 256 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[ 0.036981] audit: initializing netlink subsys (disabled)
[ 0.037159] audit: type=2000 audit(0.036:1): state=initialized audit_enabled=0 res=1
[ 0.037878] thermal_sys: Registered thermal governor ‘fair_share’
[ 0.037889] thermal_sys: Registered thermal governor ‘bang_bang’
[ 0.037917] thermal_sys: Registered thermal governor ‘step_wise’
[ 0.037930] thermal_sys: Registered thermal governor ‘user_space’
[ 0.038629] cpuidle: using governor menu
[ 0.039001] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[ 0.039108] ASID allocator initialised with 65536 entries
[ 0.040385] Serial: AMBA PL011 UART driver
[ 0.083058] HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages
[ 0.083092] HugeTLB registered 32.0 MiB page size, pre-allocated 0 pages
[ 0.083106] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[ 0.083118] HugeTLB registered 64.0 KiB page size, pre-allocated 0 pages
[ 0.084694] cryptd: max_cpu_qlen set to 1000
[ 0.091680] ACPI: Interpreter disabled.
[ 0.092143] reg-fixed-voltage regulator-flash_1v8: Failed to register regulator: -517
[ 0.092484] reg-fixed-voltage regulator-vcc_1v8: Failed to register regulator: -517
[ 0.092570] reg-fixed-voltage regulator-vcc_3v3: Failed to register regulator: -517
[ 0.092712] reg-fixed-voltage regulator-vddao_1v8: Failed to register regulator: -517
[ 0.092795] VDDAO_3V3: supplied by DC_IN
[ 0.093575] iommu: Default domain type: Translated
[ 0.093771] vgaarb: loaded
[ 0.094802] SCSI subsystem initialized

Summary. Boot time reduced by 1 second. NICE! :+1:
.deb files only.

Now you can make your own Debian patches for your favorite board :sunglasses:
+Watch power LED heartbeat in new kernel :heart:

2 Likes