From b47c0d2c4b2cb0c8c562365b75a35d4d5d3467a1 Mon Sep 17 00:00:00 2001 From: rpe Date: Sun, 13 Jul 2014 21:24:43 +0000 Subject: [PATCH] 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@ --- distrib/miniroot/install.sub | 29 ++++++++++++++--------------- 1 file 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 -- 2.20.1