aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2025-10-07 10:16:07 +0200
committerMiquel Sabaté Solà <mssola@mssola.com>2025-10-07 10:16:07 +0200
commit0ba83ff22bc3ffcdb183c388c61bf76e5f8224fa (patch)
tree4c00277c2a28c20e3f65e2edb91392dd88b2abe2 /bin
parentb00ad9823a474b1b3ff3436dd7116b8229fb6215 (diff)
downloaddotfiles-0ba83ff22bc3ffcdb183c388c61bf76e5f8224fa.tar.gz
dotfiles-0ba83ff22bc3ffcdb183c388c61bf76e5f8224fa.zip
kbuild: Adapt the uninstall.sh script to profiles
Moreover, some subtle fixes have been added, like using 'update-bootloader' instead of 'update-grub' in SUSE-like systems, and having -f in 'rm' commands so uninstall.sh can be run safely multiple times without erroring out. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/kbuild33
1 files changed, 22 insertions, 11 deletions
diff --git a/bin/kbuild b/bin/kbuild
index 23cef35..ec084dd 100755
--- a/bin/kbuild
+++ b/bin/kbuild
@@ -314,7 +314,7 @@ EXT
\$EDITOR /etc/grub.d/40_custom
# And update grub itself.
-update-grub
+update-bootloader
SCRIPT
;;
*)
@@ -338,21 +338,32 @@ if [ ! -f files.txt ]; then
fi
xargs rm -f < files.txt
-rm -r /usr/lib/modules/$name
-rm -r /boot/dtbs/$name
-rm -r /usr/lib/firmware/$name
-rm /boot/initrd.img-$name
+rm -rf /usr/lib/modules/$name
+rm -rf /boot/dtbs/$name
+rm -rf /usr/lib/firmware/$name
+rm -f /boot/initrd-$name
+rm -f /boot/initrd.img-$name
if [ -z "\$EDITOR" ]; then
EDITOR=vi
fi
-if [ -f /boot/extlinux/extlinux.conf ]; then
- \$EDITOR /boot/extlinux/extlinux.conf
-else
- \$EDITOR /etc/grub.d/40_custom
- update-grub
-fi
+
+SCRIPT
+
+case "$PROFILE" in
+ "vf2")
+cat <<SCRIPT >>"$INSTALL_PATH/uninstall.sh"
+\$EDITOR /boot/extlinux/extlinux.conf
SCRIPT
+ ;;
+ "suse")
+cat <<SCRIPT >>"$INSTALL_PATH/uninstall.sh"
+\$EDITOR /etc/grub.d/40_custom
+update-bootloader
+SCRIPT
+ ;;
+esac
+
##
# Create tarball.