diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 1996-05-31 23:00:31 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 1996-05-31 23:00:31 +0000 |
commit | 96f491ddbf9ed281369c3b3a2a4cb752f9e41158 (patch) | |
tree | 785a345dd6147f9a4eb488e0fba774b2628ed913 | |
parent | aea51fcdcf083253f5854d16da65aa2e85d14e32 (diff) |
Fix last commit (kc was w/ kc-common CVS/*)
-rw-r--r-- | distrib/i386/floppies/kc/Makefile | 60 | ||||
-rw-r--r-- | distrib/i386/floppies/kc/copy_kernel.sh | 113 | ||||
-rw-r--r-- | distrib/i386/floppies/kc/dot.profile | 13 | ||||
-rw-r--r-- | distrib/i386/floppies/kc/kcbin.conf | 15 | ||||
-rw-r--r-- | distrib/i386/floppies/kc/list | 34 | ||||
-rw-r--r-- | distrib/i386/floppies/kc/mtree.conf | 36 |
6 files changed, 271 insertions, 0 deletions
diff --git a/distrib/i386/floppies/kc/Makefile b/distrib/i386/floppies/kc/Makefile new file mode 100644 index 00000000000..c1e02d9d89b --- /dev/null +++ b/distrib/i386/floppies/kc/Makefile @@ -0,0 +1,60 @@ +# $Id: Makefile,v 1.3 1996/05/31 23:00:23 mickey Exp $ + +TOP= ${.CURDIR}/.. + +.include "${TOP}/Makefile.inc" +IMAGE= kc${REV}.fs +CBIN= kcbin +MOUNT_POINT?= /mnt +VND?= vnd0 +VND_DEV= /dev/${VND}a +VND_RDEV= /dev/r${VND}a +IMAGE?= xxx-${REV}.fs +MDEC= ${DESTDIR}/usr/mdec + +LIST= ${.CURDIR}/list +CRUNCHCONF= ${.CURDIR}/${CBIN}.conf +MTREE= ${.CURDIR}/mtree.conf + +all: ${CBIN} +.ifndef FLOPPY3 +.else +.endif +.ifndef FLOPPY3 + dd if=/dev/zero of=${IMAGE} bs=10k count=120 + vnconfig -v -c ${VND_DEV} ${IMAGE} + disklabel -w -B -b /usr/mdec/fdboot -s /usr/mdec/bootfd ${VND} floppy5 + newfs -O -m 0 -o space -i 8192 -c 80 ${VND_RDEV} floppy5 +.else + dd if=/dev/zero of=${IMAGE} bs=10k count=144 + vnconfig -v -c ${VND_DEV} ${IMAGE} + disklabel -w -B -b /usr/mdec/fdboot -s /usr/mdec/bootfd ${VND} floppy3 + newfs -O -m 0 -o space -i 8192 -c 80 ${VND_RDEV} floppy3 +.endif + mount ${VND_DEV} ${MOUNT_POINT} + mtree -def ${MTREE} -p ${MOUNT_POINT}/ -u + TOPDIR=${TOP} CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} \ + TARGDIR=${MOUNT_POINT} sh ${TOP}/runlist.sh ${LIST} + @echo "" + @df -i ${MOUNT_POINT} + @echo "" + umount ${MOUNT_POINT} + vnconfig -u ${VND_DEV} + cat /*bin/* > /dev/null + +unconfig: + -umount -f ${MOUNT_POINT} + -vnconfig -u ${VND_DEV} + -/bin/rm -f ${IMAGE} + +${CBIN}.mk ${CBIN}.cache ${CBIN}.c: ${CRUNCHCONF} + crunchgen -D ${TOP}/../../.. -L ${DESTDIR}/usr/lib ${CRUNCHCONF} + +${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c + make -f ${CBIN}.mk all + +clean cleandir: + /bin/rm -f core ${IMAGE} ${CBIN} ${CBIN}.mk ${CBIN}.cache *.o *.lo *.c + +.include <bsd.obj.mk> +.include <bsd.subdir.mk> diff --git a/distrib/i386/floppies/kc/copy_kernel.sh b/distrib/i386/floppies/kc/copy_kernel.sh new file mode 100644 index 00000000000..5b064a7fa02 --- /dev/null +++ b/distrib/i386/floppies/kc/copy_kernel.sh @@ -0,0 +1,113 @@ +# $OpenBSD: copy_kernel.sh,v 1.1 1996/05/31 23:00:25 mickey Exp $ +# +# Kernel copy script + +DEFAULT_PARTITON=sd0a +MOUNT_POINT=/mnt +KERNEL_NAME=/bsd +#TEST=testfn + +testfn() { + echo $* + sleep 5 +} + +cancel() { + echo "" + echo "Copy cancelled." + exit 1 +} + +umountfs() { + echo "Unmounting filesystem; please wait." + trap 2 3 + ${TEST} umount ${MOUNT_POINT} + case $? in + 0) + ;; + *) + echo "Warning: Unmount of ${MOUNT_POINT} failed." + ;; + esac +} + +warning() { + echo "" + echo "Copy failed or was interrupted." + echo "Warning: Copied kernel my be corrupted!" +} + +trap "cancel;" 2 3 +echo "OpenBSD kernel copy program" +echo "" +echo "Default answers are displayed in brackets. You may hit Control-C" +echo "at any time to cancel this operation (though if you hit Control-C at" +echo "a prompt, you need to hit return for it to be noticed)." + +echo "" +echo "What disk partition should the kernel be installed on?" +echo "(For example, \"sd0a\", \"wd0a\", etc.)" +echo "" +echo -n "Partition? [${DEFAULT_PARTITON}] " +read diskpart +if [ "X${diskpart}" = "X" ]; then + diskpart=${DEFAULT_PARTITON} +fi +rawdiskpart="r${diskpart}" + +echo "" +echo -n "Are you sure you want to copy a new kernel to ${diskpart}? [n] " +read reply +case ${reply} in +y*|Y*) + ;; +*) + cancel + ;; +esac + +echo "" +echo "Checking ${diskpart} partition; please wait." +${TEST} fsck -p "/dev/${rawdiskpart}" +case $? in +0) + ;; +*) + echo "File system check failed or aborted!" + cancel + ;; +esac + +echo "Mounting /dev/${diskpart} on ${MOUNT_POINT}." +trap "echo ''; umountfs; cancel;" 2 3 +${TEST} mount "/dev/${diskpart}" ${MOUNT_POINT} +case $? in +0) + ;; +*) + echo "Mount failed!" + cancel + ;; +esac + +echo "Copying kernel to ${MOUNT_POINT}." +trap "warning; umountfs; cancel;" 2 3 +${TEST} cp ${KERNEL_NAME} ${MOUNT_POINT} +case $? in +0) + ;; +*) + warning + umountfs + cancel + ;; +esac + +umountfs + +echo "" +echo "Copy completed." +echo "" +echo "Use \"halt\" to halt the system, then (when the system is halted)" +echo "eject the floppy disk and hit any key to reboot from the hard disk." +exit 0 diff --git a/distrib/i386/floppies/kc/dot.profile b/distrib/i386/floppies/kc/dot.profile new file mode 100644 index 00000000000..558b5ea2786 --- /dev/null +++ b/distrib/i386/floppies/kc/dot.profile @@ -0,0 +1,13 @@ +# $OpenBSD: dot.profile,v 1.1 1996/05/31 23:00:26 mickey Exp $ + +PATH=/sbin:/bin:/ +export PATH + +if [ "X${DONEPROFILE}" = "X" ]; then + DONEPROFILE=YES + + echo -n "Enter 'copy_kernel' at the prompt to copy a kernel to your " + echo "hard disk," + echo "'reboot' to reboot the system, or 'halt' to halt the system." + echo "" +fi diff --git a/distrib/i386/floppies/kc/kcbin.conf b/distrib/i386/floppies/kc/kcbin.conf new file mode 100644 index 00000000000..8ec72a91f7c --- /dev/null +++ b/distrib/i386/floppies/kc/kcbin.conf @@ -0,0 +1,15 @@ +# $OpenBSD: kcbin.conf,v 1.1 1996/05/31 23:00:27 mickey Exp $ +# +# kcbin.conf - unified binary for the kc floppy +# + +srcdirs bin sbin + +progs cp dd disklabel fsck_ffs init mount mount_ffs reboot sh test umount + +ln test [ +ln mount_ffs ffs +ln reboot halt +ln sh -sh # init invokes the shell this way + +libs -ledit -lutil -ltermcap -lcrypt -ll diff --git a/distrib/i386/floppies/kc/list b/distrib/i386/floppies/kc/list new file mode 100644 index 00000000000..f38ed9b786f --- /dev/null +++ b/distrib/i386/floppies/kc/list @@ -0,0 +1,34 @@ +# $OpenBSD: list,v 1.3 1996/05/31 23:00:29 mickey Exp $ + +# copy the kernel +COPY ${CURDIR}/../../../../sys/arch/i386/compile/INST/bsd bsd + +# copy the crunched binary, link to it, and kill it +COPY ${OBJDIR}/kcbin kcbin +LINK kcbin bin/cp +LINK kcbin bin/dd +LINK kcbin bin/sh +LINK kcbin bin/test +LINK kcbin bin/[ +LINK kcbin sbin/disklabel +LINK kcbin sbin/fsck_ffs +LINK kcbin sbin/halt +LINK kcbin sbin/init +LINK kcbin sbin/mount +LINK kcbin sbin/mount_ffs +LINK kcbin sbin/reboot +LINK kcbin sbin/umount +SPECIAL /bin/rm kcbin + +# copy the MAKEDEV script and make some devices +COPY ${CURDIR}/../../../../etc/etc.i386/MAKEDEV dev/MAKEDEV +SPECIAL cd dev; sh MAKEDEV floppy +SPECIAL /bin/rm dev/MAKEDEV + +# we need the contents of /usr/mdec +COPYDIR ${DESTDIR}/usr/mdec usr/mdec + +# copy the common kc-floppy tools +COPY ${CURDIR}/dot.profile .profile +COPY ${CURDIR}/copy_kernel.sh copy_kernel +SPECIAL chmod 755 copy_kernel diff --git a/distrib/i386/floppies/kc/mtree.conf b/distrib/i386/floppies/kc/mtree.conf new file mode 100644 index 00000000000..ade31ddfa5f --- /dev/null +++ b/distrib/i386/floppies/kc/mtree.conf @@ -0,0 +1,36 @@ +# $OpenBSD: mtree.conf,v 1.1 1996/05/31 23:00:30 mickey Exp $ + +/set type=dir uname=root gname=wheel mode=0755 +# . +. + +# ./bin +bin +# ./bin +.. + +# ./dev +dev +# ./dev +.. + +#./mnt +mnt +# ./mnt +.. + +# ./sbin +sbin +# ./sbin +.. + +# ./usr +usr + +# ./usr/mdec +mdec +# ./usr/mdec +.. + +# ./usr +.. |