Skip to content

Commit

Permalink
Override boot partition detection (#55)
Browse files Browse the repository at this point in the history
* Override boot partition detection

refer to #54

* Add new option

# GRUB_BTRFS_OVERRIDE_BOOT_PARTITION_DETECTION="false"  
# Change to "true" if you have a boot partition in a different subvolume

* Corrects indentation

* Update readme
GRUB_BTRFS_OVERRIDE_BOOT_PARTITION_DETECTION="false"
(Change to "true" if you have a boot partition in a different subvolume)
  • Loading branch information
Antynea authored Jul 9, 2018
1 parent 13a7186 commit a1a48d2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
19 changes: 13 additions & 6 deletions 41_snapshots-btrfs
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,11 @@ show_snap_found=${GRUB_BTRFS_SHOW_SNAPSHOTS_FOUND:-"true"}
show_total_snap_found=${GRUB_BTRFS_SHOW_TOTAL_SNAPSHOTS_FOUND:-"true"}
## Ignore specific path during run "grub-mkconfig"
ignore_specific_path=("${GRUB_BTRFS_IGNORE_SPECIFIC_PATH[@]}")
## snapper's config name
## Snapper's config name
snapper_config=${GRUB_BTRFS_SNAPPER_CONFIG:-"root"}

## Override boot partition detection
override_boot_partition_detection=${GRUB_BTRFS_OVERRIDE_BOOT_PARTITION_DETECTION:-"false"}
## Customize GRUB directory
grub_directory=${GRUB_BTRFS_DIRNAME:-"grub"}

########################
Expand Down Expand Up @@ -506,12 +508,17 @@ count_limit_snap=0
# detect uuid requirement
check_uuid_required
# Detects if /boot is a separate partition
if [[ "$root_uuid" != "$boot_uuid" ]]; then
printf "# Info: Separate boot partition detected \n" >&2 ;
if [[ "$override_boot_partition_detection" == "true" ]]; then
printf "# Info: Override boot partition detection : enable \n" >&2 ;
boot_separate
else
printf "# Info: Separate boot partition not detected \n" >&2 ;
boot_bounded
if [[ "$root_uuid" != "$boot_uuid" ]]; then
printf "# Info: Separate boot partition detected \n" >&2 ;
boot_separate
else
printf "# Info: Separate boot partition not detected \n" >&2 ;
boot_bounded
fi
fi
# unmounting mount point
umount $gbgmp
Expand Down
3 changes: 2 additions & 1 deletion 41_snapshots-btrfs_config
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@
# GRUB_BTRFS_IGNORE_SPECIFIC_PATH=("var/lib/docker") # Ignore specific path during run "grub-mkconfig"
# GRUB_BTRFS_SNAPPER_CONFIG="root" # Snapper's config name to use
# GRUB_BTRFS_DISABLE="false" # Disable Grub-btrfs
# GRUB_BTRFS_DIRNAME=grub # Might be grub2 on some systems ex. /boot/grub2/...
# GRUB_BTRFS_DIRNAME=grub # Might be grub2 on some systems ex. /boot/grub2/...
# GRUB_BTRFS_OVERRIDE_BOOT_PARTITION_DETECTION="false" # Change to "true" if you have a boot partition in a different subvolume
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ Add this lines to /etc/default/grub:

(Name of the grub folder on /boot/)

* GRUB_BTRFS_OVERRIDE_BOOT_PARTITION_DETECTION="false"
(Change to "true" if you have a boot partition in a different subvolume)

Generate grub.cfg (on Arch linux use grub-mkconfig -o /boot/grub/grub.cfg )

Expand Down

0 comments on commit a1a48d2

Please sign in to comment.