All pastes #978112 Raw Edit

Stuff

public text v1 · immutable
·published 2008-04-09 09:36 UTC
rendered paste body
Tain0s EEEpc - Xandros by Asus - 2Go Kernel Inside

######################################
/sbin/fastreboot.sh :
######################################

#!/bin/sh

if [ "$1" = "--ask" ]
then
	zenity --question && sudo $0
	exit $?
fi

[ `id -u` = "0" ] || echo "Must be root."

/usr/bin/killall --wait usbstorageapplet
sudo /sbin/jumount.sh

/bin/kill -USR1 1

######################################
/sbin/fastshutdown.sh :
######################################

#!/bin/sh

if [ "$1" = "--ask" ]
then
	zenity --question && sudo $0
	exit $?
fi

[ `id -u` = "0" ] || echo "Must be root."

/usr/bin/killall --wait usbstorageapplet
sudo /sbin/jumount.sh

/bin/kill -USR2 1

######################################
/etc/acpi/suspend2ram.sh :
######################################

#!/bin/sh

if grep -q mem /sys/power/state ; then

	# Check if 700 (2G) or 701 (4G) - 2G has no hotplug 
	MODEL=`dmidecode -s baseboard-product-name`

	# Switch on external video port. Prevents hangs.
	su user -c "DISPLAY=:0.0 /usr/bin/xrandr --output VGA --mode 800x480"

	echo "0 0 0 0">/proc/sys/kernel/printk

	TPAD=0
	if [ `synclient -l | grep TouchpadOff | cut -f 2 -d '='` -eq 0 ]; then
		TPAD=1
		synclient TouchpadOff=1
	fi

	# save the wireless power state, if ON - prepare for suspend
	WLANP=`cat /proc/acpi/asus/wlan`
	if [ $WLANP == "1" ]; then
		/etc/acpi/wlan.sh suspend
	fi

	# Bring down all dialup connections, including 3G
	DIALUP=0
	for i in "`/opt/xandros/bin/xandrosncs-servicedb --list | /bin/grep -v SUBTYPE`" ; do
	    NAME=`echo $i | /usr/bin/awk '{print $1}'`
	    TYPE=`echo $i | /usr/bin/awk '{print $2}'`
	    if [ "${TYPE#dialup}" != "$TYPE" ] ; then
	    	/opt/xandros/bin/xandrosncs-control -i $NAME stop
		DIALUP=1
	    fi
	done

	# turn off webcam
	CAMP=`cat /proc/acpi/asus/camera`
	if [ $CAMP == "1" ] ; then
		killall -9 ucview.real
	fi
	echo 0 > /proc/acpi/asus/camera

	# kill ASUS 3G tool related process
	/opt/huawei/delui.sh
	/opt/huawei/delpppd.sh

	# unload some usb modules (3G)
	if [ $DIALUP == "1" ]; then 
		/sbin/rmmod option usbserial 2>/dev/null
	fi

	# save the brightness value
	BRN=`cat /proc/acpi/asus/brn`

	/usr/bin/killall krecord

	# reset numlock - system wakes with numlock off
	su user -c "DISPLAY=:0.0 /usr/local/bin/numlockx off"

	# flush the buffers to disk
	sync

	echo -n "mem" > /sys/power/state

	# enable webcam if Skype is running before standby
	if [ "$(/bin/pidof skype)" != "" ]; then
	 echo 1 >/proc/acpi/asus/camera
	fi


	# get ready to re-init the wireless
	if [ "$MODEL" -ne 700 ]; then
		rmmod pciehp
	fi

	# wait for X display to come up
	sleep 4

	# restore screen brightness
	echo $BRN > /proc/acpi/asus/brn

	if [ $TPAD == "1" ]; then
		synclient TouchpadOff=0
	fi

	if [ $WLANP == "1" ]; then
		sleep 1
		/etc/acpi/wlan.sh cleanup
	fi

	# turn wireless down so it can be cleanly loaded by PCIe hotplug
	echo 0 > /proc/acpi/asus/wlan
	sleep 1
	if [ "$MODEL" -ne 700 ]; then
		modprobe pciehp pciehp_force=1
	fi

	# if wireless was ON before sleep - power it up
	if [ $WLANP == "1" ]; then
		sleep 1
		/etc/acpi/wlan.sh poweron
		/etc/acpi/wlan.sh restore
	fi

	# unload some usb modules (3G)
	if [ $DIALUP == "1" ]; then 
		/sbin/modprobe option 2>/dev/null
	fi

	# signal the acpid to unlock a flag from suspend.
	(sleep 2 ; killall -SIGALRM acpid )&

fi

exit 0


######################################
/var/log/jumount.log :
######################################

no log in this directory