summaryrefslogtreecommitdiffstats
path: root/abs/core/linhes-live/etc
diff options
context:
space:
mode:
authorCecil Hugh Watson <knoppmyth@gmail.com>2009-09-26 01:57:08 (GMT)
committerCecil Hugh Watson <knoppmyth@gmail.com>2009-09-26 01:57:08 (GMT)
commit7b29169fff9e7c624890c5edffe85def8a293136 (patch)
tree47753889faa3a2063b66d1c7e7681e703eb1b39a /abs/core/linhes-live/etc
parentc491dea779dac29afff3578bf8245943817c2339 (diff)
downloadlinhes_pkgbuild-7b29169fff9e7c624890c5edffe85def8a293136.zip
linhes_pkgbuild-7b29169fff9e7c624890c5edffe85def8a293136.tar.gz
linhes_pkgbuild-7b29169fff9e7c624890c5edffe85def8a293136.tar.bz2
LinHES 6.01.00
Diffstat (limited to 'abs/core/linhes-live/etc')
-rw-r--r--abs/core/linhes-live/etc/live-shutdown66
-rw-r--r--abs/core/linhes-live/etc/live-sysinit19
-rwxr-xr-xabs/core/linhes-live/etc/rc.shutdown-live1
-rwxr-xr-xabs/core/linhes-live/etc/rc.sysinit-live3
4 files changed, 76 insertions, 13 deletions
diff --git a/abs/core/linhes-live/etc/live-shutdown b/abs/core/linhes-live/etc/live-shutdown
index 807ec47..b6a8378 100644
--- a/abs/core/linhes-live/etc/live-shutdown
+++ b/abs/core/linhes-live/etc/live-shutdown
@@ -9,12 +9,12 @@ f_saveclock ()
f_swapoff ()
{
############################# Include session saving functions
- . /opt/linhes-live/session-save/shutdown2
- if [ -f /tmp/checkse ]; then
- . /tmp/checkse
- else
- checkse
- fi
+# . /opt/linhes-live/session-save/shutdown2
+# if [ -f /tmp/checkse ]; then
+# . /tmp/checkse
+# else
+# checkse
+# fi
if [ -n "${saving}" ] && ! session_save; then
echo
@@ -37,14 +37,54 @@ f_swapoff ()
f_remountro ()
{
- if [ -n "${ejectdev}" ]; then
- echo "Ejecting live CD"
- eject ${ejectdev}
- echo "========================================"
- echo "It's safe to switch the computer off now"
- echo -ne "Press Enter to continue"
- read junk
+ bootdev=`cat /.livesys/bootdevice`
+ echo "Boot device was $bootdev"
+ #bootdev=`basename $bootdev`
+ for i in `ls /dev/cd/*`
+ do
+ cdrom=`readlink -f $i`
+ if [ x$cdrom = x$bootdev ]
+ then
+ ejectdev=$cdrom
+ break
+ fi
+
+ done
+ lspci |grep -q VMware
+ if [ ! $? = 0 ]
+ then
+ if [ -n "${ejectdev}" ]
+ then
+ echo "Ejecting CD $ejectdev"
+ eject ${ejectdev}
+ echo "========================================"
+ echo "Tray will retract after 10 seconds"
+ for timer in `seq -w 10 -1 0`
+ do
+ #echo -n $timer '\x08'
+ echo -ne "\t"$timer '\010\010\010\010'
+ sleep 1
+ done
+ echo
+ echo "========================================"
+ eject -t ${ejectdev}
+ echo
+ echo "It's safe to switch the computer off now"
+ #echo -ne "Press Enter to continue"
+ #read junk
+ else
+ echo "Boot device is not a cdrom, no need to eject"
+ fi
+ else
+ echo "VMWARE detected, not ejecting the CD"
fi
}
+#Preloads these commands so we can eject the CD.
+#
+seq --help >/dev/null 2>&1
+eject --help >/dev/null 2>&1
+halt --help >/dev/null 2>&1
+poweroff --help >/dev/null 2>&1
+reboot --help >/dev/null 2>&1
# End
diff --git a/abs/core/linhes-live/etc/live-sysinit b/abs/core/linhes-live/etc/live-sysinit
index abab4a8..40edad9 100644
--- a/abs/core/linhes-live/etc/live-sysinit
+++ b/abs/core/linhes-live/etc/live-sysinit
@@ -52,3 +52,22 @@ f_swapon ()
status "Activating Swap" /sbin/swapon -a
fi
}
+f_loadmodules()
+{
+ CMDLINE=$(cat /proc/cmdline)
+ echo $CMDLINE | grep -q modules
+ if [ $? -eq 0 ]
+ then
+ TEMPVAR=${CMDLINE#* modules=}
+ CMDMODULES=${TEMPVAR%% *}
+ mymod=`echo $CMDMODULES|/bin/sed 's|-|_|g' |/bin/sed 's|,| |g'`
+ stat_busy "Loading CMD module"
+ for mod in $mymod
+ do
+ /sbin/modprobe $mod
+ done
+ stat_done
+ fi
+
+
+}
diff --git a/abs/core/linhes-live/etc/rc.shutdown-live b/abs/core/linhes-live/etc/rc.shutdown-live
index 7fa97e6..79eae47 100755
--- a/abs/core/linhes-live/etc/rc.shutdown-live
+++ b/abs/core/linhes-live/etc/rc.shutdown-live
@@ -149,6 +149,7 @@ fi
#F Remount / ro
f_remountro
+#Eject the CD
# Power off or reboot
if [ "$RUNLEVEL" = "0" ]; then
diff --git a/abs/core/linhes-live/etc/rc.sysinit-live b/abs/core/linhes-live/etc/rc.sysinit-live
index 3f72a50..afdc2ae 100755
--- a/abs/core/linhes-live/etc/rc.sysinit-live
+++ b/abs/core/linhes-live/etc/rc.sysinit-live
@@ -176,6 +176,9 @@ fi
# Load modules from the MODULES array defined in rc.conf
if ! [ "$load_modules" = "off" ]; then
if [ -f /proc/modules ]; then
+############Added by jm to load modules from /proc/cmdline
+ f_loadmodules
+##############
stat_busy "Loading Modules"
for mod in "${MODULES[@]}"; do
if [ "$mod" = "${mod#!}" ]; then