Skip to content

Commit a790ff0

Browse files
authored
"disable_script" function breaks "grub-mkconfig"
* "disable_script" function breaks "grub-mkconfig": * Replace "return 1" by "exit 0".
1 parent df64336 commit a790ff0

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

41_snapshots-btrfs

+4-7
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,12 @@ grub_btrfs_config="${sysconfdir}/default/grub-btrfs/config"
4545

4646
## Exit the script, if:
4747
disable_script() {
48-
# Disable Grub-btrfs is set to true (default=false)
49-
[[ "${GRUB_BTRFS_DISABLE:-"false"}" == "true" ]] && return 1
50-
# btrfs-progs isn't installed
51-
if ! type btrfs >/dev/null 2>&1; then return 1; fi
52-
# grub-mkconfig_lib couldn't be found
53-
[[ -f "$datarootdir/grub/grub-mkconfig_lib" ]] && . "$datarootdir/grub/grub-mkconfig_lib" || return 1
48+
[[ "${GRUB_BTRFS_DISABLE:-"false"}" == "true" ]] && exit 0 # Disable Grub-btrfs is set to true (default=false)
49+
if ! type btrfs >/dev/null 2>&1; then exit 0; fi # btrfs-progs isn't installed
50+
[[ -f "$datarootdir/grub/grub-mkconfig_lib" ]] && . "$datarootdir/grub/grub-mkconfig_lib" || exit 0 # grub-mkconfig_lib couldn't be found
5451
# Root filesystem isn't btrfs
5552
root_fs=$(${grub_probe} --target="fs" / 2>/dev/null)
56-
[[ "$root_fs" != "btrfs" ]] && return 1
53+
[[ "$root_fs" != "btrfs" ]] && exit 0
5754
return 0
5855
}
5956
disable_script

0 commit comments

Comments
 (0)