-# $OpenBSD: install.md,v 1.39 2015/05/04 19:55:26 rpe Exp $
+# $OpenBSD: install.md,v 1.40 2015/05/31 19:40:10 rpe Exp $
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
# All rights reserved.
}
md_prep_disklabel() {
- local _disk=$1 _f _op
+ local _disk=$1 _f=/tmp/fstab.$1
+
+ disklabel_autolayout $_disk $_f || return
+ [[ -s $_f ]] && return
- _f=/tmp/fstab.$_disk
- if [[ $_disk == $ROOTDISK ]]; then
- if $AUTO && get_disklabel_template; then
- disklabel -T /disklabel.auto $FSTABFLAG $_f -w -A $_disk && return
- echo "Autopartitioning failed"
- exit 1
- fi
- while :; do
- echo "The auto-allocated layout for $_disk is:"
- disklabel -h -A $_disk | egrep "^# |^ [a-p]:"
- ask "Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout?" a
- case $resp in
- a*|A*) _op=-w ;;
- e*|E*) _op=-E ;;
- c*|C*) break ;;
- *) continue ;;
- esac
- disklabel $FSTABFLAG $_f $_op -A $_disk
- return
- done
- fi
cat <<__EOT
You will now create a OpenBSD disklabel on the disk. The disklabel defines
how OpenBSD splits up the disk into OpenBSD partitions in which filesystems
-# $OpenBSD: install.md,v 1.38 2015/05/04 19:55:26 rpe Exp $
+# $OpenBSD: install.md,v 1.39 2015/05/31 19:40:10 rpe Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
}
md_prep_disklabel() {
- local _disk=$1 _f _op
+ local _disk=$1 _f=/tmp/fstab.$1
md_prep_fdisk $_disk
- _f=/tmp/fstab.$_disk
- if [[ $_disk == $ROOTDISK ]]; then
- if $AUTO && get_disklabel_template; then
- disklabel -T /disklabel.auto $FSTABFLAG $_f -w -A $_disk && return
- echo "Autopartitioning failed"
- exit 1
- fi
- while :; do
- echo "The auto-allocated layout for $_disk is:"
- disklabel -h -A $_disk | egrep "^# |^ [a-p]:"
- ask "Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout?" a
- case $resp in
- a*|A*) _op=-w ;;
- e*|E*) _op=-E ;;
- c*|C*) break ;;
- *) continue ;;
- esac
- disklabel $FSTABFLAG $_f $_op -A $_disk
- return
- done
- fi
+ disklabel_autolayout $_disk $_f || return
+ [[ -s $_f ]] && return
cat <<__EOT
-# $OpenBSD: install.md,v 1.17 2015/05/04 19:55:26 rpe Exp $
+# $OpenBSD: install.md,v 1.18 2015/05/31 19:40:10 rpe Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
}
md_prep_disklabel() {
- local _disk=$1 _f _op
+ local _disk=$1 _f=/tmp/fstab.$1
md_prep_fdisk $_disk
- _f=/tmp/fstab.$_disk
- if [[ $_disk == $ROOTDISK ]]; then
- if $AUTO && get_disklabel_template; then
- disklabel -T /disklabel.auto $FSTABFLAG $_f -w -A $_disk && return
- echo "Autopartitioning failed"
- exit 1
- fi
- while :; do
- echo "The auto-allocated layout for $_disk is:"
- disklabel -h -A $_disk | egrep "^# |^ [a-p]:"
- ask "Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout?" a
- case $resp in
- a*|A*) _op=-w ;;
- e*|E*) _op=-E ;;
- c*|C*) break ;;
- *) continue ;;
- esac
- disklabel $FSTABFLAG $_f $_op -A $_disk
- return
- done
- fi
+ disklabel_autolayout $_disk $_f || return
+ [[ -s $_f ]] && return
cat <<__EOT
-# $OpenBSD: install.md,v 1.8 2015/05/20 01:44:20 jsg Exp $
+# $OpenBSD: install.md,v 1.9 2015/05/31 19:40:10 rpe Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
}
md_prep_disklabel() {
- local _disk=$1 _f _op
+ local _disk=$1 _f=/tmp/fstab.$1
md_prep_fdisk $_disk
- _f=/tmp/fstab.$_disk
- if [[ $_disk == $ROOTDISK ]]; then
- if $AUTO && get_disklabel_template; then
- disklabel -T /disklabel.auto $FSTABFLAG $_f -w -A $_disk && return
- echo "Autopartitioning failed"
- exit 1
- fi
- while :; do
- echo "The auto-allocated layout for $_disk is:"
- disklabel -h -A $_disk | egrep "^# |^ [a-p]:"
- ask "Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout?" a
- case $resp in
- a*|A*) _op=-w ;;
- e*|E*) _op=-E ;;
- c*|C*) break ;;
- *) continue ;;
- esac
- disklabel $FSTABFLAG $_f $_op -A $_disk
- return
- done
- fi
+ disklabel_autolayout $_disk $_f || return
+ [[ -s $_f ]] && return
cat <<__EOT
-# $OpenBSD: install.md,v 1.6 2015/05/04 19:55:26 rpe Exp $
+# $OpenBSD: install.md,v 1.7 2015/05/31 19:40:10 rpe Exp $
# Copyright (c) 1996 The NetBSD Foundation, Inc.
# All rights reserved.
#
}
md_prep_disklabel() {
- local _disk=$1 _f _op _shared=n
+ local _disk=$1 _f=/tmp/fstab.$1 _shared=n
if md_has_boot_area $_disk; then
if md_has_ldm $_disk; then
fi
fi
- _f=/tmp/fstab.$_disk
- if [[ $_disk == $ROOTDISK ]]; then
- if $AUTO && get_disklabel_template; then
- disklabel -T /disklabel.auto $FSTABFLAG $_f -w -A $_disk && return
- echo "Autopartitioning failed"
- exit 1
- fi
- while :; do
- echo "The auto-allocated layout for $_disk is:"
- disklabel -h -A $_disk | egrep "^# |^ [a-p]:"
- ask "Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout?" a
- case $resp in
- a*|A*) _op=-w ;;
- e*|E*) _op=-E ;;
- c*|C*) break ;;
- *) continue ;;
- esac
- disklabel $FSTABFLAG $_f $_op -A $_disk
- _mdnoautoinstallboot=$_shared
- return
- done
+ disklabel_autolayout $_disk $_f || return
+ if [[ -s $_f ]]; then
+ _mdnoautoinstallboot=$_shared
+ return
fi
+
cat <<__EOT
You will now create a OpenBSD disklabel on the disk. The disklabel defines
how OpenBSD splits up the disk into OpenBSD partitions in which filesystems
-# $OpenBSD: install.md,v 1.28 2015/05/04 19:55:26 rpe Exp $
+# $OpenBSD: install.md,v 1.29 2015/05/31 19:40:10 rpe Exp $
#
# machine dependent section of installation/upgrade script.
#
}
md_prep_disklabel() {
- local _disk=$1 _f _op
+ local _disk=$1 _f=/tmp/fstab.$1
installboot $_disk
- _f=/tmp/fstab.$_disk
- if [[ $_disk == $ROOTDISK ]]; then
- if $AUTO && get_disklabel_template; then
- disklabel -T /disklabel.auto $FSTABFLAG $_f -w -A $_disk && return
- echo "Autopartitioning failed"
- exit 1
- fi
- while :; do
- echo "The auto-allocated layout for $_disk is:"
- disklabel -h -A $_disk | egrep "^# |^ [a-p]:"
- ask "Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout?" a
- case $resp in
- a*|A*) _op=-w ;;
- e*|E*) _op=-E ;;
- c*|C*) break ;;
- *) continue ;;
- esac
- disklabel $FSTABFLAG $_f $_op -A $_disk
- return
- done
- fi
+ disklabel_autolayout $_disk $_f || return
+ [[ -s $_f ]] && return
+
cat <<__EOT
You will now create a OpenBSD disklabel on the disk. The disklabel defines
how OpenBSD splits up the disk into OpenBSD partitions in which filesystems
-# $OpenBSD: install.md,v 1.61 2015/05/04 19:55:26 rpe Exp $
+# $OpenBSD: install.md,v 1.62 2015/05/31 19:40:10 rpe Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
}
md_prep_disklabel() {
- local _disk=$1 _f _op
+ local _disk=$1 _f=/tmp/fstab.$1
md_prep_fdisk $_disk
- _f=/tmp/fstab.$_disk
- if [[ $_disk == $ROOTDISK ]]; then
- if $AUTO && get_disklabel_template; then
- disklabel -T /disklabel.auto $FSTABFLAG $_f -w -A $_disk && return
- echo "Autopartitioning failed"
- exit 1
- fi
- while :; do
- echo "The auto-allocated layout for $_disk is:"
- disklabel -h -A $_disk | egrep "^# |^ [a-p]:"
- ask "Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout?" a
- case $resp in
- a*|A*) _op=-w ;;
- e*|E*) _op=-E ;;
- c*|C*) break ;;
- *) continue ;;
- esac
- disklabel $FSTABFLAG $_f $_op -A $_disk
- return
- done
- fi
+ disklabel_autolayout $_disk $_f || return
+ [[ -s $_f ]] && return
cat <<__EOT
-# $OpenBSD: install.md,v 1.31 2015/05/04 19:55:26 rpe Exp $
+# $OpenBSD: install.md,v 1.32 2015/05/31 19:40:10 rpe Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
}
md_prep_disklabel() {
- local _disk=$1 _f _op
+ local _disk=$1 _f=/tmp/fstab.$1
md_prep_fdisk $_disk
- _f=/tmp/fstab.$_disk
- if [[ $_disk == $ROOTDISK ]]; then
- if $AUTO && get_disklabel_template; then
- disklabel -T /disklabel.auto $FSTABFLAG $_f -w -A $_disk && return
- echo "Autopartitioning failed"
- exit 1
- fi
- while :; do
- echo "The auto-allocated layout for $_disk is:"
- disklabel -h -A $_disk | egrep "^# |^ [a-p]:"
- ask "Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout?" a
- case $resp in
- a*|A*) _op=-w ;;
- e*|E*) _op=-E ;;
- c*|C*) break ;;
- *) continue ;;
- esac
- disklabel $FSTABFLAG $_f $_op -A $_disk
- return
- done
- fi
+ disklabel_autolayout $_disk $_f || return
+ [[ -s $_f ]] && return
cat <<__EOT
-# $OpenBSD: install.md,v 1.17 2015/05/04 19:55:26 rpe Exp $
+# $OpenBSD: install.md,v 1.18 2015/05/31 19:40:10 rpe Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
}
md_prep_disklabel() {
- local _disk=$1 _f _op
+ local _disk=$1 _f=/tmp/fstab.$1
md_prep_fdisk $_disk
- _f=/tmp/fstab.$_disk
- if [[ $_disk == $ROOTDISK ]]; then
- if $AUTO && get_disklabel_template; then
- disklabel -T /disklabel.auto $FSTABFLAG $_f -w -A $_disk && return
- echo "Autopartitioning failed"
- exit 1
- fi
- while :; do
- echo "The auto-allocated layout for $_disk is:"
- disklabel -h -A $_disk | egrep "^# |^ [a-p]:"
- ask "Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout?" a
- case $resp in
- a*|A*) _op=-w ;;
- e*|E*) _op=-E ;;
- c*|C*) break ;;
- *) continue ;;
- esac
- disklabel $FSTABFLAG $_f $_op -A $_disk
- return
- done
- fi
+ disklabel_autolayout $_disk $_f || return
+ [[ -s $_f ]] && return
cat <<__EOT
-# $OpenBSD: install.md,v 1.19 2015/05/04 19:55:26 rpe Exp $
+# $OpenBSD: install.md,v 1.20 2015/05/31 19:40:10 rpe Exp $
# Copyright (c) 1996 The NetBSD Foundation, Inc.
# All rights reserved.
#
}
md_prep_disklabel() {
- local _disk=$1 _f _op
+ local _disk=$1 _f=/tmp/fstab.$1
+
+ disklabel_autolayout $_disk $_f || return
+ [[ -s $_f ]] && return
- _f=/tmp/fstab.$_disk
- if [[ $_disk == $ROOTDISK ]]; then
- if $AUTO && get_disklabel_template; then
- disklabel -T /disklabel.auto $FSTABFLAG $_f -w -A $_disk && return
- echo "Autopartitioning failed"
- exit 1
- fi
- while :; do
- echo "The auto-allocated layout for $_disk is:"
- disklabel -h -A $_disk | egrep "^# |^ [a-p]:"
- ask "Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout?" a
- case $resp in
- a*|A*) _op=-w ;;
- e*|E*) _op=-E ;;
- c*|C*) break ;;
- *) continue ;;
- esac
- disklabel $FSTABFLAG $_f $_op -A $_disk
- return
- done
- fi
cat <<__EOT
You will now create a OpenBSD disklabel on the disk. The disklabel defines
how OpenBSD splits up the disk into OpenBSD partitions in which filesystems
-# $OpenBSD: install.md,v 1.57 2015/05/04 19:55:26 rpe Exp $
+# $OpenBSD: install.md,v 1.58 2015/05/31 19:40:10 rpe Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
}
md_prep_disklabel() {
- local _disk=$1 _f _op
+ local _disk=$1 _f=/tmp/fstab.$1
PARTTABLE=
while [[ -z $PARTTABLE ]]; do
esac
done
- _f=/tmp/fstab.$_disk
- if [[ $_disk == $ROOTDISK ]]; then
- if $AUTO && get_disklabel_template; then
- disklabel -T /disklabel.auto $FSTABFLAG $_f -w -A $_disk && return
- echo "Autopartitioning failed"
- exit 1
- fi
- while :; do
- echo "The auto-allocated layout for $_disk is:"
- disklabel -h -A $_disk | egrep "^# |^ [a-p]:"
- ask "Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout?" a
- case $resp in
- a*|A*) _op=-w ;;
- e*|E*) _op=-E ;;
- c*|C*) break ;;
- *) continue ;;
- esac
- disklabel $FSTABFLAG $_f $_op -A $_disk
- return
- done
- fi
+ disklabel_autolayout $_disk $_f || return
+ [[ -s $_f ]] && return
cat <<__EOT
-# $OpenBSD: install.sub,v 1.841 2015/05/20 19:14:35 rpe Exp $
+# $OpenBSD: install.sub,v 1.842 2015/05/31 19:40:10 rpe Exp $
#
# Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback
# Copyright (c) 2015, Robert Peichaer <rpe@openbsd.org>
fi
}
+# Handle disklabel auto-layout during interactive installation and
+# autopartitioning during unattended installation for the root disk.
+# In the latter case, ask for and download autopartitioning template.
+# Abort unattended installation if autopartitioning fails.
+#
+# Parameters:
+#
+# $1 = disk
+# $2 = /path/to/fstab
+#
+disklabel_autolayout() {
+ local _disk=$1 _f=$2 _dl=/disklabel.auto _op
+
+ [[ $_disk != $ROOTDISK ]] && return
+
+ while $AUTO; do
+ ask "URL to autopartitioning template for disklabel?" none
+ [[ $resp == none ]] && break
+ echo "Fetching $resp"
+ if ftp -Vo $_dl "$resp" && [[ -s $_dl ]]; then
+ disklabel -T $_dl $FSTABFLAG $_f -w -A $_disk && return
+ echo "Autopartitioning failed"
+ exit 1
+ else
+ echo "No autopartitioning template found."
+ exit 1
+ fi
+ done
+
+ while :; do
+ echo "The auto-allocated layout for $_disk is:"
+ disklabel -h -A $_disk | egrep "^# |^ [a-p]:"
+ ask "Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout?" a
+ case $resp in
+ a*|A*) _op=-w ;;
+ e*|E*) _op=-E ;;
+ c*|C*) return 0 ;;
+ *) continue ;;
+ esac
+ disklabel $FSTABFLAG $_f $_op -A $_disk
+ return
+ done
+}
#-------------------------------------------------------------------------------
# Functions for the dmesg listener
SWAPDEV=${ROOTDISK}b
}
-# Ask for and download autopartitioning template for disklabel.
-get_disklabel_template() {
- local _dl=/disklabel.auto
-
- ask "URL to autopartitioning template for disklabel?" none
- [[ $resp == none ]] && return 1
- echo "Fetching $resp"
- ftp -Vo $_dl "$resp" && [[ -s $_dl ]] && return
- echo "No autopartitioning template found."
- exit 1
-}
-
# Start interface using the on-disk hostname.if file passed as argument $1.
# Much of this is gratuitously stolen from /etc/netstart.
ifstart () {
-# $OpenBSD: install.md,v 1.7 2015/05/04 19:55:26 rpe Exp $
+# $OpenBSD: install.md,v 1.8 2015/05/31 19:40:10 rpe Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
}
md_prep_disklabel() {
- local _disk=$1 _f _op
+ local _disk=$1 _f=/tmp/fstab.$1
md_prep_fdisk $_disk
- _f=/tmp/fstab.$_disk
- if [[ $_disk == $ROOTDISK ]]; then
- if $AUTO && get_disklabel_template; then
- disklabel -T /disklabel.auto $FSTABFLAG $_f -w -A $_disk && return
- echo "Autopartitioning failed"
- exit 1
- fi
- while :; do
- echo "The auto-allocated layout for $_disk is:"
- disklabel -h -A $_disk | egrep "^# |^ [a-p]:"
- ask "Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout?" a
- case $resp in
- a*|A*) _op=-w ;;
- e*|E*) _op=-E ;;
- c*|C*) break ;;
- *) continue ;;
- esac
- disklabel $FSTABFLAG $_f $_op -A $_disk
- return
- done
- fi
+ disklabel_autolayout $_disk $_f || return
+ [[ -s $_f ]] && return
cat <<__EOT
-# $OpenBSD: install.md,v 1.34 2015/05/04 19:55:26 rpe Exp $
+# $OpenBSD: install.md,v 1.35 2015/05/31 19:40:10 rpe Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
md_prep_disklabel()
{
- local _disk=$1 _f _op
+ local _disk=$1 _f=/tmp/fstab.$1
echo
echo "Checking SGI Volume Header:"
;;
esac
- _f=/tmp/fstab.$_disk
- if [[ $_disk == $ROOTDISK ]]; then
- if $AUTO && get_disklabel_template; then
- disklabel -T /disklabel.auto $FSTABFLAG $_f -w -A $_disk && return
- echo "Autopartitioning failed"
- exit 1
- fi
- while :; do
- echo "The auto-allocated layout for $_disk is:"
- disklabel -h -A $_disk | egrep "^# |^ [a-p]:"
- ask "Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout?" a
- case $resp in
- a*|A*) _op=-w ;;
- e*|E*) _op=-E ;;
- c*|C*) break ;;
- *) continue ;;
- esac
- disklabel $FSTABFLAG $_f $_op -A $_disk
- return
- done
- fi
+ disklabel_autolayout $_disk $_f || return
+ [[ -s $_f ]] && return
cat <<__EOT
-# $OpenBSD: install.md,v 1.19 2015/05/04 19:55:26 rpe Exp $
+# $OpenBSD: install.md,v 1.20 2015/05/31 19:40:10 rpe Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
}
md_prep_disklabel() {
- local _disk=$1 _f _op
+ local _disk=$1 _f=/tmp/fstab.$1
md_prep_fdisk $_disk
- _f=/tmp/fstab.$_disk
- if [[ $_disk == $ROOTDISK ]]; then
- if $AUTO && get_disklabel_template; then
- disklabel -T /disklabel.auto $FSTABFLAG $_f -w -A $_disk && return
- echo "Autopartitioning failed"
- exit 1
- fi
- while :; do
- echo "The auto-allocated layout for $_disk is:"
- disklabel -h -A $_disk | egrep "^# |^ [a-p]:"
- ask "Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout?" a
- case $resp in
- a*|A*) _op=-w ;;
- e*|E*) _op=-E ;;
- c*|C*) break ;;
- *) continue ;;
- esac
- disklabel $FSTABFLAG $_f $_op -A $_disk
- return
- done
- fi
+ disklabel_autolayout $_disk $_f || return
+ [[ -s $_f ]] && return
cat <<__EOT
-# $OpenBSD: install.md,v 1.71 2015/05/04 19:55:27 rpe Exp $
+# $OpenBSD: install.md,v 1.72 2015/05/31 19:40:10 rpe Exp $
# $NetBSD: install.md,v 1.3.2.5 1996/08/26 15:45:28 gwr Exp $
#
#
}
md_prep_disklabel() {
- local _disk=$1 _f _op
+ local _disk=$1 _f=/tmp/fstab.$1
+
+ disklabel_autolayout $_disk $_f || return
+ [[ -s $_f ]] && return
- _f=/tmp/fstab.$_disk
- if [[ $_disk == $ROOTDISK ]]; then
- if $AUTO && get_disklabel_template; then
- disklabel -T /disklabel.auto $FSTABFLAG $_f -w -A $_disk && return
- echo "Autopartitioning failed"
- exit 1
- fi
- while :; do
- echo "The auto-allocated layout for $_disk is:"
- disklabel -h -A $_disk | egrep "^# |^ [a-p]:"
- ask "Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout?" a
- case $resp in
- a*|A*) _op=-w ;;
- e*|E*) _op=-E ;;
- c*|C*) break ;;
- *) continue ;;
- esac
- disklabel $FSTABFLAG $_f $_op -A $_disk
- return
- done
- fi
cat <<__EOT
You will now create a Sun-style disklabel on the disk. The disklabel defines
-# $OpenBSD: install.md,v 1.43 2015/05/04 19:55:27 rpe Exp $
+# $OpenBSD: install.md,v 1.44 2015/05/31 19:40:11 rpe Exp $
# $NetBSD: install.md,v 1.3.2.5 1996/08/26 15:45:28 gwr Exp $
#
#
}
md_prep_disklabel() {
- local _disk=$1 _f _op
+ local _disk=$1 _f=/tmp/fstab.$1
+
+ disklabel_autolayout $_disk $_f || return
+ [[ -s $_f ]] && return
- _f=/tmp/fstab.$_disk
- if [[ $_disk == $ROOTDISK ]]; then
- if $AUTO && get_disklabel_template; then
- disklabel -T /disklabel.auto $FSTABFLAG $_f -w -A $_disk && return
- echo "Autopartitioning failed"
- exit 1
- fi
- while :; do
- echo "The auto-allocated layout for $_disk is:"
- disklabel -h -A $_disk | egrep "^# |^ [a-p]:"
- ask "Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout?" a
- case $resp in
- a*|A*) _op=-w ;;
- e*|E*) _op=-E ;;
- c*|C*) break ;;
- *) continue ;;
- esac
- disklabel $FSTABFLAG $_f $_op -A $_disk
- return
- done
- fi
cat <<__EOT
You will now create a Sun-style disklabel on the disk. The disklabel defines
-# $OpenBSD: install.md,v 1.43 2015/05/04 19:55:27 rpe Exp $
+# $OpenBSD: install.md,v 1.44 2015/05/31 19:40:11 rpe Exp $
# $NetBSD: install.md,v 1.3.2.5 1996/08/26 15:45:28 gwr Exp $
#
#
}
md_prep_disklabel() {
- local _disk=$1 _f _op
+ local _disk=$1 _f=/tmp/fstab.$1
+
+ disklabel_autolayout $_disk $_f || return
+ [[ -s $_f ]] && return
- _f=/tmp/fstab.$_disk
- if [[ $_disk == $ROOTDISK ]]; then
- if $AUTO && get_disklabel_template; then
- disklabel -T /disklabel.auto $FSTABFLAG $_f -w -A $_disk && return
- echo "Autopartitioning failed"
- exit 1
- fi
- while :; do
- echo "The auto-allocated layout for $_disk is:"
- disklabel -h -A $_disk | egrep "^# |^ [a-p]:"
- ask "Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout?" a
- case $resp in
- a*|A*) _op=-w ;;
- e*|E*) _op=-E ;;
- c*|C*) break ;;
- *) continue ;;
- esac
- disklabel $FSTABFLAG $_f $_op -A $_disk
- return
- done
- fi
cat <<__EOT
You will now create a OpenBSD disklabel on the disk. The disklabel defines
how OpenBSD splits up the disk into OpenBSD partitions in which filesystems
-# $OpenBSD: install.md,v 1.32 2015/05/04 19:55:27 rpe Exp $
+# $OpenBSD: install.md,v 1.33 2015/05/31 19:40:11 rpe Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
}
md_prep_disklabel() {
- local _disk=$1 _f _op
+ local _disk=$1 _f=/tmp/fstab.$1
md_prep_fdisk $_disk
- _f=/tmp/fstab.$_disk
- if [[ $_disk == $ROOTDISK ]]; then
- if $AUTO && get_disklabel_template; then
- disklabel -T /disklabel.auto $FSTABFLAG $_f -w -A $_disk && return
- echo "Autopartitioning failed"
- exit 1
- fi
- while :; do
- echo "The auto-allocated layout for $_disk is:"
- disklabel -h -A $_disk | egrep "^# |^ [a-p]:"
- ask "Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout?" a
- case $resp in
- a*|A*) _op=-w ;;
- e*|E*) _op=-E ;;
- c*|C*) break ;;
- *) continue ;;
- esac
- disklabel $FSTABFLAG $_f $_op -A $_disk
- return
- done
- fi
+ disklabel_autolayout $_disk $_f || return
+ [[ -s $_f ]] && return
cat <<__EOT