From b49e963b5e3de5d9bd84e0a92f3ba0bcd2599103 Mon Sep 17 00:00:00 2001 From: Ben Gras Date: Tue, 3 May 2005 08:54:36 +0000 Subject: [PATCH] release package script polish --- tools/chrootmake.sh | 5 +++-- tools/mkboot | 15 ++++++++++++--- tools/release.sh | 24 ++++++++++++++++++++---- 3 files changed, 35 insertions(+), 9 deletions(-) diff --git a/tools/chrootmake.sh b/tools/chrootmake.sh index ae4c4c303..fbbd5c005 100755 --- a/tools/chrootmake.sh +++ b/tools/chrootmake.sh @@ -1,11 +1,12 @@ #!/bin/sh export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin cd /usr || exit 1 -tar cf src.tar src || exit 1 +tar cf - src | compress >src.tar.z || exit 1 cd /usr/src || exit 1 make world install || exit 1 cd tools || exit 1 -make hdboot +make hdboot || exit 1 +cp ../boot/boot /boot/boot || exit 1 cd /usr || exit 1 rm -rf /usr/src || exit 1 exit 0 diff --git a/tools/mkboot b/tools/mkboot index 09a96e249..37a094cff 100755 --- a/tools/mkboot +++ b/tools/mkboot @@ -22,9 +22,15 @@ esac # The real root device may be the RAM disk. realroot=`printroot -r` +# If it's an initial fstab, pretend root is real root +if [ $root = "/dev/ROOT" ] +then root=$realroot +fi + case $action in bootable | hdboot) # We need the root device. + if [ $realroot = $root ] then rootdir= @@ -147,11 +153,14 @@ cdfdboot) # Install /dev, /boot mount $dev /mnt || exit 1 mkdir /mnt/dev + mkdir /mnt/boot + mkdir /mnt/boot/image ( cd /mnt/dev && /usr/src/commands/scripts/MAKEDEV.sh std ) - cp -p image /mnt/minix || exit 1 - cp -p ../boot/boot /mnt/boot || exit 1 + cp -p image /mnt/boot/image || exit 1 + cp -p ../boot/boot /mnt/boot/boot || exit 1 umount $dev || exit 1 - installboot -d $dev ../boot/bootblock boot || 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 }; bootcd=1; main(){delay 10000;boot}; save' || exit # copy image dd if=$dev of=cdfdimage bs=8192 count=180 diff --git a/tools/release.sh b/tools/release.sh index cfc2ebb20..6000e3936 100755 --- a/tools/release.sh +++ b/tools/release.sh @@ -3,6 +3,7 @@ COPYITEMS="usr/src usr/bin bin usr/lib" RELEASEDIR=/usr/r/release IMAGE=cdfdimage +ROOTIMAGE=rootimage ISO=minix.iso RAM=/dev/ram if [ `wc -c $RAM | awk '{ print $1 }'` -ne 1474560 ] @@ -17,22 +18,35 @@ echo -n "Device: /dev/" read dev || exit 1 TMPDISK=/dev/$dev +echo "Temporary (sub)partition to use for storage in /tmp?" +echo -n "Device: /dev/" +read tmpdev || exit 1 +TMPTMPDISK=/dev/$tmpdev + if [ -b $TMPDISK ] then : else echo "$TMPDISK is not a block device.." exit 1 fi +if [ -b $TMPTMPDISK ] +then : +else echo "$TMPDISK is not a block device.." + exit 1 +fi + umount $TMPDISK +umount $TMPTMPDISK umount $RAM ( cd .. && make clean ) -rm -rf $RELEASEDIR $ISO $IMAGE +rm -rf $RELEASEDIR $ISO $IMAGE $ROOTIMAGE mkdir -p $RELEASEDIR mkfs -b 1440 -B 1024 $RAM || exit echo " * mounting $RAM as $RELEASEDIR" mount $RAM $RELEASEDIR || exit -mkdir $RELEASEDIR/usr +mkdir $RELEASEDIR/usr $RELEASEDIR/tmp +mount $TMPTMPDISK $RELEASEDIR/tmp || exit 1 mkfs -B 1024 $TMPDISK echo " * mounting $TMPDISK as $RELEASEDIR/usr" @@ -41,19 +55,21 @@ mkdir -p $RELEASEDIR/tmp mkdir -p $RELEASEDIR/usr/tmp echo " * Transfering $COPYITEMS to $RELEASEDIR" ( cd / && tar cf - $COPYITEMS ) | ( cd $RELEASEDIR && tar xf - ) || exit 1 +( cd $RELEASEDIR && find . -name CVS | xargs rm -rf ) echo " * Chroot build" chroot $RELEASEDIR '/bin/sh -x /usr/src/tools/chrootmake.sh' || exit 1 echo " * Chroot build done" umount $TMPDISK || exit +umount $TMPTMPDISK || exit umount $RAM || exit -cp $RAM rootimage +cp $RAM $ROOTIMAGE make programs image (cd ../boot && make) make image || exit 1 ./mkboot cdfdboot writeisofs -l MINIX -b $IMAGE /tmp $ISO || exit 1 echo "Appending Minix root filesystem" -cat >>$ISO rootimage || exit 1 +cat >>$ISO $ROOTIMAGE || exit 1 echo "Appending Minix usr filesystem" cat >>$ISO $TMPDISK || exit 1 ls -al $ISO -- 2.44.0