diff options
author | Colin Guthrie <colin@mageia.org> | 2013-12-01 22:29:20 +0000 |
---|---|---|
committer | Colin Guthrie <colin@mageia.org> | 2013-12-07 18:32:06 +0000 |
commit | c4634f60b5c6d67eedfedc02166499884e4d6625 (patch) | |
tree | 844fb25572edbf617eaeccc7633d0031e7df1ec6 /rescue/tree/usr/bin | |
parent | 645e6932216fddd154865a9bebb0fd0e3beed301 (diff) | |
download | drakx-c4634f60b5c6d67eedfedc02166499884e4d6625.tar drakx-c4634f60b5c6d67eedfedc02166499884e4d6625.tar.gz drakx-c4634f60b5c6d67eedfedc02166499884e4d6625.tar.bz2 drakx-c4634f60b5c6d67eedfedc02166499884e4d6625.tar.xz drakx-c4634f60b5c6d67eedfedc02166499884e4d6625.zip |
rescue: Use systemd as initsystem.
This commit converts the rescue system to systemd rather than the legacy
sysvinit.
Besides being faster, one primary advantage of running systemd here is
that we can "boot" the system we're inspecting via systemd-nspawn
to properly test it.
Note: Bits that don't work:
* nspawn
* old dracut initqueue udev rules in /etc/ are not cleaned out (drop in
support error?)
* the gui may loop differently now
Diffstat (limited to 'rescue/tree/usr/bin')
-rwxr-xr-x | rescue/tree/usr/bin/mageia-rescue | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/rescue/tree/usr/bin/mageia-rescue b/rescue/tree/usr/bin/mageia-rescue new file mode 100755 index 000000000..c9dd35661 --- /dev/null +++ b/rescue/tree/usr/bin/mageia-rescue @@ -0,0 +1,35 @@ +#!/bin/sh + +# disable the weird echoprt in cooked mode for user interaction: +stty sane + +#LANGUAGE (filled by make_rescue_img) + +grep -q noauto /proc/cmdline || drvinst SERIAL_USB + +partimage_default_dir=/data/box +partimage_dir=`perl -lne 'print $1 if /BOX=(\S+)/' /proc/cmdline` +[ -z "$partimage_dir" ] && partimage_dir=$partimage_default_dir +partimage_server=`perl -lne 'print $1 if /\bpserver=(\S+)/' /proc/cmdline` + +LOOP="" +if grep -q save_all /proc/cmdline; then + partimage_whole_disk -s $partimage_server save_all $partimage_default_dir +elif grep -q rest_all /proc/cmdline; then + if [ -d /tmp/image$partimage_dir ]; then + partimage_whole_disk rest_all /tmp/image$partimage_dir + else + partimage_whole_disk -s $partimage_server rest_all $partimage_dir + fi +elif grep -q oem /proc/cmdline; then + /tmp/image/oem-rescue.sh +elif grep -q restore /proc/cmdline; then + /usr/sbin/restore-image.sh +elif ! grep -q expert /proc/cmdline; then + rescue-gui && LOOP=y +fi + +while [ "$LOOP" ]; do + bash --login + rescue-gui +done |