Re: [dev] fast-booting to text editor

From: Peter John Hartman <peterjohnhartman_AT_gmail.com>
Date: Sun, 20 Mar 2011 19:20:15 -0400

On Sun, Mar 20, 2011 at 07:18:12PM +0000, David Tweed wrote:
> using dwm as wm took 50s. Without starting any other programs and
> immediately hibernating, a restart from hibernate image takes 37s to
> get to the password unlock screen.(I can get rid of the need for a
> password, but I don't imagine that particular program contributed much
> to the restart time).

37s is ridiculous. i'm on an eee pc with crap-for-all everything, and it
takes < 5s. presumably, it's ubuntu as the slow-poke. here's my hib.sh
script, mmv:

#!/bin/sh
. /home/peterjh/.bash_functions

if [ $USER != "root" ]; then
        echo "User must be root."
        exit 0;
fi

logger -t hib "Start";

chvt 12

#snd_mute

sync

#logger -t hib "Umt";
/home/peterjh/bin/safe-umount.sh

wifi_file=/tmp/.hib.nyu.tmp.$$
if [[ `wlan_get_ap` == "nyu" ]]; then
        logger -t hib "Stopping network because AP is $AP"
        wlan_kill
        touch $wifi_file
else
        logger -t hib "Not stopping network because AP is not nyu but $AP"
fi

# discover video card's ID
#ID=`lspci | grep VGA | awk '{ print $1 }' | sed -e 's_AT_0000:@@' -e 's@:@/@'`
# securely create a temporary file
#TMP_FILE=`mktemp /var/tmp/video_state.XXXXXX`
#trap 'rm -f $TMP_FILE' 0 1 15
# dump current data from the video card to the temporary file
#cat /proc/bus/pci/$ID > $TMP_FILE

logger -t hib "Suspending";
echo -n mem > /sys/power/state
logger -t hib "Resuming"

# restore video card data from the temporary file on resume
#sudo -- cat $TMP_FILE > /proc/bus/pci/$ID
# remove temporary file
#rm -f $TMP_FILE

#snd_unmute

if [[ -f $wifi_file ]]; then
        rm -f $wifi_file
        logger -t hib "Not bringing ny network back up to be safe..."
        # wlan_unkill
fi

if [[ `pgrep X` != "" ]]; then
        logger -t hib "In X. chvt 7"
        chvt 7
else
        logger -t hib "Not in X. chvt 2."
        chvt 2
fi

mount -a
#w scan

sudo -u peterjh /home/peterjh/bin/remind-me.sh

-- 
sic dicit magister P
PhD Candidate
Collaborative Programme in Ancient and Medieval Philosophy
University of Toronto
http://individual.utoronto.ca/peterjh
Received on Mon Mar 21 2011 - 00:20:15 CET

This archive was generated by hypermail 2.2.0 : Mon Mar 21 2011 - 00:24:03 CET