Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asahi-kernel symlink fixes for merged-usr #78

Merged
merged 2 commits into from
Apr 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,13 @@ src_prepare() {
# prepare the default config
cp "${DISTDIR}/kernel-aarch64-16k-fedora.config-${CONFIG_VER}" ".config" || die

# localversion.05-asahi already appends "-asahi"
local myversion="-${MY_TAG}-dist"
# ensure a consistant version across kernel and gentoo
# this passes the ${PV}-as-release check in kernel-install_pkg_preinst()
# override "-asahi" in localversion.05-asahi with "_pX" to override the
# kernel's base varsion to gentoo's ${PV}
echo "-p${MY_TAG}" > localversion.05-asahi
# use CONFIG_LOCALVERSION to provide "asahi" and "dist" annotations.
local myversion="-asahi-dist"
echo "CONFIG_LOCALVERSION=\"${myversion}\"" > "${T}"/version.config || die
local dist_conf_path="${WORKDIR}/gentoo-kernel-config-${GENTOO_CONFIG_VER}"

Expand All @@ -98,9 +103,20 @@ src_prepare() {
kernel-build_merge_configs "${merge_configs[@]}"
}

# Override kernel-install_pkg_preinst() to avoid ${PV}-as-release check
pkg_preinst() {
true
src_install() {
# call kernel-build's scr_install
kernel-build_src_install

# symlink installed *.dtbs back into kernel "source" directory
local dir_ver=${PV}${KV_LOCALVERSION}
local kernel_dir=/usr/src/linux-${dir_ver}
local relfile=${ED}${kernel_dir}/include/config/kernel.release
local module_ver
module_ver=$(<"${relfile}") || die

for dtb in /boot/dtbs/${module_ver}/apple/*.dtb; do
dosym ${dtb} /${kernel_dir}/arch/arm64/boot/dts/apple/$(basename ${dtb})
done
}

pkg_postinst() {
Expand Down
Loading