From c4634f60b5c6d67eedfedc02166499884e4d6625 Mon Sep 17 00:00:00 2001 From: Colin Guthrie <colin@mageia.org> Date: Sun, 1 Dec 2013 22:29:20 +0000 Subject: 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 --- rescue/tree/usr/lib/CVS. | 0 .../tree/usr/lib/modules-load.d/mageia-rescue.conf | 17 +++++++++++++++++ rescue/tree/usr/lib/systemd/system/rescue.service | 20 ++++++++++++++++++++ .../system/systemd-udevd.service.d/dracut-rules.conf | 1 + 4 files changed, 38 insertions(+) delete mode 100644 rescue/tree/usr/lib/CVS. create mode 100644 rescue/tree/usr/lib/modules-load.d/mageia-rescue.conf create mode 100644 rescue/tree/usr/lib/systemd/system/rescue.service create mode 100644 rescue/tree/usr/lib/systemd/system/systemd-udevd.service.d/dracut-rules.conf (limited to 'rescue/tree/usr/lib') diff --git a/rescue/tree/usr/lib/CVS. b/rescue/tree/usr/lib/CVS. deleted file mode 100644 index e69de29bb..000000000 diff --git a/rescue/tree/usr/lib/modules-load.d/mageia-rescue.conf b/rescue/tree/usr/lib/modules-load.d/mageia-rescue.conf new file mode 100644 index 000000000..4111c0484 --- /dev/null +++ b/rescue/tree/usr/lib/modules-load.d/mageia-rescue.conf @@ -0,0 +1,17 @@ +ide-gd_mod +ide-cd_mod +floppy +af_packet +isofs +vfat +ext3 +ext4 +reiserfs +nilfs2 +btrfs +xfs +jfs +loop +fuse +sd_mod +sr_mod diff --git a/rescue/tree/usr/lib/systemd/system/rescue.service b/rescue/tree/usr/lib/systemd/system/rescue.service new file mode 100644 index 000000000..336e06c22 --- /dev/null +++ b/rescue/tree/usr/lib/systemd/system/rescue.service @@ -0,0 +1,20 @@ +[Unit] +Description=Mageia Rescue +DefaultDependencies=no +Conflicts=shutdown.target +After=sysinit.target plymouth-start.service +Before=shutdown.target + +[Service] +Environment=HOME=/ +WorkingDirectory=/ +ExecStartPre=-/bin/plymouth quit +ExecStart=/usr/bin/mageia-rescue +ExecStopPost=-/usr/bin/systemctl --fail --no-block reboot +Type=idle +StandardInput=tty-force +StandardOutput=inherit +StandardError=inherit +KillMode=process +IgnoreSIGPIPE=no +SendSIGHUP=yes diff --git a/rescue/tree/usr/lib/systemd/system/systemd-udevd.service.d/dracut-rules.conf b/rescue/tree/usr/lib/systemd/system/systemd-udevd.service.d/dracut-rules.conf new file mode 100644 index 000000000..b75df2e4e --- /dev/null +++ b/rescue/tree/usr/lib/systemd/system/systemd-udevd.service.d/dracut-rules.conf @@ -0,0 +1 @@ +ExecStartPre=-/usr/bin/rm -f /etc/udev/rules.d/10-console.rules -- cgit v1.2.1 From e7aedc3aa7e08f3337c86085c6da10ca83445024 Mon Sep 17 00:00:00 2001 From: Colin Guthrie <colin@mageia.org> Date: Mon, 2 Dec 2013 23:40:22 +0000 Subject: rescue: Move files around and introduce proper dep tracking. This moves any perl files into bin and sbin folders which will be directly installed in /usr/bin and /usr/sbin. This is done such that the extract modes in list.xml still work and the files end up in the right places. All other files have been moved into the tree folder in their final destination. --- rescue/tree/usr/lib/restore-image-lib.sh | 80 ++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100755 rescue/tree/usr/lib/restore-image-lib.sh (limited to 'rescue/tree/usr/lib') diff --git a/rescue/tree/usr/lib/restore-image-lib.sh b/rescue/tree/usr/lib/restore-image-lib.sh new file mode 100755 index 000000000..3451f7be5 --- /dev/null +++ b/rescue/tree/usr/lib/restore-image-lib.sh @@ -0,0 +1,80 @@ +#!/bin/bash + +TITLE="%s Installer" +BACKTITLE="%s" +MIN_DISKSIZE=5000000 + +debug="/dev/null" + +function _msgbox() +{ + dialog --timeout 60 --backtitle "$BACKTITLE" --title "$TITLE" --msgbox \ + "$1" 0 0 + + return $? +} + +function _infobox() +{ + dialog --backtitle "$BACKTITLE" --title "$TITLE" --sleep 2 \ + --infobox "$1" 0 0 + + return $? +} + +function _yesno() +{ + dialog --backtitle "$BACKTITLE" --title "$TITLE" \ + --yes-label "Yes" --no-label "No" --yesno "$1" 0 0 + + return $? +} + +function _mount() +{ + mount $1 $2 > $debug 2>&1 + + return $? +} + +function _umount() +{ + umount $1 > $debug 2>&1 + + return $? +} + +function _bind() +{ + mount --bind $1 $2 > $debug 2>&1 + + return $? +} + +function _eject() +{ + eject $1 > $debug 2>&1 + + return $? +} + +function _shutdown() +{ + [ -e /tmp/no-shutdown ] && exit + clear + sync + echo s > /proc/sysrq-trigger + echo o > /proc/sysrq-trigger + exit +} + +function _reboot() +{ + [ -e /tmp/no-shutdown ] && exit + clear + sync + echo s > /proc/sysrq-trigger + echo b > /proc/sysrq-trigger + exit +} + -- cgit v1.2.1