summaryrefslogtreecommitdiff
path: root/distrib/miniroot/install.sub
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2014-07-20 20:08:45 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2014-07-20 20:08:45 +0000
commitfdd047b7280d29c4b3a20a1db60509c4bd83030b (patch)
tree62a57058b87e17239d4b4c7540cc7fe9cfebcc0f /distrib/miniroot/install.sub
parent64f028828d17fb0c811da5fd9280ca0c67284ba1 (diff)
if we think this is a laptop (wsdisplay.....) ask a lidsuspend
question. Let's see who whines.
Diffstat (limited to 'distrib/miniroot/install.sub')
-rw-r--r--distrib/miniroot/install.sub14
1 files changed, 13 insertions, 1 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub
index 746f349cbdf..ac1a98fbb6a 100644
--- a/distrib/miniroot/install.sub
+++ b/distrib/miniroot/install.sub
@@ -1,4 +1,4 @@
-# $OpenBSD: install.sub,v 1.783 2014/07/20 18:13:22 deraadt Exp $
+# $OpenBSD: install.sub,v 1.784 2014/07/20 20:08:44 deraadt Exp $
#
# Copyright (c) 1997-2009 Todd Miller, Theo de Raadt, Ken Westerback
# All rights reserved.
@@ -1821,6 +1821,13 @@ apply()
>>/mnt/etc/sysctl.conf
fi
+ if [[ -n $lidsuspend ]]; then
+ [[ ! -f /mnt/etc/sysctl.conf ]] && \
+ echo "# created during install" >/mnt/etc/sysctl.conf
+ echo "machdep.lidsuspend=1 # Try to suspend on lid close" \
+ >>/mnt/etc/sysctl.conf
+ fi
+
if [[ $xdm == y && -x /mnt/usr/X11R6/bin/xdm ]]; then
echo "xdm_flags= # enabled during install" \
>>/mnt/etc/rc.conf.local
@@ -1853,6 +1860,7 @@ questions() {
aperture=
xdm=
+ lidsuspend=
if [[ -n $DISPLAY ]]; then
[[ -n $(scan_dmesg '/^vga.*: aperture needed/p') ]] &&
ask_yn "Do you expect to run the X Window System?" yes &&
@@ -1862,6 +1870,10 @@ questions() {
ask_yn "Do you want the X Window System to be started by xdm(1)?"
xdm=$resp
fi
+ if [[ -n $MDLID ]]; then
+ ask_yn "Do you want to suspend on lid close?" yes && \
+ lidsuspend=$resp
+ fi
fi
if [[ -n $CDEV ]]; then