diff --git a/home/.chezmoiscripts/universal/run_onchange_after_57-netdata.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_57-netdata.tmpl index 3d67525d..3c0e3b85 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_57-netdata.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_57-netdata.tmpl @@ -31,4 +31,4 @@ else logg warn '`netdata-claim.sh` is not available in the PATH' fi -{{ end - }} +{{ end -}} diff --git a/home/.chezmoiscripts/universal/run_onchange_after_64-grub-settings.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_64-grub-settings.tmpl index 39de59c8..34b872f9 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_64-grub-settings.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_64-grub-settings.tmpl @@ -122,6 +122,8 @@ fi if ! command -v grub2-mkconfig > /dev/null; then if command -v grub-mkconfig > /dev/null; then sudo ln -s "$(which grub-mkconfig)" /usr/bin/grub2-mkconfig + elif sudo which grub-mkconfig > /dev/null; then + sudo ln -s "$(sudo which grub-mkconfig)" /usr/bin/grub2-mkconfig else logg warn 'Neither grub2-mkconfig or grub-mkconfig are available' fi @@ -130,24 +132,31 @@ fi ### Apply GRUB2 theme # Set export DEBUG_MODE=true to bypass GRUB2 / Plymouth application if [ "$DEBUG_MODE" != 'true' ]; then - if [ -d /sys/firmware/efi ]; then - logg info 'Assuming system is UEFI-enabled since /sys/firmware/efi is present' - if [ -f /boot/efi/EFI/qubes/grub.cfg ]; then - logg info 'Running sudo grub2-mkconfig -o /boot/efi/EFI/qubes/grub.cfg' - sudo grub2-mkconfig -o /boot/efi/EFI/qubes/grub.cfg - logg success 'Applied GRUB2 theme' - elif [ -f /boot/efi/EFI/grub.cfg ]; then - logg info 'Running sudo grub2-mkconfig -o /boot/efi/EFI/grub.cfg' - sudo grub2-mkconfig -o /boot/efi/EFI/grub.cfg - logg success 'Applied GRUB2 theme' + if command -v grub2-mkconfig > /dev/null; then + if [ -d /sys/firmware/efi ]; then + logg info 'Assuming system is UEFI-enabled since /sys/firmware/efi is present' + if [ -f /boot/efi/EFI/qubes/grub.cfg ]; then + logg info 'Running sudo grub2-mkconfig -o /boot/efi/EFI/qubes/grub.cfg' + sudo grub2-mkconfig -o /boot/efi/EFI/qubes/grub.cfg + logg success 'Applied GRUB2 theme' + elif [ -f /boot/efi/EFI/grub.cfg ]; then + logg info 'Running sudo grub2-mkconfig -o /boot/efi/EFI/grub.cfg' + sudo grub2-mkconfig -o /boot/efi/EFI/grub.cfg + logg success 'Applied GRUB2 theme' + else + logg warn 'Unknown GRUB2 configuration - not applying GRUB2 theme' + fi else - logg warn 'Unknown GRUB2 configuration - not applying GRUB2 theme' + logg info 'Assuming system is non-UEFI since /sys/firmware/efi is not present' + logg info 'Running sudo grub2-mkconfig -o /boot/grub2/grub.cfg' + sudo grub2-mkconfig -o /boot/grub2/grub.cfg + logg success 'Applied GRUB2 theme' fi + elif [ -f /usr/sbin/update-grub ]; then + logg info 'Running `sudo update-grub`' + sudo update-grub else - logg info 'Assuming system is non-UEFI since /sys/firmware/efi is not present' - logg info 'Running sudo grub2-mkconfig -o /boot/grub2/grub.cfg' - sudo grub2-mkconfig -o /boot/grub2/grub.cfg - logg success 'Applied GRUB2 theme' + logg warn 'Unable to find appropriate GRUB mkconfig command' fi else logg info 'Skipping GRUB2 theme application because DEBUG_MODE is set to true'