summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Lecher <jlec@gentoo.org>2012-03-18 07:46:02 +0000
committerJustin Lecher <jlec@gentoo.org>2012-03-18 07:46:02 +0000
commitb902a0aee3e1b31c1a567e5cb48f77f880645301 (patch)
tree8799bfe22c560e0f1b18dd7fbdcbf0e1cee96374 /sys-apps/kexec-tools
parentPass -Os in TARGET_CFLAGS for efi-64 on x86. Don't clobber TARGET variables i... (diff)
downloadhistorical-b902a0aee3e1b31c1a567e5cb48f77f880645301.tar.gz
historical-b902a0aee3e1b31c1a567e5cb48f77f880645301.tar.bz2
historical-b902a0aee3e1b31c1a567e5cb48f77f880645301.zip
Use $RC_REBOOT instead of /sbin/runlevel, #401231 thanks William Hubbs for the patch; usability enhancements including better detection of the kernel image, additional option parsing, better descriptions in the config file, #392229, thanks teika for those things; better detection of genkernel, #370207, thanks Łukasz Stelmach & Dennis Schridde for their contributions
Package-Manager: portage-2.2.0_alpha90/cvs/Linux x86_64
Diffstat (limited to 'sys-apps/kexec-tools')
-rw-r--r--sys-apps/kexec-tools/ChangeLog12
-rw-r--r--sys-apps/kexec-tools/Manifest12
-rw-r--r--sys-apps/kexec-tools/files/README.Gentoo33
-rw-r--r--sys-apps/kexec-tools/files/kexec.conf-2.0.331
-rw-r--r--sys-apps/kexec-tools/files/kexec.init-2.0.3119
-rw-r--r--sys-apps/kexec-tools/kexec-tools-2.0.3-r1.ebuild48
6 files changed, 250 insertions, 5 deletions
diff --git a/sys-apps/kexec-tools/ChangeLog b/sys-apps/kexec-tools/ChangeLog
index 0f670e2ba6e0..e2fdfc7144de 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-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/kexec-tools/ChangeLog,v 1.45 2012/02/16 22:13:00 jlec Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/kexec-tools/ChangeLog,v 1.46 2012/03/18 07:46:02 jlec Exp $
+
+*kexec-tools-2.0.3-r1 (18 Mar 2012)
+
+ 18 Mar 2012; Justin Lecher <jlec@gentoo.org> +files/kexec.conf-2.0.3,
+ +files/kexec.init-2.0.3, +kexec-tools-2.0.3-r1.ebuild, +files/README.Gentoo:
+ Use $RC_REBOOT instead of /sbin/runlevel, #401231 thanks William Hubbs for
+ the patch; usability enhancements including better detection of the kernel
+ image, additional option parsing, better descriptions in the config file,
+ #392229, thanks teika for those things; better detection of genkernel,
+ #370207, thanks Łukasz Stelmach & Dennis Schridde for their contributions
*kexec-tools-2.0.3 (16 Feb 2012)
diff --git a/sys-apps/kexec-tools/Manifest b/sys-apps/kexec-tools/Manifest
index 7e39f33212c1..141813aeaf4f 100644
--- a/sys-apps/kexec-tools/Manifest
+++ b/sys-apps/kexec-tools/Manifest
@@ -1,21 +1,25 @@
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
+AUX README.Gentoo 939 RMD160 3b585788660081fafef348c8b00dc3cb66e9a5db SHA1 0aafd052b8771995a5a789f2193a8de6f3482c48 SHA256 e1fa00817a8230efbcdc149a64c6a65418a46d5e6977b3d3adb91d1d3f44e29f
AUX kexec-tools-2.0.0-respect-LDFLAGS.patch 290 RMD160 d49f079dc270d602f7f7802ec56ee2fe867da359 SHA1 8d65add25fee582433b08e5cd09018e2efbe55e8 SHA256 c815c53eebcfddd687cefcaa835b604b489f14410bbd4c524e845cf31c69fa15
AUX kexec.conf 397 RMD160 a366158ef7a24764c7e42bd0a246e035587d0c42 SHA1 46760b27c210c7514a86f9d2f2b35b3ffc5f9d90 SHA256 59bd15f8a0be3a41a457e61cfbb3520252773ed6422b9b223b347dfeb54f152a
+AUX kexec.conf-2.0.3 961 RMD160 e3b77fdc6fd9bb85b142cc03b4bacc752ea78754 SHA1 b8cb12701734c23363a602cfac3e8310cbe92b39 SHA256 ecc3903b0a302243be84e954c2f4bb1c0ce86ca516589a5a30fa12db821969d7
AUX kexec.init 2106 RMD160 498f7a47af6bf151561d0e2ae1ec659d716918d7 SHA1 797bb66e29c55a1e22d2b7d60141a8cdaa14058e SHA256 34c97c9d11ab741cb13160bab16e322929d2c84bbefaa13d33171bdf02b0dc98
+AUX kexec.init-2.0.3 2825 RMD160 419b67cf15c5183e34b56e6c0f43c541c865c777 SHA1 99b05cb61889f468dc25278f4c19438b94966fc7 SHA256 4f728dfa6fd5c3d65100c41665858a284132e35a7f7e45365df98d79a474f6c6
AUX kexec.init-ng 2264 RMD160 faf4d339503e80cdbb1c6a1860ce0fd0de22531c SHA1 c04dac2211c8ff792ca1127ffb36961060d6932f SHA256 ba1a0d48a1a8663d2d48b83eeda987e83fa0440254573ded7c487e888824f947
DIST kexec-tools-2.0.2.tar.bz2 305961 RMD160 cc1dd7806cbb31a5125904beab004ee8abf1a903 SHA1 cc0fcb1c258d46ac21cb064b73c19cee458f4ee7 SHA256 f9acb94dcf4cee2a04da18112a6e5732cdcbe98f893039a93582d88307e0103f
DIST kexec-tools-2.0.3.tar.xz 264620 RMD160 31229169ff1c8e83e6eb412e9222d5db0ecf50fd SHA1 0fcdc502a1e5b5f5ff1c0af120b84ce178f16649 SHA256 a2dcb8320cab2ce22b3734ec07b1a63e27d0b301b4a88556b1b05d53f7d786a9
EBUILD kexec-tools-2.0.2-r1.ebuild 1397 RMD160 efbc3cdbe00945417cb823e249dd4ae46ac321e9 SHA1 828e258b9153938c1c88efb60f333592ad5be803 SHA256 168f11edfad0582a801776889a8d1e6a8452c8dccc9e13b0a669399138b5a9bc
+EBUILD kexec-tools-2.0.3-r1.ebuild 1214 RMD160 7322b77b95af9d816a3a2fb098ba31f1c1ff47cd SHA1 6628e320d9a00eee408b8e7ceb6c6374b387ea25 SHA256 75655273df06ced0c5e064880657804ea4b203048547da53c37deb0d3e2d0720
EBUILD kexec-tools-2.0.3.ebuild 1132 RMD160 041807b8071032bb190afeb4460892f81a6458e0 SHA1 2afdd6d4b8975ad7b5b9eab9ac171b4170fe9f25 SHA256 ef170e1267edb4152d1f681c1db1e1015dba3cd0666d399e6bc05bc4b3984eb2
EBUILD kexec-tools-9999.ebuild 946 RMD160 27a265df371fa9561a75bead92ec4d7160bd0b5c SHA1 b0ff53a6932944202a5fc69551df3a12ce39ceb3 SHA256 2a644186ff46ec113f48d1952450b0b704082910b378f192c04d13e95945de03
-MISC ChangeLog 9360 RMD160 d4d98d60b248e2f4a92385f254accc487247286f SHA1 40efc8ecf392d06267c3f19c970c478c9775643a SHA256 d9177e105bee51db6bff45dde6190231dd8d6e5ca6c498789df0621777a5d0d1
+MISC ChangeLog 9929 RMD160 bfab52aed02d2c6d04b9f965e844468c2fedc9d2 SHA1 0e80421a3d09dd8d301868f24700c7afd3194e79 SHA256 92d444b4b5305d96a78b073aed7e19cc59aa31a4248c4f53e33d7b7f4cc7a5e0
MISC metadata.xml 446 RMD160 b6c05351e99ae652b8f6a59e8f59e5f9bb9ec3b0 SHA1 d26b6e9a315ab5592a045892d80801be98dd970b SHA256 b6ea39f3644b8dd1bbac879650d3e32972fa61b90a8cf50a5ef87d677cf3781b
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (GNU/Linux)
-iEYEAREKAAYFAk89f3IACgkQgAnW8HDreRY3pQCglruIN16pRR2cGeJTrUE+lLUE
-+QwAnRzxgL7jsg/RQr0P1azkxiPV45fH
-=bbc3
+iEYEAREKAAYFAk9lkr8ACgkQgAnW8HDreRZGJgCgyx9v46SthKjtQa73IFztoV68
+L5wAoKEmEnwiwndofnP4SJJ5f8gVXIDU
+=gShJ
-----END PGP SIGNATURE-----
diff --git a/sys-apps/kexec-tools/files/README.Gentoo b/sys-apps/kexec-tools/files/README.Gentoo
new file mode 100644
index 000000000000..ad88924cbb23
--- /dev/null
+++ b/sys-apps/kexec-tools/files/README.Gentoo
@@ -0,0 +1,33 @@
+Usage
+=====
+
+Do
+ $ man 8 kexec
+for full understanding of the underlying kexec command.
+Gentoo offers a wrapper to the bare kexec command through
+/etc/init.d/kexec.
+
+Configuration
+-------------
+
+Configuration is done in /etc/conf.d/kexec, which is self-documented.
+
+Usage
+-----
+
+In Gentoo, kexec is invoked, i.e., the new kernel will be booted when
+rebooting, by reboot (8) command or by pressing Ctrl+Alt+Del.
+
+If you want to use kexec once, just run
+ $ /etc/init.d/kexec start
+
+It'll reserve kexec call at reboot. Later on, you can reboot anytime,
+letting kexec starts another (or the same) kernel. When all is done in
+the runlevel 6 - killing processes, unmounting volumes, etc - kexec
+starts the new kernel instead of doing the normal hardware reboot.
+
+If you want kexec to be run every time you reboot, add it to a runlevel:
+ $ rc-update add kexec <runlevel>
+
+If you want to reboot in the normal way this time, do:
+ $ touch /nokexec
diff --git a/sys-apps/kexec-tools/files/kexec.conf-2.0.3 b/sys-apps/kexec-tools/files/kexec.conf-2.0.3
new file mode 100644
index 000000000000..a1d409edabc6
--- /dev/null
+++ b/sys-apps/kexec-tools/files/kexec.conf-2.0.3
@@ -0,0 +1,31 @@
+# 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.init-2.0.3 b/sys-apps/kexec-tools/files/kexec.init-2.0.3
new file mode 100644
index 000000000000..6ae811291133
--- /dev/null
+++ b/sys-apps/kexec-tools/files/kexec.init-2.0.3
@@ -0,0 +1,119 @@
+#!/sbin/runscript
+# Copyright 1999-2012 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 $
+
+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/kexec-tools-2.0.3-r1.ebuild b/sys-apps/kexec-tools/kexec-tools-2.0.3-r1.ebuild
new file mode 100644
index 000000000000..5197273fa2b6
--- /dev/null
+++ b/sys-apps/kexec-tools/kexec-tools-2.0.3-r1.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2012 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.3-r1.ebuild,v 1.1 2012/03/18 07:46:02 jlec Exp $
+
+EAPI=4
+
+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"
+
+ # 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 lzma) $(use_with xen) $(use_with zlib) $(use_with booke)
+}
+
+src_install() {
+ default
+
+ dodoc "${FILESDIR}"/README.Gentoo
+
+ newinitd "${FILESDIR}"/kexec.init-${PV} kexec
+ newconfd "${FILESDIR}"/kexec.conf-${PV} kexec
+}