History log of /openbsd-current/distrib/miniroot/dot.profile
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.51 20-Feb-2023 kn

Disable strict bourne shell mode to get ksh behaviour in (S)hell

Enable features like arithmatic expression and thus make the debug aid
`FUNCS_ONLY=1 . /install.sub' work in those prompts.

'!' answers spawn their own ksh process, but (S)hell drops into /.profile
sourced by /bin/sh executed by init(8), i.e. a korn shell defaulting to
strict bourne shell mode.

Shell options in this interactive parent shell do not effect install.sub
aka. /install, /autoinstall and /upgrade as it is executed in a child.

OK afresh1


Revision tags: OPENBSD_7_2_BASE
# 1.50 09-May-2022 deraadt

In a couple places, use set -m to cause subshells to gain process
groups, and then kill the process group instead of the ksh pid. Some
of these processes contain sleep, which kept running, and in some
cases retained stderr (or other fd) and confused parent processes.
In some cases, add manual wait. Finally, store the pid (nee pgrp)
in /tmp/xxpid files rather than variables, since there is a bit
of recursion and sub-shell confusion happening, and we have confused
ourselves at least twice with these pid variables not being in scope.
ok beck, with florian, ok kn
In snaps for almost a week. A few more tweaks may come in a while.


Revision tags: OPENBSD_7_0_BASE OPENBSD_7_1_BASE
# 1.49 08-Sep-2021 kn

Backout "Merge sysupgrade watchdog and prompt timeout code"
(commitid 0SH0ijktpPPcSctj)

"/autoinstall[2697]: start_timeout: not found" during non-interactive
upgrade, e.g. sysupgrade(8).

Reported by Joel Carnat <joel at carnat dot net>, thanks.


# 1.48 29-Aug-2021 kn

Merge sysupgrade watchdog and prompt timeout code

Provide TIMOUT_{ACTION,PERIOD_SEC} in {start,stop,reset}_timeout() to have
install.sub and dot.profile use the same mnemonic helpers.


# 1.47 29-Aug-2021 kn

Sync prompt timeout code with sysupgrade watchdog

Simplify code and employ the same technique in both places.
The "prompt timeout" hits when on non-interactive installations or upgrades:

Welcome to the OpenBSD/amd64 6.9 installation program.
Starting non-interactive mode in 5 seconds...
(I)nstall, (U)pgrade, (A)utoinstall or (S)hell?
Performing non-interactive upgrade...

The existing code uses a regular background job and does quirky file
descriptor fiddling just to avoid job control messages when starting the
timeout in the background.

It also does `set +m' a second time for no reason and hardodes the number of
seconds in multiple places.

Do better by using a co-process just like sysupgrade's watchdog that reboots
when the upgrade did not finish in time.

reads good to aja


# 1.46 21-Jul-2021 kn

Use exclusive lock under /dev/, silence expected errors in installer

resolvd(8), slaacd(8) and dhcpleased(8) are different from other daemons
in that there must only be a single instance.

resolvd already does this, adjust slaacd and dhcpleased accordingly while
moving the lockfile paths under /dev/ such that they work early on boot and
don't run into races should /var be (un)mounted between daemon starts.

Locking is especially required in the installer where all three daemons are
started every time the "(I)nstall, (U)pgrade, (A)utoinstall or (S)hell? "
prompt is entered, i.e. restarting installation or dropping into a shell
and back into the prompt again would start multiple instances.

To avoid expected lockfile error messages in between installer prompts,
discard standard error when starting the autoconf daemons; none of them
has other potential failure cases in installer mode before daemon(3)izing.

Input sthen deraadt
OK deraadt


# 1.45 16-Jul-2021 florian

Create working directories earlier so that resolvd can write
resolv.conf.shadow and start dhcpleased/resolvd.
OK deraadt


Revision tags: OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE OPENBSD_6_9_BASE
# 1.44 27-Apr-2019 kn

It's timer_pid not timeout_pid

There since introduction in 1.18 (2013).

OK halex


# 1.43 24-Apr-2019 florian

Perform unattended upgrade if /bsd.upgrade is present.
Sets are expected to be in /home/upgrade.
Original idea, input & OK deraadt


Revision tags: OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.42 13-Oct-2017 rpe

Move extraction of rootdisk information into the DONEPROFILE if-block.

OK tb@


# 1.41 13-Oct-2017 rpe

Comment trap handlers


# 1.40 13-Oct-2017 rpe

Tweak comments


# 1.39 13-Oct-2017 rpe

Add a comment for slaacd(8) start and replace the if-then-fi block
with a [[ test ]] && command construct.


Revision tags: OPENBSD_6_2_BASE
# 1.38 08-Jul-2017 florian

Enable slaacd on the installer and temporarily neuter router
advertisement processing and solicitation sending like we already did
for the non-install kernels.

Next step will be to tedu all that code from the kernel.

OK rpe@ for the installer bits
move forward deraadt@


Revision tags: OPENBSD_6_1_BASE
# 1.37 20-Feb-2017 rpe

Zap the extra echo and show the prompt using the var?'prompt' feature
of read.


# 1.36 09-Sep-2016 rpe

There were 3 ways of using shell at the initial prompt of the installer.
One is enough.

OK halex


# 1.35 05-Sep-2016 rpe

Tweak comments and spacing.

OK krw, halex


# 1.34 05-Sep-2016 rpe

Relax permissions to make files readable by unpriv users again.

Found out by naddy
OK deraadt


# 1.33 04-Sep-2016 rpe

Move files created by root during install/upgrade in a subdir of
/tmp with proper permissions so that unprivileged programs can not
tamper with them.

positive feedback from deraadt
OK halex


Revision tags: OPENBSD_6_0_BASE
# 1.32 08-Apr-2016 rpe

Directly assign device name to rootdisk with modified sed pattern.

With help from and OK halex@
OK krw@


# 1.31 02-Apr-2016 rpe

- merge install.sh into install.sub as do_install()
- merge upgrade.sh into install.sub as do_upgrade()
- delete install.sh and upgrade.sh
- make install.sub executable
- turn install and upgrade into symbolic links to install.sub
- add autoinstall symbolic link to install.sub
- change dot.profile to use these symlinks
- introduce a -m option to set MODE in install.sub
- alternativly set MODE and AUTO depending on PROGNAME
- execute the do_{install,upgrade) functions depending on $MODE

OK halex@, krw@
'go for it' deraadt@


Revision tags: OPENBSD_5_9_BASE
# 1.30 26-Jan-2016 rpe

spacing

OK krw@


Revision tags: OPENBSD_5_8_BASE
# 1.29 03-Jul-2015 rpe

Use [aA]* instead of a*|A* in case-blocks.

OK krw@
@halex agreed on this in a similar diff


# 1.28 01-Jul-2015 rpe

Use ksh style tests like in the rest of the installer scripts.

OK krw@ halex@


# 1.27 28-Mar-2015 rpe

- Start comments with capital letters.
- End comments with a full stop.

OK krw@


Revision tags: OPENBSD_5_7_BASE
# 1.26 23-Oct-2014 rpe

Extend autoinstall(8) feature:

- Ask for responsefile location (url or local path) if dhcp discovery
fails for location or mode. If 'next-server' is found in dhcp lease
file, provide a default url http://next-server/install.conf.

- Ask for installer mode if the specified response file name does not
match *install.conf or *upgrade.conf.

- If present, use /auto_install.conf or /auto_upgrade.conf as response
file for unattended installation or upgrade.

- Automatically start installer in unattended mode if either one of
these files is present when the system boots.

- Document changes in manpage and installation notes.

OK krw@ deraadt@


Revision tags: OPENBSD_5_6_BASE
# 1.25 16-Jul-2014 deraadt

spaces


Revision tags: OPENBSD_5_5_BASE
# 1.24 21-Feb-2014 deraadt

oops, seperate pieces coming...


# 1.23 21-Feb-2014 deraadt

services


# 1.22 16-Dec-2013 halex

Replace `[RESPONSEFILE=...] install auto` voodoo with plain'ol getopts,
as discussed with uwe@ at some point.

ok krw@, rpe@, "Cool" uwe@


# 1.21 02-Dec-2013 halex

As the number of interactively triggered (A)utoinstall's should be quite
outnumbered by (I)nstall's and (U)pgrade's, reorder the alternatives.

"sure" deraadt@


# 1.20 28-Nov-2013 rpe

Now, that the auto installer supports both, install and upgrade,
use "non-interactive mode" instead of installation.

ok deraadt@


# 1.19 14-Nov-2013 halex

fix ^C handling which was accidentally trapped a bit to much

ok rpe@ krw@


# 1.18 27-Oct-2013 uwe

Unattended installation using DHCP and a response file

For a completely unattended installation bsd.rd has to be netbooted,
a DHCP server must be running and provide "next-server", which will be
used to fetch "http://<next-server>/install.conf". The format of the
response file is a list of "<key> = <value>" pairs where <key> is a
substring of the interactive question (case-insensitive) and <value> is
what would be entered interactively.

Minimal response file example:

system hostname = openbsd
password for root account = <...>
network interfaces = re0
IPv4 address for re0 = dhcp
server? = <...>

This is a starting point, it still a bit rough.

ok krw@, many improvements by halex@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.17 08-Jul-2011 halex

make exiting the shell take you back to the inital prompt

"i like" henning@, "Fine with me" deraadt@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.16 30-Jun-2010 halex

revert last ^D behaviour change

requested and well explained by krw@


# 1.15 30-Jun-2010 halex

make the installer quit when ^D is pressed at any prompt

ok deraadt@


Revision tags: OPENBSD_4_7_BASE
# 1.14 10-Jan-2010 deraadt

remove and move some chatty byte during upgrade startup; ok krw, idea from mcbride


Revision tags: OPENBSD_4_6_BASE
# 1.13 12-Jun-2009 deraadt

Put back the once-only code that krw removed earlier, because we want ^C
from the install script to go to the # prompt, not back to the question.


# 1.12 07-Jun-2009 krw

More tersification. Fixes verbiage issue reported by jdixon@ on
icb.


# 1.11 04-Jun-2009 krw

Implement '!' and '!<cmd>' at the "(I)nstall ..." prompt so we
aren't lying about being able to do that at any prompt.

Suggested by deraadt@


# 1.10 04-Jun-2009 krw

Only print the intro verbiage once, instead of every pass through the "(I)nstall, ..."
loop.

Noticed by & ok deraadt@


# 1.9 03-Jun-2009 krw

Add hw.machine and kern.osrelease to install media sysctl. Using
these rather than hard coded variables allows the rationalization
of the greeting by moving it into dot.profile. Whack at dot.profile
a lot. Eliminate the 'Proceed with ...' question as unneeded.
Eliminate welcome().

ok deraadt@ "I like" todd@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.8 03-Aug-2008 krw

Sparc miniroot hasn't worked for a while, since the sed code to find
the root disk was broken. Simplify and fix said sed code. Problem
noted by okan@ and others, diagnosed by deraadt@, sed suggestions from
nordin@, jmc@, fgsch@, guenther@.

'get something in before sparc gets done' deraadt@


Revision tags: OPENBSD_4_3_BASE
# 1.7 16-Nov-2007 krw

Simplify the sed expression used to set 'rootdisk'. Shaves bytes from the
install media. From Tamas Tevesz.


Revision tags: OPENBSD_4_1_BASE OPENBSD_4_2_BASE
# 1.6 16-Feb-2007 deraadt

better X"" idiom in while loop; didickman@yahoo.com


Revision tags: OPENBSD_4_0_BASE
# 1.5 04-Mar-2006 krw

Put comment on separate line so it is stripped from install media.


Revision tags: OPENBSD_3_2_BASE OPENBSD_3_3_BASE OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.4 13-Sep-2002 deraadt

do not stty 9600


# 1.3 29-Aug-2002 krw

Add a new verb to list2sh.awk, 'REMOVE'. This allows the easy
disabling of '(U)pgrade' in architectures by adding

REMOVE upgrade

to the end of the 'list' file for that architecture.

Add code to dot.profile to check for the presence of the upgrade
script before offering to (U)pgrade.

Use the new verb to disable upgrades for sparc.

ok deraadt@.


# 1.2 09-Jun-2002 todd

knf


# 1.1 22-Apr-2002 deraadt

use one common dot.profile for all


# 1.50 09-May-2022 deraadt

In a couple places, use set -m to cause subshells to gain process
groups, and then kill the process group instead of the ksh pid. Some
of these processes contain sleep, which kept running, and in some
cases retained stderr (or other fd) and confused parent processes.
In some cases, add manual wait. Finally, store the pid (nee pgrp)
in /tmp/xxpid files rather than variables, since there is a bit
of recursion and sub-shell confusion happening, and we have confused
ourselves at least twice with these pid variables not being in scope.
ok beck, with florian, ok kn
In snaps for almost a week. A few more tweaks may come in a while.


Revision tags: OPENBSD_7_0_BASE OPENBSD_7_1_BASE
# 1.49 08-Sep-2021 kn

Backout "Merge sysupgrade watchdog and prompt timeout code"
(commitid 0SH0ijktpPPcSctj)

"/autoinstall[2697]: start_timeout: not found" during non-interactive
upgrade, e.g. sysupgrade(8).

Reported by Joel Carnat <joel at carnat dot net>, thanks.


# 1.48 29-Aug-2021 kn

Merge sysupgrade watchdog and prompt timeout code

Provide TIMOUT_{ACTION,PERIOD_SEC} in {start,stop,reset}_timeout() to have
install.sub and dot.profile use the same mnemonic helpers.


# 1.47 29-Aug-2021 kn

Sync prompt timeout code with sysupgrade watchdog

Simplify code and employ the same technique in both places.
The "prompt timeout" hits when on non-interactive installations or upgrades:

Welcome to the OpenBSD/amd64 6.9 installation program.
Starting non-interactive mode in 5 seconds...
(I)nstall, (U)pgrade, (A)utoinstall or (S)hell?
Performing non-interactive upgrade...

The existing code uses a regular background job and does quirky file
descriptor fiddling just to avoid job control messages when starting the
timeout in the background.

It also does `set +m' a second time for no reason and hardodes the number of
seconds in multiple places.

Do better by using a co-process just like sysupgrade's watchdog that reboots
when the upgrade did not finish in time.

reads good to aja


# 1.46 21-Jul-2021 kn

Use exclusive lock under /dev/, silence expected errors in installer

resolvd(8), slaacd(8) and dhcpleased(8) are different from other daemons
in that there must only be a single instance.

resolvd already does this, adjust slaacd and dhcpleased accordingly while
moving the lockfile paths under /dev/ such that they work early on boot and
don't run into races should /var be (un)mounted between daemon starts.

Locking is especially required in the installer where all three daemons are
started every time the "(I)nstall, (U)pgrade, (A)utoinstall or (S)hell? "
prompt is entered, i.e. restarting installation or dropping into a shell
and back into the prompt again would start multiple instances.

To avoid expected lockfile error messages in between installer prompts,
discard standard error when starting the autoconf daemons; none of them
has other potential failure cases in installer mode before daemon(3)izing.

Input sthen deraadt
OK deraadt


# 1.45 16-Jul-2021 florian

Create working directories earlier so that resolvd can write
resolv.conf.shadow and start dhcpleased/resolvd.
OK deraadt


Revision tags: OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE OPENBSD_6_9_BASE
# 1.44 27-Apr-2019 kn

It's timer_pid not timeout_pid

There since introduction in 1.18 (2013).

OK halex


# 1.43 24-Apr-2019 florian

Perform unattended upgrade if /bsd.upgrade is present.
Sets are expected to be in /home/upgrade.
Original idea, input & OK deraadt


Revision tags: OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.42 13-Oct-2017 rpe

Move extraction of rootdisk information into the DONEPROFILE if-block.

OK tb@


# 1.41 13-Oct-2017 rpe

Comment trap handlers


# 1.40 13-Oct-2017 rpe

Tweak comments


# 1.39 13-Oct-2017 rpe

Add a comment for slaacd(8) start and replace the if-then-fi block
with a [[ test ]] && command construct.


Revision tags: OPENBSD_6_2_BASE
# 1.38 08-Jul-2017 florian

Enable slaacd on the installer and temporarily neuter router
advertisement processing and solicitation sending like we already did
for the non-install kernels.

Next step will be to tedu all that code from the kernel.

OK rpe@ for the installer bits
move forward deraadt@


Revision tags: OPENBSD_6_1_BASE
# 1.37 20-Feb-2017 rpe

Zap the extra echo and show the prompt using the var?'prompt' feature
of read.


# 1.36 09-Sep-2016 rpe

There were 3 ways of using shell at the initial prompt of the installer.
One is enough.

OK halex


# 1.35 05-Sep-2016 rpe

Tweak comments and spacing.

OK krw, halex


# 1.34 05-Sep-2016 rpe

Relax permissions to make files readable by unpriv users again.

Found out by naddy
OK deraadt


# 1.33 04-Sep-2016 rpe

Move files created by root during install/upgrade in a subdir of
/tmp with proper permissions so that unprivileged programs can not
tamper with them.

positive feedback from deraadt
OK halex


Revision tags: OPENBSD_6_0_BASE
# 1.32 08-Apr-2016 rpe

Directly assign device name to rootdisk with modified sed pattern.

With help from and OK halex@
OK krw@


# 1.31 02-Apr-2016 rpe

- merge install.sh into install.sub as do_install()
- merge upgrade.sh into install.sub as do_upgrade()
- delete install.sh and upgrade.sh
- make install.sub executable
- turn install and upgrade into symbolic links to install.sub
- add autoinstall symbolic link to install.sub
- change dot.profile to use these symlinks
- introduce a -m option to set MODE in install.sub
- alternativly set MODE and AUTO depending on PROGNAME
- execute the do_{install,upgrade) functions depending on $MODE

OK halex@, krw@
'go for it' deraadt@


Revision tags: OPENBSD_5_9_BASE
# 1.30 26-Jan-2016 rpe

spacing

OK krw@


Revision tags: OPENBSD_5_8_BASE
# 1.29 03-Jul-2015 rpe

Use [aA]* instead of a*|A* in case-blocks.

OK krw@
@halex agreed on this in a similar diff


# 1.28 01-Jul-2015 rpe

Use ksh style tests like in the rest of the installer scripts.

OK krw@ halex@


# 1.27 28-Mar-2015 rpe

- Start comments with capital letters.
- End comments with a full stop.

OK krw@


Revision tags: OPENBSD_5_7_BASE
# 1.26 23-Oct-2014 rpe

Extend autoinstall(8) feature:

- Ask for responsefile location (url or local path) if dhcp discovery
fails for location or mode. If 'next-server' is found in dhcp lease
file, provide a default url http://next-server/install.conf.

- Ask for installer mode if the specified response file name does not
match *install.conf or *upgrade.conf.

- If present, use /auto_install.conf or /auto_upgrade.conf as response
file for unattended installation or upgrade.

- Automatically start installer in unattended mode if either one of
these files is present when the system boots.

- Document changes in manpage and installation notes.

OK krw@ deraadt@


Revision tags: OPENBSD_5_6_BASE
# 1.25 16-Jul-2014 deraadt

spaces


Revision tags: OPENBSD_5_5_BASE
# 1.24 21-Feb-2014 deraadt

oops, seperate pieces coming...


# 1.23 21-Feb-2014 deraadt

services


# 1.22 16-Dec-2013 halex

Replace `[RESPONSEFILE=...] install auto` voodoo with plain'ol getopts,
as discussed with uwe@ at some point.

ok krw@, rpe@, "Cool" uwe@


# 1.21 02-Dec-2013 halex

As the number of interactively triggered (A)utoinstall's should be quite
outnumbered by (I)nstall's and (U)pgrade's, reorder the alternatives.

"sure" deraadt@


# 1.20 28-Nov-2013 rpe

Now, that the auto installer supports both, install and upgrade,
use "non-interactive mode" instead of installation.

ok deraadt@


# 1.19 14-Nov-2013 halex

fix ^C handling which was accidentally trapped a bit to much

ok rpe@ krw@


# 1.18 27-Oct-2013 uwe

Unattended installation using DHCP and a response file

For a completely unattended installation bsd.rd has to be netbooted,
a DHCP server must be running and provide "next-server", which will be
used to fetch "http://<next-server>/install.conf". The format of the
response file is a list of "<key> = <value>" pairs where <key> is a
substring of the interactive question (case-insensitive) and <value> is
what would be entered interactively.

Minimal response file example:

system hostname = openbsd
password for root account = <...>
network interfaces = re0
IPv4 address for re0 = dhcp
server? = <...>

This is a starting point, it still a bit rough.

ok krw@, many improvements by halex@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.17 08-Jul-2011 halex

make exiting the shell take you back to the inital prompt

"i like" henning@, "Fine with me" deraadt@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.16 30-Jun-2010 halex

revert last ^D behaviour change

requested and well explained by krw@


# 1.15 30-Jun-2010 halex

make the installer quit when ^D is pressed at any prompt

ok deraadt@


Revision tags: OPENBSD_4_7_BASE
# 1.14 10-Jan-2010 deraadt

remove and move some chatty byte during upgrade startup; ok krw, idea from mcbride


Revision tags: OPENBSD_4_6_BASE
# 1.13 12-Jun-2009 deraadt

Put back the once-only code that krw removed earlier, because we want ^C
from the install script to go to the # prompt, not back to the question.


# 1.12 07-Jun-2009 krw

More tersification. Fixes verbiage issue reported by jdixon@ on
icb.


# 1.11 04-Jun-2009 krw

Implement '!' and '!<cmd>' at the "(I)nstall ..." prompt so we
aren't lying about being able to do that at any prompt.

Suggested by deraadt@


# 1.10 04-Jun-2009 krw

Only print the intro verbiage once, instead of every pass through the "(I)nstall, ..."
loop.

Noticed by & ok deraadt@


# 1.9 03-Jun-2009 krw

Add hw.machine and kern.osrelease to install media sysctl. Using
these rather than hard coded variables allows the rationalization
of the greeting by moving it into dot.profile. Whack at dot.profile
a lot. Eliminate the 'Proceed with ...' question as unneeded.
Eliminate welcome().

ok deraadt@ "I like" todd@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.8 03-Aug-2008 krw

Sparc miniroot hasn't worked for a while, since the sed code to find
the root disk was broken. Simplify and fix said sed code. Problem
noted by okan@ and others, diagnosed by deraadt@, sed suggestions from
nordin@, jmc@, fgsch@, guenther@.

'get something in before sparc gets done' deraadt@


Revision tags: OPENBSD_4_3_BASE
# 1.7 16-Nov-2007 krw

Simplify the sed expression used to set 'rootdisk'. Shaves bytes from the
install media. From Tamas Tevesz.


Revision tags: OPENBSD_4_1_BASE OPENBSD_4_2_BASE
# 1.6 16-Feb-2007 deraadt

better X"" idiom in while loop; didickman@yahoo.com


Revision tags: OPENBSD_4_0_BASE
# 1.5 04-Mar-2006 krw

Put comment on separate line so it is stripped from install media.


Revision tags: OPENBSD_3_2_BASE OPENBSD_3_3_BASE OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.4 13-Sep-2002 deraadt

do not stty 9600


# 1.3 29-Aug-2002 krw

Add a new verb to list2sh.awk, 'REMOVE'. This allows the easy
disabling of '(U)pgrade' in architectures by adding

REMOVE upgrade

to the end of the 'list' file for that architecture.

Add code to dot.profile to check for the presence of the upgrade
script before offering to (U)pgrade.

Use the new verb to disable upgrades for sparc.

ok deraadt@.


# 1.2 09-Jun-2002 todd

knf


# 1.1 22-Apr-2002 deraadt

use one common dot.profile for all


# 1.49 08-Sep-2021 kn

Backout "Merge sysupgrade watchdog and prompt timeout code"
(commitid 0SH0ijktpPPcSctj)

"/autoinstall[2697]: start_timeout: not found" during non-interactive
upgrade, e.g. sysupgrade(8).

Reported by Joel Carnat <joel at carnat dot net>, thanks.


# 1.48 29-Aug-2021 kn

Merge sysupgrade watchdog and prompt timeout code

Provide TIMOUT_{ACTION,PERIOD_SEC} in {start,stop,reset}_timeout() to have
install.sub and dot.profile use the same mnemonic helpers.


# 1.47 29-Aug-2021 kn

Sync prompt timeout code with sysupgrade watchdog

Simplify code and employ the same technique in both places.
The "prompt timeout" hits when on non-interactive installations or upgrades:

Welcome to the OpenBSD/amd64 6.9 installation program.
Starting non-interactive mode in 5 seconds...
(I)nstall, (U)pgrade, (A)utoinstall or (S)hell?
Performing non-interactive upgrade...

The existing code uses a regular background job and does quirky file
descriptor fiddling just to avoid job control messages when starting the
timeout in the background.

It also does `set +m' a second time for no reason and hardodes the number of
seconds in multiple places.

Do better by using a co-process just like sysupgrade's watchdog that reboots
when the upgrade did not finish in time.

reads good to aja


# 1.46 21-Jul-2021 kn

Use exclusive lock under /dev/, silence expected errors in installer

resolvd(8), slaacd(8) and dhcpleased(8) are different from other daemons
in that there must only be a single instance.

resolvd already does this, adjust slaacd and dhcpleased accordingly while
moving the lockfile paths under /dev/ such that they work early on boot and
don't run into races should /var be (un)mounted between daemon starts.

Locking is especially required in the installer where all three daemons are
started every time the "(I)nstall, (U)pgrade, (A)utoinstall or (S)hell? "
prompt is entered, i.e. restarting installation or dropping into a shell
and back into the prompt again would start multiple instances.

To avoid expected lockfile error messages in between installer prompts,
discard standard error when starting the autoconf daemons; none of them
has other potential failure cases in installer mode before daemon(3)izing.

Input sthen deraadt
OK deraadt


# 1.45 16-Jul-2021 florian

Create working directories earlier so that resolvd can write
resolv.conf.shadow and start dhcpleased/resolvd.
OK deraadt


Revision tags: OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE OPENBSD_6_9_BASE
# 1.44 27-Apr-2019 kn

It's timer_pid not timeout_pid

There since introduction in 1.18 (2013).

OK halex


# 1.43 24-Apr-2019 florian

Perform unattended upgrade if /bsd.upgrade is present.
Sets are expected to be in /home/upgrade.
Original idea, input & OK deraadt


Revision tags: OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.42 13-Oct-2017 rpe

Move extraction of rootdisk information into the DONEPROFILE if-block.

OK tb@


# 1.41 13-Oct-2017 rpe

Comment trap handlers


# 1.40 13-Oct-2017 rpe

Tweak comments


# 1.39 13-Oct-2017 rpe

Add a comment for slaacd(8) start and replace the if-then-fi block
with a [[ test ]] && command construct.


Revision tags: OPENBSD_6_2_BASE
# 1.38 08-Jul-2017 florian

Enable slaacd on the installer and temporarily neuter router
advertisement processing and solicitation sending like we already did
for the non-install kernels.

Next step will be to tedu all that code from the kernel.

OK rpe@ for the installer bits
move forward deraadt@


Revision tags: OPENBSD_6_1_BASE
# 1.37 20-Feb-2017 rpe

Zap the extra echo and show the prompt using the var?'prompt' feature
of read.


# 1.36 09-Sep-2016 rpe

There were 3 ways of using shell at the initial prompt of the installer.
One is enough.

OK halex


# 1.35 05-Sep-2016 rpe

Tweak comments and spacing.

OK krw, halex


# 1.34 05-Sep-2016 rpe

Relax permissions to make files readable by unpriv users again.

Found out by naddy
OK deraadt


# 1.33 04-Sep-2016 rpe

Move files created by root during install/upgrade in a subdir of
/tmp with proper permissions so that unprivileged programs can not
tamper with them.

positive feedback from deraadt
OK halex


Revision tags: OPENBSD_6_0_BASE
# 1.32 08-Apr-2016 rpe

Directly assign device name to rootdisk with modified sed pattern.

With help from and OK halex@
OK krw@


# 1.31 02-Apr-2016 rpe

- merge install.sh into install.sub as do_install()
- merge upgrade.sh into install.sub as do_upgrade()
- delete install.sh and upgrade.sh
- make install.sub executable
- turn install and upgrade into symbolic links to install.sub
- add autoinstall symbolic link to install.sub
- change dot.profile to use these symlinks
- introduce a -m option to set MODE in install.sub
- alternativly set MODE and AUTO depending on PROGNAME
- execute the do_{install,upgrade) functions depending on $MODE

OK halex@, krw@
'go for it' deraadt@


Revision tags: OPENBSD_5_9_BASE
# 1.30 26-Jan-2016 rpe

spacing

OK krw@


Revision tags: OPENBSD_5_8_BASE
# 1.29 03-Jul-2015 rpe

Use [aA]* instead of a*|A* in case-blocks.

OK krw@
@halex agreed on this in a similar diff


# 1.28 01-Jul-2015 rpe

Use ksh style tests like in the rest of the installer scripts.

OK krw@ halex@


# 1.27 28-Mar-2015 rpe

- Start comments with capital letters.
- End comments with a full stop.

OK krw@


Revision tags: OPENBSD_5_7_BASE
# 1.26 23-Oct-2014 rpe

Extend autoinstall(8) feature:

- Ask for responsefile location (url or local path) if dhcp discovery
fails for location or mode. If 'next-server' is found in dhcp lease
file, provide a default url http://next-server/install.conf.

- Ask for installer mode if the specified response file name does not
match *install.conf or *upgrade.conf.

- If present, use /auto_install.conf or /auto_upgrade.conf as response
file for unattended installation or upgrade.

- Automatically start installer in unattended mode if either one of
these files is present when the system boots.

- Document changes in manpage and installation notes.

OK krw@ deraadt@


Revision tags: OPENBSD_5_6_BASE
# 1.25 16-Jul-2014 deraadt

spaces


Revision tags: OPENBSD_5_5_BASE
# 1.24 21-Feb-2014 deraadt

oops, seperate pieces coming...


# 1.23 21-Feb-2014 deraadt

services


# 1.22 16-Dec-2013 halex

Replace `[RESPONSEFILE=...] install auto` voodoo with plain'ol getopts,
as discussed with uwe@ at some point.

ok krw@, rpe@, "Cool" uwe@


# 1.21 02-Dec-2013 halex

As the number of interactively triggered (A)utoinstall's should be quite
outnumbered by (I)nstall's and (U)pgrade's, reorder the alternatives.

"sure" deraadt@


# 1.20 28-Nov-2013 rpe

Now, that the auto installer supports both, install and upgrade,
use "non-interactive mode" instead of installation.

ok deraadt@


# 1.19 14-Nov-2013 halex

fix ^C handling which was accidentally trapped a bit to much

ok rpe@ krw@


# 1.18 27-Oct-2013 uwe

Unattended installation using DHCP and a response file

For a completely unattended installation bsd.rd has to be netbooted,
a DHCP server must be running and provide "next-server", which will be
used to fetch "http://<next-server>/install.conf". The format of the
response file is a list of "<key> = <value>" pairs where <key> is a
substring of the interactive question (case-insensitive) and <value> is
what would be entered interactively.

Minimal response file example:

system hostname = openbsd
password for root account = <...>
network interfaces = re0
IPv4 address for re0 = dhcp
server? = <...>

This is a starting point, it still a bit rough.

ok krw@, many improvements by halex@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.17 08-Jul-2011 halex

make exiting the shell take you back to the inital prompt

"i like" henning@, "Fine with me" deraadt@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.16 30-Jun-2010 halex

revert last ^D behaviour change

requested and well explained by krw@


# 1.15 30-Jun-2010 halex

make the installer quit when ^D is pressed at any prompt

ok deraadt@


Revision tags: OPENBSD_4_7_BASE
# 1.14 10-Jan-2010 deraadt

remove and move some chatty byte during upgrade startup; ok krw, idea from mcbride


Revision tags: OPENBSD_4_6_BASE
# 1.13 12-Jun-2009 deraadt

Put back the once-only code that krw removed earlier, because we want ^C
from the install script to go to the # prompt, not back to the question.


# 1.12 07-Jun-2009 krw

More tersification. Fixes verbiage issue reported by jdixon@ on
icb.


# 1.11 04-Jun-2009 krw

Implement '!' and '!<cmd>' at the "(I)nstall ..." prompt so we
aren't lying about being able to do that at any prompt.

Suggested by deraadt@


# 1.10 04-Jun-2009 krw

Only print the intro verbiage once, instead of every pass through the "(I)nstall, ..."
loop.

Noticed by & ok deraadt@


# 1.9 03-Jun-2009 krw

Add hw.machine and kern.osrelease to install media sysctl. Using
these rather than hard coded variables allows the rationalization
of the greeting by moving it into dot.profile. Whack at dot.profile
a lot. Eliminate the 'Proceed with ...' question as unneeded.
Eliminate welcome().

ok deraadt@ "I like" todd@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.8 03-Aug-2008 krw

Sparc miniroot hasn't worked for a while, since the sed code to find
the root disk was broken. Simplify and fix said sed code. Problem
noted by okan@ and others, diagnosed by deraadt@, sed suggestions from
nordin@, jmc@, fgsch@, guenther@.

'get something in before sparc gets done' deraadt@


Revision tags: OPENBSD_4_3_BASE
# 1.7 16-Nov-2007 krw

Simplify the sed expression used to set 'rootdisk'. Shaves bytes from the
install media. From Tamas Tevesz.


Revision tags: OPENBSD_4_1_BASE OPENBSD_4_2_BASE
# 1.6 16-Feb-2007 deraadt

better X"" idiom in while loop; didickman@yahoo.com


Revision tags: OPENBSD_4_0_BASE
# 1.5 04-Mar-2006 krw

Put comment on separate line so it is stripped from install media.


Revision tags: OPENBSD_3_2_BASE OPENBSD_3_3_BASE OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.4 13-Sep-2002 deraadt

do not stty 9600


# 1.3 29-Aug-2002 krw

Add a new verb to list2sh.awk, 'REMOVE'. This allows the easy
disabling of '(U)pgrade' in architectures by adding

REMOVE upgrade

to the end of the 'list' file for that architecture.

Add code to dot.profile to check for the presence of the upgrade
script before offering to (U)pgrade.

Use the new verb to disable upgrades for sparc.

ok deraadt@.


# 1.2 09-Jun-2002 todd

knf


# 1.1 22-Apr-2002 deraadt

use one common dot.profile for all


# 1.48 29-Aug-2021 kn

Merge sysupgrade watchdog and prompt timeout code

Provide TIMOUT_{ACTION,PERIOD_SEC} in {start,stop,reset}_timeout() to have
install.sub and dot.profile use the same mnemonic helpers.


# 1.47 29-Aug-2021 kn

Sync prompt timeout code with sysupgrade watchdog

Simplify code and employ the same technique in both places.
The "prompt timeout" hits when on non-interactive installations or upgrades:

Welcome to the OpenBSD/amd64 6.9 installation program.
Starting non-interactive mode in 5 seconds...
(I)nstall, (U)pgrade, (A)utoinstall or (S)hell?
Performing non-interactive upgrade...

The existing code uses a regular background job and does quirky file
descriptor fiddling just to avoid job control messages when starting the
timeout in the background.

It also does `set +m' a second time for no reason and hardodes the number of
seconds in multiple places.

Do better by using a co-process just like sysupgrade's watchdog that reboots
when the upgrade did not finish in time.

reads good to aja


# 1.46 21-Jul-2021 kn

Use exclusive lock under /dev/, silence expected errors in installer

resolvd(8), slaacd(8) and dhcpleased(8) are different from other daemons
in that there must only be a single instance.

resolvd already does this, adjust slaacd and dhcpleased accordingly while
moving the lockfile paths under /dev/ such that they work early on boot and
don't run into races should /var be (un)mounted between daemon starts.

Locking is especially required in the installer where all three daemons are
started every time the "(I)nstall, (U)pgrade, (A)utoinstall or (S)hell? "
prompt is entered, i.e. restarting installation or dropping into a shell
and back into the prompt again would start multiple instances.

To avoid expected lockfile error messages in between installer prompts,
discard standard error when starting the autoconf daemons; none of them
has other potential failure cases in installer mode before daemon(3)izing.

Input sthen deraadt
OK deraadt


# 1.45 16-Jul-2021 florian

Create working directories earlier so that resolvd can write
resolv.conf.shadow and start dhcpleased/resolvd.
OK deraadt


Revision tags: OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE OPENBSD_6_9_BASE
# 1.44 27-Apr-2019 kn

It's timer_pid not timeout_pid

There since introduction in 1.18 (2013).

OK halex


# 1.43 24-Apr-2019 florian

Perform unattended upgrade if /bsd.upgrade is present.
Sets are expected to be in /home/upgrade.
Original idea, input & OK deraadt


Revision tags: OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.42 13-Oct-2017 rpe

Move extraction of rootdisk information into the DONEPROFILE if-block.

OK tb@


# 1.41 13-Oct-2017 rpe

Comment trap handlers


# 1.40 13-Oct-2017 rpe

Tweak comments


# 1.39 13-Oct-2017 rpe

Add a comment for slaacd(8) start and replace the if-then-fi block
with a [[ test ]] && command construct.


Revision tags: OPENBSD_6_2_BASE
# 1.38 08-Jul-2017 florian

Enable slaacd on the installer and temporarily neuter router
advertisement processing and solicitation sending like we already did
for the non-install kernels.

Next step will be to tedu all that code from the kernel.

OK rpe@ for the installer bits
move forward deraadt@


Revision tags: OPENBSD_6_1_BASE
# 1.37 20-Feb-2017 rpe

Zap the extra echo and show the prompt using the var?'prompt' feature
of read.


# 1.36 09-Sep-2016 rpe

There were 3 ways of using shell at the initial prompt of the installer.
One is enough.

OK halex


# 1.35 05-Sep-2016 rpe

Tweak comments and spacing.

OK krw, halex


# 1.34 05-Sep-2016 rpe

Relax permissions to make files readable by unpriv users again.

Found out by naddy
OK deraadt


# 1.33 04-Sep-2016 rpe

Move files created by root during install/upgrade in a subdir of
/tmp with proper permissions so that unprivileged programs can not
tamper with them.

positive feedback from deraadt
OK halex


Revision tags: OPENBSD_6_0_BASE
# 1.32 08-Apr-2016 rpe

Directly assign device name to rootdisk with modified sed pattern.

With help from and OK halex@
OK krw@


# 1.31 02-Apr-2016 rpe

- merge install.sh into install.sub as do_install()
- merge upgrade.sh into install.sub as do_upgrade()
- delete install.sh and upgrade.sh
- make install.sub executable
- turn install and upgrade into symbolic links to install.sub
- add autoinstall symbolic link to install.sub
- change dot.profile to use these symlinks
- introduce a -m option to set MODE in install.sub
- alternativly set MODE and AUTO depending on PROGNAME
- execute the do_{install,upgrade) functions depending on $MODE

OK halex@, krw@
'go for it' deraadt@


Revision tags: OPENBSD_5_9_BASE
# 1.30 26-Jan-2016 rpe

spacing

OK krw@


Revision tags: OPENBSD_5_8_BASE
# 1.29 03-Jul-2015 rpe

Use [aA]* instead of a*|A* in case-blocks.

OK krw@
@halex agreed on this in a similar diff


# 1.28 01-Jul-2015 rpe

Use ksh style tests like in the rest of the installer scripts.

OK krw@ halex@


# 1.27 28-Mar-2015 rpe

- Start comments with capital letters.
- End comments with a full stop.

OK krw@


Revision tags: OPENBSD_5_7_BASE
# 1.26 23-Oct-2014 rpe

Extend autoinstall(8) feature:

- Ask for responsefile location (url or local path) if dhcp discovery
fails for location or mode. If 'next-server' is found in dhcp lease
file, provide a default url http://next-server/install.conf.

- Ask for installer mode if the specified response file name does not
match *install.conf or *upgrade.conf.

- If present, use /auto_install.conf or /auto_upgrade.conf as response
file for unattended installation or upgrade.

- Automatically start installer in unattended mode if either one of
these files is present when the system boots.

- Document changes in manpage and installation notes.

OK krw@ deraadt@


Revision tags: OPENBSD_5_6_BASE
# 1.25 16-Jul-2014 deraadt

spaces


Revision tags: OPENBSD_5_5_BASE
# 1.24 21-Feb-2014 deraadt

oops, seperate pieces coming...


# 1.23 21-Feb-2014 deraadt

services


# 1.22 16-Dec-2013 halex

Replace `[RESPONSEFILE=...] install auto` voodoo with plain'ol getopts,
as discussed with uwe@ at some point.

ok krw@, rpe@, "Cool" uwe@


# 1.21 02-Dec-2013 halex

As the number of interactively triggered (A)utoinstall's should be quite
outnumbered by (I)nstall's and (U)pgrade's, reorder the alternatives.

"sure" deraadt@


# 1.20 28-Nov-2013 rpe

Now, that the auto installer supports both, install and upgrade,
use "non-interactive mode" instead of installation.

ok deraadt@


# 1.19 14-Nov-2013 halex

fix ^C handling which was accidentally trapped a bit to much

ok rpe@ krw@


# 1.18 27-Oct-2013 uwe

Unattended installation using DHCP and a response file

For a completely unattended installation bsd.rd has to be netbooted,
a DHCP server must be running and provide "next-server", which will be
used to fetch "http://<next-server>/install.conf". The format of the
response file is a list of "<key> = <value>" pairs where <key> is a
substring of the interactive question (case-insensitive) and <value> is
what would be entered interactively.

Minimal response file example:

system hostname = openbsd
password for root account = <...>
network interfaces = re0
IPv4 address for re0 = dhcp
server? = <...>

This is a starting point, it still a bit rough.

ok krw@, many improvements by halex@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.17 08-Jul-2011 halex

make exiting the shell take you back to the inital prompt

"i like" henning@, "Fine with me" deraadt@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.16 30-Jun-2010 halex

revert last ^D behaviour change

requested and well explained by krw@


# 1.15 30-Jun-2010 halex

make the installer quit when ^D is pressed at any prompt

ok deraadt@


Revision tags: OPENBSD_4_7_BASE
# 1.14 10-Jan-2010 deraadt

remove and move some chatty byte during upgrade startup; ok krw, idea from mcbride


Revision tags: OPENBSD_4_6_BASE
# 1.13 12-Jun-2009 deraadt

Put back the once-only code that krw removed earlier, because we want ^C
from the install script to go to the # prompt, not back to the question.


# 1.12 07-Jun-2009 krw

More tersification. Fixes verbiage issue reported by jdixon@ on
icb.


# 1.11 04-Jun-2009 krw

Implement '!' and '!<cmd>' at the "(I)nstall ..." prompt so we
aren't lying about being able to do that at any prompt.

Suggested by deraadt@


# 1.10 04-Jun-2009 krw

Only print the intro verbiage once, instead of every pass through the "(I)nstall, ..."
loop.

Noticed by & ok deraadt@


# 1.9 03-Jun-2009 krw

Add hw.machine and kern.osrelease to install media sysctl. Using
these rather than hard coded variables allows the rationalization
of the greeting by moving it into dot.profile. Whack at dot.profile
a lot. Eliminate the 'Proceed with ...' question as unneeded.
Eliminate welcome().

ok deraadt@ "I like" todd@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.8 03-Aug-2008 krw

Sparc miniroot hasn't worked for a while, since the sed code to find
the root disk was broken. Simplify and fix said sed code. Problem
noted by okan@ and others, diagnosed by deraadt@, sed suggestions from
nordin@, jmc@, fgsch@, guenther@.

'get something in before sparc gets done' deraadt@


Revision tags: OPENBSD_4_3_BASE
# 1.7 16-Nov-2007 krw

Simplify the sed expression used to set 'rootdisk'. Shaves bytes from the
install media. From Tamas Tevesz.


Revision tags: OPENBSD_4_1_BASE OPENBSD_4_2_BASE
# 1.6 16-Feb-2007 deraadt

better X"" idiom in while loop; didickman@yahoo.com


Revision tags: OPENBSD_4_0_BASE
# 1.5 04-Mar-2006 krw

Put comment on separate line so it is stripped from install media.


Revision tags: OPENBSD_3_2_BASE OPENBSD_3_3_BASE OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.4 13-Sep-2002 deraadt

do not stty 9600


# 1.3 29-Aug-2002 krw

Add a new verb to list2sh.awk, 'REMOVE'. This allows the easy
disabling of '(U)pgrade' in architectures by adding

REMOVE upgrade

to the end of the 'list' file for that architecture.

Add code to dot.profile to check for the presence of the upgrade
script before offering to (U)pgrade.

Use the new verb to disable upgrades for sparc.

ok deraadt@.


# 1.2 09-Jun-2002 todd

knf


# 1.1 22-Apr-2002 deraadt

use one common dot.profile for all


# 1.46 21-Jul-2021 kn

Use exclusive lock under /dev/, silence expected errors in installer

resolvd(8), slaacd(8) and dhcpleased(8) are different from other daemons
in that there must only be a single instance.

resolvd already does this, adjust slaacd and dhcpleased accordingly while
moving the lockfile paths under /dev/ such that they work early on boot and
don't run into races should /var be (un)mounted between daemon starts.

Locking is especially required in the installer where all three daemons are
started every time the "(I)nstall, (U)pgrade, (A)utoinstall or (S)hell? "
prompt is entered, i.e. restarting installation or dropping into a shell
and back into the prompt again would start multiple instances.

To avoid expected lockfile error messages in between installer prompts,
discard standard error when starting the autoconf daemons; none of them
has other potential failure cases in installer mode before daemon(3)izing.

Input sthen deraadt
OK deraadt


# 1.45 16-Jul-2021 florian

Create working directories earlier so that resolvd can write
resolv.conf.shadow and start dhcpleased/resolvd.
OK deraadt


Revision tags: OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE OPENBSD_6_9_BASE
# 1.44 27-Apr-2019 kn

It's timer_pid not timeout_pid

There since introduction in 1.18 (2013).

OK halex


# 1.43 24-Apr-2019 florian

Perform unattended upgrade if /bsd.upgrade is present.
Sets are expected to be in /home/upgrade.
Original idea, input & OK deraadt


Revision tags: OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.42 13-Oct-2017 rpe

Move extraction of rootdisk information into the DONEPROFILE if-block.

OK tb@


# 1.41 13-Oct-2017 rpe

Comment trap handlers


# 1.40 13-Oct-2017 rpe

Tweak comments


# 1.39 13-Oct-2017 rpe

Add a comment for slaacd(8) start and replace the if-then-fi block
with a [[ test ]] && command construct.


Revision tags: OPENBSD_6_2_BASE
# 1.38 08-Jul-2017 florian

Enable slaacd on the installer and temporarily neuter router
advertisement processing and solicitation sending like we already did
for the non-install kernels.

Next step will be to tedu all that code from the kernel.

OK rpe@ for the installer bits
move forward deraadt@


Revision tags: OPENBSD_6_1_BASE
# 1.37 20-Feb-2017 rpe

Zap the extra echo and show the prompt using the var?'prompt' feature
of read.


# 1.36 09-Sep-2016 rpe

There were 3 ways of using shell at the initial prompt of the installer.
One is enough.

OK halex


# 1.35 05-Sep-2016 rpe

Tweak comments and spacing.

OK krw, halex


# 1.34 05-Sep-2016 rpe

Relax permissions to make files readable by unpriv users again.

Found out by naddy
OK deraadt


# 1.33 04-Sep-2016 rpe

Move files created by root during install/upgrade in a subdir of
/tmp with proper permissions so that unprivileged programs can not
tamper with them.

positive feedback from deraadt
OK halex


Revision tags: OPENBSD_6_0_BASE
# 1.32 08-Apr-2016 rpe

Directly assign device name to rootdisk with modified sed pattern.

With help from and OK halex@
OK krw@


# 1.31 02-Apr-2016 rpe

- merge install.sh into install.sub as do_install()
- merge upgrade.sh into install.sub as do_upgrade()
- delete install.sh and upgrade.sh
- make install.sub executable
- turn install and upgrade into symbolic links to install.sub
- add autoinstall symbolic link to install.sub
- change dot.profile to use these symlinks
- introduce a -m option to set MODE in install.sub
- alternativly set MODE and AUTO depending on PROGNAME
- execute the do_{install,upgrade) functions depending on $MODE

OK halex@, krw@
'go for it' deraadt@


Revision tags: OPENBSD_5_9_BASE
# 1.30 26-Jan-2016 rpe

spacing

OK krw@


Revision tags: OPENBSD_5_8_BASE
# 1.29 03-Jul-2015 rpe

Use [aA]* instead of a*|A* in case-blocks.

OK krw@
@halex agreed on this in a similar diff


# 1.28 01-Jul-2015 rpe

Use ksh style tests like in the rest of the installer scripts.

OK krw@ halex@


# 1.27 28-Mar-2015 rpe

- Start comments with capital letters.
- End comments with a full stop.

OK krw@


Revision tags: OPENBSD_5_7_BASE
# 1.26 23-Oct-2014 rpe

Extend autoinstall(8) feature:

- Ask for responsefile location (url or local path) if dhcp discovery
fails for location or mode. If 'next-server' is found in dhcp lease
file, provide a default url http://next-server/install.conf.

- Ask for installer mode if the specified response file name does not
match *install.conf or *upgrade.conf.

- If present, use /auto_install.conf or /auto_upgrade.conf as response
file for unattended installation or upgrade.

- Automatically start installer in unattended mode if either one of
these files is present when the system boots.

- Document changes in manpage and installation notes.

OK krw@ deraadt@


Revision tags: OPENBSD_5_6_BASE
# 1.25 16-Jul-2014 deraadt

spaces


Revision tags: OPENBSD_5_5_BASE
# 1.24 21-Feb-2014 deraadt

oops, seperate pieces coming...


# 1.23 21-Feb-2014 deraadt

services


# 1.22 16-Dec-2013 halex

Replace `[RESPONSEFILE=...] install auto` voodoo with plain'ol getopts,
as discussed with uwe@ at some point.

ok krw@, rpe@, "Cool" uwe@


# 1.21 02-Dec-2013 halex

As the number of interactively triggered (A)utoinstall's should be quite
outnumbered by (I)nstall's and (U)pgrade's, reorder the alternatives.

"sure" deraadt@


# 1.20 28-Nov-2013 rpe

Now, that the auto installer supports both, install and upgrade,
use "non-interactive mode" instead of installation.

ok deraadt@


# 1.19 14-Nov-2013 halex

fix ^C handling which was accidentally trapped a bit to much

ok rpe@ krw@


# 1.18 27-Oct-2013 uwe

Unattended installation using DHCP and a response file

For a completely unattended installation bsd.rd has to be netbooted,
a DHCP server must be running and provide "next-server", which will be
used to fetch "http://<next-server>/install.conf". The format of the
response file is a list of "<key> = <value>" pairs where <key> is a
substring of the interactive question (case-insensitive) and <value> is
what would be entered interactively.

Minimal response file example:

system hostname = openbsd
password for root account = <...>
network interfaces = re0
IPv4 address for re0 = dhcp
server? = <...>

This is a starting point, it still a bit rough.

ok krw@, many improvements by halex@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.17 08-Jul-2011 halex

make exiting the shell take you back to the inital prompt

"i like" henning@, "Fine with me" deraadt@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.16 30-Jun-2010 halex

revert last ^D behaviour change

requested and well explained by krw@


# 1.15 30-Jun-2010 halex

make the installer quit when ^D is pressed at any prompt

ok deraadt@


Revision tags: OPENBSD_4_7_BASE
# 1.14 10-Jan-2010 deraadt

remove and move some chatty byte during upgrade startup; ok krw, idea from mcbride


Revision tags: OPENBSD_4_6_BASE
# 1.13 12-Jun-2009 deraadt

Put back the once-only code that krw removed earlier, because we want ^C
from the install script to go to the # prompt, not back to the question.


# 1.12 07-Jun-2009 krw

More tersification. Fixes verbiage issue reported by jdixon@ on
icb.


# 1.11 04-Jun-2009 krw

Implement '!' and '!<cmd>' at the "(I)nstall ..." prompt so we
aren't lying about being able to do that at any prompt.

Suggested by deraadt@


# 1.10 04-Jun-2009 krw

Only print the intro verbiage once, instead of every pass through the "(I)nstall, ..."
loop.

Noticed by & ok deraadt@


# 1.9 03-Jun-2009 krw

Add hw.machine and kern.osrelease to install media sysctl. Using
these rather than hard coded variables allows the rationalization
of the greeting by moving it into dot.profile. Whack at dot.profile
a lot. Eliminate the 'Proceed with ...' question as unneeded.
Eliminate welcome().

ok deraadt@ "I like" todd@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.8 03-Aug-2008 krw

Sparc miniroot hasn't worked for a while, since the sed code to find
the root disk was broken. Simplify and fix said sed code. Problem
noted by okan@ and others, diagnosed by deraadt@, sed suggestions from
nordin@, jmc@, fgsch@, guenther@.

'get something in before sparc gets done' deraadt@


Revision tags: OPENBSD_4_3_BASE
# 1.7 16-Nov-2007 krw

Simplify the sed expression used to set 'rootdisk'. Shaves bytes from the
install media. From Tamas Tevesz.


Revision tags: OPENBSD_4_1_BASE OPENBSD_4_2_BASE
# 1.6 16-Feb-2007 deraadt

better X"" idiom in while loop; didickman@yahoo.com


Revision tags: OPENBSD_4_0_BASE
# 1.5 04-Mar-2006 krw

Put comment on separate line so it is stripped from install media.


Revision tags: OPENBSD_3_2_BASE OPENBSD_3_3_BASE OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.4 13-Sep-2002 deraadt

do not stty 9600


# 1.3 29-Aug-2002 krw

Add a new verb to list2sh.awk, 'REMOVE'. This allows the easy
disabling of '(U)pgrade' in architectures by adding

REMOVE upgrade

to the end of the 'list' file for that architecture.

Add code to dot.profile to check for the presence of the upgrade
script before offering to (U)pgrade.

Use the new verb to disable upgrades for sparc.

ok deraadt@.


# 1.2 09-Jun-2002 todd

knf


# 1.1 22-Apr-2002 deraadt

use one common dot.profile for all


# 1.45 16-Jul-2021 florian

Create working directories earlier so that resolvd can write
resolv.conf.shadow and start dhcpleased/resolvd.
OK deraadt


Revision tags: OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE OPENBSD_6_9_BASE
# 1.44 27-Apr-2019 kn

It's timer_pid not timeout_pid

There since introduction in 1.18 (2013).

OK halex


# 1.43 24-Apr-2019 florian

Perform unattended upgrade if /bsd.upgrade is present.
Sets are expected to be in /home/upgrade.
Original idea, input & OK deraadt


Revision tags: OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.42 13-Oct-2017 rpe

Move extraction of rootdisk information into the DONEPROFILE if-block.

OK tb@


# 1.41 13-Oct-2017 rpe

Comment trap handlers


# 1.40 13-Oct-2017 rpe

Tweak comments


# 1.39 13-Oct-2017 rpe

Add a comment for slaacd(8) start and replace the if-then-fi block
with a [[ test ]] && command construct.


Revision tags: OPENBSD_6_2_BASE
# 1.38 08-Jul-2017 florian

Enable slaacd on the installer and temporarily neuter router
advertisement processing and solicitation sending like we already did
for the non-install kernels.

Next step will be to tedu all that code from the kernel.

OK rpe@ for the installer bits
move forward deraadt@


Revision tags: OPENBSD_6_1_BASE
# 1.37 20-Feb-2017 rpe

Zap the extra echo and show the prompt using the var?'prompt' feature
of read.


# 1.36 09-Sep-2016 rpe

There were 3 ways of using shell at the initial prompt of the installer.
One is enough.

OK halex


# 1.35 05-Sep-2016 rpe

Tweak comments and spacing.

OK krw, halex


# 1.34 05-Sep-2016 rpe

Relax permissions to make files readable by unpriv users again.

Found out by naddy
OK deraadt


# 1.33 04-Sep-2016 rpe

Move files created by root during install/upgrade in a subdir of
/tmp with proper permissions so that unprivileged programs can not
tamper with them.

positive feedback from deraadt
OK halex


Revision tags: OPENBSD_6_0_BASE
# 1.32 08-Apr-2016 rpe

Directly assign device name to rootdisk with modified sed pattern.

With help from and OK halex@
OK krw@


# 1.31 02-Apr-2016 rpe

- merge install.sh into install.sub as do_install()
- merge upgrade.sh into install.sub as do_upgrade()
- delete install.sh and upgrade.sh
- make install.sub executable
- turn install and upgrade into symbolic links to install.sub
- add autoinstall symbolic link to install.sub
- change dot.profile to use these symlinks
- introduce a -m option to set MODE in install.sub
- alternativly set MODE and AUTO depending on PROGNAME
- execute the do_{install,upgrade) functions depending on $MODE

OK halex@, krw@
'go for it' deraadt@


Revision tags: OPENBSD_5_9_BASE
# 1.30 26-Jan-2016 rpe

spacing

OK krw@


Revision tags: OPENBSD_5_8_BASE
# 1.29 03-Jul-2015 rpe

Use [aA]* instead of a*|A* in case-blocks.

OK krw@
@halex agreed on this in a similar diff


# 1.28 01-Jul-2015 rpe

Use ksh style tests like in the rest of the installer scripts.

OK krw@ halex@


# 1.27 28-Mar-2015 rpe

- Start comments with capital letters.
- End comments with a full stop.

OK krw@


Revision tags: OPENBSD_5_7_BASE
# 1.26 23-Oct-2014 rpe

Extend autoinstall(8) feature:

- Ask for responsefile location (url or local path) if dhcp discovery
fails for location or mode. If 'next-server' is found in dhcp lease
file, provide a default url http://next-server/install.conf.

- Ask for installer mode if the specified response file name does not
match *install.conf or *upgrade.conf.

- If present, use /auto_install.conf or /auto_upgrade.conf as response
file for unattended installation or upgrade.

- Automatically start installer in unattended mode if either one of
these files is present when the system boots.

- Document changes in manpage and installation notes.

OK krw@ deraadt@


Revision tags: OPENBSD_5_6_BASE
# 1.25 16-Jul-2014 deraadt

spaces


Revision tags: OPENBSD_5_5_BASE
# 1.24 21-Feb-2014 deraadt

oops, seperate pieces coming...


# 1.23 21-Feb-2014 deraadt

services


# 1.22 16-Dec-2013 halex

Replace `[RESPONSEFILE=...] install auto` voodoo with plain'ol getopts,
as discussed with uwe@ at some point.

ok krw@, rpe@, "Cool" uwe@


# 1.21 02-Dec-2013 halex

As the number of interactively triggered (A)utoinstall's should be quite
outnumbered by (I)nstall's and (U)pgrade's, reorder the alternatives.

"sure" deraadt@


# 1.20 28-Nov-2013 rpe

Now, that the auto installer supports both, install and upgrade,
use "non-interactive mode" instead of installation.

ok deraadt@


# 1.19 14-Nov-2013 halex

fix ^C handling which was accidentally trapped a bit to much

ok rpe@ krw@


# 1.18 27-Oct-2013 uwe

Unattended installation using DHCP and a response file

For a completely unattended installation bsd.rd has to be netbooted,
a DHCP server must be running and provide "next-server", which will be
used to fetch "http://<next-server>/install.conf". The format of the
response file is a list of "<key> = <value>" pairs where <key> is a
substring of the interactive question (case-insensitive) and <value> is
what would be entered interactively.

Minimal response file example:

system hostname = openbsd
password for root account = <...>
network interfaces = re0
IPv4 address for re0 = dhcp
server? = <...>

This is a starting point, it still a bit rough.

ok krw@, many improvements by halex@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.17 08-Jul-2011 halex

make exiting the shell take you back to the inital prompt

"i like" henning@, "Fine with me" deraadt@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.16 30-Jun-2010 halex

revert last ^D behaviour change

requested and well explained by krw@


# 1.15 30-Jun-2010 halex

make the installer quit when ^D is pressed at any prompt

ok deraadt@


Revision tags: OPENBSD_4_7_BASE
# 1.14 10-Jan-2010 deraadt

remove and move some chatty byte during upgrade startup; ok krw, idea from mcbride


Revision tags: OPENBSD_4_6_BASE
# 1.13 12-Jun-2009 deraadt

Put back the once-only code that krw removed earlier, because we want ^C
from the install script to go to the # prompt, not back to the question.


# 1.12 07-Jun-2009 krw

More tersification. Fixes verbiage issue reported by jdixon@ on
icb.


# 1.11 04-Jun-2009 krw

Implement '!' and '!<cmd>' at the "(I)nstall ..." prompt so we
aren't lying about being able to do that at any prompt.

Suggested by deraadt@


# 1.10 04-Jun-2009 krw

Only print the intro verbiage once, instead of every pass through the "(I)nstall, ..."
loop.

Noticed by & ok deraadt@


# 1.9 03-Jun-2009 krw

Add hw.machine and kern.osrelease to install media sysctl. Using
these rather than hard coded variables allows the rationalization
of the greeting by moving it into dot.profile. Whack at dot.profile
a lot. Eliminate the 'Proceed with ...' question as unneeded.
Eliminate welcome().

ok deraadt@ "I like" todd@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.8 03-Aug-2008 krw

Sparc miniroot hasn't worked for a while, since the sed code to find
the root disk was broken. Simplify and fix said sed code. Problem
noted by okan@ and others, diagnosed by deraadt@, sed suggestions from
nordin@, jmc@, fgsch@, guenther@.

'get something in before sparc gets done' deraadt@


Revision tags: OPENBSD_4_3_BASE
# 1.7 16-Nov-2007 krw

Simplify the sed expression used to set 'rootdisk'. Shaves bytes from the
install media. From Tamas Tevesz.


Revision tags: OPENBSD_4_1_BASE OPENBSD_4_2_BASE
# 1.6 16-Feb-2007 deraadt

better X"" idiom in while loop; didickman@yahoo.com


Revision tags: OPENBSD_4_0_BASE
# 1.5 04-Mar-2006 krw

Put comment on separate line so it is stripped from install media.


Revision tags: OPENBSD_3_2_BASE OPENBSD_3_3_BASE OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.4 13-Sep-2002 deraadt

do not stty 9600


# 1.3 29-Aug-2002 krw

Add a new verb to list2sh.awk, 'REMOVE'. This allows the easy
disabling of '(U)pgrade' in architectures by adding

REMOVE upgrade

to the end of the 'list' file for that architecture.

Add code to dot.profile to check for the presence of the upgrade
script before offering to (U)pgrade.

Use the new verb to disable upgrades for sparc.

ok deraadt@.


# 1.2 09-Jun-2002 todd

knf


# 1.1 22-Apr-2002 deraadt

use one common dot.profile for all


# 1.44 27-Apr-2019 kn

It's timer_pid not timeout_pid

There since introduction in 1.18 (2013).

OK halex


# 1.43 24-Apr-2019 florian

Perform unattended upgrade if /bsd.upgrade is present.
Sets are expected to be in /home/upgrade.
Original idea, input & OK deraadt


Revision tags: OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.42 13-Oct-2017 rpe

Move extraction of rootdisk information into the DONEPROFILE if-block.

OK tb@


# 1.41 13-Oct-2017 rpe

Comment trap handlers


# 1.40 13-Oct-2017 rpe

Tweak comments


# 1.39 13-Oct-2017 rpe

Add a comment for slaacd(8) start and replace the if-then-fi block
with a [[ test ]] && command construct.


Revision tags: OPENBSD_6_2_BASE
# 1.38 08-Jul-2017 florian

Enable slaacd on the installer and temporarily neuter router
advertisement processing and solicitation sending like we already did
for the non-install kernels.

Next step will be to tedu all that code from the kernel.

OK rpe@ for the installer bits
move forward deraadt@


Revision tags: OPENBSD_6_1_BASE
# 1.37 20-Feb-2017 rpe

Zap the extra echo and show the prompt using the var?'prompt' feature
of read.


# 1.36 09-Sep-2016 rpe

There were 3 ways of using shell at the initial prompt of the installer.
One is enough.

OK halex


# 1.35 05-Sep-2016 rpe

Tweak comments and spacing.

OK krw, halex


# 1.34 05-Sep-2016 rpe

Relax permissions to make files readable by unpriv users again.

Found out by naddy
OK deraadt


# 1.33 04-Sep-2016 rpe

Move files created by root during install/upgrade in a subdir of
/tmp with proper permissions so that unprivileged programs can not
tamper with them.

positive feedback from deraadt
OK halex


Revision tags: OPENBSD_6_0_BASE
# 1.32 08-Apr-2016 rpe

Directly assign device name to rootdisk with modified sed pattern.

With help from and OK halex@
OK krw@


# 1.31 02-Apr-2016 rpe

- merge install.sh into install.sub as do_install()
- merge upgrade.sh into install.sub as do_upgrade()
- delete install.sh and upgrade.sh
- make install.sub executable
- turn install and upgrade into symbolic links to install.sub
- add autoinstall symbolic link to install.sub
- change dot.profile to use these symlinks
- introduce a -m option to set MODE in install.sub
- alternativly set MODE and AUTO depending on PROGNAME
- execute the do_{install,upgrade) functions depending on $MODE

OK halex@, krw@
'go for it' deraadt@


Revision tags: OPENBSD_5_9_BASE
# 1.30 26-Jan-2016 rpe

spacing

OK krw@


Revision tags: OPENBSD_5_8_BASE
# 1.29 03-Jul-2015 rpe

Use [aA]* instead of a*|A* in case-blocks.

OK krw@
@halex agreed on this in a similar diff


# 1.28 01-Jul-2015 rpe

Use ksh style tests like in the rest of the installer scripts.

OK krw@ halex@


# 1.27 28-Mar-2015 rpe

- Start comments with capital letters.
- End comments with a full stop.

OK krw@


Revision tags: OPENBSD_5_7_BASE
# 1.26 23-Oct-2014 rpe

Extend autoinstall(8) feature:

- Ask for responsefile location (url or local path) if dhcp discovery
fails for location or mode. If 'next-server' is found in dhcp lease
file, provide a default url http://next-server/install.conf.

- Ask for installer mode if the specified response file name does not
match *install.conf or *upgrade.conf.

- If present, use /auto_install.conf or /auto_upgrade.conf as response
file for unattended installation or upgrade.

- Automatically start installer in unattended mode if either one of
these files is present when the system boots.

- Document changes in manpage and installation notes.

OK krw@ deraadt@


Revision tags: OPENBSD_5_6_BASE
# 1.25 16-Jul-2014 deraadt

spaces


Revision tags: OPENBSD_5_5_BASE
# 1.24 21-Feb-2014 deraadt

oops, seperate pieces coming...


# 1.23 21-Feb-2014 deraadt

services


# 1.22 16-Dec-2013 halex

Replace `[RESPONSEFILE=...] install auto` voodoo with plain'ol getopts,
as discussed with uwe@ at some point.

ok krw@, rpe@, "Cool" uwe@


# 1.21 02-Dec-2013 halex

As the number of interactively triggered (A)utoinstall's should be quite
outnumbered by (I)nstall's and (U)pgrade's, reorder the alternatives.

"sure" deraadt@


# 1.20 28-Nov-2013 rpe

Now, that the auto installer supports both, install and upgrade,
use "non-interactive mode" instead of installation.

ok deraadt@


# 1.19 14-Nov-2013 halex

fix ^C handling which was accidentally trapped a bit to much

ok rpe@ krw@


# 1.18 27-Oct-2013 uwe

Unattended installation using DHCP and a response file

For a completely unattended installation bsd.rd has to be netbooted,
a DHCP server must be running and provide "next-server", which will be
used to fetch "http://<next-server>/install.conf". The format of the
response file is a list of "<key> = <value>" pairs where <key> is a
substring of the interactive question (case-insensitive) and <value> is
what would be entered interactively.

Minimal response file example:

system hostname = openbsd
password for root account = <...>
network interfaces = re0
IPv4 address for re0 = dhcp
server? = <...>

This is a starting point, it still a bit rough.

ok krw@, many improvements by halex@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.17 08-Jul-2011 halex

make exiting the shell take you back to the inital prompt

"i like" henning@, "Fine with me" deraadt@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.16 30-Jun-2010 halex

revert last ^D behaviour change

requested and well explained by krw@


# 1.15 30-Jun-2010 halex

make the installer quit when ^D is pressed at any prompt

ok deraadt@


Revision tags: OPENBSD_4_7_BASE
# 1.14 10-Jan-2010 deraadt

remove and move some chatty byte during upgrade startup; ok krw, idea from mcbride


Revision tags: OPENBSD_4_6_BASE
# 1.13 12-Jun-2009 deraadt

Put back the once-only code that krw removed earlier, because we want ^C
from the install script to go to the # prompt, not back to the question.


# 1.12 07-Jun-2009 krw

More tersification. Fixes verbiage issue reported by jdixon@ on
icb.


# 1.11 04-Jun-2009 krw

Implement '!' and '!<cmd>' at the "(I)nstall ..." prompt so we
aren't lying about being able to do that at any prompt.

Suggested by deraadt@


# 1.10 04-Jun-2009 krw

Only print the intro verbiage once, instead of every pass through the "(I)nstall, ..."
loop.

Noticed by & ok deraadt@


# 1.9 03-Jun-2009 krw

Add hw.machine and kern.osrelease to install media sysctl. Using
these rather than hard coded variables allows the rationalization
of the greeting by moving it into dot.profile. Whack at dot.profile
a lot. Eliminate the 'Proceed with ...' question as unneeded.
Eliminate welcome().

ok deraadt@ "I like" todd@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.8 03-Aug-2008 krw

Sparc miniroot hasn't worked for a while, since the sed code to find
the root disk was broken. Simplify and fix said sed code. Problem
noted by okan@ and others, diagnosed by deraadt@, sed suggestions from
nordin@, jmc@, fgsch@, guenther@.

'get something in before sparc gets done' deraadt@


Revision tags: OPENBSD_4_3_BASE
# 1.7 16-Nov-2007 krw

Simplify the sed expression used to set 'rootdisk'. Shaves bytes from the
install media. From Tamas Tevesz.


Revision tags: OPENBSD_4_1_BASE OPENBSD_4_2_BASE
# 1.6 16-Feb-2007 deraadt

better X"" idiom in while loop; didickman@yahoo.com


Revision tags: OPENBSD_4_0_BASE
# 1.5 04-Mar-2006 krw

Put comment on separate line so it is stripped from install media.


Revision tags: OPENBSD_3_2_BASE OPENBSD_3_3_BASE OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.4 13-Sep-2002 deraadt

do not stty 9600


# 1.3 29-Aug-2002 krw

Add a new verb to list2sh.awk, 'REMOVE'. This allows the easy
disabling of '(U)pgrade' in architectures by adding

REMOVE upgrade

to the end of the 'list' file for that architecture.

Add code to dot.profile to check for the presence of the upgrade
script before offering to (U)pgrade.

Use the new verb to disable upgrades for sparc.

ok deraadt@.


# 1.2 09-Jun-2002 todd

knf


# 1.1 22-Apr-2002 deraadt

use one common dot.profile for all


# 1.42 13-Oct-2017 rpe

Move extraction of rootdisk information into the DONEPROFILE if-block.

OK tb@


# 1.41 13-Oct-2017 rpe

Comment trap handlers


# 1.40 13-Oct-2017 rpe

Tweak comments


# 1.39 13-Oct-2017 rpe

Add a comment for slaacd(8) start and replace the if-then-fi block
with a [[ test ]] && command construct.


Revision tags: OPENBSD_6_2_BASE
# 1.38 08-Jul-2017 florian

Enable slaacd on the installer and temporarily neuter router
advertisement processing and solicitation sending like we already did
for the non-install kernels.

Next step will be to tedu all that code from the kernel.

OK rpe@ for the installer bits
move forward deraadt@


Revision tags: OPENBSD_6_1_BASE
# 1.37 20-Feb-2017 rpe

Zap the extra echo and show the prompt using the var?'prompt' feature
of read.


# 1.36 09-Sep-2016 rpe

There were 3 ways of using shell at the initial prompt of the installer.
One is enough.

OK halex


# 1.35 05-Sep-2016 rpe

Tweak comments and spacing.

OK krw, halex


# 1.34 05-Sep-2016 rpe

Relax permissions to make files readable by unpriv users again.

Found out by naddy
OK deraadt


# 1.33 04-Sep-2016 rpe

Move files created by root during install/upgrade in a subdir of
/tmp with proper permissions so that unprivileged programs can not
tamper with them.

positive feedback from deraadt
OK halex


Revision tags: OPENBSD_6_0_BASE
# 1.32 08-Apr-2016 rpe

Directly assign device name to rootdisk with modified sed pattern.

With help from and OK halex@
OK krw@


# 1.31 02-Apr-2016 rpe

- merge install.sh into install.sub as do_install()
- merge upgrade.sh into install.sub as do_upgrade()
- delete install.sh and upgrade.sh
- make install.sub executable
- turn install and upgrade into symbolic links to install.sub
- add autoinstall symbolic link to install.sub
- change dot.profile to use these symlinks
- introduce a -m option to set MODE in install.sub
- alternativly set MODE and AUTO depending on PROGNAME
- execute the do_{install,upgrade) functions depending on $MODE

OK halex@, krw@
'go for it' deraadt@


Revision tags: OPENBSD_5_9_BASE
# 1.30 26-Jan-2016 rpe

spacing

OK krw@


Revision tags: OPENBSD_5_8_BASE
# 1.29 03-Jul-2015 rpe

Use [aA]* instead of a*|A* in case-blocks.

OK krw@
@halex agreed on this in a similar diff


# 1.28 01-Jul-2015 rpe

Use ksh style tests like in the rest of the installer scripts.

OK krw@ halex@


# 1.27 28-Mar-2015 rpe

- Start comments with capital letters.
- End comments with a full stop.

OK krw@


Revision tags: OPENBSD_5_7_BASE
# 1.26 23-Oct-2014 rpe

Extend autoinstall(8) feature:

- Ask for responsefile location (url or local path) if dhcp discovery
fails for location or mode. If 'next-server' is found in dhcp lease
file, provide a default url http://next-server/install.conf.

- Ask for installer mode if the specified response file name does not
match *install.conf or *upgrade.conf.

- If present, use /auto_install.conf or /auto_upgrade.conf as response
file for unattended installation or upgrade.

- Automatically start installer in unattended mode if either one of
these files is present when the system boots.

- Document changes in manpage and installation notes.

OK krw@ deraadt@


Revision tags: OPENBSD_5_6_BASE
# 1.25 16-Jul-2014 deraadt

spaces


Revision tags: OPENBSD_5_5_BASE
# 1.24 21-Feb-2014 deraadt

oops, seperate pieces coming...


# 1.23 21-Feb-2014 deraadt

services


# 1.22 16-Dec-2013 halex

Replace `[RESPONSEFILE=...] install auto` voodoo with plain'ol getopts,
as discussed with uwe@ at some point.

ok krw@, rpe@, "Cool" uwe@


# 1.21 02-Dec-2013 halex

As the number of interactively triggered (A)utoinstall's should be quite
outnumbered by (I)nstall's and (U)pgrade's, reorder the alternatives.

"sure" deraadt@


# 1.20 28-Nov-2013 rpe

Now, that the auto installer supports both, install and upgrade,
use "non-interactive mode" instead of installation.

ok deraadt@


# 1.19 14-Nov-2013 halex

fix ^C handling which was accidentally trapped a bit to much

ok rpe@ krw@


# 1.18 27-Oct-2013 uwe

Unattended installation using DHCP and a response file

For a completely unattended installation bsd.rd has to be netbooted,
a DHCP server must be running and provide "next-server", which will be
used to fetch "http://<next-server>/install.conf". The format of the
response file is a list of "<key> = <value>" pairs where <key> is a
substring of the interactive question (case-insensitive) and <value> is
what would be entered interactively.

Minimal response file example:

system hostname = openbsd
password for root account = <...>
network interfaces = re0
IPv4 address for re0 = dhcp
server? = <...>

This is a starting point, it still a bit rough.

ok krw@, many improvements by halex@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.17 08-Jul-2011 halex

make exiting the shell take you back to the inital prompt

"i like" henning@, "Fine with me" deraadt@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.16 30-Jun-2010 halex

revert last ^D behaviour change

requested and well explained by krw@


# 1.15 30-Jun-2010 halex

make the installer quit when ^D is pressed at any prompt

ok deraadt@


Revision tags: OPENBSD_4_7_BASE
# 1.14 10-Jan-2010 deraadt

remove and move some chatty byte during upgrade startup; ok krw, idea from mcbride


Revision tags: OPENBSD_4_6_BASE
# 1.13 12-Jun-2009 deraadt

Put back the once-only code that krw removed earlier, because we want ^C
from the install script to go to the # prompt, not back to the question.


# 1.12 07-Jun-2009 krw

More tersification. Fixes verbiage issue reported by jdixon@ on
icb.


# 1.11 04-Jun-2009 krw

Implement '!' and '!<cmd>' at the "(I)nstall ..." prompt so we
aren't lying about being able to do that at any prompt.

Suggested by deraadt@


# 1.10 04-Jun-2009 krw

Only print the intro verbiage once, instead of every pass through the "(I)nstall, ..."
loop.

Noticed by & ok deraadt@


# 1.9 03-Jun-2009 krw

Add hw.machine and kern.osrelease to install media sysctl. Using
these rather than hard coded variables allows the rationalization
of the greeting by moving it into dot.profile. Whack at dot.profile
a lot. Eliminate the 'Proceed with ...' question as unneeded.
Eliminate welcome().

ok deraadt@ "I like" todd@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.8 03-Aug-2008 krw

Sparc miniroot hasn't worked for a while, since the sed code to find
the root disk was broken. Simplify and fix said sed code. Problem
noted by okan@ and others, diagnosed by deraadt@, sed suggestions from
nordin@, jmc@, fgsch@, guenther@.

'get something in before sparc gets done' deraadt@


Revision tags: OPENBSD_4_3_BASE
# 1.7 16-Nov-2007 krw

Simplify the sed expression used to set 'rootdisk'. Shaves bytes from the
install media. From Tamas Tevesz.


Revision tags: OPENBSD_4_1_BASE OPENBSD_4_2_BASE
# 1.6 16-Feb-2007 deraadt

better X"" idiom in while loop; didickman@yahoo.com


Revision tags: OPENBSD_4_0_BASE
# 1.5 04-Mar-2006 krw

Put comment on separate line so it is stripped from install media.


Revision tags: OPENBSD_3_2_BASE OPENBSD_3_3_BASE OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.4 13-Sep-2002 deraadt

do not stty 9600


# 1.3 29-Aug-2002 krw

Add a new verb to list2sh.awk, 'REMOVE'. This allows the easy
disabling of '(U)pgrade' in architectures by adding

REMOVE upgrade

to the end of the 'list' file for that architecture.

Add code to dot.profile to check for the presence of the upgrade
script before offering to (U)pgrade.

Use the new verb to disable upgrades for sparc.

ok deraadt@.


# 1.2 09-Jun-2002 todd

knf


# 1.1 22-Apr-2002 deraadt

use one common dot.profile for all