Browse Source

foom

OPENBSD_2_1
deraadt 28 years ago
parent
commit
87e3ea1c97
4 changed files with 0 additions and 180 deletions
  1. +0
    -57
      src/etc/etc.i386/Makefile.kc
  2. +0
    -113
      src/etc/etc.i386/files.kc/copy_kernel
  3. +0
    -8
      src/etc/etc.i386/files.kc/dot.profile
  4. +0
    -2
      src/etc/etc.i386/files.kc/list

+ 0
- 57
src/etc/etc.i386/Makefile.kc View File

@ -1,57 +0,0 @@
# $Id: Makefile.kc,v 1.3 1996/06/11 10:20:26 deraadt Exp $
.ifndef MOUNT_POINT
MOUNT_POINT= /mnt
.endif
.if !defined(VND_DEV) || !defined(VND_DEV)
VND_DEV= /dev/vnd0a
VND_RDEV= /dev/rvnd0a
.endif
PID!= echo $$$$
REALIMAGE!= echo /tmp/image.${PID}
ROOTDIRLIST= / /bin /dev /instbin /mnt /sbin /usr
BINDIRLIST= /usr/bin
FLOPPYBINS= fsck init mount reboot sh tar test umount
all:
.if !defined(IMAGE) || !defined(KERNEL)
@echo both IMAGE and KERNEL must be defined
@false
.else
dd if=/dev/zero of=${REALIMAGE} bs=10k count=120
vnconfig -c ${VND_DEV} ${REALIMAGE}
disklabel -w -B -b ${DESTDIR}/usr/mdec/fdboot -s ${DESTDIR}/usr/mdec/bootfd \
${VND_RDEV} floppy5
newfs -m 0 -o space -i 6144 -c 80 ${VND_DEV} floppy5
mount ${VND_DEV} ${MOUNT_POINT}
for d in ${ROOTDIRLIST} ; do \
install -d -o root -g wheel -m 755 ${MOUNT_POINT}$$d ; \
done
for d in ${BINDIRLIST} ; do \
install -d -o ${BINOWN} -g ${BINGRP} -m 755 ${MOUNT_POINT}$$d ; \
done
cp ${KERNEL} ${MOUNT_POINT}
cp ${.CURDIR}/etc.i386/MAKEDEV ${MOUNT_POINT}/dev
(cd ${MOUNT_POINT}/dev; sh MAKEDEV floppy)
for b in ${FLOPPYBINS} ; do \
( cd ${.CURDIR}/../sys/arch/i386/floppy/$$b ; \
make DESTDIR=${MOUNT_POINT} install ) ; \
done
set -- `grep -v '^#' ${.CURDIR}/etc.i386/files.kc/list`; \
while [ $$# -ge 2 ]; do \
from=$$1; shift; \
to=$$1; shift; \
cp ${.CURDIR}/etc.i386/files.kc/$$from ${MOUNT_POINT}/$$to; \
done
umount ${MOUNT_POINT}
vnconfig -u ${VND_DEV}
cat /*bin/* > /dev/null
cp ${REALIMAGE} ${IMAGE}
.endif
unconfig:
-umount -f ${MOUNT_POINT}
-vnconfig -u ${VND_DEV}
-/bin/rm -f ${REALIMAGE} ${IMAGE}

+ 0
- 113
src/etc/etc.i386/files.kc/copy_kernel View File

@ -1,113 +0,0 @@
# $Id: copy_kernel,v 1.2 1996/06/11 09:05:32 deraadt 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

+ 0
- 8
src/etc/etc.i386/files.kc/dot.profile View File

@ -1,8 +0,0 @@
# $Id: dot.profile,v 1.1.1.1 1995/10/18 08:38:00 deraadt Exp $
PATH=/sbin:/bin:/instbin
export PATH
echo "Enter 'copy_kernel' at the prompt to copy a kernel to your hard disk,"
echo "'reboot' to reboot the system, or 'halt' to halt the system."
echo ""

+ 0
- 2
src/etc/etc.i386/files.kc/list View File

@ -1,2 +0,0 @@
dot.profile .profile
copy_kernel instbin/copy_kernel

Loading…
Cancel
Save