Commit b2bffe91 authored by Nikos Skalkotos's avatar Nikos Skalkotos
Browse files

Remove the boot and shutdown process in helper VM

Make snf-image-helper ran as init process when calling the helper
VM. Also make the helper VM shut down quickly by using the shut off
SysRq.
parent 603c05f7
...@@ -85,6 +85,10 @@ report_error() { ...@@ -85,6 +85,10 @@ report_error() {
fi fi
} }
system_poweroff() {
echo o > /proc/sysrq-trigger
}
get_base_distro() { get_base_distro() {
local root_dir=$1 local root_dir=$1
......
...@@ -17,18 +17,24 @@ ...@@ -17,18 +17,24 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA. # 02110-1301, USA.
. @commondir@/common.sh PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
set -e if [ $$ -eq 1 ]; then
mount / -o remount
/etc/init.d/udev start
hwclock -u -s
if [ "x$1" != "x--force" ]; then (exec $0) &
echo "WARNING: Exiting, this command would cause the system to halt." >&2 wait
echo "Use --force if you know what you're doing." >&2 exit 0 # Hopefully this is never called...
exit 1
fi fi
. @commondir@/common.sh
set -e
# terminate helper vm when the script exits # terminate helper vm when the script exits
add_cleanup telinit 0 add_cleanup system_poweroff
if [ ! -b "$FLOPPY_DEV" ]; then if [ ! -b "$FLOPPY_DEV" ]; then
log_error "Floppy device is not present!" log_error "Floppy device is not present!"
......
...@@ -176,7 +176,7 @@ $TIMEOUT -k "$HELPER_HARD_TIMEOUT" "$HELPER_SOFT_TIMEOUT" \ ...@@ -176,7 +176,7 @@ $TIMEOUT -k "$HELPER_HARD_TIMEOUT" "$HELPER_SOFT_TIMEOUT" \
-serial file:>(./helper-monitor.py ${MONITOR_FD}) \ -serial file:>(./helper-monitor.py ${MONITOR_FD}) \
-fda "$floppy" -vga none -nographic -parallel none -monitor null \ -fda "$floppy" -vga none -nographic -parallel none -monitor null \
-kernel "$HELPER_KERNEL" -initrd "$HELPER_INITRD" \ -kernel "$HELPER_KERNEL" -initrd "$HELPER_INITRD" \
-append "quiet ro root=/dev/sda1 console=ttyS0,9600n8 snf_image_activate_helper" \ -append "quiet ro root=/dev/sda1 console=ttyS0,9600n8 snf_image_activate_helper init=/usr/bin/snf-image-helper" \
2>&1 | sed -u 's|^|HELPER: |g' 2>&1 | sed -u 's|^|HELPER: |g'
rc=$? rc=$?
set -e set -e
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment