diff options
author | Justin Lecher <jlec@gentoo.org> | 2013-03-27 11:50:55 +0000 |
---|---|---|
committer | Justin Lecher <jlec@gentoo.org> | 2013-03-27 11:50:55 +0000 |
commit | 346dc29c564f6cb11b56829663d088ec6cb7b63d (patch) | |
tree | 68321fb51bc4242fbeb24bb7c0da7cc1b1c8beac /sys-apps/kexec-tools | |
parent | Version bump for the 3.2 series, remove old. (diff) | |
download | gentoo-2-346dc29c564f6cb11b56829663d088ec6cb7b63d.tar.gz gentoo-2-346dc29c564f6cb11b56829663d088ec6cb7b63d.tar.bz2 gentoo-2-346dc29c564f6cb11b56829663d088ec6cb7b63d.zip |
sys-apps/kexec-tools: Version BUmp; drop bashism from initscript, #447548; enhanced detection of kernel and initrd image, #412039
(Portage version: 2.2.0_alpha169/cvs/Linux x86_64, signed Manifest commit with key 8009D6F070EB7916)
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-tools-2.0.4-disable-kexec-test.patch | 17 | ||||
-rw-r--r-- | sys-apps/kexec-tools/files/kexec.conf-2.0.4 | 34 | ||||
-rw-r--r-- | sys-apps/kexec-tools/files/kexec.init-2.0.3 | 4 | ||||
-rw-r--r-- | sys-apps/kexec-tools/files/kexec.init-2.0.4 | 143 | ||||
-rw-r--r-- | sys-apps/kexec-tools/kexec-tools-2.0.4.ebuild | 54 | ||||
-rw-r--r-- | sys-apps/kexec-tools/metadata.xml | 18 |
7 files changed, 269 insertions, 13 deletions
diff --git a/sys-apps/kexec-tools/ChangeLog b/sys-apps/kexec-tools/ChangeLog index e2fdfc7144de..8e20b8f3f698 100644 --- a/sys-apps/kexec-tools/ChangeLog +++ b/sys-apps/kexec-tools/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for sys-apps/kexec-tools -# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/kexec-tools/ChangeLog,v 1.46 2012/03/18 07:46:02 jlec Exp $ +# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/kexec-tools/ChangeLog,v 1.47 2013/03/27 11:50:54 jlec Exp $ + +*kexec-tools-2.0.4 (27 Mar 2013) + + 27 Mar 2013; Justin Lecher <jlec@gentoo.org> files/kexec.init-2.0.3, + +files/kexec.conf-2.0.4, +files/kexec.init-2.0.4, +kexec-tools-2.0.4.ebuild, + +files/kexec-tools-2.0.4-disable-kexec-test.patch, metadata.xml: + Version BUmp; drop bashism from initscript, #447548; enhanced detection of + kernel and initrd image, #412039 *kexec-tools-2.0.3-r1 (18 Mar 2012) diff --git a/sys-apps/kexec-tools/files/kexec-tools-2.0.4-disable-kexec-test.patch b/sys-apps/kexec-tools/files/kexec-tools-2.0.4-disable-kexec-test.patch new file mode 100644 index 000000000000..6fc73f2db181 --- /dev/null +++ b/sys-apps/kexec-tools/files/kexec-tools-2.0.4-disable-kexec-test.patch @@ -0,0 +1,17 @@ +diff --git kexec-tools-2.0.3/kexec_test/Makefile kexec-tools-2.0.3/kexec_test/Makefile +index fec6210..2ed4d51 100644 +--- kexec-tools-2.0.3/kexec_test/Makefile ++++ kexec-tools-2.0.3/kexec_test/Makefile +@@ -8,12 +8,6 @@ dist += kexec_test/Makefile $(KEXEC_TEST_SRCS) \ + kexec_test/x86-setup-legacy-pic.S + + BUILD_KEXEC_TEST = no +-ifeq ($(ARCH),i386) +-BUILD_KEXEC_TEST = yes +-endif +-ifeq ($(ARCH),x86_64) +-BUILD_KEXEC_TEST = yes +-endif + + ifeq ($(BUILD_KEXEC_TEST),yes) + diff --git a/sys-apps/kexec-tools/files/kexec.conf-2.0.4 b/sys-apps/kexec-tools/files/kexec.conf-2.0.4 new file mode 100644 index 000000000000..b71ea2bae97f --- /dev/null +++ b/sys-apps/kexec-tools/files/kexec.conf-2.0.4 @@ -0,0 +1,34 @@ +# 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-3.9.0" + +# 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" + +# Do not try to mount /boot +# DONT_MOUNT_BOOT="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 index 6ae811291133..a2d32f030219 100644 --- a/sys-apps/kexec-tools/files/kexec.init-2.0.3 +++ b/sys-apps/kexec-tools/files/kexec.init-2.0.3 @@ -1,7 +1,7 @@ #!/sbin/runscript -# Copyright 1999-2012 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-2.0.3,v 1.1 2012/03/18 07:46:02 jlec Exp $ +# $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 diff --git a/sys-apps/kexec-tools/files/kexec.init-2.0.4 b/sys-apps/kexec-tools/files/kexec.init-2.0.4 new file mode 100644 index 000000000000..5977111d7c42 --- /dev/null +++ b/sys-apps/kexec-tools/files/kexec.init-2.0.4 @@ -0,0 +1,143 @@ +#!/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,v 1.1 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 +} + +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}] && [ -z ${initrd} ]; then + eerror "Requested initrd: ${INITRD}" + 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+=" --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 + 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 + 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/kexec-tools-2.0.4.ebuild b/sys-apps/kexec-tools/kexec-tools-2.0.4.ebuild new file mode 100644 index 000000000000..3c7013e81ded --- /dev/null +++ b/sys-apps/kexec-tools/kexec-tools-2.0.4.ebuild @@ -0,0 +1,54 @@ +# 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.ebuild,v 1.1 2013/03/27 11:50:54 jlec Exp $ + +EAPI=5 + +inherit eutils flag-o-matic linux-info + +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" + +src_prepare() { + epatch \ + "${FILESDIR}"/${PN}-2.0.0-respect-LDFLAGS.patch \ + "${FILESDIR}"/${P}-disable-kexec-test.patch + + # to disable the -fPIE -pie in the hardened compiler + if gcc-specs-pie ; then + filter-flags -fPIE + append-ldflags -nopie + fi +} + +src_configure() { + # GNU Make's $(COMPILE.S) passes ASFLAGS to $(CCAS), CCAS=$(CC) + export ASFLAGS="${CCASFLAGS}" + econf \ + $(use_with booke) \ + $(use_with lzma) \ + $(use_with xen) \ + $(use_with zlib) +} + +src_install() { + default + + dodoc "${FILESDIR}"/README.Gentoo + + newinitd "${FILESDIR}"/kexec.init-${PV} kexec + newconfd "${FILESDIR}"/kexec.conf-${PV} kexec +} diff --git a/sys-apps/kexec-tools/metadata.xml b/sys-apps/kexec-tools/metadata.xml index ca45fa44c725..1443e322b1a8 100644 --- a/sys-apps/kexec-tools/metadata.xml +++ b/sys-apps/kexec-tools/metadata.xml @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> <pkgmetadata> - <herd>kernel-misc</herd> - <maintainer> - <email>jlec@gentoo.org</email> - </maintainer> - <use> - <flag name="lzma">Enables support for LZMA compressed kernel images</flag> - <flag name="booke">Include support for Book-E memory management</flag> - <flag name="xen">Enable extended xen support</flag> - </use> + <herd>kernel-misc</herd> + <maintainer> + <email>jlec@gentoo.org</email> + </maintainer> + <use> + <flag name="lzma">Enables support for LZMA compressed kernel images</flag> + <flag name="booke">Include support for Book-E memory management</flag> + <flag name="xen">Enable extended xen support</flag> + </use> </pkgmetadata> |