pentoo-sources: damnit

This commit is contained in:
Rick Farina (Zero_Chaos) 2020-08-27 13:32:58 -04:00
parent 18d1e54010
commit ee7a3cfcd4
No known key found for this signature in database
GPG key ID: A29433C0AA431DDC
2 changed files with 32 additions and 2 deletions

View file

@ -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

View file

@ -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
}