From 146a6734ef74423112f9acd6f8d93f1d8851d40d Mon Sep 17 00:00:00 2001 From: Dennis Schridde Date: Sun, 21 Apr 2013 11:48:08 -0400 Subject: sys-apps/systemd-units-7: add kexec stuff see bug https://bugs.gentoo.org/show_bug.cgi?id=415359 --- sys-apps/systemd-units/files/90_kexec | 12 +++++ .../files/services-server/kexec-load_at.service | 12 +++++ sys-apps/systemd-units/systemd-units-6.ebuild | 41 ----------------- sys-apps/systemd-units/systemd-units-7.ebuild | 53 ++++++++++++++++++++++ 4 files changed, 77 insertions(+), 41 deletions(-) create mode 100644 sys-apps/systemd-units/files/90_kexec create mode 100644 sys-apps/systemd-units/files/services-server/kexec-load_at.service delete mode 100644 sys-apps/systemd-units/systemd-units-6.ebuild create mode 100644 sys-apps/systemd-units/systemd-units-7.ebuild 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-6.ebuild deleted file mode 100644 index 630c8b5..0000000 --- a/sys-apps/systemd-units/systemd-units-6.ebuild +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -EAPI=3 -inherit eutils systemd - -DESCRIPTION="Service files for sys-apps/systemd" -HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd http://en.gentoo-wiki.com/wiki/Systemd" -SRC_URI="" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~x86" -IUSE="+basic +desktop server ingnome3" - -RDEPEND="" -DEPEND="" - -src_install() { - if use basic; then - systemd_dounit "${FILESDIR}"/services-basic/* - fi - - if use server; then - systemd_dounit "${FILESDIR}"/services-server/* - systemd_dotmpfilesd "${FILESDIR}"/tmpfiles-server/* - fi - - if use desktop; then - systemd_dounit "${FILESDIR}"/services-desktop/* - - if ! use ingnome3; then - rm -f "${D}/$(systemd_get_unitdir)"/gdm.service - fi - fi - - # Files in portage cannot contain a literal '@' character. Therfore, - # convert the code string "_at" into an '@' before installing. - rename '_at' '@' "${D}/$(systemd_get_unitdir)"/* -} diff --git a/sys-apps/systemd-units/systemd-units-7.ebuild b/sys-apps/systemd-units/systemd-units-7.ebuild new file mode 100644 index 0000000..0ef9f2d --- /dev/null +++ b/sys-apps/systemd-units/systemd-units-7.ebuild @@ -0,0 +1,53 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=3 +inherit eutils systemd + +DESCRIPTION="Service files for sys-apps/systemd" +HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd http://en.gentoo-wiki.com/wiki/Systemd" +SRC_URI="" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="+basic +desktop server ingnome3" + +RDEPEND="" +DEPEND="" + +src_install() { + if use basic; then + systemd_dounit "${FILESDIR}"/services-basic/* + fi + + 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 + systemd_dounit "${FILESDIR}"/services-desktop/* + + if ! use ingnome3; then + rm -f "${D}/$(systemd_get_unitdir)"/gdm.service + fi + fi + + # Files in portage cannot contain a literal '@' character. Therfore, + # 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 +} -- cgit v1.2.3-65-gdbad