diff --git a/sdk_container/src/third_party/portage-stable/sys-apps/kexec-tools/files/kexec-auto-load b/sdk_container/src/third_party/portage-stable/sys-apps/kexec-tools/files/kexec-auto-load new file mode 100644 index 0000000000..62c828fd1c --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/sys-apps/kexec-tools/files/kexec-auto-load @@ -0,0 +1,95 @@ +#!/usr/bin/env bash + +# Defaults +LAYOUT=compat +BOOTPART=/boot +KNAME=kernel +INITRD=initramfs.img + +instkern_state=/var/lib/misc/installkernel +if [[ -s ${instkern_state} ]]; then + # If we have a log file, set defaults from there. + IFS=$'\t' read -r -a LastKernArray <<< "$(tail -n1 ${instkern_state})" + LAYOUT="${LastKernArray[4]}" + BOOTPART="${LastKernArray[7]}" + KNAME="${LastKernArray[8]}" + if [[ "${LastKernArray[9]}" != unknown && ${LAYOUT} != uki ]]; then + INITRD="${LastKernArray[9]}" + else + INITRD= + fi +fi + +if [[ ${LAYOUT} == uki ]]; then + echo "WARNING: kexec currently does not support UKIs" + KPARAM= +else + if [[ -f /etc/kernel/cmdline ]]; then + KPARAM="$(tr -s "${IFS}" ' ' , # or bzImage, vmlinuz (without suffix), # then it's automaticaly detected. # Setting it to "-" will disable kexec. -#KNAME="vmlinuz-3.9.0" +#KNAME="kernel" # Initrd # Same automatic detection restriction as for KNAME apply. @@ -31,4 +31,4 @@ #KPARAM="splash=silent,theme:emergence" # Do not try to mount /boot -# DONT_MOUNT_BOOT="yes" +#DONT_MOUNT_BOOT="yes" diff --git a/sdk_container/src/third_party/portage-stable/sys-apps/kexec-tools/files/kexec.service b/sdk_container/src/third_party/portage-stable/sys-apps/kexec-tools/files/kexec.service index 289aae0df0..ce9adf0e5d 100644 --- a/sdk_container/src/third_party/portage-stable/sys-apps/kexec-tools/files/kexec.service +++ b/sdk_container/src/third_party/portage-stable/sys-apps/kexec-tools/files/kexec.service @@ -9,8 +9,8 @@ ConditionPathExists=!/nokexec 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} +ExecStart=/usr/sbin/kexec-auto-load +ExecStop=/usr/sbin/kexec-auto-load [Install] WantedBy=multi-user.target diff --git a/sdk_container/src/third_party/portage-stable/sys-apps/kexec-tools/kexec-tools-2.0.29.ebuild b/sdk_container/src/third_party/portage-stable/sys-apps/kexec-tools/kexec-tools-2.0.29-r1.ebuild similarity index 85% rename from sdk_container/src/third_party/portage-stable/sys-apps/kexec-tools/kexec-tools-2.0.29.ebuild rename to sdk_container/src/third_party/portage-stable/sys-apps/kexec-tools/kexec-tools-2.0.29-r1.ebuild index bedde55d96..761057097d 100644 --- a/sdk_container/src/third_party/portage-stable/sys-apps/kexec-tools/kexec-tools-2.0.29.ebuild +++ b/sdk_container/src/third_party/portage-stable/sys-apps/kexec-tools/kexec-tools-2.0.29-r1.ebuild @@ -3,7 +3,7 @@ EAPI=8 -inherit libtool linux-info optfeature systemd +inherit libtool linux-info systemd if [[ ${PV} == "9999" ]] ; then inherit git-r3 autotools @@ -92,24 +92,16 @@ src_install() { dodoc "${FILESDIR}"/README.Gentoo newinitd "${FILESDIR}"/kexec-r2.init kexec - newconfd "${FILESDIR}"/kexec.conf-2.0.4 kexec insinto /etc doins "${FILESDIR}"/kexec.conf + dosym ../kexec.conf /etc/conf.d/kexec - insinto /etc/kernel/postinst.d - doins "${FILESDIR}"/90_kexec - + dosbin "${FILESDIR}"/kexec-auto-load 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 - local n_root_args=$(grep -o -- '\/dev/null | wc -l) local has_rootpart_set=no if [[ -f "${EROOT}/etc/conf.d/kexec" ]]; then @@ -125,7 +117,4 @@ pkg_postinst() { ewarn "in case running system and initramfs do not agree on detected" ewarn "root device name!" fi - - optfeature "automatically updating /etc/kexec.conf on each kernel installation" \ - "sys-kernel/installkernel[-systemd]" } diff --git a/sdk_container/src/third_party/portage-stable/sys-apps/kexec-tools/kexec-tools-9999.ebuild b/sdk_container/src/third_party/portage-stable/sys-apps/kexec-tools/kexec-tools-9999.ebuild index bedde55d96..761057097d 100644 --- a/sdk_container/src/third_party/portage-stable/sys-apps/kexec-tools/kexec-tools-9999.ebuild +++ b/sdk_container/src/third_party/portage-stable/sys-apps/kexec-tools/kexec-tools-9999.ebuild @@ -3,7 +3,7 @@ EAPI=8 -inherit libtool linux-info optfeature systemd +inherit libtool linux-info systemd if [[ ${PV} == "9999" ]] ; then inherit git-r3 autotools @@ -92,24 +92,16 @@ src_install() { dodoc "${FILESDIR}"/README.Gentoo newinitd "${FILESDIR}"/kexec-r2.init kexec - newconfd "${FILESDIR}"/kexec.conf-2.0.4 kexec insinto /etc doins "${FILESDIR}"/kexec.conf + dosym ../kexec.conf /etc/conf.d/kexec - insinto /etc/kernel/postinst.d - doins "${FILESDIR}"/90_kexec - + dosbin "${FILESDIR}"/kexec-auto-load 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 - local n_root_args=$(grep -o -- '\/dev/null | wc -l) local has_rootpart_set=no if [[ -f "${EROOT}/etc/conf.d/kexec" ]]; then @@ -125,7 +117,4 @@ pkg_postinst() { ewarn "in case running system and initramfs do not agree on detected" ewarn "root device name!" fi - - optfeature "automatically updating /etc/kexec.conf on each kernel installation" \ - "sys-kernel/installkernel[-systemd]" }