From: deraadt Date: Mon, 14 Apr 1997 10:57:09 +0000 (+0000) Subject: create ramdisk bootable floppies by typing "make" X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=4aedf5750f7ddf5d388b405e0f6c53b4441cc525;p=openbsd create ramdisk bootable floppies by typing "make" --- diff --git a/distrib/i386/floppies/ramdisk/Makefile b/distrib/i386/floppies/ramdisk/Makefile index 053c46cda79..fe5c1f29bc2 100644 --- a/distrib/i386/floppies/ramdisk/Makefile +++ b/distrib/i386/floppies/ramdisk/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.1 1997/04/13 17:17:52 mickey Exp $ +# $OpenBSD: Makefile,v 1.2 1997/04/14 10:57:09 deraadt Exp $ # $NetBSD: Makefile,v 1.1 1995/07/18 04:13:06 briggs Exp $ TOP= ${.CURDIR}/.. @@ -8,24 +8,72 @@ IMAGE= miniroot-${REV}.fs CRUNCHCONF?= ${.CURDIR}/${CBIN}.conf BASE=miniroot -MOUNT_POINT= /mnt1 +MOUNT_POINT= /mnt BDEV= /dev/rd0a CDEV= /dev/rrd0a RDEV= /dev/rd0c -KERNEL= /sys/arch/i386/compile/RAMDISK/bsd - -all: ${CBIN} ${IMAGE} - @echo "all done" +VND?= vnd0 +VND_DEV= /dev/${VND}a +VND_RDEV= /dev/r${VND}a +VND_CRDEV= /dev/r${VND}c +PID!= echo $$$$ +REALIMAGE!= echo /tmp/image.${PID} +LISTFLOPPY= ${.CURDIR}/list_floppy .include "Makefile.inc" +all: floppy + +floppy: bsd.gz +.ifndef FLOPPY3 + dd if=/dev/zero of=${REALIMAGE} bs=10k count=120 + vnconfig -v -c ${VND} ${REALIMAGE} + disklabel -w -r ${VND} floppy5 + newfs -m 0 -o space -i 8192 -c 80 ${VND_RDEV} floppy5 +.else + dd if=/dev/zero of=${REALIMAGE} bs=10k count=144 + vnconfig -v -c ${VND} ${REALIMAGE} + disklabel -w -r ${VND} floppy3 + newfs -m 0 -o space -i 6500 -c 80 ${VND_RDEV} floppy3 +.endif + mount ${VND_DEV} ${MOUNT_POINT} + TOPDIR=${TOP} CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} \ + TARGDIR=${MOUNT_POINT} sh ${TOP}/runlist.sh ${LISTFLOPPY} + sync + cat /*bin/* > /dev/null + sync + /usr/mdec/installboot -v /mnt/boot ${DESTDIR}/usr/mdec/biosboot ${VND_CRDEV} + @echo "" + @df -i ${MOUNT_POINT} + @echo "" + sync + cat /*bin/* > /dev/null + sync + umount ${MOUNT_POINT} + vnconfig -u ${VND} + cp ${REALIMAGE} ${IMAGE} + rm ${REALIMAGE} + DISKTYPE= rdroot NBLKS= 4046 # old format, minfree, opt, b/i trks, sects, cpg NEWFSARGS= -t ffs -m 0 -o space -c 16 -i 4096 -${IMAGE}: do_prep do_mount do_files do_umount_copy do_unconfig +bsd.gz: bsd.rd + gzip -c9 bsd.rd > bsd.gz + +bsd.rd: ${IMAGE} bsd rdsetroot + cp bsd bsd.rd + ${.CURDIR}/${__objdir}/rdsetroot bsd.rd < ${IMAGE} + +bsd: + cd ${.CURDIR}/../../../../sys/arch/i386/conf && config RAMDISK + cd ${.CURDIR}/../../../../sys/arch/i386/compile/RAMDISK && \ + make clean && make depend && make + cp ${.CURDIR}/../../../../sys/arch/i386/compile/RAMDISK/bsd bsd + +${IMAGE}: do_prep do_mount do_files do_umount_copy do_unconfig ${CBIN} mv -f ${IMAGE}.tmp ${IMAGE} -if [ -e ${.CURDIR}/${__objdir}/rd.pid ] ; then \ kill `cat ${.CURDIR}/${__objdir}/rd.pid`; \ @@ -35,12 +83,6 @@ ${IMAGE}: do_prep do_mount do_files do_umount_copy do_unconfig rdsetroot: ${TOP}/common/rdsetroot.c ${HOSTCC} -DDEBUG -o rdsetroot ${TOP}/common/rdsetroot.c -setroot: ${IMAGE} bsd - ${.CURDIR}/${__objdir}/rdsetroot bsd < ${IMAGE} - -bsd: ${KERNEL} - cp ${KERNEL} bsd - writetape: echo rewinding tape < /dev/rst0 buffer -i /usr/mdec/stboot -o /dev/nrst0 @@ -71,6 +113,10 @@ do_unconfig: rm ${.CURDIR}/${__objdir}/rd.pid; \ fi +unconfig: + -umount -f ${MOUNT_POINT} + -vnconfig -u ${VND} + -/bin/rm -f ${IMAGE} .PRECIOUS: ${IMAGE} diff --git a/distrib/i386/floppies/ramdisk/Makefile.inc b/distrib/i386/floppies/ramdisk/Makefile.inc index 39090ce2cdc..343fb26b7dd 100644 --- a/distrib/i386/floppies/ramdisk/Makefile.inc +++ b/distrib/i386/floppies/ramdisk/Makefile.inc @@ -1,11 +1,11 @@ # -# $OpenBSD: Makefile.inc,v 1.1 1997/04/13 17:17:52 mickey Exp $ +# $OpenBSD: Makefile.inc,v 1.2 1997/04/14 10:57:11 deraadt Exp $ # $NetBSD: Makefile.inc,v 1.1 1995/07/18 04:13:14 briggs Exp $ # # TOP is assumed to be defined by Makefile including this one. -CBIN?= raminst +CBIN?= instbin COMMONDIR= ${TOP}/ramdisk MOUNT_POINT?= ${TOP}/${BASE}/fs diff --git a/distrib/i386/floppies/ramdisk/instbin.conf b/distrib/i386/floppies/ramdisk/instbin.conf new file mode 100644 index 00000000000..f6aa305cb45 --- /dev/null +++ b/distrib/i386/floppies/ramdisk/instbin.conf @@ -0,0 +1,25 @@ +# $OpenBSD: instbin.conf,v 1.1 1997/04/14 10:57:12 deraadt Exp $ +# +# instbin.conf - unified binary for the inst/upgr floppies +# + +srcdirs bin sbin usr.bin/less usr.bin usr.sbin gnu/usr.bin + +progs bad144 cat chmod chown chroot cp dd df disklabel ed expr fsck_ffs +progs ftp fdisk +progs ifconfig init less ln ls mkdir mknod mount mount_cd9660 +progs mount_ffs mount_msdos mount_nfs mount_kernfs +progs mv newfs pax pdksh ping pwd reboot rm route +progs sed shutdown slattach strings stty sync test tip umount +progs rsh restore gzip + +ln chown chgrp +ln fsck_ffs fsck +ln less more +ln pax tar +ln pdksh sh +ln pdksh -sh # init invokes the shell this way +ln test [ +ln reboot halt + +libs -ledit -lutil -ltermcap -lkrb -ldes -ll -lm diff --git a/distrib/i386/floppies/ramdisk/list_floppy b/distrib/i386/floppies/ramdisk/list_floppy new file mode 100644 index 00000000000..886721e84a0 --- /dev/null +++ b/distrib/i386/floppies/ramdisk/list_floppy @@ -0,0 +1,5 @@ +# $OpenBSD: list_floppy,v 1.1 1997/04/14 10:57:14 deraadt Exp $ + +COPY ${DESTDIR}/usr/mdec/boot boot +COPY ${OBJDIR}/bsd.gz bsd.gz + diff --git a/distrib/i386/floppies/ramdisk/raminst.conf b/distrib/i386/floppies/ramdisk/raminst.conf deleted file mode 100644 index bae23665c81..00000000000 --- a/distrib/i386/floppies/ramdisk/raminst.conf +++ /dev/null @@ -1,25 +0,0 @@ -# $OpenBSD: raminst.conf,v 1.1 1997/04/13 17:17:55 mickey Exp $ -# -# instbin.conf - unified binary for the inst/upgr floppies -# - -srcdirs bin sbin usr.bin/less usr.bin usr.sbin gnu/usr.bin - -progs bad144 cat chmod chown chroot cp dd df disklabel ed expr fsck_ffs -progs ftp fdisk -progs ifconfig init less ln ls mkdir mknod mount mount_cd9660 -progs mount_ffs mount_msdos mount_nfs mount_kernfs -progs mv newfs pax pdksh ping pwd reboot rm route -progs sed shutdown slattach strings stty sync test tip umount -progs rsh restore gzip - -ln chown chgrp -ln fsck_ffs fsck -ln less more -ln pax tar -ln pdksh sh -ln pdksh -sh # init invokes the shell this way -ln test [ -ln reboot halt - -libs -ledit -lutil -ltermcap -lkrb -ldes -ll -lm