minix/tools/release.sh

76 lines
1.9 KiB
Bash
Raw Normal View History

2005-04-21 16:53:53 +02:00
#!/bin/sh
COPYITEMS="usr/src usr/bin bin usr/lib"
RELEASEDIR=/usr/r/release
IMAGE=cdfdimage
2005-05-03 10:54:36 +02:00
ROOTIMAGE=rootimage
2005-04-21 16:53:53 +02:00
ISO=minix.iso
RAM=/dev/ram
if [ `wc -c $RAM | awk '{ print $1 }'` -ne 1474560 ]
then echo "$RAM should be exactly 1440k."
exit 1
fi
echo "Warning: I'm going to mkfs $RAM!"
echo "Temporary (sub)partition to use to make the /usr FS image? "
echo "It has to be at least 40MB, not much more because it's going to be "
echo "appended to the .iso. It will be mkfsed!"
echo -n "Device: /dev/"
read dev || exit 1
TMPDISK=/dev/$dev
2005-05-03 10:54:36 +02:00
echo "Temporary (sub)partition to use for storage in /tmp?"
echo -n "Device: /dev/"
read tmpdev || exit 1
TMPTMPDISK=/dev/$tmpdev
2005-04-21 16:53:53 +02:00
if [ -b $TMPDISK ]
then :
else echo "$TMPDISK is not a block device.."
exit 1
fi
2005-05-03 10:54:36 +02:00
if [ -b $TMPTMPDISK ]
then :
else echo "$TMPDISK is not a block device.."
exit 1
fi
2005-04-21 16:53:53 +02:00
umount $TMPDISK
2005-05-03 10:54:36 +02:00
umount $TMPTMPDISK
2005-04-21 16:53:53 +02:00
umount $RAM
( cd .. && make clean )
2005-05-03 10:54:36 +02:00
rm -rf $RELEASEDIR $ISO $IMAGE $ROOTIMAGE
2005-04-21 16:53:53 +02:00
mkdir -p $RELEASEDIR
mkfs -b 1440 -B 1024 $RAM || exit
echo " * mounting $RAM as $RELEASEDIR"
mount $RAM $RELEASEDIR || exit
2005-05-03 10:54:36 +02:00
mkdir $RELEASEDIR/usr $RELEASEDIR/tmp
mount $TMPTMPDISK $RELEASEDIR/tmp || exit 1
2005-04-21 16:53:53 +02:00
mkfs -B 1024 $TMPDISK
echo " * mounting $TMPDISK as $RELEASEDIR/usr"
mount $TMPDISK $RELEASEDIR/usr || exit
mkdir -p $RELEASEDIR/tmp
mkdir -p $RELEASEDIR/usr/tmp
echo " * Transfering $COPYITEMS to $RELEASEDIR"
( cd / && tar cf - $COPYITEMS ) | ( cd $RELEASEDIR && tar xf - ) || exit 1
2005-05-03 10:54:36 +02:00
( cd $RELEASEDIR && find . -name CVS | xargs rm -rf )
2005-04-21 16:53:53 +02:00
echo " * Chroot build"
chroot $RELEASEDIR '/bin/sh -x /usr/src/tools/chrootmake.sh' || exit 1
echo " * Chroot build done"
umount $TMPDISK || exit
2005-05-03 10:54:36 +02:00
umount $TMPTMPDISK || exit
2005-04-21 16:53:53 +02:00
umount $RAM || exit
2005-05-03 10:54:36 +02:00
cp $RAM $ROOTIMAGE
2005-04-21 16:53:53 +02:00
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"
2005-05-03 10:54:36 +02:00
cat >>$ISO $ROOTIMAGE || exit 1
2005-04-21 16:53:53 +02:00
echo "Appending Minix usr filesystem"
cat >>$ISO $TMPDISK || exit 1
ls -al $ISO