summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2016-03-24 15:21:44 -0400
committerMike Frysinger <vapier@gentoo.org>2016-03-24 17:39:33 -0400
commit2ad6174bad17a8a426b977d82017d399111ab963 (patch)
treec414a0e667f1a65ecece4978447a739534851347 /sys-apps/kexec-tools
parentapp-text/asciidoc: move to readme.gentoo-r1 eclass (diff)
downloadgentoo-2ad6174bad17a8a426b977d82017d399111ab963.tar.gz
gentoo-2ad6174bad17a8a426b977d82017d399111ab963.tar.bz2
gentoo-2ad6174bad17a8a426b977d82017d399111ab963.zip
sys-apps/kexec-tools: merge git & release versions
Diffstat (limited to 'sys-apps/kexec-tools')
-rw-r--r--sys-apps/kexec-tools/files/kexec.conf-999918
-rw-r--r--sys-apps/kexec-tools/files/kexec.init-9999165
-rw-r--r--sys-apps/kexec-tools/kexec-tools-9999.ebuild23
3 files changed, 13 insertions, 193 deletions
diff --git a/sys-apps/kexec-tools/files/kexec.conf-9999 b/sys-apps/kexec-tools/files/kexec.conf-9999
deleted file mode 100644
index 74f8b891ce54..000000000000
--- a/sys-apps/kexec-tools/files/kexec.conf-9999
+++ /dev/null
@@ -1,18 +0,0 @@
-# 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-9999 b/sys-apps/kexec-tools/files/kexec.init-9999
deleted file mode 100644
index f1306874297c..000000000000
--- a/sys-apps/kexec-tools/files/kexec.init-9999
+++ /dev/null
@@ -1,165 +0,0 @@
-#!/sbin/runscript
-# Copyright 1999-2013 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-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/kexec-tools-9999.ebuild b/sys-apps/kexec-tools/kexec-tools-9999.ebuild
index 008925c94fd6..8e66b4e631b9 100644
--- a/sys-apps/kexec-tools/kexec-tools-9999.ebuild
+++ b/sys-apps/kexec-tools/kexec-tools-9999.ebuild
@@ -1,21 +1,25 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
-EAPI=5
+EAPI="5"
-AUTOTOOLS_AUTORECONF=true
+if [[ ${PV} == "9999" ]] ; then
+ inherit git-r3
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git"
+ AUTOTOOLS_AUTORECONF=true
+else
+ SRC_URI="mirror://kernel/linux/utils/kernel/kexec/${P}.tar.xz"
+ KEYWORDS="~amd64 ~x86"
+fi
-inherit autotools-utils linux-info systemd git-r3
+inherit autotools-utils linux-info systemd
DESCRIPTION="Load another kernel from the currently executing Linux kernel"
HOMEPAGE="https://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="booke lzma xen zlib"
REQUIRED_USE="lzma? ( zlib )"
@@ -30,7 +34,6 @@ CONFIG_CHECK="~KEXEC"
PATCHES=(
"${FILESDIR}"/${PN}-2.0.4-disable-kexec-test.patch
"${FILESDIR}"/${PN}-2.0.4-out-of-source.patch
- "${FILESDIR}"/${PN}-2.0.9-hardened.patch
)
pkg_setup() {
@@ -53,8 +56,8 @@ src_install() {
dodoc "${FILESDIR}"/README.Gentoo
- newinitd "${FILESDIR}"/kexec.init-${PV} kexec
- newconfd "${FILESDIR}"/kexec.conf-${PV} kexec
+ newinitd "${FILESDIR}"/kexec.init-2.0.4-r3 kexec
+ newconfd "${FILESDIR}"/kexec.conf-2.0.4 kexec
insinto /etc
doins "${FILESDIR}"/kexec.conf