diff options
-rw-r--r-- | distrib/amd64/common/install.md | 9 | ||||
-rw-r--r-- | distrib/i386/common/install.md | 9 | ||||
-rw-r--r-- | distrib/macppc/ramdisk/install.md | 9 | ||||
-rw-r--r-- | distrib/miniroot/install.sh | 56 | ||||
-rw-r--r-- | distrib/miniroot/install.sub | 18 | ||||
-rw-r--r-- | distrib/mvme88k/ramdisk/install.md | 9 | ||||
-rw-r--r-- | distrib/sgi/ramdisk/install.md | 21 | ||||
-rw-r--r-- | distrib/sparc64/common/install.md | 9 |
8 files changed, 64 insertions, 76 deletions
diff --git a/distrib/amd64/common/install.md b/distrib/amd64/common/install.md index 1d912e8d398..ccf6bce9db0 100644 --- a/distrib/amd64/common/install.md +++ b/distrib/amd64/common/install.md @@ -1,4 +1,4 @@ -# $OpenBSD: install.md,v 1.25 2010/08/08 21:06:06 krw Exp $ +# $OpenBSD: install.md,v 1.26 2011/01/03 00:36:46 deraadt Exp $ # # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -39,11 +39,10 @@ NCPU=$(sysctl -n hw.ncpufound) ((NCPU > 1)) && { DEFAULTSETS="bsd bsd.rd bsd.mp" ; SANESETS="bsd bsd.mp" ; } md_installboot() { - cd /mnt - if [[ -f bsd.mp ]] && ((NCPU > 1)); then + if [[ -f /mnt/bsd.mp ]] && ((NCPU > 1)); then echo "Multiprocessor machine; using bsd.mp instead of bsd." - mv bsd bsd.sp 2>/dev/null - mv bsd.mp bsd + mv /mnt/bsd /mnt/bsd.sp 2>/dev/null + mv /mnt/bsd.mp /mnt/bsd fi cp /usr/mdec/boot /mnt/boot diff --git a/distrib/i386/common/install.md b/distrib/i386/common/install.md index ba5b11e9c81..92b68533167 100644 --- a/distrib/i386/common/install.md +++ b/distrib/i386/common/install.md @@ -1,4 +1,4 @@ -# $OpenBSD: install.md,v 1.49 2010/08/08 21:06:06 krw Exp $ +# $OpenBSD: install.md,v 1.50 2011/01/03 00:36:49 deraadt Exp $ # # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -39,11 +39,10 @@ NCPU=$(sysctl -n hw.ncpufound) ((NCPU > 1)) && { DEFAULTSETS="bsd bsd.rd bsd.mp" ; SANESETS="bsd bsd.mp" ; } md_installboot() { - cd /mnt - if [[ -f bsd.mp ]] && ((NCPU > 1)); then + if [[ -f /mnt/bsd.mp ]] && ((NCPU > 1)); then echo "Multiprocessor machine; using bsd.mp instead of bsd." - mv bsd bsd.sp 2>/dev/null - mv bsd.mp bsd + mv /mnt/bsd /mnt/bsd.sp 2>/dev/null + mv /mnt/bsd.mp /mnt/bsd fi # LBA biosboot uses /boot's i-node number. Using 'cat' preserves that diff --git a/distrib/macppc/ramdisk/install.md b/distrib/macppc/ramdisk/install.md index 89279e1514a..76d6f1d2e86 100644 --- a/distrib/macppc/ramdisk/install.md +++ b/distrib/macppc/ramdisk/install.md @@ -1,4 +1,4 @@ -# $OpenBSD: install.md,v 1.47 2010/10/02 00:11:57 krw Exp $ +# $OpenBSD: install.md,v 1.48 2011/01/03 00:36:49 deraadt Exp $ # # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -40,11 +40,10 @@ NCPU=$(sysctl -n hw.ncpufound) md_installboot() { local _disk=$1 - cd /mnt - if [[ -f bsd.mp ]] && ((NCPU > 1)); then + if [[ -f /mnt/bsd.mp ]] && ((NCPU > 1)); then echo "Multiprocessor machine; using bsd.mp instead of bsd." - mv bsd bsd.sp 2>/dev/null - mv bsd.mp bsd + mv /mnt/bsd /mnt/bsd.sp 2>/dev/null + mv /mnt/bsd.mp /mnt/bsd fi # If there is an MSDOS partition on the boot disk, copy ofwboot diff --git a/distrib/miniroot/install.sh b/distrib/miniroot/install.sh index 319737e04ec..48ebb31e79e 100644 --- a/distrib/miniroot/install.sh +++ b/distrib/miniroot/install.sh @@ -1,5 +1,5 @@ #!/bin/ksh -# $OpenBSD: install.sh,v 1.214 2010/12/22 22:22:40 todd Exp $ +# $OpenBSD: install.sh,v 1.215 2011/01/03 00:36:50 deraadt Exp $ # $NetBSD: install.sh,v 1.5.2.8 1996/08/27 18:15:05 gwr Exp $ # # Copyright (c) 1997-2009 Todd Miller, Theo de Raadt, Ken Westerback @@ -63,7 +63,6 @@ MODE=install # include common subroutines and initialization code . install.sub -cd /tmp DISK= DISKS_DONE= _DKDEVS=$(get_dkdevs) @@ -78,7 +77,7 @@ while :; do # Always do ROOTDISK first, and repeat until it is configured. if isin $ROOTDISK $_DKDEVS; then resp=$ROOTDISK - rm -f fstab + rm -f /tmp/fstab # Make sure empty files exist so we don't have to # keep checking for their existence before grep'ing. else @@ -97,26 +96,26 @@ while :; do # Deal with disklabels, including editing the root disklabel # and labeling additional disks. This is machine-dependent since # some platforms may not be able to provide this functionality. - # fstab.$DISK is created here with 'disklabel -f'. - rm -f *.$DISK + # /tmp/fstab.$DISK is created here with 'disklabel -f'. + rm -f /tmp/*.$DISK AUTOROOT=n md_prep_disklabel $DISK || { DISK= ; continue ; } # Make sure there is a '/' mount point. - grep -qs " / ffs " fstab.$ROOTDISK || \ + grep -qs " / ffs " /tmp/fstab.$ROOTDISK || \ { DISK= ; echo "'/' must be configured!" ; continue ; } - if [[ -f fstab.$DISK ]]; then + if [[ -f /tmp/fstab.$DISK ]]; then # Avoid duplicate mount points on different disks. while read _pp _mp _rest; do - [[ fstab.$DISK == $(grep -l " $_mp " fstab.*) ]] || \ + [[ /tmp/fstab.$DISK == $(grep -l " $_mp " /tmp/fstab.*) ]] || \ { _rest=$DISK ; DISK= ; break ; } - done <fstab.$DISK + done </tmp/fstab.$DISK if [[ -z $DISK ]]; then # Allow disklabel(8) to read mountpoint info. - cat fstab.$_rest >/etc/fstab - rm fstab.$_rest - set -- $(grep -h " $_mp " fstab.*[0-9]) + cat /tmp/fstab.$_rest >/etc/fstab + rm /tmp/fstab.$_rest + set -- $(grep -h " $_mp " /tmp/fstab.*[0-9]) echo "$_pp and $1 can't both be mounted at $_mp." continue fi @@ -134,13 +133,13 @@ while :; do # mount points. _fsent[$_i]="$_mp!$_pp" : $(( _i += 1 )) - done <fstab.$DISK + done </tmp/fstab.$DISK fi # New swap partitions? disklabel $DISK 2>&1 | sed -ne \ "/^ *\([a-p]\): .* swap /s,,/dev/$DISK\1 none swap sw 0 0,p" | \ - grep -v "^/dev/$SWAPDEV " >>fstab + grep -v "^/dev/$SWAPDEV " >>/tmp/fstab done # Write fstab entries to fstab in mount point alphabetic order @@ -185,8 +184,7 @@ for _mp in $(bsort ${_fsent[*]}); do *) echo -n ",nosuid" ;; esac echo " 1 2" -done >>fstab -cd / +done >>/tmp/fstab munge_fstab mount_fs "-o async" @@ -196,8 +194,8 @@ install_sets # If we did not succeed at setting TZ yet, we try again # using the timezone names extracted from the base set if [[ -z $TZ ]]; then - ( cd /mnt/usr/share/zoneinfo - ls -1dF `tar cvf /dev/null [A-Za-y]*` >/mnt/tmp/tzlist ) + (cd /mnt/usr/share/zoneinfo + ls -1dF `tar cvf /dev/null [A-Za-y]*` >/mnt/tmp/tzlist ) echo set_timezone /mnt/tmp/tzlist rm -f /mnt/tmp/tzlist @@ -237,12 +235,10 @@ mv /tmp/ttys /mnt/etc/ttys echo -n "Saving configuration files..." # Save any leases obtained during install. -( cd /var/db -[ -f dhclient.leases ] && mv dhclient.leases /mnt/var/db/. ) +(cd /var/db; [ -f dhclient.leases ] && mv dhclient.leases /mnt/var/db/. ) # Move configuration files from /tmp to /mnt/etc. -( cd /tmp -hostname >myname +hostname >/tmp/myname # Append entries to installed hosts file, changing '1.2.3.4 hostname' # to '1.2.3.4 hostname.$FQDN hostname'. Leave untouched lines containing @@ -256,20 +252,20 @@ if [[ -f hosts ]]; then else echo "$_addr\t$_hn.$_dn $_hn" fi - done <hosts >>/mnt/etc/hosts - rm hosts + done </tmp/hosts >>/mnt/etc/hosts + rm /tmp/hosts fi # Append dhclient.conf to installed dhclient.conf. _f=dhclient.conf -[[ -f $_f ]] && { cat $_f >>/mnt/etc/$_f ; rm $_f ; } +[[ -f /tmp/$_f ]] && { cat /tmp/$_f >>/mnt/etc/$_f ; rm /tmp/$_f ; } -# Possible files: fstab hostname.* kbdtype mygate myname ttys -# boot.conf resolv.conf sysctl.conf resolv.conf.tail +# Possible files to copy from /tmp: fstab hostname.* kbdtype mygate +# myname ttys boot.conf resolv.conf sysctl.conf resolv.conf.tail # Save only non-empty (-s) regular (-f) files. -for _f in fstab hostname* kbdtype my* ttys *.conf *.tail; do +(cd /tmp; for _f in fstab hostname* kbdtype my* ttys *.conf *.tail; do [[ -f $_f && -s $_f ]] && mv $_f /mnt/etc/. -done ) +done) # Feed the random pool some junk before we read from it (dmesg; cat $SERVERLISTALL; sysctl; route -n show; df; @@ -292,7 +288,7 @@ if [[ -n $user ]]; then mkdir -p /mnt/home/$user (cd /mnt/etc/skel; cp -pR . /mnt/home/$user) - ( umask 077 && + (umask 077 && sed "s,^To: root\$,To: ${username} <${user}>," \ /mnt/var/mail/root > /mnt/var/mail/$user ) chown -R 1000:1000 /mnt/home/$user /mnt/var/mail/$user diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index a4b9efac596..e238b80d95e 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,4 +1,4 @@ -# $OpenBSD: install.sub,v 1.631 2010/11/22 14:10:42 halex Exp $ +# $OpenBSD: install.sub,v 1.632 2011/01/03 00:36:50 deraadt Exp $ # $NetBSD: install.sub,v 1.5.2.8 1996/09/02 23:25:02 pk Exp $ # # Copyright (c) 1997-2009 Todd Miller, Theo de Raadt, Ken Westerback @@ -1943,18 +1943,16 @@ finish_up() { fi echo -n "Making all device nodes..." - (cd /mnt/dev - sh MAKEDEV all - # Make sure any devices we found during probe are created in the - # installed system. - for _dev in $(get_dkdevs) $(get_cddevs) $MTDEVS ; do - sh MAKEDEV $_dev - done + (cd /mnt/dev; sh MAKEDEV all + # Make sure any devices we found during probe are created in the + # installed system. + for _dev in $(get_dkdevs) $(get_cddevs) $MTDEVS ; do + sh MAKEDEV $_dev + done ) echo "done." - (cd /; md_installboot $ROOTDISK) - cd / + md_installboot $ROOTDISK populateusrlocal diff --git a/distrib/mvme88k/ramdisk/install.md b/distrib/mvme88k/ramdisk/install.md index 781eee3cc99..9675a1bcffe 100644 --- a/distrib/mvme88k/ramdisk/install.md +++ b/distrib/mvme88k/ramdisk/install.md @@ -1,4 +1,4 @@ -# $OpenBSD: install.md,v 1.37 2009/06/04 00:44:47 krw Exp $ +# $OpenBSD: install.md,v 1.38 2011/01/03 00:36:50 deraadt Exp $ # Copyright (c) 1996 The NetBSD Foundation, Inc. # All rights reserved. # @@ -37,11 +37,10 @@ NCPU=$(sysctl -n hw.ncpufound) ((NCPU > 1)) && { DEFAULTSETS="bsd bsd.rd bsd.mp" ; SANESETS="bsd bsd.mp" ; } md_installboot() { - cd /mnt - if [[ -f bsd.mp ]] && ((NCPU > 1)); then + if [[ -f /mnt/bsd.mp ]] && ((NCPU > 1)); then echo "Multiprocessor machine; using bsd.mp instead of bsd." - mv bsd bsd.sp 2>/dev/null - mv bsd.mp bsd + mv /mnt/bsd /mnt/bsd.sp 2>/dev/null + mv /mnt/bsd.mp /mnt/bsd fi cp /mnt/usr/mdec/bootsd /mnt/boot diff --git a/distrib/sgi/ramdisk/install.md b/distrib/sgi/ramdisk/install.md index 41ead3e8234..27595d34b09 100644 --- a/distrib/sgi/ramdisk/install.md +++ b/distrib/sgi/ramdisk/install.md @@ -1,4 +1,4 @@ -# $OpenBSD: install.md,v 1.23 2010/06/26 23:16:41 krw Exp $ +# $OpenBSD: install.md,v 1.24 2011/01/03 00:36:50 deraadt Exp $ # # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -46,21 +46,20 @@ fi DEFAULTSETS=${MDSETS} md_installboot() { - cd /mnt - if [[ -f bsd.${IPARCH} ]]; then - mv bsd.${IPARCH} bsd + if [[ -f /mnt/bsd.${IPARCH} ]]; then + mv /mnt/bsd.${IPARCH} /mnt/bsd fi - if [[ -f bsd.mp.${IPARCH} ]]; then - mv bsd.mp.${IPARCH} bsd.mp + if [[ -f /mnt/bsd.mp.${IPARCH} ]]; then + mv /mnt/bsd.mp.${IPARCH} /mnt/bsd.mp fi - if [[ -f bsd.rd.${IPARCH} ]]; then - mv bsd.rd.${IPARCH} bsd.rd + if [[ -f /mnt/bsd.rd.${IPARCH} ]]; then + mv /mnt/bsd.rd.${IPARCH} /mnt/bsd.rd fi - if [[ -f bsd.mp ]] && ((NCPU > 1)); then + if [[ -f /mnt/bsd.mp ]] && ((NCPU > 1)); then echo "Multiprocessor machine; using bsd.mp instead of bsd." - mv bsd bsd.sp 2>/dev/null - mv bsd.mp bsd + mv /mnt/bsd /mnt/bsd.sp 2>/dev/null + mv /mnt/bsd.mp /mnt/bsd fi } diff --git a/distrib/sparc64/common/install.md b/distrib/sparc64/common/install.md index 368b7e541c0..6f42920c0d2 100644 --- a/distrib/sparc64/common/install.md +++ b/distrib/sparc64/common/install.md @@ -1,4 +1,4 @@ -# $OpenBSD: install.md,v 1.33 2009/06/04 00:44:47 krw Exp $ +# $OpenBSD: install.md,v 1.34 2011/01/03 00:36:50 deraadt Exp $ # $NetBSD: install.md,v 1.3.2.5 1996/08/26 15:45:28 gwr Exp $ # # @@ -43,11 +43,10 @@ NCPU=$(sysctl -n hw.ncpufound) md_installboot() { local _prefix - cd /mnt - if [[ -f bsd.mp ]] && ((NCPU > 1)); then + if [[ -f /mnt/bsd.mp ]] && ((NCPU > 1)); then echo "Multiprocessor machine; using bsd.mp instead of bsd." - mv bsd bsd.sp 2>/dev/null - mv bsd.mp bsd + mv /mnt/bsd /mnt/bsd.sp 2>/dev/null + mv /mnt/bsd.mp /mnt/bsd fi # Figure out which /usr/mdec directory to use |