1000001101000 / Debian_on_Buffalo

Tools for Installing/Running Debian on Buffalo ARM based Linkstation/Terastation/Kurobox/Cloudstor devices.
316 stars 40 forks source link

[bookworm] Linkstation Live v2 kernel v6.1.0-9 fails to boot (initrd disabled), installer v5.10.136 works #182

Open digitalcircuit opened 1 year ago

digitalcircuit commented 1 year ago

After following the Debian guide for upgrading to bookworm, I've gotten an unbootable Linkstation Live v2.

[    0.000000] INITRD: 0x00800000+0x005dd000 overlaps in-use memory region
[    0.000000]  - disabling initrd

[…trimmed more messages, see full excerpt below…]

[    1.102814] List of all partitions:
[    1.106424] No filesystem could mount root, tried: 
[    1.106448] 
[    1.112894] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
Tap/click for serial console logs: Linux kernel v6.1.0-9 initrd disabled, cannot find root filesystem ``` […] ## Booting image at 00100000 ... Image Name: kernel 6.1.0-9-marvell Created: 2023-06-14 9:39:20 UTC Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 2685139 Bytes = 2.6 MB Load Address: 01a00000 Entry Point: 01a00000 Verifying Checksum ... OK OK ## Loading Ramdisk Image at 00800000 ... Image Name: ramdisk 6.1.0-9-marvell Created: 2023-06-14 9:39:21 UTC Image Type: ARM Linux RAMDisk Image (uncompressed) Data Size: 6146668 Bytes = 5.9 MB Load Address: 00000000 Entry Point: 00000000 Verifying Checksum ... OK Starting kernel ... arg:console=ttyS0,115200 root=/dev/sda2 rw panic=5 iomem=relaxed BOOTVER=1.10 [ 0.000000] Booting Linux on physical CPU 0x0 [ 0.000000] Linux version 6.1.0-9-marvell (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 Debian 6.1.27-1 (2023-05-08) [ 0.000000] CPU: Feroceon [41069260] revision 0 (ARMv5TEJ), cr=a005317f [ 0.000000] CPU: VIVT data cache, VIVT instruction cache [ 0.000000] OF: fdt: Machine model: Buffalo Linkstation Pro/Live [ 0.000000] Memory policy: Data cache writeback [ 0.000000] INITRD: 0x00800000+0x005dd000 overlaps in-use memory region [ 0.000000] - disabling initrd [ 0.000000] Zone ranges: [ 0.000000] Normal [mem 0x0000000000000000-0x0000000007ffffff] [ 0.000000] HighMem empty [ 0.000000] Movable zone start for each node [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x0000000000000000-0x0000000007ffffff] [ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff] [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 32512 [ 0.000000] Kernel command line: console=ttyS0,115200 root=/dev/sda2 rw panic=5 iomem=relaxed BOOTVER=1.10 [ 0.000000] Unknown kernel command line parameters "BOOTVER=1.10", will be passed to user space. [ 0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes, linear) [ 0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes, linear) [ 0.000000] mem auto-init: stack:all(zero), heap alloc:on, heap free:off [ 0.000000] Memory: 121572K/131072K available (5134K kernel code, 846K rwdata, 1532K rodata, 320K init, 245K bss, 9500K reserved, 0K cma-reserved, 0K highmem) [ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 [ 0.000000] ftrace: allocating 24552 entries in 72 pages [ 0.000000] ftrace: allocated 72 pages with 2 groups [ 0.000000] trace event string verifier disabled [ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16 [ 0.000000] clocksource: orion_clocksource: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 11467562657 ns [ 0.000004] sched_clock: 32 bits at 167MHz, resolution 6ns, wraps every 12884901885ns [ 0.000094] Switching to timer-based delay loop, resolution 6ns [ 0.000548] Calibrating delay loop (skipped), value calculated using timer frequency.. 333.33 BogoMIPS (lpj=666666) [ 0.000606] pid_max: default: 32768 minimum: 301 [ 0.001915] LSM: Security Framework initializing [ 0.002929] landlock: Up and running. [ 0.002945] Yama: disabled by default; enable with sysctl kernel.yama.* [ 0.003575] AppArmor: AppArmor initialized [ 0.004456] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) [ 0.004519] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) [ 0.008808] CPU: Testing write buffer coherency: ok [ 0.014110] cblist_init_generic: Setting adjustable number of callback queues. [ 0.014142] cblist_init_generic: Setting shift to 0 and lim to 1. [ 0.014756] cblist_init_generic: Setting shift to 0 and lim to 1. [ 0.015505] Setting up static identity map for 0x8220 - 0x825c [ 0.019597] devtmpfs: initialized [ 0.029063] VFP support v0.3: not present [ 0.029560] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns [ 0.029642] futex hash table entries: 256 (order: -1, 3072 bytes, linear) [ 0.030078] pinctrl core: initialized pinctrl subsystem [ 0.035742] NET: Registered PF_NETLINK/PF_ROUTE protocol family [ 0.037774] DMA: preallocated 256 KiB pool for atomic coherent allocations [ 0.040222] audit: initializing netlink subsys (disabled) [ 0.042648] thermal_sys: Registered thermal governor 'fair_share' [ 0.042680] thermal_sys: Registered thermal governor 'bang_bang' [ 0.042700] thermal_sys: Registered thermal governor 'step_wise' [ 0.042720] thermal_sys: Registered thermal governor 'user_space' [ 0.042806] cpuidle: using governor ladder [ 0.043063] Orion ID: MV88F5182-A2. TCLK=0. [ 0.048165] audit: type=2000 audit(0.040:1): state=initialized audit_enabled=0 res=1 [ 0.061529] No ATAGs? [ 0.167143] clocksource: Switched to clocksource orion_clocksource [ 0.177047] VFS: Disk quotas dquot_6.6.0 [ 0.177312] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes) [ 0.184511] AppArmor: AppArmor Filesystem Enabled [ 0.196396] NET: Registered PF_INET protocol family [ 0.197713] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear) [ 0.204507] tcp_listen_portaddr_hash hash table entries: 1024 (order: 0, 4096 bytes, linear) [ 0.205157] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear) [ 0.205247] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear) [ 0.205338] TCP bind hash table entries: 1024 (order: 1, 8192 bytes, linear) [ 0.205528] TCP: Hash tables configured (established 1024 bind 1024) [ 0.206293] MPTCP token hash table entries: 512 (order: 0, 6144 bytes, linear) [ 0.206680] UDP hash table entries: 256 (order: 0, 4096 bytes, linear) [ 0.206781] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear) [ 0.211832] NET: Registered PF_UNIX/PF_LOCAL protocol family [ 0.212106] PCI: CLS 0 bytes, default 32 [ 0.307634] Initialise system trusted keyrings [ 0.308103] Key type blacklist registered [ 0.312246] workingset: timestamp_bits=30 max_order=15 bucket_order=0 [ 0.339458] Key type asymmetric registered [ 0.339496] Asymmetric key parser 'x509' registered [ 0.345784] alg: self-tests for CTR-KDF (hmac(sha256)) passed [ 0.346683] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252) [ 0.351401] orion-pinctrl f1010000.pinctrl: registered pinctrl driver [ 0.356347] mv_xor f1060900.dma-controller: Marvell shared XOR driver [ 0.428549] mv_xor f1060900.dma-controller: Marvell XOR (Registers Mode): ( xor cpy intr ) [ 0.429984] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled [ 0.433953] printk: console [ttyS0] disabled [ 0.434236] f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 23, base_baud = 10416666) is a 16550A [ 0.981914] printk: console [ttyS0] enabled [ 0.988799] f1012100.serial: ttyS1 at MMIO 0xf1012100 (irq = 24, base_baud = 10416666) is a 16550A [ 1.002580] i2c_dev: i2c /dev entries driver [ 1.007752] mv64xxx_i2c mv64xxx_i2c.0: can't get pinctrl, bus recovery not supported [ 1.018582] ledtrig-cpu: registered to indicate activity on CPUs [ 1.029562] registered taskstats version 1 [ 1.033959] Loading compiled-in X.509 certificates [ 1.053038] Loaded X.509 cert 'Debian Secure Boot CA: 6ccece7e4c6c0d1f6149f3dd27dfcc5cbb419ea1' [ 1.062429] Loaded X.509 cert 'Debian Secure Boot Signer 2022 - linux: 14011249c2675ea8e5148542202005810584b25f' [ 1.079524] Key type encrypted registered [ 1.084596] AppArmor: AppArmor sha1 policy hashing enabled [ 1.102814] List of all partitions: [ 1.106424] No filesystem could mount root, tried: [ 1.106448] [ 1.112894] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) [ 1.121163] CPU: 0 PID: 1 Comm: swapper Not tainted 6.1.0-9-marvell #1 Debian 6.1.27-1 [ 1.129185] Hardware name: Marvell Orion5x (Flattened Device Tree) [ 1.135386] unwind_backtrace from show_stack+0x18/0x1c [ 1.140700] show_stack from dump_stack_lvl+0x28/0x30 [ 1.145823] dump_stack_lvl from panic+0xd8/0x30c [ 1.150619] panic from mount_block_root+0x16c/0x1f4 [ 1.155666] mount_block_root from prepare_namespace+0x148/0x184 [ 1.161721] prepare_namespace from kernel_init+0x18/0x114 [ 1.167266] kernel_init from ret_from_fork+0x14/0x2c [ 1.172379] Exception stack(0xc8809fb0 to 0xc8809ff8) [ 1.177472] 9fa0: 00000000 00000000 00000000 00000000 [ 1.185683] 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 1.193892] 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 [ 1.200553] Rebooting in 5 seconds.. ```

However, copying over uImage.buffalo.lsgl as uImage.buffalo.installer then booting this 5.10.136 kernel results in a successful boot with no apparent issues.

Marvell>> setenv kernel uImage.buffalo.installer
Marvell>> boot

[…trimmed more messages, see full excerpt below…]

[    5.817907] Run /init as init process
Loading, please wait...
Starting systemd-udevd version 252.6-1
Tap/click for serial console logs: Linux kernel v5.10.136 mounts root filesystem and boots fine ``` Marvell>> setenv kernel uImage.buffalo.installer Marvell>> boot […] Using device ide1, partition 1 ** Bad partition 1 ** <> ## Booting image at 00100000 ... Image Name: debian_installer Created: 2018-01-01 1:01:01 UTC Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 3169323 Bytes = 3 MB Load Address: 00008000 Entry Point: 00008000 Verifying Checksum ... OK OK ## Loading Ramdisk Image at 00800000 ... Image Name: ramdisk 6.1.0-9-marvell Created: 2023-06-14 9:39:21 UTC Image Type: ARM Linux RAMDisk Image (uncompressed) Data Size: 6146668 Bytes = 5.9 MB Load Address: 00000000 Entry Point: 00000000 Verifying Checksum ... OK Starting kernel ... arg:console=ttyS0,115200 root=/dev/sda2 rw panic=5 iomem=relaxed BOOTVER=1.10 [ 0.000000] Booting Linux on physical CPU 0x0 [ 0.000000] Linux version 5.10.136 (root@7d7f79d84c77) (arm-linux-gnueabi-gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #9 Tue Aug 16 07:48:27 UTC 2022 [ 0.000000] CPU: Feroceon [41069260] revision 0 (ARMv5TEJ), cr=a005317f [ 0.000000] CPU: VIVT data cache, VIVT instruction cache [ 0.000000] OF: fdt: Machine model: Buffalo Linkstation Pro/Live [ 0.000000] Memory policy: Data cache writeback [ 0.000000] Zone ranges: [ 0.000000] Normal [mem 0x0000000000000000-0x0000000007ffffff] [ 0.000000] HighMem empty [ 0.000000] Movable zone start for each node [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x0000000000000000-0x0000000007ffffff] [ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff] [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 32512 [ 0.000000] Kernel command line: console=ttyS0,115200 bootshim=1 [ 0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes, linear) [ 0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes, linear) [ 0.000000] mem auto-init: stack:off, heap alloc:on, heap free:off [ 0.000000] Memory: 114148K/131072K available (6159K kernel code, 968K rwdata, 1772K rodata, 340K init, 234K bss, 16924K reserved, 0K cma-reserved, 0K highmem) [ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 [ 0.000000] ftrace: allocating 27324 entries in 81 pages [ 0.000000] ftrace: allocated 81 pages with 3 groups [ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16 [ 0.000000] clocksource: orion_clocksource: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 11467562657 ns [ 0.000025] sched_clock: 32 bits at 166MHz, resolution 6ns, wraps every 12884901885ns [ 0.000112] Switching to timer-based delay loop, resolution 6ns [ 0.000452] Calibrating delay loop (skipped), value calculated using timer frequency.. 333.33 BogoMIPS (lpj=666666) [ 0.000518] pid_max: default: 32768 minimum: 301 [ 0.001899] LSM: Security Framework initializing [ 0.002486] Yama: disabled by default; enable with sysctl kernel.yama.* [ 0.003238] AppArmor: AppArmor initialized [ 0.003633] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) [ 0.003698] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) [ 0.007778] CPU: Testing write buffer coherency: ok [ 0.011766] Setting up static identity map for 0x8200 - 0x823c [ 0.015213] devtmpfs: initialized [ 0.024458] VFP support v0.3: not present [ 0.024943] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns [ 0.025017] futex hash table entries: 256 (order: -1, 3072 bytes, linear) [ 0.025580] pinctrl core: initialized pinctrl subsystem [ 0.030570] NET: Registered protocol family 16 [ 0.032504] DMA: preallocated 256 KiB pool for atomic coherent allocations [ 0.034873] audit: initializing netlink subsys (disabled) [ 0.037348] thermal_sys: Registered thermal governor 'fair_share' [ 0.037375] thermal_sys: Registered thermal governor 'bang_bang' [ 0.037420] thermal_sys: Registered thermal governor 'step_wise' [ 0.037459] thermal_sys: Registered thermal governor 'user_space' [ 0.037626] cpuidle: using governor ladder [ 0.037681] cpuidle: using governor menu [ 0.037853] Orion ID: MV88F5182-A2. TCLK=0. [ 0.040527] audit: type=2000 audit(0.032:1): state=initialized audit_enabled=0 res=1 [ 0.058312] No ATAGs? [ 0.098457] SCSI subsystem initialized [ 0.100373] usbcore: registered new interface driver usbfs [ 0.100585] usbcore: registered new interface driver hub [ 0.100754] usbcore: registered new device driver usb [ 0.105848] clocksource: Switched to clocksource orion_clocksource [ 0.336818] VFS: Disk quotas dquot_6.6.0 [ 0.337084] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes) [ 0.339937] AppArmor: AppArmor Filesystem Enabled [ 0.344798] NET: Registered protocol family 2 [ 0.345402] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear) [ 0.347786] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear) [ 0.348465] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear) [ 0.348554] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear) [ 0.348624] TCP: Hash tables configured (established 1024 bind 1024) [ 0.349010] UDP hash table entries: 256 (order: 0, 4096 bytes, linear) [ 0.349117] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear) [ 0.350210] NET: Registered protocol family 1 [ 0.350333] PCI: CLS 0 bytes, default 32 [ 0.351271] Trying to unpack rootfs image as initramfs... [ 4.129604] Freeing initrd memory: 6004K [ 4.133119] Initialise system trusted keyrings [ 4.133409] Key type blacklist registered [ 4.134409] workingset: timestamp_bits=30 max_order=15 bucket_order=0 [ 4.156012] zbud: loaded [ 4.162119] fuse: init (API version 7.32) [ 4.164511] Key type asymmetric registered [ 4.164563] Asymmetric key parser 'x509' registered [ 4.164711] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251) [ 4.169825] orion-pinctrl f1010000.pinctrl: registered pinctrl driver [ 4.174085] mv_xor f1060900.dma-controller: Marvell shared XOR driver [ 4.234354] mv_xor f1060900.dma-controller: Marvell XOR (Registers Mode): ( xor cpy intr ) [ 4.235702] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled [ 4.239287] printk: console [ttyS0] disabled [ 4.239557] f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 23, base_baud = 10416666) is a 16550A [ 4.752201] printk: console [ttyS0] enabled [ 4.758725] f1012100.serial: ttyS1 at MMIO 0xf1012100 (irq = 24, base_baud = 10416666) is a 16550A [ 4.803960] loop: module loaded [ 4.808398] sata_mv sata_mv.0: cannot get optional clkdev [ 4.814871] sata_mv sata_mv.0: slots 32 ports 2 [ 4.832938] scsi host0: sata_mv [ 4.838759] scsi host1: sata_mv [ 4.842903] ata1: SATA max UDMA/133 irq 28 [ 4.847097] ata2: SATA max UDMA/133 irq 28 [ 4.924658] mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4 [ 4.996347] mv643xx_eth_port mv643xx_eth_port.0 eth0: port 0 with MAC address 00:16:01:c5:63:5c [ 5.005355] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver [ 5.012017] ehci-pci: EHCI PCI platform driver [ 5.016680] ehci-orion: EHCI orion driver [ 5.021097] orion-ehci f1050000.ehci: EHCI Host Controller [ 5.026837] orion-ehci f1050000.ehci: new USB bus registered, assigned bus number 1 [ 5.035127] orion-ehci f1050000.ehci: irq 26, io mem 0xf1050000 [ 5.053948] orion-ehci f1050000.ehci: USB 2.0 started, EHCI 1.00 [ 5.061119] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.10 [ 5.069496] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 5.076776] usb usb1: Product: EHCI Host Controller [ 5.081722] usb usb1: Manufacturer: Linux 5.10.136 ehci_hcd [ 5.087356] usb usb1: SerialNumber: f1050000.ehci [ 5.094095] hub 1-0:1.0: USB hub found [ 5.098154] hub 1-0:1.0: 1 port detected [ 5.103893] orion-ehci f10a0000.ehci: EHCI Host Controller [ 5.109636] orion-ehci f10a0000.ehci: new USB bus registered, assigned bus number 2 [ 5.118074] orion-ehci f10a0000.ehci: irq 30, io mem 0xf10a0000 [ 5.137935] orion-ehci f10a0000.ehci: USB 2.0 started, EHCI 1.00 [ 5.145021] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.10 [ 5.153387] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 5.160671] usb usb2: Product: EHCI Host Controller [ 5.165617] usb usb2: Manufacturer: Linux 5.10.136 ehci_hcd [ 5.171252] usb usb2: SerialNumber: f10a0000.ehci [ 5.177905] hub 2-0:1.0: USB hub found [ 5.181963] hub 2-0:1.0: 1 port detected [ 5.187826] usbcore: registered new interface driver usb-storage [ 5.194463] i2c /dev entries driver [ 5.201794] rtc-rs5c372 0-0032: rs5c372a found, 24hr [ 5.212870] rtc rtc0: invalid alarm value: 2023-06-14T37:85:00 [ 5.219371] rtc-rs5c372 0-0032: registered as rtc0 [ 5.226292] rtc-rs5c372 0-0032: setting system clock to 2023-06-14T10:52:40 UTC (1686739960) [ 5.237336] ledtrig-cpu: registered to indicate activity on CPUs [ 5.251291] marvell-cesa mv_crypto: CESA device successfully registered [ 5.259868] physmap-flash f4000000.flash: physmap platform flash device: [mem 0xf4000000-0xf403ffff] [ 5.269148] Found: SST 39LF020 [ 5.272287] f4000000.flash: Found 1 x8 devices at 0x0 in 8-bit bank [ 5.327842] Support for command set 0002 not present [ 5.332896] gen_probe: No supported Vendor Command Set found [ 5.338623] physmap-flash f4000000.flash: map_probe failed [ 5.348148] NET: Registered protocol family 10 [ 5.353997] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300) [ 5.382467] ata1.00: ATA-8: SAMSUNG HD501LJ, CR100-10, max UDMA7 [ 5.388575] ata1.00: 976773168 sectors, multi 0: LBA48 NCQ (depth 31/32) [ 5.408775] ata1.00: configured for UDMA/133 [ 5.414264] scsi 0:0:0:0: Direct-Access ATA SAMSUNG HD501LJ 0-10 PQ: 0 ANSI: 5 [ 5.438700] scsi 0:0:0:0: Attached scsi generic sg0 type 0 [ 5.446525] sd 0:0:0:0: [sda] 976773168 512-byte logical blocks: (500 GB/466 GiB) [ 5.459538] sd 0:0:0:0: [sda] Write Protect is off [ 5.468718] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 5.531941] sda: sda1 sda2 sda3 < sda5 > [ 5.553031] sd 0:0:0:0: [sda] Attached SCSI disk [ 5.649183] Segment Routing with IPv6 [ 5.653604] NET: Registered protocol family 17 [ 5.659048] registered taskstats version 1 [ 5.663248] Loading compiled-in X.509 certificates [ 5.669546] AppArmor: AppArmor sha1 policy hashing enabled [ 5.782891] ata2: SATA link down (SStatus 0 SControl 300) [ 5.807066] Freeing unused kernel memory: 340K [ 5.811576] Kernel memory protection not selected by kernel config. [ 5.817907] Run /init as init process Loading, please wait... Starting systemd-udevd version 252.6-1 […] ```

For now, I can revert to Linux kernel v5.10.x to have a booting system, but this isn't sustainable long-term. Please let me know if there's anything further that would help!

1000001101000 commented 1 year ago

Good to hear from you!

It's been taking an increasing number of tweaks behind the scenes to keep these devices booting modern kernels using their original bootloaders.

The issue that you are encountering happens because the compressed kernel unpacks itself into the beginning of memory when it starts. Modern kernels are now getting large enough that this will overwrite the initrd when loaded into it's default address. The reason this stops happening when using my kernel image is because I wrote some assembly code that I append to the front of the kernel which moves the initrd farther down in memory before starting to the kernel to prevent this.

The easiest way to correct this might be to re-install using my bookworm installer images once I post them in the next day or two. Otherwise you could look at the install scripts in the repo and replicate the steps for enabling the "bootshim" on your system.

Another thing to watch out for with that model is a 7MB limit for the initrd (uboot crashes if you try to load a file bigger than that). I've worked around that in a couple of ways for devices using my installer process:

digitalcircuit commented 1 year ago

First, thank you for all the effort to keep these devices alive. The fact I've gotten around 14 years of service from this Linkstation Live v2 is great! Both from a budget sense, and reducing electronics waste.

I appreciate your detailed explanation and solution. In the future, I may reinstall using your upcoming bookworm installer images.

But, as I didn't want to wait nor deal with reinstalling, I've documented the steps I took in the off-hand chance it helps others who run into this issue…

  1. Boot into the installer kernel to get a working system
    • The easiest approach may be to pull the drive out of the Linkstation and copy uImage.buffalo.lsgl over top of uImage.buffalo in the boot partition
    • Alternatively, you can save this as uImage.buffalo.installer, then with a hardware serial console cable connected, interrupt the second u-Boot "Hit any key to stop autoboot" prompt (not the first one), then run setenv kernel uImage.buffalo.installer followed by boot
  2. Log in as your standard user
  3. Fetch and install the bootshim tools
    
    cd $(mktemp -d)
    # Download tools
    wget "https://github.com/1000001101000/Debian_on_Buffalo/raw/master/Tools/0-install_shim"
    wget "https://github.com/1000001101000/Debian_on_Buffalo/raw/master/Tools/bootshim/armel_shim"

Copy bootshim locally

sudo cp "armel_shim" "/boot/bootshim"

Ensure bootshim is installed with kernel updates

chmod 755 "0-install_shim" sudo cp "0-install_shim" "/etc/initramfs/post-update.d/"

Install bootshim into all kernels right now

sudo "/etc/initramfs/post-update.d/0-install_shim"

4.  Confirm that bootshim is installed
```sh
user@hostname:/tmp/tmp.a6h2T8YYQL$ sudo "/etc/initramfs/post-update.d/0-install_shim"
bootshim installed to /boot/vmlinuz
bootshim installed to /boot/vmlinuz-5.10.0-23-marvell
bootshim installed to /boot/vmlinuz-6.1.0-9-marvell
user@hostname:/tmp/tmp.a6h2T8YYQL$ 
  1. If you booted into the installer kernel by overwriting the file on disk (instead of temporarily modifying the u-Boot environment), reinstall the latest kernel to overwrite the installer kernel
    
    dpkg -l 'linux-image*-marvell*'

sudo apt install --reinstall [YOUR_LATEST_KERNEL_VERSION]


In my case, as I am not using the custom kernel, the last two entries are…

ii linux-image-6.1.0-9-marvell 6.1.27-1 armel Linux 6.1 for Marvell Kirkwood/Orion ii linux-image-marvell 6.1.27-1 armel Linux for Marvell Kirkwood/Orion (meta-package)

So my resulting command is…
```sh
user@hostname:/tmp/tmp.a6h2T8YYQL$ sudo apt install --reinstall linux-image-6.1.0-9-marvell

You should see something like this in your apt output…

[…]
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-6.1.0-9-marvell
bootshim installed to /boot/vmlinuz-6.1.0-9-marvell
Using DTB: orion5x-linkstation-lsgl.dtb
[…]
  1. If initrd winds up exceeding 7 MB (untested - my current initrd is 5.9 MB, so I am skipping this step for now), install the custom kernel
    sudo wget -O /etc/apt/custom_repo.gpg https://raw.githubusercontent.com/1000001101000/Debian_on_Buffalo/master/PPA/KEY.gpg
    sudo apt-key add /etc/apt/custom_repo.gpg
    source /etc/os-release
    echo "deb https://raw.githubusercontent.com/1000001101000/Debian_on_Buffalo/master/PPA/ $VERSION_CODENAME main" | sudo tee "/etc/apt/sources.list.d/buffalo_kernel.list"
    sudo apt-get update
    sudo apt-get -y install linux-image-marvell-buffalo
  2. Prepare your recovery method just in case (serial console, pulling the drive out, etc), then reboot
  3. Log in as your standard user and check kernel version
    uname -r

    In my case…

    user@hostname:~$ uname -r
    6.1.0-9-marvell
1000001101000 commented 1 year ago

Nice work!

1000001101000 commented 1 year ago

The Bookworm installer files are up now.

digitalcircuit commented 1 year ago

Thanks for the heads up! I see that the bootshim scripts are updated, so I'll update it on my Linkstation Live.

The one other issue I've run into so far after moving to bookworm without reinstalling is occasional brief single beeps, and this morning it started flashing error and beeping in two tones.

Though the fan seemed to be running, it felt warm. I'm guessing I also need to set up your micon_scripts's fan daemon for fan control, even though micro-evtd's config file claims it handles fan control. Alternatively, though it didn't seem too dusty, I might just need to clean out the internals.

(I will look into reinstalling at some point to clean up the cruft from the years and ensure I've got everything as it should be.)

I'm guessing this issue can be closed, unless you'd like to keep it open as a heads up to anyone else upgrading to bookworm.

1000001101000 commented 1 year ago

if you’re using my micro-evtd binary the features from the config won’t work. looking back I should have renamed my fork of micro-evtd to something else.

The original micro-evtd has a ton of features like fan control but is also aggressively specific to the LS-GL.

The only feature I was interested in was its ability to send arbitrary micon messages using a small binary that could fit in a 7mb installer. So I removed basically everything else, added support for missing message types (mainly LCD stuff) and setup the build process…. I’ve found it quite amusing using it on armel,armhf,amd64 and powerpc systems.

digitalcircuit commented 1 year ago

Ah, that's good to know. I'm still using the original micro-evtd binary as shipped with the installer for Debian 7, possibly Debian 6, so I will not try to update it from this repository without also applying all the other related changes you've included.

I'll keep monitoring the beeps, and if it keeps happening I'll look into other potential causes, and simply reinstalling with your installer images.

Thank you!

digitalcircuit commented 1 year ago

Context for legacy micro-evtd trouble

This is not an issue with your installer! This is a result of myself seeing how far I can get without doing a full reinstall.

Over the past month, the beeping has randomly continued, and systemctl restart micro-evtd works around it for an hour to a couple days.

It seems like the watchdog service part of the old (Debian 7-ish) micro-evtd is failing, so I've tried migrating to your simplified micon_scripts.

How to upgrade to micon_scripts

In case this helps anyone else upgrading a legacy Debian install who doesn't want to go through the whole install process, here are the steps I took…

# Check some requirements to try to ensure a similar system
if ! command -v "micro-evtd" >/dev/null 2>&1; then
    echo "You need to have the legacy Debian 'micro-evtd' command already installed to follow this migration guide." >&2
    sleep 5
    exit 1
fi
if ! command -v "microapl" >/dev/null 2>&1; then
    echo "You need to have the legacy Debian 'microapl' command already installed to follow this migration guide." >&2
    sleep 5
    exit 1
fi

# Prepare
cd "$(mktemp -d)"

# Install Python libraries
# (These were missing from my installation - you might be missing more!)
sudo apt install python3-serial

# Download micon-scripts
mkdir "micon_scripts"
cd "micon_scripts"
wget "https://raw.githubusercontent.com/1000001101000/Debian_on_Buffalo/master/Tools/micon_scripts/libmicon.py"
wget "https://raw.githubusercontent.com/1000001101000/Debian_on_Buffalo/master/Tools/micon_scripts/micon_boot.service"
wget "https://raw.githubusercontent.com/1000001101000/Debian_on_Buffalo/master/Tools/micon_scripts/micon_fan_daemon.py"
wget "https://raw.githubusercontent.com/1000001101000/Debian_on_Buffalo/master/Tools/micon_scripts/micon_fan_daemon.service"
wget "https://raw.githubusercontent.com/1000001101000/Debian_on_Buffalo/master/Tools/micon_scripts/micon_shutdown.py"
wget "https://raw.githubusercontent.com/1000001101000/Debian_on_Buffalo/master/Tools/micon_scripts/micon_startup.py"
wget "https://raw.githubusercontent.com/1000001101000/Debian_on_Buffalo/master/Tools/micon_scripts/serial_console.py"
cd ".."

# Move scripts into place
sudo cp -r "micon_scripts" "/usr/local/bin/"
sudo cp micon_scripts/*.service /etc/systemd/system/
sudo chmod 755 /usr/local/bin/micon_scripts/*.py

# Skip the shutdown service for now, keep using the legacy one
# sudo ln -s /usr/local/bin/micon_scripts/micon_shutdown.py /lib/systemd/system-shutdown/micon_shutdown.py

# Disable the legacy micro-evtd daemon
sudo systemctl disable micro-evtd.service

# Enable the new daemons
sudo systemctl enable micon_boot.service
sudo systemctl enable micon_fan_daemon.service

# Check that at least micon_boot works now
sudo systemctl start --wait micon_boot.service
sudo systemctl status micon_boot.service

# Reboot
sudo reboot

Results

Services are successfully enabled and the Linkstation power LED stops blinking on boot.

I am still testing this and will edit my comment with an update on the beeping/watchdog service.

EDIT 2023-7-20: The beeping has stopped! With this, my upgrade to bookworm without reinstalling is successful.

sudo systemctl status micon_boot.service micon_fan_daemon.service micro-evtd.service

# Trimmed results:
# ○ micon_boot.service - Tell Terastation it finished booting so it doesnt shutdown
#     Loaded: loaded (/etc/systemd/system/micon_boot.service; enabled; preset: enabled)
#     Active: inactive (dead) since Thu 2023-07-13 22:06:40 EDT; 3min 2s ago
#   Main PID: 316 (code=exited, status=0/SUCCESS)
#
# ● micon_fan_daemon.service - Terastation Fan Service
#     Loaded: loaded (/etc/systemd/system/micon_fan_daemon.service; enabled; preset: enabled)
#     Active: active (running) since Thu 2023-07-13 22:06:24 EDT; 3min 22s ago
#   Main PID: 317 (micon_fan_daemo)
#
# ○ micro-evtd.service - LSB: Daemon for Linkstation/Kuro micro controller
#     Loaded: loaded (/etc/init.d/micro-evtd; generated)
#     Active: inactive (dead)

References: