leftdiodes.co.uk

if-pre-oops.d

22 Dec 2021

Upgrading a Linkstation 220D from Buster to Bullseye

My current home network storage solution is a Buffalo LinkStation 220D running Debian (installed using the tools and instructions from the Debian_on_Buffalo repository). I recently upgraded it from Buster to Bullseye using the instructions in the release notes and discovered (the hard way!) that a broken networking script will stop the ethernet interface being brought up when rebooting after the upgrade. This left the device offline without no way to log back in and repair it.

Specifically, the /etc/network/if-pre-up.d/ifup_mac_custom script fails because the fw_printenv tool has moved from u-boot-tools in Buster to liubootenv-tool in Bullseye.

N.B. On my machine, the new tool just doesn’t work. Further investigation is on the TODO list.

How to fix it

Option 1

After upgrading (but before rebooting!), edit /etc/network/if-pre-up.d/ifup_mac_custom and comment out the contents. Add the following at the end of the file:

ip link set dev eth0 address "18:c2:bf:xx:yy:zz"

replacing the MAC address with the appropriate value for your device.

You might also be able to delete the ifup_mac_custom file and add the command directly to /etc/network/interfaces, but that isn’t something I’ve tried.

Option 2

If you only find out after the reboot that something has gone wrong, then you need an alternative way to access your device. One option is to use the recovery / emergency mode firmware on the device to boot into the Debian installer using TFTP.

  1. Set up a TFTP server on a machine that can be connected to the Linkstation
  2. Download the relevant kernel and initrd files from Debian_on_Buffalo
  3. Place these in the right folder for your TFTP server (On my Fedora machine, this was /var/lib/tftp) and rename them to uImage.buffalo and initrd.buffalo.
  4. Make sure your TFTP server has the IP address 192.168.11.1
  5. With the Linkstation powered off, remove the hard drives
  6. Turn the Linkstation on. Wait for the flashing red light, then push the button on the front panel to trigger the TFTP boot process
  7. Use the details here to connect to the installer
  8. Once the installer has loaded, reconnect the drives
  9. Follow the installer as far as the disk partitioning screen (so that all the hardware detection etc. is complete), then drop to a shell (“Go Back” and select the relevant option)
  10. Mount your root partition and edit the offending file, as above.

Aside from this minor bump, my LS220D is quite happily running Bullseye without any other faffing about required.

Resources used

The recovery process used was put together using information from the following pages, as well as those already linked above: