From 9aea6114011606582a6a1adb1a0945a1f1d52f92 Mon Sep 17 00:00:00 2001 From: Kirill Elagin Date: Thu, 1 Sep 2011 00:14:05 +0400 Subject: [PATCH] Add vga_switcheroo options --- defaults/linuxrc | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/defaults/linuxrc b/defaults/linuxrc index 7aa11e3..b5f088a 100755 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -246,6 +246,10 @@ do # fi # fi # ;; + # vga_switcheroo + vga_switcheroo\=*) + VGA_SWITCHEROO=`parse_opt "${x}"` + ;; esac done @@ -285,6 +289,25 @@ else good_msg 'Skipping module load; no modules in the ramdisk!' fi +# Issue vga_switcheroo commands +if [ -n "$VGA_SWITCHEROO" ] +then + local SWITCH_PATH="/sys/kernel/debug/vgaswitcheroo/switch" + mount -t debugfs none /sys/kernel/debug || bad_msg "Couldn't mount debugfs!" + if [ ! -f "$SWITCH_PATH" ] + then + warn_msg "vga_switcheroo is not initialized!" + else + local IFS="," + for c in $VGA_SWITCHEROO + do + good_msg "Echoing \"$c\" to $SWITCH_PATH" + echo "$c" > $SWITCH_PATH + done + fi +fi + + # Apply scan delay if specified sdelay -- 1.7.3.4