Open digitalcircuit opened 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:
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…
uImage.buffalo.lsgl
over top of uImage.buffalo
in the boot partitionuImage.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
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"
sudo cp "armel_shim" "/boot/bootshim"
chmod 755 "0-install_shim" sudo cp "0-install_shim" "/etc/initramfs/post-update.d/"
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$
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
[…]
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
uname -r
In my case…
user@hostname:~$ uname -r
6.1.0-9-marvell
Nice work!
The Bookworm installer files are up now.
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.
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.
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!
micro-evtd
troubleThis 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
.
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
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:
After following the Debian guide for upgrading to
bookworm
, I've gotten an unbootable Linkstation Live v2.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
asuImage.buffalo.installer
then booting this 5.10.136 kernel results in a successful boot with no apparent issues.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 ** <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!