mirror of
https://github.com/Antynea/grub-btrfs.git
synced 2026-03-07 14:54:33 +08:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
92eef3079d | ||
|
|
4e1b628465 | ||
|
|
21df698e04 |
@@ -152,6 +152,7 @@ test_btrfs()
|
|||||||
fi
|
fi
|
||||||
set -e
|
set -e
|
||||||
}
|
}
|
||||||
|
|
||||||
##############
|
##############
|
||||||
### Script ###
|
### Script ###
|
||||||
##############
|
##############
|
||||||
@@ -207,7 +208,7 @@ make_menu_entries()
|
|||||||
fi
|
fi
|
||||||
echo 'Loading Snapshot: "${snap_date_time}" "${snap_dir_name}"'
|
echo 'Loading Snapshot: "${snap_date_time}" "${snap_dir_name}"'
|
||||||
echo 'Loading Kernel: "${k}" ...'
|
echo 'Loading Kernel: "${k}" ...'
|
||||||
linux \"${boot_dir_root_grub}/"${k}"\" root="${LINUX_ROOT_DEVICE}" rw rootflags=subvol=\""${snap_dir_name}"\" ${kernel_parameters}"
|
linux \"${boot_dir_root_grub}/"${k}"\" root="${LINUX_ROOT_DEVICE}" rw ${kernel_parameters} rootflags=subvol=\""${snap_dir_name}"\""
|
||||||
if [[ -f "${boot_dir}"/"${u}" && "${i}" != "${prefix_i}-${kversion}-${alt_suffix_i}" ]] ; then
|
if [[ -f "${boot_dir}"/"${u}" && "${i}" != "${prefix_i}-${kversion}-${alt_suffix_i}" ]] ; then
|
||||||
entry "\
|
entry "\
|
||||||
echo 'Loading Microcode & Initramfs: "${u}" "${i}" ...'
|
echo 'Loading Microcode & Initramfs: "${u}" "${i}" ...'
|
||||||
@@ -238,12 +239,17 @@ snapshot_list()
|
|||||||
{
|
{
|
||||||
# Query info from snapper if it is installed
|
# Query info from snapper if it is installed
|
||||||
type snapper >/dev/null 2>&1
|
type snapper >/dev/null 2>&1
|
||||||
if [[ $? -eq 0 ]]; then
|
if [ $? -eq 0 ]; then
|
||||||
local snapper_ids=($(snapper --no-dbus -t 0 -c "$snapper_config" list | tail -n +3 | cut -d'|' -f 1))
|
if [ -s "/etc/snapper/configs/$snapper_config" ]; then
|
||||||
local snapper_types=($(snapper --no-dbus -t 0 -c "$snapper_config" list | tail -n +3 | cut -d'|' -f 2))
|
printf "# Info: snapper detected, using config '$snapper_config'\n" >&2
|
||||||
|
local snapper_ids=($(snapper --no-dbus -t 0 -c "$snapper_config" list | tail -n +3 | cut -d'|' -f 1))
|
||||||
|
local snapper_types=($(snapper --no-dbus -t 0 -c "$snapper_config" list | tail -n +3 | cut -d'|' -f 2))
|
||||||
|
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
local snapper_descriptions=($(snapper --no-dbus -t 0 -c "$snapper_config" list | tail -n +3 | rev | cut -d'|' -f 2 | rev))
|
local snapper_descriptions=($(snapper --no-dbus -t 0 -c "$snapper_config" list | tail -n +3 | rev | cut -d'|' -f 2 | rev))
|
||||||
|
else
|
||||||
|
printf "# Warning: snapper detected but config '$snapper_config' does not exist\n" >&2
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
@@ -523,11 +529,11 @@ check_uuid_required
|
|||||||
if [[ "$override_boot_partition_detection" == "true" ]]; then
|
if [[ "$override_boot_partition_detection" == "true" ]]; then
|
||||||
printf "# Info: Override boot partition detection : enable \n" >&2 ;
|
printf "# Info: Override boot partition detection : enable \n" >&2 ;
|
||||||
boot_separate
|
boot_separate
|
||||||
else
|
else
|
||||||
if [[ "$root_uuid" != "$boot_uuid" ]]; then
|
if [[ "$root_uuid" != "$boot_uuid" ]]; then
|
||||||
printf "# Info: Separate boot partition detected \n" >&2 ;
|
printf "# Info: Separate boot partition detected \n" >&2 ;
|
||||||
boot_separate
|
boot_separate
|
||||||
else
|
else
|
||||||
printf "# Info: Separate boot partition not detected \n" >&2 ;
|
printf "# Info: Separate boot partition not detected \n" >&2 ;
|
||||||
boot_bounded
|
boot_bounded
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -132,10 +132,10 @@ You have the possibility to modify many parameters in `/etc/default/grub-btrfs/c
|
|||||||
|
|
||||||
##
|
##
|
||||||
### Automatically update grub
|
### Automatically update grub
|
||||||
If you would like Grub to automatically update when a snapshots is made or deleted:
|
If you would like Grub to automatically update when a snapshot is made or deleted:
|
||||||
* Mount your subvolume which contains snapshots to `/.snapshots`
|
* Mount your subvolume which contains snapshots to `/.snapshots`
|
||||||
* Use `systemctl start/enable grub-btrfs.path`
|
* Use `systemctl start/enable grub-btrfs.path`
|
||||||
* `grub-btrfs.path` automatically (re)generate `grub.cfg` when a modification appear in `/.snapshots`
|
* `grub-btrfs.path` automatically (re)generates `grub.cfg` when a modification appears in `/.snapshots`
|
||||||
##
|
##
|
||||||
### Special thanks for assistance and contributions
|
### Special thanks for assistance and contributions
|
||||||
* [maximbaz](https://github.com/maximbaz)
|
* [maximbaz](https://github.com/maximbaz)
|
||||||
|
|||||||
Reference in New Issue
Block a user