When using your NSLU2 with an alternate firmware, you may encounter problems. I'm facing the problem, that my Slug won't boot anymore and I don't have a RS-232 converter at the moment to connect to my Slug via serial port.
One solution I came to is booting your slugs OS through qemu. I used a 4GB USB-Stick to store my Debian installation.
http://www.aurel32.net/info/debian_arm_qemu.php is a very good resource, I'm using the kernel and initrd images from this site.
This section is under construction.
Assuming your USB-Stick's device node is /dev/sda:
dd if=/dev/sda of=sda bs=512
Also make a backup, we will overwrite the current content of the USB-Stick later. You also could store the partition table, if you are planning to change your image without qemu.
/sbin/cfdisk -P t /dev/sda >partitiontable.txt
The output cat partitiontable.txt
Partitionstabelle von /dev/sda
---Anfangs---- -----End------ Anfangs- Anzahl der
# Flags Kopf Sekt Zyl. ID Kopf Sekt Zyl Sektor Sektoren
-- ----- ---- ---- ---- ---- ---- ---- ---- ----------- -----------
1 0x00 1 1 0 0x83 254 63 479 63 7711137
2 0x00 0 1 480 0x82 254 63 497 7711200 289170
3 0x00 0 0 0 0x00 0 0 0 0 0
4 0x00 0 0 0 0x00 0 0 0 0 0
We need to disable the LED activation scripts, otherwise the system won't boot completely.
qemu-system-arm -M versatilepb -m 256 -hda sda \ -kernel vmlinuz-2.6.18-5-versatile -initrd initrd.img-2.6.18-5-versatile \ -append "root=/dev/sda1 single"
a more elegant way is following way to run your configuration
qemu-system-arm -M versatilepb -m 256 -hda sda -nographic \ -kernel vmlinuz-2.6.18-5-versatile \ -initrd initrd.img-2.6.18-5-versatile \ -append "root=/dev/sda1 console=ttyAMA0 single"
This will use your terminal window for output, this should be more comfortable than a 80×25 wide display.
This will boot your actual DebianSlug installation in single user-mode.
After a while he finished the boot process and asks for your root password.
During boot you may noticed a message, that eth0 has been renamed to eth2. To bring up your network, just execute:
dhclient eth2
To copy all your changes back to the USB-Stick, you could do a
dd if=sda of=/dev/sda bs=512
Before running this command please ensure, that this device is your USB-Stick. Overwriting a wrong device damages your partition table and could result in data-loss!
During working with qemu and my Slug image I encountered following problems
Turn it on by running
leds disk-2 on
to turn it of again
leds disk-2 off
You can mount the image by using a loop-device. There is a little need of a calculation, so if you have dumped the partitiontable to partitiontable.txt, look up the Start-Sector of the partition you want to mount.
Partition one starts at sector 63 and the blocksize is 512 in this example. The offset will be at:
63 * 512 = 32256
Mounting the loop device:
losetup /dev/loop/0 -o 32256 sda mount /dev/loop/0 /mnt/misc/
Umounting the loop device:
umount /mnt/misc/ losetup -d /dev/loop/0
set your time be using date or run a ntp client. I have ntpd installed, so executing
ntpd -s
should fix your time.
And before someone tries to blame me for any damage or data-loss. I don't take any responsibility for any mistakes you make.
Discussion