diff options
author | 1997-10-31 05:41:27 +0000 | |
---|---|---|
committer | 1997-10-31 05:41:27 +0000 | |
commit | f35dd6a07ac422874632f1ff8315e0622b19bc0c (patch) | |
tree | a0c6a1b3f4a387b5d2eaf96ec7da852d6f3b011e | |
parent | From Jim Rees <rees@umich.edu>: remember media type (diff) | |
download | wireguard-openbsd-f35dd6a07ac422874632f1ff8315e0622b19bc0c.tar.xz wireguard-openbsd-f35dd6a07ac422874632f1ff8315e0622b19bc0c.zip |
Final pass through the ramdisk installer. Seems to work correctly.
-rw-r--r-- | distrib/hp300/ramdisk/Makefile | 4 | ||||
-rw-r--r-- | distrib/hp300/ramdisk/install.md | 30 | ||||
-rw-r--r-- | distrib/hp300/ramdisk/install.sh | 92 | ||||
-rw-r--r-- | distrib/hp300/ramdisk/install.sub | 13 | ||||
-rw-r--r-- | distrib/hp300/ramdisk/mtree.conf | 14 |
5 files changed, 100 insertions, 53 deletions
diff --git a/distrib/hp300/ramdisk/Makefile b/distrib/hp300/ramdisk/Makefile index cec3fb0457f..1a7fb785586 100644 --- a/distrib/hp300/ramdisk/Makefile +++ b/distrib/hp300/ramdisk/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.9 1997/10/20 04:23:31 downsj Exp $ +# $OpenBSD: Makefile,v 1.10 1997/10/31 05:41:27 downsj Exp $ # $NetBSD: Makefile,v 1.1 1995/07/18 04:13:06 briggs Exp $ TOP= ${.CURDIR}/.. @@ -46,7 +46,7 @@ ${IMAGE}: ${CBIN} rd_setup do_files rd_teardown rd_setup: ${CBIN} dd if=/dev/zero of=${REALIMAGE} bs=512 count=${NBLKS} vnconfig -v -c ${VND} ${REALIMAGE} - disklabel -w -r ${VND} ${DISKTYPE} + disklabel -w ${VND} ${DISKTYPE} newfs ${NEWFSARGS} ${VND_RDEV} fsck ${VND_RDEV} mount ${VND_DEV} ${MOUNT_POINT} diff --git a/distrib/hp300/ramdisk/install.md b/distrib/hp300/ramdisk/install.md index e116fcffcff..31598a1750e 100644 --- a/distrib/hp300/ramdisk/install.md +++ b/distrib/hp300/ramdisk/install.md @@ -1,6 +1,6 @@ #!/bin/sh # -# $OpenBSD: install.md,v 1.6 1997/09/30 17:52:41 deraadt Exp $ +# $OpenBSD: install.md,v 1.7 1997/10/31 05:41:28 downsj Exp $ # $NetBSD: install.md,v 1.1.2.4 1996/08/26 15:45:14 gwr Exp $ # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -261,7 +261,7 @@ __scsi_label_1 # edit the partition table. It's horrible, I know. Bleh. disklabel -W ${1} - if ! disklabel -w -r ${1} ${_cur_disk_name}; then + if ! disklabel -r -w ${1} ${_cur_disk_name}; then echo "" echo "ERROR: can't bootstrap disklabel!" rval="1" @@ -279,7 +279,7 @@ __scsi_label_1 getresp "" disklabel -W ${1} - if ! disklabel -r -E /dev/r${1}a; then + if ! disklabel -r -e /dev/r${1}a; then echo "" echo "ERROR: can't fixup geometry!" rval="1" @@ -375,7 +375,7 @@ md_labeldisk() { 0) # Go ahead and just edit the disklabel. disklabel -W $1 - disklabel -r -E $1 + disklabel -E $1 ;; *) @@ -410,7 +410,7 @@ md_labeldisk() { # We have some defaults installed. Pop into # the disklabel editor. disklabel -W $1 - if ! disklabel -r -E $1; then + if ! disklabel -E $1; then echo "" echo "ERROR: couldn't set partition map for $1" echo "" @@ -458,6 +458,13 @@ of sectors per cylinder should be given as the offset) and partition `c' must have an fstype of `unused'. Non-boot disks may start filesystems at offset 0. +If there is no existing label on the disk, you MUST EDIT THE DISK GEOMETRY. +Please have information on your disk at hand in order to do so. Failure +to correct the disk geometry will result in your system being unable to +boot from the disk you are installing on to. Be sure `cylinders', +`total sectors' and `rpm' are set to something reasonable; this may be +accomplished with the `e' command from within the disklabel editor. + [Example] 16 partitions: # size offset fstype [fsize bsize cpg] @@ -471,7 +478,14 @@ __md_prep_disklabel_1 echo -n "Press [Enter] to continue " getresp "" disklabel -W ${_disk} - disklabel -r -E ${_disk} + disklabel -E ${_disk} + + # We need to edit the disklabel, again, due to problems with using + # disklabel -E (currently) on this arch. XXX + disklabel ${_disk} | sed -e 's/interleave: 0/interleave: 1/' \ + -e 's/rpm: 0/rpm: 3600/' > /tmp/disklabelfixup + disklabel -R ${_disk} /tmp/disklabelfixup + rm /tmp/disklabelfixup } md_copy_kernel() { @@ -484,7 +498,7 @@ md_copy_kernel() { md_welcome_banner() { ( echo "" - echo "Welcome to the OpenBSD/hp300 ${VERSION} installation program." + echo "Welcome to the OpenBSD/hp300 ${VERSION_MAJOR}.${VERSION_MINOR} installation program." cat << \__welcome_banner_1 This program is designed to help you install OpenBSD on your system in a @@ -512,7 +526,7 @@ prompt, you may have to hit return. Also, quitting in the middle of installation may leave your system in an inconsistent state. __welcome_banner_1 -) | less +) | less -E } md_not_going_to_install() { diff --git a/distrib/hp300/ramdisk/install.sh b/distrib/hp300/ramdisk/install.sh index dd8c6e45a43..63105294907 100644 --- a/distrib/hp300/ramdisk/install.sh +++ b/distrib/hp300/ramdisk/install.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $OpenBSD: install.sh,v 1.5 1997/10/20 07:06:03 downsj Exp $ +# $OpenBSD: install.sh,v 1.6 1997/10/31 05:41:28 downsj Exp $ # $NetBSD: install.sh,v 1.5.2.8 1996/08/27 18:15:05 gwr Exp $ # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -136,52 +136,72 @@ if [ "`df /`" = "`df /mnt`" ]; then # Assume partition 'a' of $ROOTDISK is for the root filesystem. # Loop and get the rest. # XXX ASSUMES THAT THE USER DOESN'T PROVIDE BOGUS INPUT. - cat << \__get_filesystems_1 + cat << __get_filesystems_1 You will now have the opportunity to enter filesystem information. You will be -prompted for device name and mount point (full path, including the prepending -'/' character). (NOTE: these do not have to be in any particular order). +prompted for the mount point (full path, including the prepending '/' character) +for each BSD partition on ${ROOTDISK}. Enter "none" to skip a partition or +"done" when you are finished. __get_filesystems_1 - echo "The following will be used for the root filesystem:" + echo "The following will be used for the root filesystem and swap:" echo " ${ROOTDISK}a /" + echo " ${ROOTDISK}b swap" echo "${ROOTDISK}a /" > ${FILESYSTEMS} - resp="X" # force at least one iteration - while [ "X$resp" != X"done" ]; do - echo "" - echo -n "Device name? [done] " - getresp "done" - case "$resp" in - done) - ;; - - *) - _device_name=`basename $resp` - - # force at least one iteration - _first_char="X" - while [ "X${_first_char}" != X"/" ]; do - echo -n "Mount point? " - getresp "" - _mount_point=$resp - _first_char=`firstchar ${_mount_point}` - if [ "X${_first_char}" != X"/" ]; then - echo "mount point must be an absolute path!" - fi - done - if [ "X${_mount_point}" = X"/" ]; then - echo "root mount point already taken care of!" - else - echo "${_device_name} ${_mount_point}" \ - >> ${FILESYSTEMS} - fi - resp="X" # force loop to repeat - ;; + # XXX - allow the user to name mount points on disks other than ROOTDISK + # also allow a way to enter non-BSD partitions (but don't newfs!) + # Get the list of BSD partitions and store sizes + _npartitions=0 + for _p in `disklabel ${ROOTDISK} 2>&1 | grep '^ *[a-p]:.*BSD' | sed 's/^ *\([a-p]\): *\([0-9][0-9]*\) .*/\1\2/'`; do + case $_p in + a*) # We already have an 'a' + ;; + *) _pp=`firstchar ${_p}` + _ps=`echo ${_p} | sed 's/^.//'` + _partitions[${_npartitions}]=${_pp} + _psizes[${_npartitions}]=${_ps} + _npartitions=$(( ${_npartitions} + 1 )) + ;; esac done + # Now prompt the user for the mount points. Loop until "done" + echo "" + _i=0 + resp="X" + while [ $_npartitions -gt 0 -a X${resp} != X"done" ]; do + _pp=${_partitions[${_i}]} + _ps=$(( ${_psizes[${_i}]} / 2 )) + _mp=${_mount_points[${_i}]} + + # Get the mount point from the user + while : ; do + echo -n "Mount point for ${ROOTDISK}${_pp} (size=${_ps}k) [$_mp]? " + getresp "$_mp" + case "X${resp}" in + X/*) _mount_points[${_i}]=$resp + break ;; + Xdone|Xnone|X) break ;; + *) echo "mount point must be an absolute path!";; + esac + done + _i=$(( ${_i} + 1 )) + if [ $_i -ge $_npartitions ]; then + _i=0 + fi + done + + # Now write it out + _i=0 + while test $_i -lt $_npartitions; do + if [ -n "${_mount_points[${_i}]}" ]; then + echo "${ROOTDISK}${_partitions[${_i}]} ${_mount_points[${_i}]}" >> ${FILESYSTEMS} + fi + _i=$(( ${_i} + 1 )) + done + echo "" echo "You have configured the following devices and mount points:" echo "" diff --git a/distrib/hp300/ramdisk/install.sub b/distrib/hp300/ramdisk/install.sub index fa96c49dc25..e9d30acc6f4 100644 --- a/distrib/hp300/ramdisk/install.sub +++ b/distrib/hp300/ramdisk/install.sub @@ -1,5 +1,5 @@ #!/bin/sh -# $OpenBSD: install.sub,v 1.7 1997/10/20 07:06:04 downsj Exp $ +# $OpenBSD: install.sub,v 1.8 1997/10/31 05:41:29 downsj Exp $ # $NetBSD: install.sub,v 1.5.2.8 1996/09/02 23:25:02 pk Exp $ # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -40,16 +40,16 @@ # OpenBSD installation/upgrade script - common subroutines. ROOTDISK="" # filled in below -VERSION=2.2 +VERSION=22 VERSION_MAJOR=$(( $VERSION / 10 )) VERSION_MINOR=$(( $VERSION % 10 )) export VERSION VERSION_MAJOR VERSION_MINOR -ALLSETS="base etc misc comp text man game" # default install sets -UPGRSETS="base misc comp text man game" # default upgrade sets +ALLSETS="base etc misc comp text man game kernel" # default install sets +UPGRSETS="base misc comp text man game kernel" # default upgrade sets SNAPSETS="bin dev etc games man misc sbin text \ usr.bin usr.binutils usr.games usr.include \ - usr.lib usr.libexec usr.misc usr.sbin usr.share var" + usr.lib usr.libexec usr.misc usr.sbin usr.share var kernel" THESETS= # one of the above local_sets_dir="" # Path searched for sets by install_sets @@ -474,6 +474,7 @@ configure_ifs() { done # Get netmask + resp="" if [ "X${_interface_mask}" = X"" ]; then _interface_mask=255.255.255.0 fi @@ -975,7 +976,7 @@ install_from_mounted_fs() { else resp=y fi - echo -n "Continue extraction [$resp]?" + echo -n "Continue extraction in this directory [$resp]?" getresp "$resp" if [ "$resp" = "n" ]; then break diff --git a/distrib/hp300/ramdisk/mtree.conf b/distrib/hp300/ramdisk/mtree.conf index dd3b0130168..cf3d69f01bd 100644 --- a/distrib/hp300/ramdisk/mtree.conf +++ b/distrib/hp300/ramdisk/mtree.conf @@ -1,5 +1,5 @@ # -# $OpenBSD: mtree.conf,v 1.1 1997/02/16 18:20:05 downsj Exp $ +# $OpenBSD: mtree.conf,v 1.2 1997/10/31 05:41:29 downsj Exp $ # $NetBSD: mtree.conf,v 1.1 1995/07/18 04:13:24 briggs Exp $ # @@ -47,6 +47,18 @@ kern # ./kern .. +# ./var +var + +# ./var/tmp +tmp + +# ./var +.. + +# ./ +.. + # ./usr usr |