summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Ammerlaan <andrewammerlaan@gentoo.org>2024-02-07 13:41:30 +0100
committerAndrew Ammerlaan <andrewammerlaan@gentoo.org>2024-02-11 13:11:16 +0100
commitb5685236fc2dabb63b552e9a4c040724b726a585 (patch)
tree14f51083d6bd4524b27c6664f654b21dd27d72bb
parentkernel-build.eclass: install vmlinu{x,z} symlink (diff)
downloadgentoo-b5685236fc2dabb63b552e9a4c040724b726a585.tar.gz
gentoo-b5685236fc2dabb63b552e9a4c040724b726a585.tar.bz2
gentoo-b5685236fc2dabb63b552e9a4c040724b726a585.zip
kernel-install.eclass: install vmlinu{x,z} symlink
and also link generic initrd/uki.efi Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
-rw-r--r--eclass/kernel-install.eclass28
1 files changed, 21 insertions, 7 deletions
diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass
index 78a498000790..47865a953389 100644
--- a/eclass/kernel-install.eclass
+++ b/eclass/kernel-install.eclass
@@ -572,6 +572,7 @@ kernel-install_pkg_preinst() {
local dir_ver=${PV}${KV_LOCALVERSION}
local kernel_dir=${ED}/usr/src/linux-${dir_ver}
local relfile=${kernel_dir}/include/config/kernel.release
+ local image_path=$(dist-kernel_get_image_path)
[[ ! -d ${kernel_dir} ]] &&
die "Kernel directory ${kernel_dir} not installed!"
[[ ! -f ${relfile} ]] &&
@@ -598,6 +599,12 @@ kernel-install_pkg_preinst() {
rm "${ED}/lib/modules/${release}"/{build,source} || die
dosym "../../../src/linux-${dir_ver}" "/usr/lib/modules/${release}/build"
dosym "../../../src/linux-${dir_ver}" "/usr/lib/modules/${release}/source"
+ for file in vmlinux vmlinuz; do
+ if [[ -L "${ED}/lib/modules/${release}/${file}" ]]; then
+ rm "${ED}/lib/modules/${release}/${file}" || die
+ dosym "../../../src/linux-${dir_ver}/${image_path}" "/usr/lib/modules/${release}/${file}"
+ fi
+ done
fi
}
@@ -629,7 +636,7 @@ kernel-install_install_all() {
local dir_ver=${1}
local kernel_dir=${EROOT}/usr/src/linux-${dir_ver}
local relfile=${kernel_dir}/include/config/kernel.release
- local image_path=${kernel_dir}/$(dist-kernel_get_image_path)
+ local image_path=$(dist-kernel_get_image_path)
local image_dir=${image_path%/*}
local module_ver
module_ver=$(<"${relfile}") || die
@@ -638,15 +645,22 @@ kernel-install_install_all() {
if use generic-uki; then
# Populate placeholders
kernel-install_extract_from_uki linux \
- "${image_dir}"/uki.efi \
- "${image_path}"
+ "${kernel_dir}/${image_dir}"/uki.efi \
+ "${kernel_dir}/${image_path}"
kernel-install_extract_from_uki initrd \
- "${image_dir}"/uki.efi \
- "${image_dir}"/initrd
+ "${kernel_dir}/${image_dir}"/uki.efi \
+ "${kernel_dir}/${image_dir}"/initrd
+ if [[ -L ${EROOT}/lib && ${EROOT}/lib -ef ${EROOT}/usr/lib ]]; then
+ ln -sf "../../../src/linux-${dir_ver}/${image_dir}/initrd" "${EROOT}/usr/lib/modules/${module_ver}/initrd" || die
+ ln -sf "../../../src/linux-${dir_ver}/${image_dir}/uki.efi" "${EROOT}/usr/lib/modules/${module_ver}/uki.efi" || die
+ else
+ ln -sf "../../../usr/src/linux-${dir_ver}/${image_dir}/initrd" "${EROOT}/lib/modules/${module_ver}/initrd" || die
+ ln -sf "../../../usr/src/linux-${dir_ver}/${image_dir}/uki.efi" "${EROOT}/lib/modules/${module_ver}/uki.efi" || die
+ fi
else
# Remove placeholders, -f because these have already been removed
# when doing emerge --config.
- rm -f "${image_dir}"/{initrd,uki.efi} || die
+ rm -f "${kernel_dir}/${image_dir}"/{initrd,uki.efi} || die
fi
fi
@@ -656,7 +670,7 @@ kernel-install_install_all() {
nonfatal mount-boot_check_status || break
nonfatal dist-kernel_install_kernel "${module_ver}" \
- "${image_path}" "${kernel_dir}/System.map" || break
+ "${kernel_dir}/${image_path}" "${kernel_dir}/System.map" || break
success=1
break