diff options
author | Robert Peichaer <rpe@cvs.openbsd.org> | 2014-07-13 21:24:44 +0000 |
---|---|---|
committer | Robert Peichaer <rpe@cvs.openbsd.org> | 2014-07-13 21:24:44 +0000 |
commit | 86ba5a59e1814f403ee6946fc2f0e1d6a7da38ab (patch) | |
tree | 9939db50ec2682b463a9b5ddf366fdc36b9a7dc1 /distrib/miniroot/install.sub | |
parent | d0db0dd5bc70e6d396668a79adbc0f24c739e18e (diff) |
Only set machdep.allowaperture if 'vga1: aperture needed' is found
in dmesg output. Use that information to decide whether or not to
ask the user if he intends to use X.
initial diff from and OK halex@
OK deraadt@
Diffstat (limited to 'distrib/miniroot/install.sub')
-rw-r--r-- | distrib/miniroot/install.sub | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index 27935f14da1..f5f34f1bfee 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,4 +1,4 @@ -# $OpenBSD: install.sub,v 1.779 2014/07/13 13:53:36 rpe Exp $ +# $OpenBSD: install.sub,v 1.780 2014/07/13 21:24:43 rpe Exp $ # # Copyright (c) 1997-2009 Todd Miller, Theo de Raadt, Ken Westerback # All rights reserved. @@ -1814,8 +1814,8 @@ apply() >/mnt/etc/ntpd.conf fi - if [[ $x11 == y ]]; then - sed "/^#\(machdep\.allowaperture=${MDXAPERTURE}\)/s//\1 /" \ + if [[ -n $aperture ]]; then + sed "s/^#\(machdep\.allowaperture=$aperture\)/\1 /" \ /mnt/etc/sysctl.conf >/tmp/sysctl.conf cp /tmp/sysctl.conf /mnt/etc/sysctl.conf fi @@ -1838,7 +1838,7 @@ apply() } questions() { - local _d _xdmask=y _def + local _d ask_yn "Start sshd(8) by default?" yes sshd=$resp @@ -1850,18 +1850,17 @@ questions() { ntpd_server=$resp fi - def=no - [[ -n $DISPLAY ]] && def=yes - if [[ -n $MDXAPERTURE ]]; then - ask_yn "Do you expect to run the X Window System?" $def - x11=$resp - # if aperture was n, do not ask for xdm - _xdmask=$resp - fi + aperture= + xdm= + if [[ -n $DISPLAY ]]; then + [[ -n $(scan_dmesg '/^vga1: aperture needed/p') ]] && + ask_yn "Do you expect to run the X Window System?" yes && + aperture=$MDXAPERTURE - if [[ -n $MDXDM && $_xdmask == y ]]; then - ask_yn "Do you want the X Window System to be started by xdm(1)?" - xdm=$resp + if [[ -n $MDXDM ]]; then + ask_yn "Do you want the X Window System to be started by xdm(1)?" + xdm=$resp + fi fi if [[ -n $CDEV ]]; then |