set -- `ls -t $rootdir/boot/image`
case $# in
- 0|1)
+ 0|1|2|3)
# Not much there, do not remove a thing.
;;
*)
- # Remove the newest image in /boot/image. This seems strange,
- # but the old image is normally the "stable" image.
-
- echo "rm $root:/boot/image/$1"
- rm -f "$rootdir/boot/image/$1"
+ # Remove the third-newest image in /boot/image, but
+ # only if there's an older one (which is kept).
+ echo "rm $root:/boot/image/$3"
+ rm -f "$rootdir/boot/image/$3"
esac
# Install the new image.
cp -p ../boot/boot /mnt/boot/boot || exit 1
umount $dev || exit 1
installboot -d $dev ../boot/bootblock boot/boot || exit 1
- edparams $dev 'unset bootopts; unset servers; unset image; ramimagedev=c0d2p1; unset rootdev; unset leader; leader() { echo If the system cannot find root, please hit ESC and set your\nramimagedev to the CD device, partition 1. e.g.\nramimagedev=c0d2p1 .. then boot to start.\n\nOtherwise I will boot with my defaults in 10 seconds.\n\n }; bootcd=1; main(){delay 10000;boot}; save' || exit
-# edparams $dev 'unset bootopts; unset servers; unset image; ramimagedev=c0d2p1; unset rootdev; unset leader; bootcd=1; main(){delay 10000;boot}; save' || exit
+ edparams $dev 'unset bootopts; unset servers; unset image; cdproberoot=1; unset rootdev; unset leader; leader() { echo \n--- Welcome to MINIX3 ---\n\nPress ESC if you need to do any special configuration\nOtherwise I will boot with my defaults in 10 seconds\n\n }; bootcd=1; main(){delay 10000;boot}; save' || exit
# copy image
dd if=$dev of=cdfdimage bs=8192 count=180