to the OpenBSD installer. It is available during unattended installation.
The template file is fetched from an url, provided as answer to a new
question in the response file:
URL to autopartitioning template for disklabel = url
Original diff from and OK henning@
'no objection' krw@
-# $OpenBSD: install.md,v 1.38 2014/08/15 09:45:54 rpe Exp $
+# $OpenBSD: install.md,v 1.39 2015/05/04 19:55:26 rpe Exp $
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
# All rights reserved.
_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]:"
-# $OpenBSD: install.md,v 1.37 2015/01/12 16:33:31 deraadt Exp $
+# $OpenBSD: install.md,v 1.38 2015/05/04 19:55:26 rpe Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
_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]:"
-# $OpenBSD: install.md,v 1.16 2013/11/16 18:37:26 rpe Exp $
+# $OpenBSD: install.md,v 1.17 2015/05/04 19:55:26 rpe Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
_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]:"
-# $OpenBSD: install.md,v 1.6 2015/01/26 01:55:55 jsg Exp $
+# $OpenBSD: install.md,v 1.7 2015/05/04 19:55:26 rpe Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
_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]:"
-# $OpenBSD: install.md,v 1.5 2014/08/15 09:45:54 rpe Exp $
+# $OpenBSD: install.md,v 1.6 2015/05/04 19:55:26 rpe Exp $
# Copyright (c) 1996 The NetBSD Foundation, Inc.
# All rights reserved.
#
_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]:"
-# $OpenBSD: install.md,v 1.27 2015/03/08 13:13:48 deraadt Exp $
+# $OpenBSD: install.md,v 1.28 2015/05/04 19:55:26 rpe Exp $
#
# machine dependent section of installation/upgrade script.
#
_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]:"
-# $OpenBSD: install.md,v 1.60 2015/01/12 16:33:31 deraadt Exp $
+# $OpenBSD: install.md,v 1.61 2015/05/04 19:55:26 rpe Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
_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]:"
-# $OpenBSD: install.md,v 1.30 2013/11/16 18:37:27 rpe Exp $
+# $OpenBSD: install.md,v 1.31 2015/05/04 19:55:26 rpe Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
_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]:"
-# $OpenBSD: install.md,v 1.16 2015/04/19 00:37:36 deraadt Exp $
+# $OpenBSD: install.md,v 1.17 2015/05/04 19:55:26 rpe Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
_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]:"
-# $OpenBSD: install.md,v 1.18 2014/08/15 09:45:54 rpe Exp $
+# $OpenBSD: install.md,v 1.19 2015/05/04 19:55:26 rpe Exp $
# Copyright (c) 1996 The NetBSD Foundation, Inc.
# All rights reserved.
#
_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]:"
-# $OpenBSD: install.md,v 1.56 2014/08/20 06:52:21 phessler Exp $
+# $OpenBSD: install.md,v 1.57 2015/05/04 19:55:26 rpe Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
_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]:"
-# $OpenBSD: install.sub,v 1.835 2015/04/28 21:41:40 sthen Exp $
+# $OpenBSD: install.sub,v 1.836 2015/05/04 19:55:26 rpe Exp $
#
# Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback
# Copyright (c) 2015, Robert Peichaer <rpe@openbsd.org>
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.6 2014/03/05 20:03:01 jasper Exp $
+# $OpenBSD: install.md,v 1.7 2015/05/04 19:55:26 rpe Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
_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]:"
-# $OpenBSD: install.md,v 1.33 2014/03/24 20:47:30 miod Exp $
+# $OpenBSD: install.md,v 1.34 2015/05/04 19:55:26 rpe Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
_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]:"
-# $OpenBSD: install.md,v 1.18 2013/11/16 18:37:27 rpe Exp $
+# $OpenBSD: install.md,v 1.19 2015/05/04 19:55:26 rpe Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
_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]:"
-# $OpenBSD: install.md,v 1.70 2015/03/11 15:21:50 deraadt Exp $
+# $OpenBSD: install.md,v 1.71 2015/05/04 19:55:27 rpe Exp $
# $NetBSD: install.md,v 1.3.2.5 1996/08/26 15:45:28 gwr Exp $
#
#
_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]:"
-# $OpenBSD: install.md,v 1.42 2014/11/22 15:02:27 deraadt Exp $
+# $OpenBSD: install.md,v 1.43 2015/05/04 19:55:27 rpe Exp $
# $NetBSD: install.md,v 1.3.2.5 1996/08/26 15:45:28 gwr Exp $
#
#
_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]:"
-# $OpenBSD: install.md,v 1.42 2014/03/22 02:24:43 krw Exp $
+# $OpenBSD: install.md,v 1.43 2015/05/04 19:55:27 rpe Exp $
# $NetBSD: install.md,v 1.3.2.5 1996/08/26 15:45:28 gwr Exp $
#
#
_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]:"
-# $OpenBSD: install.md,v 1.31 2014/08/06 16:13:48 ajacoutot Exp $
+# $OpenBSD: install.md,v 1.32 2015/05/04 19:55:27 rpe Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
_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]:"