I've got altboot running OK, and here's how I went about creating my own "XXX-rootfs.bin" file.
# On my Zaurus 5500 (collie)
# 1. Did a fresh install of OZ 3.5.3 (zImage and initrd.bin) using 64-0 kernel and opie rootfs.
# (used regular install instructions for OZ 3.5.3)
# 2. Followed instructions to upgrade kernel to r21
# (see
http://openzaurus.org/wordpress/2005/07/27...nel-on-collie/)# 3. Inserted SD card (formatted as VFAT, could also be formatted as ext2)
# 4. created the boot-images directory
mkdir -p /media/card/boot-images
# 5. Copied altboot ipkg from hentges.net into the Zaurus and installed it
# (I've got a collie, make sure you use the one for your machine)
wget
http://hentges.net/tmp/altboot/altboot_200...8-r1_collie.ipkipkg install altboot_20050618-r1_collie.ipk
# At this point, I have a plain OZ 3.5.3 install, with altboot. I now tried to create
# a rootfs.bin file on my SD card.
# 6. created file about 250MB (you can make it much smaller, every 100000
# works out to about 50MB).
dd if=/dev/zero of=/media/card/boot-images/001-rootfs.bin count=500000
# 7. make ext2 filesystem in that file
mkfs.ext2 /media/card/boot-images/001-rootfs.bin
# 8. mount the file (if /mnt/temp if it doesn't exist, run "mkdir -p /mnt/temp")
losetup /dev/loop1 /media/card/boot-images/001-rootfs.bin
mount /dev/loop1 /mnt/temp
cd /mnt/temp
# 9. copy the current root into my loop mounted filesystem
export dirname="bin boot dev etc home lib opt proc sbin sys usr var"
for dn in $(echo $dirname);do tar cf - /$dn | tar xvf - -C /mnt/temp;done
# 10. create other directories and links
mkdir -p media/card
mkdir -p media/card1
mkdir -p media/card2
mkdir -p media/card3
mkdir -p media/cf
mkdir -p media/hdd
mkdir -p media/image
mkdir -p media/net
mkdir -p media/ram
mkdir -p media/realroot
mkdir -p media/union
mkdir -p mnt/temp
ln -s /var/tmp tmp
cd /mnt/temp/mnt
ln -s /media/card card
ln -s /media/cf cf
ln -s /media/net net
ln -s /media/ram ram
# 11. I also went into /var and removed some temporary files (i.e. "*.pid" files in /var/run, files in /var/lock/subsys).
# 12. unmount and disconnect the the copied root filesystem
cd
umount /mnt/temp
losetup -d /dev/loop1
# Now I was ready to reboot and try to use the new filesystem on the SD card.
At the altboot message I hit a key to launch altboot
I then chose option 4, boot from SD and got these messages:
mount: /proc/mounts: No such file or directory
Mounting rootfs rw...ok
Generating device files...ok
Loading SD kernel module...ok
Mounting /media/card...ok
Note: No INIT [/sbin/init.sysvinit] found on target
At this point, since I had "001-rootfs.bin" and "002-rootfs.bin" (which was the one CoreDump supplied), I chose my new one. Success!
Does anyone have a better way to do this? I'm interested in making more, but I'd like to hear about more efficient ways to make the "xxx-rootfs.bin" files.
Thanks,
Mark
P.S. There is one thing I've noticed, I always seem to do a fsck during a reboot after running from the SD image file. This seems wrong. I've tried using several different ways to shutdown the system, such as:
1. Shutdown (from utility tab)
2. Shutting down Opie, logging into a vt term as root, issuing "shutdown -r now"
What could be causing the unclean mount of the SD image, and any ideas on how can I try to troubleshoot it?
Thanks