diff options
| author | Miquel Sabaté Solà <mssola@mssola.com> | 2025-10-07 10:16:07 +0200 |
|---|---|---|
| committer | Miquel Sabaté Solà <mssola@mssola.com> | 2025-10-07 10:16:07 +0200 |
| commit | 0ba83ff22bc3ffcdb183c388c61bf76e5f8224fa (patch) | |
| tree | 4c00277c2a28c20e3f65e2edb91392dd88b2abe2 | |
| parent | b00ad9823a474b1b3ff3436dd7116b8229fb6215 (diff) | |
| download | dotfiles-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>
| -rwxr-xr-x | bin/kbuild | 33 |
1 files changed, 22 insertions, 11 deletions
@@ -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. |
