diff --git a/scripts/pentoo-updater.sh b/scripts/pentoo-updater.sh index 39a1a3be8..bfdedac3b 100755 --- a/scripts/pentoo-updater.sh +++ b/scripts/pentoo-updater.sh @@ -24,6 +24,31 @@ WE_FAILED=0 . /etc/profile env-update +kernel_symlink_fixer() { + ##adjust /usr/src/linux link if we are pretty sure we won't screw up the system + KV=$(uname -r) + if [ -d "/usr/src/linux-${KV}" ] && [ "$(readlink -e /usr/src/linux)" != "/usr/src/linux-${KV}" ]; then + if /usr/bin/qfile "/usr/src/linux-${KV}" > /dev/null 2>&1; then + if [ -L /usr/src/linux ]; then + unlink /usr/src/linux + fi + ln -s "/usr/src/linux-${KV}" /usr/src/linux + if [ -L "/lib/modules/${KV}/build" ]; then + unlink "/lib/modules/${KV}/build" + fi + ln -s "/usr/src/linux-${KV}" "/lib/modules/${KV}/build" + if [ -L "/lib/modules/${KV}/source" ]; then + unlink "/lib/modules/${KV}/source" + fi + ln -s "/usr/src/linux-${KV}" "/lib/modules/${KV}/source" + else + printf "Kernel symlink cannot be correctly set, this is likely to cause failures.\n" + return 1 + fi + fi + return 0 +} + setup_env() { #colorize the updates even if colors end up in the logs export EMERGE_DEFAULT_OPTS="$(portageq envvar EMERGE_DEFAULT_OPTS) --color=y" @@ -258,6 +283,11 @@ do_sync() { main_checks() { setup_env + if kernel_symlink_fixer; then + KERNEL_SYMLINK=0 + else + KERNEL_SYMLINK=1 + fi #check profile, manage repo, ensure valid python selected check_profile if [ -n "${clst_target}" ]; then #we are in catalyst diff --git a/sys-kernel/pentoo-sources/pentoo-sources-5.8.4-r2.ebuild b/sys-kernel/pentoo-sources/pentoo-sources-5.8.4-r2.ebuild index ec668057b..296da0e71 100644 --- a/sys-kernel/pentoo-sources/pentoo-sources-5.8.4-r2.ebuild +++ b/sys-kernel/pentoo-sources/pentoo-sources-5.8.4-r2.ebuild @@ -42,9 +42,9 @@ src_install() { kernel-2_src_install insinto /usr/share/${PN} if use amd64; then - doins "${FILESDIR}"/config-amd64-${PV} + doins "${FILESDIR}"/config-amd64-${PVR} elif use x86; then - doins "${FILESDIR}"/config-x86-${PV} + doins "${FILESDIR}"/config-x86-${PVR} fi }