NSLU2 Diagnostics with qemuAbout
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. Kernel resourcehttp://www.aurel32.net/info/debian_arm_qemu.php is a very good resource, I'm using the kernel and initrd images from this site. How-To
This section is under construction. Make a copy of the USB-StickAssuming 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
Booting your NSLU2 using single user modeWe 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. Starting the network deviceDuring boot you may noticed a message, that eth0 has been renamed to eth2. To bring up your network, just execute: dhclient eth2 Writing back to USBTo 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! Trouble ShootingDuring working with qemu and my Slug image I encountered following problems Activity LED for disk 2 doesn't turn onTurn it on by running leds disk-2 on to turn it of again leds disk-2 off Is it possible to mount the generated image?
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. 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 Could not load /lib/modules/2.6.18-5-versatile/modules.dep
timestamp YYYY-MM-DD hh:mm:ss is <large_number> in the futureset your time be using date or run a ntp client. I have ntpd installed, so executing ntpd -s should fix your time. DisclaimerAnd before someone tries to blame me for any damage or data-loss. I don't take any responsibility for any mistakes you make. |
Discussion