diff options
author | Justin Lecher <jlec@gentoo.org> | 2013-09-21 11:35:53 +0000 |
---|---|---|
committer | Justin Lecher <jlec@gentoo.org> | 2013-09-21 11:35:53 +0000 |
commit | 331d37f2d817a26bfdadf816a8f11830787e0b4c (patch) | |
tree | 98b0da311d1b4f74772280f14abeaf5990ed1897 /sys-apps/kexec-tools | |
parent | Add missing dependency on dev-perl/Net-DNS (#478356 by Michael Weber) (diff) | |
download | gentoo-2-331d37f2d817a26bfdadf816a8f11830787e0b4c.tar.gz gentoo-2-331d37f2d817a26bfdadf816a8f11830787e0b4c.tar.bz2 gentoo-2-331d37f2d817a26bfdadf816a8f11830787e0b4c.zip |
sys-apps/kexec-tools: Add support for systemd, #478072; Fix issues with openrc init scripts, #481506; thanks BobbyK for the patches
(Portage version: 2.2.6/cvs/Linux x86_64, signed Manifest commit with key B9D4F231BD1558AB!)
Diffstat (limited to 'sys-apps/kexec-tools')
-rw-r--r-- | sys-apps/kexec-tools/ChangeLog | 12 | ||||
-rw-r--r-- | sys-apps/kexec-tools/files/kexec.conf | 32 | ||||
-rw-r--r-- | sys-apps/kexec-tools/files/kexec.conf-2.0.3 | 31 | ||||
-rw-r--r-- | sys-apps/kexec-tools/files/kexec.conf-9999 | 18 | ||||
-rw-r--r-- | sys-apps/kexec-tools/files/kexec.init-2.0.3 | 119 | ||||
-rw-r--r-- | sys-apps/kexec-tools/files/kexec.init-2.0.4-r2 | 165 | ||||
-rw-r--r--[-rwxr-xr-x] | sys-apps/kexec-tools/files/kexec.init-9999 (renamed from sys-apps/kexec-tools/files/kexec.init) | 4 | ||||
-rw-r--r-- | sys-apps/kexec-tools/files/kexec.init-ng | 101 | ||||
-rw-r--r-- | sys-apps/kexec-tools/files/kexec.service | 16 | ||||
-rw-r--r-- | sys-apps/kexec-tools/kexec-tools-2.0.4-r2.ebuild | 70 | ||||
-rw-r--r-- | sys-apps/kexec-tools/kexec-tools-9999.ebuild | 65 |
11 files changed, 345 insertions, 288 deletions
diff --git a/sys-apps/kexec-tools/ChangeLog b/sys-apps/kexec-tools/ChangeLog index fd33e615469f..1ad615c41707 100644 --- a/sys-apps/kexec-tools/ChangeLog +++ b/sys-apps/kexec-tools/ChangeLog @@ -1,6 +1,16 @@ # ChangeLog for sys-apps/kexec-tools # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/kexec-tools/ChangeLog,v 1.52 2013/08/11 11:18:15 jlec Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/kexec-tools/ChangeLog,v 1.53 2013/09/21 11:35:53 jlec Exp $ + +*kexec-tools-2.0.4-r2 (21 Sep 2013) + + 21 Sep 2013; Justin Lecher <jlec@gentoo.org> +kexec-tools-2.0.4-r2.ebuild, + kexec-tools-9999.ebuild, -files/kexec.conf-2.0.3, -files/kexec.init-2.0.3, + +files/kexec.init-2.0.4-r2, +files/kexec.conf-9999, +files/kexec.init-9999, + files/kexec.conf, -files/kexec.init, -files/kexec.init-ng, + +files/kexec.service: + Add support for systemd, #478072; Fix issues with openrc init scripts, + #481506; thanks BobbyK for the patches 11 Aug 2013; Justin Lecher <jlec@gentoo.org> -kexec-tools-2.0.2-r1.ebuild, -kexec-tools-2.0.3.ebuild, -kexec-tools-2.0.3-r1.ebuild: diff --git a/sys-apps/kexec-tools/files/kexec.conf b/sys-apps/kexec-tools/files/kexec.conf index 74f8b891ce54..aa829b9c2349 100644 --- a/sys-apps/kexec-tools/files/kexec.conf +++ b/sys-apps/kexec-tools/files/kexec.conf @@ -1,18 +1,16 @@ -# Boot partition -#BOOTPART="/boot" +# Kernel image pathname, relative from /boot. +KNAME="bzimage" -# Kernel name -#KNAME="vmlinuz-2.6.10" - -# Root partition (should be autodetected) -#ROOTPART="/dev/hda3" - -# Kernel parameters (should be autodetected) -#KPARAM="splash=silent,theme:emergence" - -# Initrd -#INITRD="/boot/fbsplash-emergence-1024x768" - -# Load kexec kernel image into memory during shutdown instead of bootup -# (default: yes) -#LOAD_DURING_SHUTDOWN="yes" +# Additional arguments passed to kexec (8) +# Following arguments are support: +# +# --reuse-cmdline +# Use the current boot command line +# +# --command-line=string +# Use a different command line +# +# --initrd=file +# Specify an initrd to use +# +KEXEC_OPT_ARGS="--reuse-cmdline" diff --git a/sys-apps/kexec-tools/files/kexec.conf-2.0.3 b/sys-apps/kexec-tools/files/kexec.conf-2.0.3 deleted file mode 100644 index a1d409edabc6..000000000000 --- a/sys-apps/kexec-tools/files/kexec.conf-2.0.3 +++ /dev/null @@ -1,31 +0,0 @@ -# Load kexec kernel image into memory during shutdown instead of bootup -# (default: yes) -#LOAD_DURING_SHUTDOWN="yes" - -# Additional arguments passed to kexec (8) -#KEXEC_OPT_ARGS="" - -# Kernel image partition. Mounted automatically if not. -# (default: /boot) -#BOOTPART="/boot" - -# Root partition (should be autodetected) -#ROOTPART="/dev/hda3" - -# Kernel image pathname, relative from BOOTPART. -# If it's one of -# {kernel-genkernel,bzImage,vmlinuz,kernel}-<currently running kernel version>, -# or bzImage, vmlinuz (without suffix), -# then it's automaticaly detected. -# Setting it to "-" will disable kexec. -#KNAME="vmlinuz-2.6.10" - -# Initrd -# Same automatic detection restriction as for KNAME apply. -# initramfs-genkernel-<currently running kernel version>, -# initrd{,.img}-<currently running kernel version>{,.img} -# will be detected. -#INITRD="/boot/fbsplash-emergence-1024x768" - -# Kernel parameters (should be autodetected) -#KPARAM="splash=silent,theme:emergence" diff --git a/sys-apps/kexec-tools/files/kexec.conf-9999 b/sys-apps/kexec-tools/files/kexec.conf-9999 new file mode 100644 index 000000000000..74f8b891ce54 --- /dev/null +++ b/sys-apps/kexec-tools/files/kexec.conf-9999 @@ -0,0 +1,18 @@ +# Boot partition +#BOOTPART="/boot" + +# Kernel name +#KNAME="vmlinuz-2.6.10" + +# Root partition (should be autodetected) +#ROOTPART="/dev/hda3" + +# Kernel parameters (should be autodetected) +#KPARAM="splash=silent,theme:emergence" + +# Initrd +#INITRD="/boot/fbsplash-emergence-1024x768" + +# Load kexec kernel image into memory during shutdown instead of bootup +# (default: yes) +#LOAD_DURING_SHUTDOWN="yes" diff --git a/sys-apps/kexec-tools/files/kexec.init-2.0.3 b/sys-apps/kexec-tools/files/kexec.init-2.0.3 deleted file mode 100644 index a2d32f030219..000000000000 --- a/sys-apps/kexec-tools/files/kexec.init-2.0.3 +++ /dev/null @@ -1,119 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2013 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/kexec-tools/files/kexec.init-2.0.3,v 1.2 2013/03/27 11:50:55 jlec Exp $ - -depend() { - need localmount -} - -image_path() { - local x= kver=$(uname -r) karch=$(uname -m) - BOOTPART="${BOOTPART:-/boot}" - for x in "${KNAME:-bzImage}" vmlinuz \ - bzImage-${kver} vmlinuz-${kver} \ - kernel-genkernel-${karch}-${kver} \ - kernel-${kver} kernel-${karch}; do - if [[ -e "${BOOTPART}/${x}" ]] ; then - echo "${BOOTPART}/${x}" - return 0 - fi - done - - return 1 -} - -initrd_path() { - local x= kver=$(uname -r) karch=$(uname -m) - BOOTPART="${BOOTPART:-/boot}" - for x in "${INITRD:-initrd}" \ - initrd.img-${kver} initrd-${kver}.img \ - initrd-${kver} initramfs-${kver}.img \ - initramfs-genkernel-${karch}-${kver} ; do - if [[ -e "${BOOTPART}/${x}" ]] ; then - echo "${BOOTPART}/${x}" - return 0 - fi - done - - return 1 -} - -load_image() { - if [[ "${KNAME}" = "-" ]]; then - ebegin "Disabling kexec" - kexec -u - eend $? - return $? - fi - - BOOTPART="${BOOTPART:-/boot}" - local img="$(image_path)" initrd="$(initrd_path)" mounted=false initrdopt= - - if [[ -z "${img}" ]] || [[ -z "${initrd}" ]]; then - # If we cannot find our image, try mounting ${BOOTPART} - if ! grep -q " ${BOOTPART} " /proc/mounts; then - ebegin "Mounting ${BOOTPART}" - mount "${BOOTPART}" && mounted=true - eend $? || return $? - img="$(image_path)" - initrd="$(initrd_path)" - fi - fi - - if [[ -z "${img}" ]]; then - eerror "No kernel image found in ${BOOTPART}!" - ${mounted} && umount "${BOOTPART}" - return 1 - else - ebegin "Loading kernel image ${img} for kexec" - fi - - [[ -n "${ROOTPART}" ]] || \ - ROOTPART="$(readlink -f "$(sed -n '/^\/[^ ]* \/ / s,^\([^ ]*\).*,\1,p' /proc/mounts)")" - - [[ -n "${KPARAM}" ]] || KEXEC_OPT_ARGS+=" --reuse-cmdline" - - [[ -n "${initrd}" ]] && [[ -e "${initrd}" ]] && initrdopt="--initrd=${initrd}" - - einfo " Setting kexec with ${KEXEC_OPT_ARGS} -l ${img} root=${ROOTPART} ${KPARAM} ${initrdopt}" - kexec ${KEXEC_OPT_ARGS} -l "${img}" --append="root=${ROOTPART} ${KPARAM}" ${initrdopt} - local res=$? - - ${mounted} && umount "${BOOTPART}" - eend ${res} - return ${res} -} - -start() { - if [[ "${LOAD_DURING_SHUTDOWN:-yes}" = "yes" ]]; then - image_path > /dev/null || \ - ewarn "Cannot find kernel image. Please make sure a valid kernel image is present before reboot." - return 0 - else - ebegin "Configuring kexec" - load_image - eend $? - fi -} - -stop() { - [[ "${LOAD_DURING_SHUTDOWN:-yes}" != "yes" ]] && return 0 - - if ! yesno $RC_REBOOT; then - einfo "Not rebooting, so disabling" - kexec -u - return 0 - fi - - if [[ -f /nokexec ]]; then - einfo "Not using kexec during reboot" - rm -f /nokexec - kexec -u - return 0 - fi - - ebegin "Configuring kexec" - load_image - eend $? -} diff --git a/sys-apps/kexec-tools/files/kexec.init-2.0.4-r2 b/sys-apps/kexec-tools/files/kexec.init-2.0.4-r2 new file mode 100644 index 000000000000..f22566d6a085 --- /dev/null +++ b/sys-apps/kexec-tools/files/kexec.init-2.0.4-r2 @@ -0,0 +1,165 @@ +#!/sbin/runscript +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/kexec-tools/files/kexec.init-2.0.4-r2,v 1.1 2013/09/21 11:35:53 jlec Exp $ + +depend() { + need localmount +} + +image_path() { + local x= kver=$(uname -r) karch=$(uname -m) + BOOTPART="${BOOTPART:-/boot}" + KNAME="${KNAME:-bzImage}" + if [ -e "${KNAME}" ]; then + echo "${KNAME}" + return 0 + fi + for x in "${KNAME#${BOOTPART}}" vmlinuz \ + bzImage-${kver} vmlinuz-${kver} \ + kernel-genkernel-${karch}-${kver} \ + kernel-${kver} kernel-${karch}; do + if [ -e "${BOOTPART}/${x}" ]; then + echo "${BOOTPART}/${x}" + return 0 + fi + done + + return 1 +} + +initrd_path() { + local x= kver=$(uname -r) karch=$(uname -m) + BOOTPART="${BOOTPART:-/boot}" + INITRD="${INITRD:-initrd}" + if [ -e "${INITRD}" ]; then + echo "${INITRD}" + return 0 + fi + for x in "${INITRD#${BOOTPART}}" \ + initrd.img-${kver} initrd-${kver}.img \ + initrd-${kver} initramfs-${kver}.img \ + initramfs-genkernel-${karch}-${kver} ; do + if [ -e "${BOOTPART}/${x}" ]; then + echo "${BOOTPART}/${x}" + return 0 + fi + done + + return 1 +} + +mount_boot(){ + local ret + + [ -n "${DONT_MOUNT_BOOT}" ] && return 1 + grep -q " ${BOOTPART:-/boot} " /proc/mounts && return 1 + + BOOTPART="${BOOTPART:-/boot}" + ebegin "Mounting ${BOOTPART}" + mount "${BOOTPART}"; ret=$? + eend ${ret} + return ${ret} +} + +load_image() { + local ret + if [ "${KNAME}" = "-" ]; then + ebegin "Disabling kexec" + kexec -u; ret=$? + eend ${ret} + return ${ret} + fi + + BOOTPART="${BOOTPART:-/boot}" + local img= initrd="$(initrd_path)" mounted=false initrdopt= + + if ! img="$(image_path)"; then + if mount_boot; then + if img="$(image_path)"; then + mounted=true + initrd="$(initrd_path)" + else + eerror "No kernel image found in ${BOOTPART}!" + umount "${BOOTPART}" + return 1 + fi + else + eerror "No kernel image found in ${BOOTPART}!" + return 1 + fi + fi + + if [ -n "${INITRD}" ] && \ + ! [ "${BOOTPART}/${INITRD#${BOOTPART}}" = "${initrd}" ]; then + eerror "Requested initrd: ${INITRD#${BOOTPART}}" + eerror "could not be found" + return 1 + fi + + [ -n "${ROOTPART}" ] || \ + ROOTPART="$(readlink -f "$(sed -n '/^\/[^ ]* \/ / s,^\([^ ]*\).*,\1,p' /proc/mounts)")" + + [ -n "${KPARAM}" ] || KEXEC_OPT_ARGS="${KEXEC_OPT_ARGS} --reuse-cmdline" + + [ -n "${initrd}" ] && [ -e "${initrd}" ] && initrdopt="--initrd=${initrd}" + + local msg= + [ -n "${initrd}" ] && \ + msg="with ${initrd}" + einfo "Using kernel image ${img} ${msg} for kexec" + + ebegin "Setting kexec with ${KEXEC_OPT_ARGS} -l ${img} root=${ROOTPART} ${KPARAM} ${initrdopt}" + kexec ${KEXEC_OPT_ARGS} -l "${img}" --append="root=${ROOTPART} ${KPARAM}" ${initrdopt} + local res=$? + + ${mounted} && umount "${BOOTPART}" + eend ${res} + return ${res} +} + +start() { + if [ "${LOAD_DURING_SHUTDOWN:-yes}" = "yes" ]; then + local ret=0 + BOOTPART="${BOOTPART:-/boot}" + if mount_boot; then + mounted=true + fi + if ! image_path > /dev/null; then + ewarn "Cannot find kernel image!" + ewarn "Please make sure a valid kernel image is present before reboot." + return 0 + fi + if [ -n "${mounted}" ]; then + ebegin "Unmounting ${BOOTPART}" + umount "${BOOTPART}"; ret=$? + eend ${ret} + fi + return ${ret} + else + ebegin "Configuring kexec" + load_image + eend $? + fi +} + +stop() { + [ "${LOAD_DURING_SHUTDOWN:-yes}" != "yes" ] && return 0 + + if ! yesno $RC_REBOOT; then + einfo "Not rebooting, so disabling" + kexec -u + return 0 + fi + + if [ -f /nokexec ]; then + einfo "Not using kexec during reboot" + rm -f /nokexec + kexec -u + return 0 + fi + + ebegin "Configuring kexec" + load_image + eend $? +} diff --git a/sys-apps/kexec-tools/files/kexec.init b/sys-apps/kexec-tools/files/kexec.init-9999 index 80edb435c89b..56a092832ec8 100755..100644 --- a/sys-apps/kexec-tools/files/kexec.init +++ b/sys-apps/kexec-tools/files/kexec.init-9999 @@ -1,7 +1,7 @@ #!/sbin/runscript -# Copyright 1999-2010 Gentoo Foundation +# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/kexec-tools/files/kexec.init,v 1.15 2010/10/29 06:44:51 jlec Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/kexec-tools/files/kexec.init-9999,v 1.1 2013/09/21 11:35:53 jlec Exp $ depend() { need localmount diff --git a/sys-apps/kexec-tools/files/kexec.init-ng b/sys-apps/kexec-tools/files/kexec.init-ng deleted file mode 100644 index 20a03e3a35bb..000000000000 --- a/sys-apps/kexec-tools/files/kexec.init-ng +++ /dev/null @@ -1,101 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/kexec-tools/files/kexec.init-ng,v 1.1 2011/03/27 08:31:50 jlec Exp $ - -depend() { - need localmount -} - -image_path() { - local x= kver=$(uname -r) - for x in "${KNAME:-bzImage}" vmlinuz \ - bzImage-"${kver}" vmlinuz-"${kver}" ; do - if [ -e "${BOOTPART}/${x}" ] ; then - echo "${BOOTPART}/${x}" - return 0 - fi - done - - return 1 -} - -load_image() { - if [ "${KNAME}" = "-" ] ; then - ebegin "Disabling kexec" - kexec -u - eend $? - return $? - fi - - BOOTPART="${BOOTPART:-/boot}" - local img="$(image_path)" mounted=false initrdopt= - - if [ -z "${img}" ] ; then - # If we cannot find our image, try mounting ${BOOTPART} - if ! grep -q " ${BOOTPART} " /proc/mounts ; then - ebegin "Mounting ${BOOTPART}" - mount "${BOOTPART}" && mounted=true - eend $? || return $? - img="$(image_path)" - fi - fi - - if [ -z "${img}" ] ; then - eerror "No kernel image found in ${BOOTPART}!" - ${mounted} && umount "${BOOTPART}" - return 1 - fi - - ebegin "Loading kernel image ${img} for kexec" - if [ -z "${ROOTPART}" ] ; then - ROOTPART="$(readlink -f "$(sed -n '/^\/[^ ]* \/ / s,^\([^ ]*\).*,\1,p' /etc/mtab)")" - fi - if [ -z "${KPARAM}" ] ; then - KPARAM="$(sed -e 's/ /\n/g' /proc/cmdline | grep -v -e "^root=" | tr '\n' ' ')" - fi - - # Use the default initrd if it exists and none other given - if [ -z "${INITRD}" -a -e "${BOOTPART}"/initrd ] ; then - INITRD="${BOOTPART}/initrd" - fi - if [ -e "${INITRD}" ] ; then - initrdopt="--initrd=${INITRD}" - fi - - kexec -l "${img}" --append="root=${ROOTPART} ${KPARAM}" ${initrdopt} - local res=$? - - ${mounted} && umount "${BOOTPART}" - eend ${res} - return ${res} -} - -start() { - [ "${LOAD_DURING_SHUTDOWN:-yes}" = "yes" ] && return 0 - - ebegin "Configuring kexec" - load_image - eend 0 -} - -stop() { - [ "${LOAD_DURING_SHUTDOWN:-yes}" != "yes" ] && return 0 - - ebegin "Configuring kexec" - if [ "`/sbin/runlevel|/bin/cut -c 3`" != "6" ]; then - einfo "Not rebooting, so disabling" - kexec -u - return 0 - fi - - if [ "`/sbin/runlevel|/bin/cut -c 3`" = "6" ] && [ -f /nokexec ]; then - einfo "Not using kexec during reboot" - rm -f /nokexec - kexec -u - return 0 - fi - - load_image - eend $? -} diff --git a/sys-apps/kexec-tools/files/kexec.service b/sys-apps/kexec-tools/files/kexec.service new file mode 100644 index 000000000000..289aae0df0b1 --- /dev/null +++ b/sys-apps/kexec-tools/files/kexec.service @@ -0,0 +1,16 @@ +[Unit] +Description=Gracefully restart the box +Documentation=man:kexec(8) +After=boot.mount +Before=shutdown.target umount.target final.target +ConditionPathExists=!/nokexec + +[Service] +Type=oneshot +RemainAfterExit=yes +EnvironmentFile=/etc/kexec.conf +ExecStart=/usr/sbin/kexec -l /boot/${KNAME} ${KEXEC_OPT_ARGS} +ExecStop=/usr/sbin/kexec -l /boot/${KNAME} ${KEXEC_OPT_ARGS} + +[Install] +WantedBy=multi-user.target diff --git a/sys-apps/kexec-tools/kexec-tools-2.0.4-r2.ebuild b/sys-apps/kexec-tools/kexec-tools-2.0.4-r2.ebuild new file mode 100644 index 000000000000..9aa786dcbad7 --- /dev/null +++ b/sys-apps/kexec-tools/kexec-tools-2.0.4-r2.ebuild @@ -0,0 +1,70 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/kexec-tools/kexec-tools-2.0.4-r2.ebuild,v 1.1 2013/09/21 11:35:53 jlec Exp $ + +EAPI=5 + +inherit autotools-utils flag-o-matic linux-info systemd + +DESCRIPTION="Load another kernel from the currently executing Linux kernel" +HOMEPAGE="http://kernel.org/pub/linux/utils/kernel/kexec/" +SRC_URI="mirror://kernel/linux/utils/kernel/kexec/${P}.tar.xz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="booke lzma xen zlib" + +DEPEND=" + lzma? ( app-arch/xz-utils ) + zlib? ( sys-libs/zlib )" +RDEPEND="${DEPEND}" + +CONFIG_CHECK="~KEXEC" + +PATCHES=( + "${FILESDIR}"/${PN}-2.0.0-respect-LDFLAGS.patch + "${FILESDIR}"/${P}-disable-kexec-test.patch + ) + +pkg_setup() { + # GNU Make's $(COMPILE.S) passes ASFLAGS to $(CCAS), CCAS=$(CC) + export ASFLAGS="${CCASFLAGS}" + # to disable the -fPIE -pie in the hardened compiler + if gcc-specs-pie ; then + filter-flags -fPIE + append-ldflags -nopie + fi +} + +src_configure() { + local myeconfargs=( + $(use_with booke) + $(use_with lzma) + $(use_with xen) + $(use_with zlib) + ) + autotools-utils_src_configure +} + +src_install() { + autotools-utils_src_install + + dodoc "${FILESDIR}"/README.Gentoo + + newinitd "${FILESDIR}"/kexec.init-${PVR} kexec + newconfd "${FILESDIR}"/kexec.conf-${PV} kexec + + insinto /etc + doins "${FILESDIR}"/kexec.conf + + systemd_dounit "${FILESDIR}"/kexec.service +} + +pkg_postinst() { + if systemd_is_booted || has_version sys-apps/systemd; then + elog "For systemd support the new config file is" + elog " /etc/kexec.conf" + elog "Please adopt it to your needs as there is no autoconfig anymore" + fi +} diff --git a/sys-apps/kexec-tools/kexec-tools-9999.ebuild b/sys-apps/kexec-tools/kexec-tools-9999.ebuild index 1bd1daa82059..a3ab07661f38 100644 --- a/sys-apps/kexec-tools/kexec-tools-9999.ebuild +++ b/sys-apps/kexec-tools/kexec-tools-9999.ebuild @@ -1,39 +1,70 @@ -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/kexec-tools/kexec-tools-9999.ebuild,v 1.7 2011/09/21 08:31:54 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/kexec-tools/kexec-tools-9999.ebuild,v 1.8 2013/09/21 11:35:53 jlec Exp $ -EAPI=2 +EAPI=5 -EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git" -inherit git-2 autotools +AUTOTOOLS_AUTORECONF=true + +inherit autotools-utils flag-o-matic git-2 linux-info systemd DESCRIPTION="Load another kernel from the currently executing Linux kernel" HOMEPAGE="http://kernel.org/pub/linux/utils/kernel/kexec/" SRC_URI="" +EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git" LICENSE="GPL-2" SLOT="0" KEYWORDS="" -IUSE="xen zlib" -DEPEND="zlib? ( sys-libs/zlib )" +IUSE="booke lzma xen zlib" + +DEPEND=" + lzma? ( app-arch/xz-utils ) + zlib? ( sys-libs/zlib )" RDEPEND="${DEPEND}" -src_unpack() { - git-2_src_unpack - cd "${S}" - eautoreconf +CONFIG_CHECK="~KEXEC" + +PATCHES=( "${FILESDIR}"/${PN}-2.0.4-disable-kexec-test.patch ) + +pkg_setup() { + # GNU Make's $(COMPILE.S) passes ASFLAGS to $(CCAS), CCAS=$(CC) + export ASFLAGS="${CCASFLAGS}" + # to disable the -fPIE -pie in the hardened compiler + if gcc-specs-pie ; then + filter-flags -fPIE + append-ldflags -nopie + fi } src_configure() { - econf $(use_with zlib) $(use_with xen) + local myeconfargs=( + $(use_with booke) + $(use_with lzma) + $(use_with xen) + $(use_with zlib) + ) + autotools-utils_src_configure } src_install() { - emake DESTDIR="${D}" install || die "make install failed" + autotools-utils_src_install + + dodoc "${FILESDIR}"/README.Gentoo + + newinitd "${FILESDIR}"/kexec.init-${PV} kexec + newconfd "${FILESDIR}"/kexec.conf-${PV} kexec - doman kexec/kexec.8 - dodoc News AUTHORS TODO doc/*.txt + insinto /etc + doins "${FILESDIR}"/kexec.conf + + systemd_dounit "${FILESDIR}"/kexec.service +} - newinitd "${FILESDIR}"/kexec.init kexec || die - newconfd "${FILESDIR}"/kexec.conf kexec || die +pkg_postinst() { + if systemd_is_booted || has_version sys-apps/systemd; then + elog "For systemd support the new config file is" + elog " /etc/kexec.conf" + elog "Please adopt it to your needs as there is no autoconfig anymore" + fi } |