|
|
@ -3,7 +3,7 @@ |
|
|
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
|
|
|
# |
|
|
|
# Filename: target/idunn/initramfs/init.sh |
|
|
|
# Copyright (C) 2008 The OpenSDE Project |
|
|
|
# Copyright (C) 2008 - 2009 The OpenSDE Project |
|
|
|
# |
|
|
|
# More information can be found in the files COPYING and README. |
|
|
|
# |
|
|
@ -26,24 +26,7 @@ shutoff_handler() { |
|
|
|
ln -s / /var/run/init.lock 2> /dev/null || return |
|
|
|
|
|
|
|
# stop services |
|
|
|
/etc/rc.d/rc.shutdown |
|
|
|
|
|
|
|
# terminate the rest |
|
|
|
sleep 1 |
|
|
|
killall5 -s TERM |
|
|
|
sleep 2 |
|
|
|
|
|
|
|
# unmount stuff |
|
|
|
grep '^/' /proc/mounts | cut -d' ' -f2 | tac | while read x; do |
|
|
|
umount -r "$x" |
|
|
|
done |
|
|
|
|
|
|
|
# kill'em all |
|
|
|
killall5 -s KILL |
|
|
|
sleep 1 |
|
|
|
|
|
|
|
# an umount the rest |
|
|
|
umount -ar |
|
|
|
/etc/rc.d/rc.shutdown -u |
|
|
|
|
|
|
|
case "$1" in |
|
|
|
USR1) halt -f ;; |
|
|
@ -78,18 +61,13 @@ while true; do |
|
|
|
/etc/rc.d/rc.shutdown 2>&1 | tee -a $LOG |
|
|
|
|
|
|
|
# terminate the rest |
|
|
|
sleep 1 |
|
|
|
killall5 -s TERM |
|
|
|
sleep 2 |
|
|
|
killall5 -s KILL |
|
|
|
|
|
|
|
/etc/rc.d/rc.switchroot stop 2>&1 | tee -a $LOG |
|
|
|
|
|
|
|
# and proceed |
|
|
|
exec switch_root -c /dev/console "$rootfs" "$init" $initopt 2>&1 >> $LOG |
|
|
|
errno=$? |
|
|
|
|
|
|
|
# outch! |
|
|
|
# outch! what are we doing here? |
|
|
|
if [ ! -s $LOG ]; then |
|
|
|
# the world is gone, time to panic |
|
|
|
exit $errno |
|
|
|