diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-apps/kexec-tools |
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-apps/kexec-tools')
18 files changed, 1193 insertions, 0 deletions
diff --git a/sys-apps/kexec-tools/Manifest b/sys-apps/kexec-tools/Manifest new file mode 100644 index 000000000000..7423272ab5e8 --- /dev/null +++ b/sys-apps/kexec-tools/Manifest @@ -0,0 +1,22 @@ +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.0-respect-LDFLAGS.patch 293 SHA256 0f7e6cf0ef6bc4ffd898009f3e8d9952fcb2abff7537776023b2194019c885e5 SHA512 c5213462a1e543a357c128af51c9da260fcfa5bcddd9d6bd2fadc84f0456722752e2e7a5584de84d1beca580e07e40ec424eb2577d604beb186403975f7fcd1e WHIRLPOOL 79fe97189297b5d5d87f661ce30b88dee83972157ea99f153f0d0a3f33417e0da6f488c21b16fdcb777a68657fcff88283e49cf6ff2018784c660bc2b88904fb +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.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 3361 SHA256 f462ad4908cd12f19d8255a1efb96cf98bef74d9965f9f47a914096d7b129fc5 SHA512 b4152adced5f2fb6b31b9a42d898efc83d5b6a612b315bc7960fcd16361ed85a465032ce46e54c49c11b0817b84dfa59f1ee00d43442c17ab23bece65e032060 WHIRLPOOL c5eaf77bc2f559d190c9ff7708d79e620071565005febf64e202df79769f0e46b9d4c1bcb5048408222d6312c0eb6b072b41a2805be912ad738668e0dd433e12 +AUX kexec.init-2.0.13-r1 3655 SHA256 c93221d21b73e58efab8d045e164a9be7caf8bed427380a6a75dc996085faf96 SHA512 1d04e14e6fe1debc55fa23029a68f78f2d2a408c12bee6d55252109da178c3dbc998db4ccc7f05f7f8c65b333b50d6a1da7bf0d325ee6cae2f00840078d8a457 WHIRLPOOL 3ea9d42e4bf63845e5310c9108690ee24867628cf89d688c7b0c70b5fc35c97a17ed1c073dc3871826b628986b2a5da7087f625e259625ab88558fd9d163828e +AUX kexec.init-2.0.4-r2 3507 SHA256 643a90ea83b3940e44e6631337d8a56cb21c7b70408603a44611a52a0cce86c1 SHA512 a1b1d907a349b66b97bdbd04fcb0baf03add50816538591a6273e2c3e991b36dd9e15cbe694d915e369ad425c313673b2f9dfd756000fae22102c73ed07deff2 WHIRLPOOL e2b06e98a3c309055e05a88b5291a831c4d8f59e621ec6b52a7a62892f5e7fba75278af16fe9e0534fc274b96cbe04b7b5eb1cd56a938bcd4d79e4493571be0f +AUX kexec.init-2.0.4-r3 3515 SHA256 3e179b6fd9515f8ce97a1ba15a3bb705bbb401e583a674932c664ac7955099a6 SHA512 b9de8b745bc343a6da559064ba1410fffd62e1c8a158012b7dc4c801dc5e5ab6be2aca81be0db7f235c5d1aace308f2d6ff3a3cbf09b7246dd9e1fe4f18655c1 WHIRLPOOL e7786abe4845f7e675b6963a709627b6870e2615bde5fd56b8895c327a31ac74bc1bd81e1e6213e262e46340b0af71ecce25a65371fae15f3d205d8d0316ddce +AUX kexec.service 407 SHA256 d95610609301d46e0f67efd78653beabd7dd253d2bf00f5736de5cdfbf2ea94e SHA512 9f0fa6d39c67048fe774fee0f2e8ed10e9e12a2468e7dda193cd8c5bd8b4cf49819d14703efad35c91265cd4e03c6f5460934b5fe92efd06eab8dc619920b1e3 WHIRLPOOL 9a412481d729e7ec7cec3a4142f2159337d61baf22431e4129f1e7798bf2683f1802e51edc92800e6b42b8b9b01cd83ef51f67cbc1cb7a4b209f923f3180948f +DIST kexec-tools-2.0.14.tar.xz 283640 SHA256 ffb2e7e99d9d08754c6bc1922aed3c000094f318665d82a72ecc76c4ff1c0dc6 SHA512 8c1f9d1f4bb69a621961d45091f9c8349535ae69b80168423663685b44d89e1b9324d5cd11c83e86d805a3371f4f1600b0def551c52efb3c6cf020e9c11c273f WHIRLPOOL 1f9cc414724bf2d710876b2fbf721543cbd973b272a66b86bf134774b946ec540579b698fa3bcb56a2041d226da2c4298f750180c671ece17633067370a9df8e +DIST kexec-tools-2.0.15.tar.xz 286944 SHA256 899b7b861431eb51886d0c12866e91b036228244d35a5fb04762dd1a3c0194e7 SHA512 0bddf31b9bb0e203b813d820e1e248974c2d62cb388dfaf4f2f4971f764cc71e54edbaeaeb663c15d6fa06574beceb87d9ffd7d822ac6699d86c54645096e7e9 WHIRLPOOL 8d40f03cc9cbaf90a9ab9bcb009dfd3c5b1130eec6ac515c3d3a2f7d7205d856fb43ff748a4ef51a1d3169f7ba068d998baafc155c7400a8e96245e326d62558 +DIST kexec-tools-2.0.4.tar.xz 271604 SHA256 e5f5ab00d746eb15b4714eca6a8ec5a1a86a62ce2bbdad1b3000161138a978c6 SHA512 2514f407d9150d2615dffc91a525fb28f159bef92b9543f9802e2618746b7d4c04137668ad8a8d8f0b75f68ed9057d09629ce736b6a061b5cf817b9d904f549e WHIRLPOOL 70ad298512e700cd1cdee7698e4fa68a769d91d3080d5d8387b8362ad49126ad68b0b6dbd1f13305958bdc988f805fa610e487682fd0eb5e4e9bcda0a9022627 +EBUILD kexec-tools-2.0.14.ebuild 1700 SHA256 80d8edc17a3ec421e15309db52fcde87c6ebd528fac4fcdbb2527d19ae83296f SHA512 3fbfc404e7e83a7a74efa5d1ffdf18239ba0e342a0a8a53d1e18b5cc97dd3258d78448b1c5ba20c22559ad18a4488917f3a9feeb711a98fb5720b65cbf47053a WHIRLPOOL b5759527e92e5fdc426f76dfed99b276d3b23e210b11c70fd3dab5c53c4264c004aeeb25ce784be78b69d5225bfb3646d0e2d7a4f4bbef7c4eddd470ad138523 +EBUILD kexec-tools-2.0.15.ebuild 1709 SHA256 2f7dc6d787e62850c84f6757fe9383f810c175aa8a728df50fc444108b867665 SHA512 2a55d5f45633ef05a2fd7bafe0da9052e7f994f698705eb1e3707ae0a0b916c16354e0ea4fd0a8b575217c773f1b7e79b3eedf5f2d5a475829afb49267621ef7 WHIRLPOOL ca8777dac0a982ff64149e8563d4a8343ab221e81fd6fe1e02d4db84518eb2bd9a55085a5768b635298e3fb479c8948178175181f43bea755b8f92507b46c966 +EBUILD kexec-tools-2.0.4-r2.ebuild 1639 SHA256 0cfc223b659de530ff90a67748cfe3f7cec6d2e69f52397847bbd93f95c774ad SHA512 0b1fdd825a235646f6589e1043a7edb190d3aeab6ec4dc153235140995d5ee6b09c226eb159182a3cebfcd9ff9251e241ef12fc0313a6f092a8187e197a3ce82 WHIRLPOOL 9289cf6095624cf4d93aa90883dc6f50751b4fafbadf4c03b8eed3dc1cf5fba4ff8c1b7f94cf8eebce8402fb5200388672f7e0a18eb26f116d69169ad7db896e +EBUILD kexec-tools-9999.ebuild 1709 SHA256 2f7dc6d787e62850c84f6757fe9383f810c175aa8a728df50fc444108b867665 SHA512 2a55d5f45633ef05a2fd7bafe0da9052e7f994f698705eb1e3707ae0a0b916c16354e0ea4fd0a8b575217c773f1b7e79b3eedf5f2d5a475829afb49267621ef7 WHIRLPOOL ca8777dac0a982ff64149e8563d4a8343ab221e81fd6fe1e02d4db84518eb2bd9a55085a5768b635298e3fb479c8948178175181f43bea755b8f92507b46c966 +MISC ChangeLog 4635 SHA256 5d4db73b0ad8fe0a7658756629595187cd9d7f57bc49b7a1c967efadd2344131 SHA512 3d323bb7cb4391d70c455ed3f658010afe0241c07f8d0f670776c997088d21e79f9cb248273999da26acc5a5ca2bd884f947adf97841cef07e72684239538b4f WHIRLPOOL 8003c708454d492bfa20d7ebff1b80f91dcfc1c6cb290e6c197ba3b9330304c6d0f12e9584d8304b4cbc60902e9cd0007290e720bb8b147338db994492849f8f +MISC ChangeLog-2015 13851 SHA256 a3bcc65aaef51bd56f433ca33a52ae000bdae38cdeee6160309893bdbf924a2e SHA512 056e5ffc5523bb1c2e9791dc4faa1715202cbe11b3300589f9cef62dcbfac78b41e99237c4044c1b8622f781f2a0a0343ec16dfdee795e2fa0ad11bafe94d0e5 WHIRLPOOL 2b93fa80c4499a1602a345d1546e795a745cc4d2aa0c874f9269ea1f7b9bd0b0931163027376ffb161d5622684b8612eba3acff81d7aecee3147486b40bb1002 +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 000000000000..40bad423955d --- /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 000000000000..7735e3275ba4 --- /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.0-respect-LDFLAGS.patch b/sys-apps/kexec-tools/files/kexec-tools-2.0.0-respect-LDFLAGS.patch new file mode 100644 index 000000000000..040d138ece06 --- /dev/null +++ b/sys-apps/kexec-tools/files/kexec-tools-2.0.0-respect-LDFLAGS.patch @@ -0,0 +1,11 @@ +--- kdump/Makefile ++++ kdump/Makefile +@@ -18,7 +18,7 @@ + $(KDUMP): CC=$(TARGET_CC) + $(KDUMP): $(KDUMP_OBJS) + @$(MKDIR) -p $(@D) +- $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -o $@ $(KDUMP_OBJS) ++ $(LINK.o) $(CFLAGS) -o $@ $(KDUMP_OBJS) + + $(KDUMP_MANPAGE): kdump/kdump.8 + $(MKDIR) -p $(MANDIR)/man8 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-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 000000000000..64c6cd8ab419 --- /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.conf b/sys-apps/kexec-tools/files/kexec.conf new file mode 100644 index 000000000000..aa829b9c2349 --- /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 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.12 b/sys-apps/kexec-tools/files/kexec.init-2.0.12 new file mode 100644 index 000000000000..a7bd859f0826 --- /dev/null +++ b/sys-apps/kexec-tools/files/kexec.init-2.0.12 @@ -0,0 +1,174 @@ +#!/sbin/openrc-run +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# 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.init-2.0.13-r1 b/sys-apps/kexec-tools/files/kexec.init-2.0.13-r1 new file mode 100644 index 000000000000..5415b3bc85c0 --- /dev/null +++ b/sys-apps/kexec-tools/files/kexec.init-2.0.13-r1 @@ -0,0 +1,186 @@ +#!/sbin/openrc-run +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# 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 +} + +get_genkernel_arch() { + case $1 in + x86_64) echo "amd64" ;; + i[3456]86) echo "x86" ;; + *) echo "$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)" + local gkarch="$(get_genkernel_arch $karch)" + for x in \ + "bzImage" \ + "vmlinuz" \ + "bzImage-${kver}" \ + "vmlinuz-${kver}" \ + "kernel-genkernel-${karch}-${kver}" \ + "kernel-genkernel-${gkarch}-${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)" + local gkarch="$(get_genkernel_arch $karch)" + for x in \ + "initrd" \ + "initrd.img-${kver}" \ + "initrd-${kver}.img" \ + "initrd-${kver}" \ + "initramfs-${kver}.img" \ + "initramfs-genkernel-${karch}-${kver}" \ + "initramfs-genkernel-${gkarch}-${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.init-2.0.4-r2 b/sys-apps/kexec-tools/files/kexec.init-2.0.4-r2 new file mode 100644 index 000000000000..f60cb2a7cafa --- /dev/null +++ b/sys-apps/kexec-tools/files/kexec.init-2.0.4-r2 @@ -0,0 +1,164 @@ +#!/sbin/openrc-run +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +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-2.0.4-r3 b/sys-apps/kexec-tools/files/kexec.init-2.0.4-r3 new file mode 100644 index 000000000000..6eb2a748c9e9 --- /dev/null +++ b/sys-apps/kexec-tools/files/kexec.init-2.0.4-r3 @@ -0,0 +1,164 @@ +#!/sbin/openrc-run +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +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 + + [ "${DONT_MOUNT_BOOT:-no}" = "no" ] || 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() { + 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 + + [ "${LOAD_DURING_SHUTDOWN:-yes}" != "yes" ] && return 0 + + ebegin "Configuring kexec" + 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.14.ebuild b/sys-apps/kexec-tools/kexec-tools-2.0.14.ebuild new file mode 100644 index 000000000000..df5c2d5b6103 --- /dev/null +++ b/sys-apps/kexec-tools/kexec-tools-2.0.14.ebuild @@ -0,0 +1,76 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +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 ~arm64 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 +) + +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.13-r1 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/kexec-tools-2.0.15.ebuild b/sys-apps/kexec-tools/kexec-tools-2.0.15.ebuild new file mode 100644 index 000000000000..f3f01574c051 --- /dev/null +++ b/sys-apps/kexec-tools/kexec-tools-2.0.15.ebuild @@ -0,0 +1,81 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +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 ~arm64 ~x86" +fi + +inherit libtool 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 +) + +pkg_setup() { + # GNU Make's $(COMPILE.S) passes ASFLAGS to $(CCAS), CCAS=$(CC) + export ASFLAGS="${CCASFLAGS}" +} + +src_prepare() { + default + elibtoolize +} + +src_configure() { + local myeconfargs=( + $(use_with booke) + $(use_with lzma) + $(use_with xen) + $(use_with zlib) + ) + econf "${myeconfargs[@]}" +} + +src_install() { + default + + dodoc "${FILESDIR}"/README.Gentoo + + newinitd "${FILESDIR}"/kexec.init-2.0.13-r1 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/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..89c77e7586ba --- /dev/null +++ b/sys-apps/kexec-tools/kexec-tools-2.0.4-r2.ebuild @@ -0,0 +1,72 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 + +inherit autotools-utils flag-o-matic linux-info systemd + +DESCRIPTION="Load another kernel from the currently executing Linux kernel" +HOMEPAGE="https://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" + +REQUIRED_USE="lzma? ( 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 + "${FILESDIR}"/${P}-out-of-source.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 new file mode 100644 index 000000000000..f3f01574c051 --- /dev/null +++ b/sys-apps/kexec-tools/kexec-tools-9999.ebuild @@ -0,0 +1,81 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +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 ~arm64 ~x86" +fi + +inherit libtool 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 +) + +pkg_setup() { + # GNU Make's $(COMPILE.S) passes ASFLAGS to $(CCAS), CCAS=$(CC) + export ASFLAGS="${CCASFLAGS}" +} + +src_prepare() { + default + elibtoolize +} + +src_configure() { + local myeconfargs=( + $(use_with booke) + $(use_with lzma) + $(use_with xen) + $(use_with zlib) + ) + econf "${myeconfargs[@]}" +} + +src_install() { + default + + dodoc "${FILESDIR}"/README.Gentoo + + newinitd "${FILESDIR}"/kexec.init-2.0.13-r1 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 000000000000..2ea57db782e2 --- /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>base-system@gentoo.org</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> |