From a7cb3530ebd77745524b1d9e26cea1c47f525146 Mon Sep 17 00:00:00 2001 From: optout Date: Fri, 12 Apr 2024 16:34:07 +0000 Subject: [PATCH] Fixed return error due to not being contained within function --- self_compilation.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/self_compilation.sh b/self_compilation.sh index c39dfe7..6a86e95 100644 --- a/self_compilation.sh +++ b/self_compilation.sh @@ -103,18 +103,20 @@ fi make -j $(nproc --all) make modules_install INSTALL_MOD_STRIP=1 install +function install_kernel() { +declare -r distroId="$(awk -F= '$1=="ID"{print $NF}' /etc/os-release)" case "${distroId,,}" in *void*) cp ./arch/x86_64/boot/bzImage /boot/vmlinuz-"$KVER" - dracut --kver "$KVER" --force - grub-mkconfig -o /boot/grub/grub.cfg - xbps-reconfigure -fa - /usr/bin/update-grub + dracut --kver "$KVER" --force + grub-mkconfig -o /boot/grub/grub.cfg + xbps-reconfigure -fa + /usr/bin/update-grub return 0 ;; *debian*|*ubuntu*) cp ./arch/x86_64/boot/bzImage /boot/vmlinuz-"$KVER" - dracut --kver "$KVER" --force + dracut --kver "$KVER" --force update-grub2 return 0 ;; @@ -126,7 +128,11 @@ case "${distroId,,}" in printf '%s\n' "Unable to detect Operating System!" >&2 return 1 ;; - esac +esac +} + +install_kernel + # Remove sysmap/signing keys