diff options
author | 2013-04-21 11:48:08 -0400 | |
---|---|---|
committer | 2013-04-21 11:49:20 -0400 | |
commit | 146a6734ef74423112f9acd6f8d93f1d8851d40d (patch) | |
tree | dfa5bc41d84d2684a585db22fb5f671426230d60 | |
parent | sys-apps/systemd-units: remove vsftpd.service included upstream (diff) | |
download | systemd-146a6734ef74423112f9acd6f8d93f1d8851d40d.tar.gz systemd-146a6734ef74423112f9acd6f8d93f1d8851d40d.tar.bz2 systemd-146a6734ef74423112f9acd6f8d93f1d8851d40d.zip |
sys-apps/systemd-units-7: add kexec stuff
see bug https://bugs.gentoo.org/show_bug.cgi?id=415359
-rw-r--r-- | sys-apps/systemd-units/files/90_kexec | 12 | ||||
-rw-r--r-- | sys-apps/systemd-units/files/services-server/kexec-load_at.service | 12 | ||||
-rw-r--r-- | sys-apps/systemd-units/systemd-units-7.ebuild (renamed from sys-apps/systemd-units/systemd-units-6.ebuild) | 12 |
3 files changed, 36 insertions, 0 deletions
diff --git a/sys-apps/systemd-units/files/90_kexec b/sys-apps/systemd-units/files/90_kexec new file mode 100644 index 0000000..19a7b5c --- /dev/null +++ b/sys-apps/systemd-units/files/90_kexec @@ -0,0 +1,12 @@ +#!/bin/sh + +version="$1" ; shift +image="$1" ; shift + +for s in `systemctl show kexec.target | sed -nre 's/^Wants=(.*)/\1/p'` ; do + case "${s}" in + kexec-load@*) systemctl disable "${s}" ;; + esac +done + +exec systemctl enable kexec-load@"${version}" diff --git a/sys-apps/systemd-units/files/services-server/kexec-load_at.service b/sys-apps/systemd-units/files/services-server/kexec-load_at.service new file mode 100644 index 0000000..e75e594 --- /dev/null +++ b/sys-apps/systemd-units/files/services-server/kexec-load_at.service @@ -0,0 +1,12 @@ +[Unit] +Description=load %i kernel into the current kernel +Documentation=man:kexec(8) +DefaultDependencies=no +Before=shutdown.target umount.target final.target + +[Service] +Type=oneshot +ExecStart=/usr/sbin/kexec -l /boot/vmlinuz-%i --initrd=/boot/initramfs-%i.img --reuse-cmdline + +[Install] +WantedBy=kexec.target diff --git a/sys-apps/systemd-units/systemd-units-6.ebuild b/sys-apps/systemd-units/systemd-units-7.ebuild index 630c8b5..0ef9f2d 100644 --- a/sys-apps/systemd-units/systemd-units-6.ebuild +++ b/sys-apps/systemd-units/systemd-units-7.ebuild @@ -25,6 +25,10 @@ src_install() { if use server; then systemd_dounit "${FILESDIR}"/services-server/* systemd_dotmpfilesd "${FILESDIR}"/tmpfiles-server/* + ( + insinto /etc/kernel/postinst.d/ + doins "${FILESDIR}"/90_kexec + ) fi if use desktop; then @@ -39,3 +43,11 @@ src_install() { # convert the code string "_at" into an '@' before installing. rename '_at' '@' "${D}/$(systemd_get_unitdir)"/* } + +pkg_postinst() { + if use server; then + elog "The file '${ROOT}etc/kernel/postinst.d/90_kexec' has been" + elog "installed for you. If you use kexec, you may want to enable it by" + elog "making it exectuable." + fi +} |