commit:     d22c47c86acf37929e39382560b038719f30b840
Author:     Aric Belsito <lluixhi <AT> gmail <DOT> com>
AuthorDate: Tue Dec  6 20:49:05 2016 +0000
Commit:     Aric Belsito <lluixhi <AT> gmail <DOT> com>
CommitDate: Tue Dec  6 20:49:05 2016 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=d22c47c8

sys-apps/kexec-tools: Add latest version

 sys-apps/kexec-tools/Manifest                      |  12 ++
 sys-apps/kexec-tools/files/90_kexec                |   9 ++
 sys-apps/kexec-tools/files/README.Gentoo           |  33 ++++
 .../kexec-tools-2.0.4-disable-kexec-test.patch     |  17 ++
 .../files/kexec-tools-2.0.4-out-of-source.patch    |  24 +++
 .../files/kexec-tools-2.0.9-gnu-source.patch       |  10 ++
 sys-apps/kexec-tools/files/kexec.conf              |  16 ++
 sys-apps/kexec-tools/files/kexec.conf-2.0.4        |  34 ++++
 sys-apps/kexec-tools/files/kexec.init-2.0.12       | 175 +++++++++++++++++++++
 sys-apps/kexec-tools/files/kexec.service           |  16 ++
 sys-apps/kexec-tools/kexec-tools-2.0.12.ebuild     |  78 +++++++++
 sys-apps/kexec-tools/metadata.xml                  |  13 ++
 12 files changed, 437 insertions(+)

diff --git a/sys-apps/kexec-tools/Manifest b/sys-apps/kexec-tools/Manifest
new file mode 100644
index 0000000..35ba5f7
--- /dev/null
+++ b/sys-apps/kexec-tools/Manifest
@@ -0,0 +1,12 @@
+AUX 90_kexec 199 SHA256 
0200acc44dfe1108bbc0123ccf3e41ad73d9709c13e8d5ef6333fdff575d3dd8 SHA512 
31837eb7df9b5c9b63c5f500e55fb584e315ac20f328490ff812a265f1a01604724bf4699f142255f7c5fa78cb2d8f2d6220a91961ac90df644b5d545d47ca39
 WHIRLPOOL 
de8bef4f71012ec2868b705dc2943cea27fc66e0987474bcf6269abc02a6409c7868a17ba7dc24a1016066cd6f65bed3179f83e3cc9b247c6a19f126905e7797
+AUX README.Gentoo 937 SHA256 
6ddecc284c89f031792eb31455460a0acece4b3b6103b9ceb8ad79052d7ab42d SHA512 
f082763692def43a97866b88443daf08a2bc1b0dccdc90160d12effa16e1293d8db6935c72ca9dd5502f844078241cbecdfde15b6e8f67a2cca8f3e89f14e654
 WHIRLPOOL 
d8692b1599ef938e048dc42f4aa3ab73f644c68394243e16834b971772919656ebf95554e7d7226f17a86cc42e390c4a5b7cb611280e076e3dd2e02e3c315846
+AUX kexec-tools-2.0.4-disable-kexec-test.patch 473 SHA256 
95d7d6756aa438af926358dc9e6c964e11201a7c19b2ed2b457f013313d47558 SHA512 
c7fe9176db7c3f9c84add1c263c5a695684bf1db55d47152534f0bbb97c084ad5d3f2090307d0bdfcf5622fa810aca3c104f81b3d24baa76f42d3f32d1d4bbad
 WHIRLPOOL 
3b0cebf5aa1cd923c7867d588af9b74002b6266d3065e7c59061c5b510ad1f8aea0e1fa78d2f17a94bf25424db1d566a5648530e9ce5044ead28407b7f6135c5
+AUX kexec-tools-2.0.4-out-of-source.patch 816 SHA256 
f86f053efcd210f7919f458a52721ae3704a905488935a66f67a039bd915d6bf SHA512 
4839800f99e2bdb7dfbf3aa1f3ad795feb63b4e493812a50d4baa839a27b5e96319c4e848969cbcedf627a32ed5fbfb312461c2ac89b73daaa7f8f680f35f504
 WHIRLPOOL 
ec72be471f55d26f18152d6c92c85974c9e2c89021566d2311e517b880846c94d19057f69d055de74954efdef9301fd356b87ff1647467d425bb755c54f338bb
+AUX kexec-tools-2.0.9-gnu-source.patch 455 SHA256 
08b5bc5b838389d8299a331c6f61ba63fc6705e7169e95c323b325ab45855dbf SHA512 
8f860517a1bae52128648b551ad71306edeefd302b7442761181777ef951163af1b189a16bf507cba9879bf318e3de6973500d9bd799e504c81af7862ac23c34
 WHIRLPOOL 
00bcc8a5949d6cd9a2b8db0c04164d2a6ce79939525df93860b306fab45dce7146d23cf3f5ca04e73f4824a8d1db1f9346d77b601dc2bb127a116c3dbb0d57e9
+AUX kexec.conf 340 SHA256 
19d6a02cf0bf3cebf03dc81c3b9fd5f517815ab1060f67cb9019b7e9653a7fc0 SHA512 
66beb57ee13dba70f75f12326643270a0c888e178fdfca8ba7a566a874707aebe2afebb6ceae976dfb0aaf3135048daad6277e70580e4c7911b9ddbf74e4f00a
 WHIRLPOOL 
b77bb59ab16ea67690fa3e551995510b0fb0d82f7e2f10f9ed7d7815eb1e498cdda9ea667d2648b62cd1ae86a3ab67ae2ca1abd1fd2b9fce376b64ac41fb8725
+AUX kexec.conf-2.0.4 1013 SHA256 
4c1b7e4651cd4be342db48389bc560589c896004f0274f8aba35a92fcd790531 SHA512 
96db2834454aa4d038061e9b1f918932da3d3054021487425d0f70c6ad32096b9433ae2f3921e83196b23af901c32e591df3d6a84a6d14e064608d8ad895a599
 WHIRLPOOL 
3041644bf1688ac6c89e6078adcee987913bce124ea3ae4a2ce342c0956f319cccae93aabf39ee4aed9f23812e575f7f06cbf110bf39d9d961a1a19294108f27
+AUX kexec.init-2.0.12 3368 SHA256 
6ca160cf3a8120f6bd609c2ac784a50e0314c0d7030c253929cfb7490bea7966 SHA512 
18718ac27ca564e3995c0a43d3ae9cd46148cb3b83048ef132bf35f2480c6bf5487c6cb8ae36f720dc2dbc56de0292e13648001392ee539448dd01fa3b1fb9d0
 WHIRLPOOL 
2ee9b196f61cd937def36cb8284003e4f3a6b01bb0a127587a64ffa814d2e51bc852048705d510b90158a3a0d3aa7948afaf92dfe1397db5bdf73b27317c7dbe
+AUX kexec.service 407 SHA256 
d95610609301d46e0f67efd78653beabd7dd253d2bf00f5736de5cdfbf2ea94e SHA512 
9f0fa6d39c67048fe774fee0f2e8ed10e9e12a2468e7dda193cd8c5bd8b4cf49819d14703efad35c91265cd4e03c6f5460934b5fe92efd06eab8dc619920b1e3
 WHIRLPOOL 
9a412481d729e7ec7cec3a4142f2159337d61baf22431e4129f1e7798bf2683f1802e51edc92800e6b42b8b9b01cd83ef51f67cbc1cb7a4b209f923f3180948f
+DIST kexec-tools-2.0.12.tar.xz 274776 SHA256 
14ce67b6242426a7ded10f58b7d29d3cfef5c1379850e8ba3816bb42053f920d SHA512 
d192f841180daf534f7214b6c7c5dcd9de0e5616e8cb0da164c24e8b5903a2f65bb1fbe6ca29a3b9077fa6f6435cc33fda19a96584e1f393ee7a2fe56f374dab
 WHIRLPOOL 
9895716544987682f4ba9cc0622afa14c7dc844482fedce29ec9780b8ff74f87cf2bd79ef58febe651fa3bc5934b6d54aaae31d2593fb32ea9fffdca1e5f8c91
+EBUILD kexec-tools-2.0.12.ebuild 1743 SHA256 
3dd9479307a25d2b434b84683e6f5cec16172701b64bbe1e60ff12d67b980365 SHA512 
5da831105989f9d1cebcff20a755ef1de137c1bb81ee4d49cff42d0a46eda91cd90e5ca3daf6c4e0208e986821a60e029c5866fa9d0761a0a3309af90d9fcd03
 WHIRLPOOL 
197581a330d574a71e25495ac5b4fc6961cd6d44635157c63e38639912482d31a2a94dc351b5e32834001ed313b67feee3377660bbe7d393b8565cabb399ff04
+MISC metadata.xml 490 SHA256 
7c27519c83a0610e3e576265116392d298620be323c61a45a7634f29714cf265 SHA512 
6f4b25178cc6b8ff3fea664f2717eb7268d9e71c4ca46c170887eb836f9d78dff7e64067968175d018dc22bbcc2bb8cd6fd5f44edba0966fa568f9fd827a1cff
 WHIRLPOOL 
45f2c1810f7717b0845b2003fea19be5cf9df3f3f2de22a686be9b961a6ebdcdad45cf12097b26b569dadf9a0e7300dcc735b9a4b0b64458f915a88fa8344c58

diff --git a/sys-apps/kexec-tools/files/90_kexec 
b/sys-apps/kexec-tools/files/90_kexec
new file mode 100644
index 0000000..40bad42
--- /dev/null
+++ b/sys-apps/kexec-tools/files/90_kexec
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+version="$1" ; shift
+image="$1" ; shift
+
+exec sed \
+       -e "s:\"vmlinuz-.*\":\"vmlinuz-${version}\":" \
+       -e "s:/boot/initramfs-.*\.img:/boot/initramfs-${version}\.img:" \
+       -i /etc/kexec.conf

diff --git a/sys-apps/kexec-tools/files/README.Gentoo 
b/sys-apps/kexec-tools/files/README.Gentoo
new file mode 100644
index 0000000..7735e32
--- /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-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 0000000..6fc73f2
--- /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-tools-2.0.4-out-of-source.patch 
b/sys-apps/kexec-tools/files/kexec-tools-2.0.4-out-of-source.patch
new file mode 100644
index 0000000..64c6cd8
--- /dev/null
+++ b/sys-apps/kexec-tools/files/kexec-tools-2.0.4-out-of-source.patch
@@ -0,0 +1,24 @@
+ Makefile.in | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index c1859d1..1aa8559 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -44,7 +44,7 @@ TARGET_CFLAGS        = @TARGET_CFLAGS@
+ 
+ # Base compiler flags. These are extended by the subcomponent-Makefiles
+ # where necessary.
+-CPPFLAGS      = @CPPFLAGS@ -I$(srcdir)/include -I$(srcdir)/util_lib/include \
++CPPFLAGS      = @CPPFLAGS@ -I$(top_builddir)/include -I$(srcdir)/include 
-I$(srcdir)/util_lib/include \
+                       -Iinclude/ $($(ARCH)_CPPFLAGS)
+ CFLAGS                = @CFLAGS@ -fno-strict-aliasing -Wall 
-Wstrict-prototypes
+ PURGATORY_EXTRA_CFLAGS = @PURGATORY_EXTRA_CFLAGS@
+@@ -77,6 +77,7 @@ pkgincludedir = $(includedir)/$(PACKAGE_NAME)
+ DESTDIR =
+ 
+ srcdir                = @srcdir@
++top_builddir = @top_builddir@
+ VPATH         = .:$(srcdir)
+ 
+ # install paths

diff --git a/sys-apps/kexec-tools/files/kexec-tools-2.0.9-gnu-source.patch 
b/sys-apps/kexec-tools/files/kexec-tools-2.0.9-gnu-source.patch
new file mode 100644
index 0000000..cfe89c1
--- /dev/null
+++ b/sys-apps/kexec-tools/files/kexec-tools-2.0.9-gnu-source.patch
@@ -0,0 +1,10 @@
+diff -Naurw kexec-tools-2.0.9.orig/vmcore-dmesg/vmcore-dmesg.c 
kexec-tools-2.0.9/vmcore-dmesg/vmcore-dmesg.c
+--- kexec-tools-2.0.9.orig/vmcore-dmesg/vmcore-dmesg.c 2014-10-13 
21:58:06.000000000 -0700
++++ kexec-tools-2.0.9/vmcore-dmesg/vmcore-dmesg.c      2015-12-30 
11:51:20.594760356 -0800
+@@ -1,5 +1,6 @@
+ #define _XOPEN_SOURCE 600
+ #define _LARGEFILE_SOURCE 1
++#define _GNU_SOURCE 1
+ #define _FILE_OFFSET_BITS 64
+ #include <endian.h>
+ #include <byteswap.h>

diff --git a/sys-apps/kexec-tools/files/kexec.conf 
b/sys-apps/kexec-tools/files/kexec.conf
new file mode 100644
index 0000000..aa829b9
--- /dev/null
+++ b/sys-apps/kexec-tools/files/kexec.conf
@@ -0,0 +1,16 @@
+# Kernel image pathname, relative from /boot.
+KNAME="bzimage"
+
+# 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.4 
b/sys-apps/kexec-tools/files/kexec.conf-2.0.4
new file mode 100644
index 0000000..b71ea2b
--- /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.12 
b/sys-apps/kexec-tools/files/kexec.init-2.0.12
new file mode 100755
index 0000000..87863b3
--- /dev/null
+++ b/sys-apps/kexec-tools/files/kexec.init-2.0.12
@@ -0,0 +1,175 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# Set up some defaults.
+: "${LOAD_DURING_SHUTDOWN:=yes}"
+: "${BOOTPART:=/boot}"
+: "${DONT_MOUNT_BOOT:=no}"
+
+depend() {
+       need localmount
+}
+
+auto_prefix_bootpath() {
+       # Only auto-add prefix to relative paths.
+       case $1 in
+       */*) echo "$1";;
+       *)   echo "${BOOTPART}/$1" ;;
+       esac
+}
+
+image_path() {
+       # Do no sanity checking if the user has set a value.
+       if [ -n "${KNAME}" ]; then
+               auto_prefix_bootpath "${KNAME}"
+               return
+       fi
+
+       local x kver="$(uname -r)" karch="$(uname -m)"
+       for x in \
+               "bzImage" \
+               "vmlinuz" \
+               "bzImage-${kver}" \
+               "vmlinuz-${kver}" \
+               "kernel-genkernel-${karch}-${kver}" \
+               "kernel-${kver}" \
+               "kernel-${karch}"; do
+               if [ -e "${BOOTPART}/${x}" ]; then
+                       echo "${BOOTPART}/${x}"
+                       return
+               fi
+       done
+
+       return 1
+}
+
+initrd_path() {
+       # Do no sanity checking if the user has set a value.
+       if [ -n "${INITRD}" ]; then
+               auto_prefix_bootpath "${INITRD}"
+               return 0
+       fi
+
+       local x kver="$(uname -r)" karch="$(uname -m)"
+       for x in \
+               "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() {
+       [ "${DONT_MOUNT_BOOT}" != "no" ] && return 1
+       mountinfo -q "${BOOTPART}" && return 1
+
+       ebegin "Mounting ${BOOTPART}"
+       mount "${BOOTPART}"
+       eend $?
+}
+
+load_image() {
+       if [ "${KNAME}" = "-" ]; then
+               ebegin "Disabling kexec"
+               kexec -u
+               eend $?
+               return  # eend preserved $? for us.
+       fi
+
+       local img initrd="$(initrd_path)" mounted=false kparamopt 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 [ -z "${ROOTPART}" ]; then
+               ROOTPART="$(readlink -f "$(sed -n '/^\/[^ ]* \/ / s,^\([^ 
]*\).*,\1,p' /proc/mounts)")"
+       fi
+
+       if [ -z "${KPARAM}" ]; then
+               kparamopt="--reuse-cmdline"
+       fi
+
+       if [ -n "${initrd}" ]; then
+               initrdopt="--initrd=${initrd}"
+       fi
+
+       local msg
+       [ -n "${initrd}" ] && \
+               msg=" (with ${initrd})"
+       ebegin "Using kernel image ${img}${msg} for kexec"
+
+       kexec ${KEXEC_OPT_ARGS} ${kparamopt} \
+               -l "${img}" --append="root=${ROOTPART} ${KPARAM}" ${initrdopt}
+       local ret=$?
+
+       ${mounted} && umount "${BOOTPART}"
+       eend ${ret}
+       return ${ret}
+}
+
+start() {
+       if [ "${LOAD_DURING_SHUTDOWN}" = "yes" ]; then
+               local mounted
+               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}"
+                       eend $?
+               fi
+               # $? is already set to the previous calls.
+               return
+       else
+               load_image
+       fi
+}
+
+stop() {
+       if ! yesno ${RC_REBOOT}; then
+               ebegin "Not rebooting; disabling kexec"
+               kexec -u
+               eend $?
+               return
+       fi
+
+       if [ -f /nokexec ]; then
+               ebegin "Rebooting; disabling kexec due to /nokexec"
+               rm -f /nokexec
+               kexec -u
+               eend $?
+               return
+       fi
+
+       if [ "${LOAD_DURING_SHUTDOWN}" = "yes" ]; then
+               load_image
+       fi
+}

diff --git a/sys-apps/kexec-tools/files/kexec.service 
b/sys-apps/kexec-tools/files/kexec.service
new file mode 100644
index 0000000..289aae0
--- /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.12.ebuild 
b/sys-apps/kexec-tools/kexec-tools-2.0.12.ebuild
new file mode 100644
index 0000000..8f28a67
--- /dev/null
+++ b/sys-apps/kexec-tools/kexec-tools-2.0.12.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+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
+
+DESCRIPTION="Load another kernel from the currently executing Linux kernel"
+HOMEPAGE="https://kernel.org/pub/linux/utils/kernel/kexec/";
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="booke lzma xen zlib"
+
+REQUIRED_USE="lzma? ( zlib )"
+
+DEPEND="
+       lzma? ( app-arch/xz-utils )
+       zlib? ( sys-libs/zlib )"
+RDEPEND="${DEPEND}"
+
+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-gnu-source.patch
+)
+
+pkg_setup() {
+       # GNU Make's $(COMPILE.S) passes ASFLAGS to $(CCAS), CCAS=$(CC)
+       export ASFLAGS="${CCASFLAGS}"
+}
+
+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-2.0.12 kexec
+       newconfd "${FILESDIR}"/kexec.conf-2.0.4 kexec
+
+       insinto /etc
+       doins "${FILESDIR}"/kexec.conf
+
+       insinto /etc/kernel/postinst.d
+       doins "${FILESDIR}"/90_kexec
+
+       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/metadata.xml 
b/sys-apps/kexec-tools/metadata.xml
new file mode 100644
index 0000000..2ea57db
--- /dev/null
+++ b/sys-apps/kexec-tools/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+  <maintainer type="project">
+    <email>[email protected]</email>
+    <name>Gentoo Base System</name>
+  </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>

Reply via email to