release package script polish
This commit is contained in:
parent
14b68c70c4
commit
b49e963b5e
|
@ -1,11 +1,12 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
|
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
|
||||||
cd /usr || exit 1
|
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
|
cd /usr/src || exit 1
|
||||||
make world install || exit 1
|
make world install || exit 1
|
||||||
cd tools || exit 1
|
cd tools || exit 1
|
||||||
make hdboot
|
make hdboot || exit 1
|
||||||
|
cp ../boot/boot /boot/boot || exit 1
|
||||||
cd /usr || exit 1
|
cd /usr || exit 1
|
||||||
rm -rf /usr/src || exit 1
|
rm -rf /usr/src || exit 1
|
||||||
exit 0
|
exit 0
|
||||||
|
|
15
tools/mkboot
15
tools/mkboot
|
@ -22,9 +22,15 @@ esac
|
||||||
# The real root device may be the RAM disk.
|
# The real root device may be the RAM disk.
|
||||||
realroot=`printroot -r`
|
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
|
case $action in
|
||||||
bootable | hdboot)
|
bootable | hdboot)
|
||||||
# We need the root device.
|
# We need the root device.
|
||||||
|
|
||||||
if [ $realroot = $root ]
|
if [ $realroot = $root ]
|
||||||
then
|
then
|
||||||
rootdir=
|
rootdir=
|
||||||
|
@ -147,11 +153,14 @@ cdfdboot)
|
||||||
# Install /dev, /boot
|
# Install /dev, /boot
|
||||||
mount $dev /mnt || exit 1
|
mount $dev /mnt || exit 1
|
||||||
mkdir /mnt/dev
|
mkdir /mnt/dev
|
||||||
|
mkdir /mnt/boot
|
||||||
|
mkdir /mnt/boot/image
|
||||||
( cd /mnt/dev && /usr/src/commands/scripts/MAKEDEV.sh std )
|
( cd /mnt/dev && /usr/src/commands/scripts/MAKEDEV.sh std )
|
||||||
cp -p image /mnt/minix || exit 1
|
cp -p image /mnt/boot/image || exit 1
|
||||||
cp -p ../boot/boot /mnt/boot || exit 1
|
cp -p ../boot/boot /mnt/boot/boot || exit 1
|
||||||
umount $dev || 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
|
# copy image
|
||||||
dd if=$dev of=cdfdimage bs=8192 count=180
|
dd if=$dev of=cdfdimage bs=8192 count=180
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
COPYITEMS="usr/src usr/bin bin usr/lib"
|
COPYITEMS="usr/src usr/bin bin usr/lib"
|
||||||
RELEASEDIR=/usr/r/release
|
RELEASEDIR=/usr/r/release
|
||||||
IMAGE=cdfdimage
|
IMAGE=cdfdimage
|
||||||
|
ROOTIMAGE=rootimage
|
||||||
ISO=minix.iso
|
ISO=minix.iso
|
||||||
RAM=/dev/ram
|
RAM=/dev/ram
|
||||||
if [ `wc -c $RAM | awk '{ print $1 }'` -ne 1474560 ]
|
if [ `wc -c $RAM | awk '{ print $1 }'` -ne 1474560 ]
|
||||||
|
@ -17,22 +18,35 @@ echo -n "Device: /dev/"
|
||||||
read dev || exit 1
|
read dev || exit 1
|
||||||
TMPDISK=/dev/$dev
|
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 ]
|
if [ -b $TMPDISK ]
|
||||||
then :
|
then :
|
||||||
else echo "$TMPDISK is not a block device.."
|
else echo "$TMPDISK is not a block device.."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -b $TMPTMPDISK ]
|
||||||
|
then :
|
||||||
|
else echo "$TMPDISK is not a block device.."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
umount $TMPDISK
|
umount $TMPDISK
|
||||||
|
umount $TMPTMPDISK
|
||||||
umount $RAM
|
umount $RAM
|
||||||
|
|
||||||
( cd .. && make clean )
|
( cd .. && make clean )
|
||||||
rm -rf $RELEASEDIR $ISO $IMAGE
|
rm -rf $RELEASEDIR $ISO $IMAGE $ROOTIMAGE
|
||||||
mkdir -p $RELEASEDIR
|
mkdir -p $RELEASEDIR
|
||||||
mkfs -b 1440 -B 1024 $RAM || exit
|
mkfs -b 1440 -B 1024 $RAM || exit
|
||||||
echo " * mounting $RAM as $RELEASEDIR"
|
echo " * mounting $RAM as $RELEASEDIR"
|
||||||
mount $RAM $RELEASEDIR || exit
|
mount $RAM $RELEASEDIR || exit
|
||||||
mkdir $RELEASEDIR/usr
|
mkdir $RELEASEDIR/usr $RELEASEDIR/tmp
|
||||||
|
mount $TMPTMPDISK $RELEASEDIR/tmp || exit 1
|
||||||
|
|
||||||
mkfs -B 1024 $TMPDISK
|
mkfs -B 1024 $TMPDISK
|
||||||
echo " * mounting $TMPDISK as $RELEASEDIR/usr"
|
echo " * mounting $TMPDISK as $RELEASEDIR/usr"
|
||||||
|
@ -41,19 +55,21 @@ mkdir -p $RELEASEDIR/tmp
|
||||||
mkdir -p $RELEASEDIR/usr/tmp
|
mkdir -p $RELEASEDIR/usr/tmp
|
||||||
echo " * Transfering $COPYITEMS to $RELEASEDIR"
|
echo " * Transfering $COPYITEMS to $RELEASEDIR"
|
||||||
( cd / && tar cf - $COPYITEMS ) | ( cd $RELEASEDIR && tar xf - ) || exit 1
|
( cd / && tar cf - $COPYITEMS ) | ( cd $RELEASEDIR && tar xf - ) || exit 1
|
||||||
|
( cd $RELEASEDIR && find . -name CVS | xargs rm -rf )
|
||||||
echo " * Chroot build"
|
echo " * Chroot build"
|
||||||
chroot $RELEASEDIR '/bin/sh -x /usr/src/tools/chrootmake.sh' || exit 1
|
chroot $RELEASEDIR '/bin/sh -x /usr/src/tools/chrootmake.sh' || exit 1
|
||||||
echo " * Chroot build done"
|
echo " * Chroot build done"
|
||||||
umount $TMPDISK || exit
|
umount $TMPDISK || exit
|
||||||
|
umount $TMPTMPDISK || exit
|
||||||
umount $RAM || exit
|
umount $RAM || exit
|
||||||
cp $RAM rootimage
|
cp $RAM $ROOTIMAGE
|
||||||
make programs image
|
make programs image
|
||||||
(cd ../boot && make)
|
(cd ../boot && make)
|
||||||
make image || exit 1
|
make image || exit 1
|
||||||
./mkboot cdfdboot
|
./mkboot cdfdboot
|
||||||
writeisofs -l MINIX -b $IMAGE /tmp $ISO || exit 1
|
writeisofs -l MINIX -b $IMAGE /tmp $ISO || exit 1
|
||||||
echo "Appending Minix root filesystem"
|
echo "Appending Minix root filesystem"
|
||||||
cat >>$ISO rootimage || exit 1
|
cat >>$ISO $ROOTIMAGE || exit 1
|
||||||
echo "Appending Minix usr filesystem"
|
echo "Appending Minix usr filesystem"
|
||||||
cat >>$ISO $TMPDISK || exit 1
|
cat >>$ISO $TMPDISK || exit 1
|
||||||
ls -al $ISO
|
ls -al $ISO
|
||||||
|
|
Loading…
Reference in a new issue