Commit 3006101b authored by Anton Midyukov's avatar Anton Midyukov

live, grub, isolinux: new target use/live/rescue

The new target adds rescue mode to the regular livecd. live should do not be installable, since in it serious changes that are unacceptable for a normal system.
parent 1ef803fb
menuentry $"Rescue LiveCD" --id 'live_rescue' {
savedefault
echo $"Loading Linux vmlinuz$KFLAVOUR ..."
linux /boot/vmlinuz$KFLAVOUR fastboot live @initrd_bootargs@ @stagename@=live systemd.unit=live-rescue.target ramdisk_size=@live_size@ nosplash vga=@bootvga@ @rescue_bootargs@ $EFI_BOOTARGS lang=$lang lowmem
echo $"Loading initial ramdisk ..."
initrd /boot/@initrd@$KFLAVOUR.@initrd_ext@
}
......@@ -99,6 +99,11 @@ else
use/live/suspend: use/live; @:
endif
# live as Rescue
use/live/rescue: use/live use/grub/live-rescue.cfg use/syslinux/live-rescue.cfg
@$(call add,LIVE_PACKAGES,startup-rescue)
@$(call add,LIVE_LISTS,tagged/base+rescue)
# for kiosks
use/live/runapp: use/live
@$(call add,LIVE_PACKAGES,livecd-runapp)
......
#!/bin/sh -efu
# don't cripple the image to be copied over
[ -n "${GLOBAL_LIVE_INSTALL-}" ] || \
[ -x /usr/sbin/live-install ] || \
[ -x /usr/sbin/livecd-install ] && exit 0
[ -x /sbin/rescue-launcher ] || [ -x /usr/bin/rescue-shell-show ] || exit 0
# for systemd only
rpm -q systemd-sysvinit >/dev/null 2>&1 || exit 0
# disable issue "Hello friend, say '$LIVECD_LOGIN' to log in at"
[ ! -f /etc/sysconfig/livecd-user ] ||
sed -i 's/^#LIVECD_NO_ISSUE=1/LIVECD_NO_ISSUE=1/' /etc/sysconfig/livecd-user
mkdir -p /etc/systemd/system/getty@.service.d
cat>>/etc/systemd/system/getty@.service.d/override.conf<<'EOF'
[Service]
Type=simple
ExecStart=
ExecStart=-agetty -a root --noclear - $TERM
EOF
mkdir -p /etc/systemd/system/live-rescue.target.d
cat>>/etc/systemd/system/live-rescue.target<<'EOF'
[Unit]
Description=Live Rescue System
Documentation=man:systemd.special(7)
Requires=basic.target network.target getty.target
Conflicts=rescue.service rescue.target multi-user.target
Conflicts=altlinux-first_time.service vconsole-setup-kludge@tty1.service
Before=altlinux-first_time.service vconsole-setup-kludge@.service
After=basic.target rescue.service rescue.target multi-user.target
After=getty.target
AllowIsolate=yes
EOF
cat>>/root/.bash_profile<<'EOF'
if grep -qsv 'init=' /proc/cmdline; then
EOF
[ -x /sbin/rescue-launcher ] && cat>>/root/.bash_profile<<'EOF'
if grep -wqs autorun /proc/cmdline; then
if [ -x /sbin/rescue-launcher ]; then
if [ "$(tty 2>/dev/null)" = "/dev/tty1" ]; then
/sbin/rescue-launcher "$@"
fi
fi
fi
EOF
[ -x /usr/bin/rescue-shell-show ] && cat>>/root/.bash_profile<<'EOF'
rescue-shell-show
EOF
echo "fi" >> /root/.bash_profile
label live_rescue
menu label ^Rescue LiveCD
kernel /boot/vmlinuz
append initrd=/boot/@initrd@ fastboot live @initrd_bootargs@ @stagename@=live systemd.unit=live-rescue.target ramdisk_size=@live_size@ nosplash showopts vga=@bootvga@ @rescue_bootargs@ lowmem
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