Skip to content

Commit

Permalink
Fix : GRUB_BTRFS_LIMIT (Limit the number of snapshots populated in th…
Browse files Browse the repository at this point in the history
…e GRUB menu.)

Fix : When a value =< 0, script stop correctly
fix : When a value => 1, script stop when the value is reached

e.g :
 - GRUB_BTRFS_LIMIT="0"
   script doesn't detect snapshot

 - GRUB_BTRFS_LIMIT"1" or "2" "etc..."
   script will stop the snapshot detection when value is reached
  • Loading branch information
Antynea committed Apr 22, 2016
1 parent 87a94c1 commit f0c50d1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions 41_snapshots-btrfs
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ list_kernels_initramfs()
IFS=$'\n'
count_limit_snap=0
for item in $(snapshot_list); do
### fix: limit_snap_show=0
[[ ${limit_snap_show} -le 0 ]] && break;
IFS=$oldIFS
item=($item)
snap_dir_name=${item[@]:2:${#item[@]}}
Expand Down Expand Up @@ -314,11 +316,9 @@ list_kernels_initramfs()
title_format
# echo "${title_menu[*]}"
snapshots_entry
### Limit snapshots found during run "grub-mkconfig"
count_limit_snap=$((1+$count_limit_snap))
if [[ $count_limit_snap -gt $limit_snap_show ]]; then
break;
fi
### Limit snapshots found during run "grub-mkconfig"
count_limit_snap=$((1+$count_limit_snap))
[[ $count_limit_snap -ge $limit_snap_show ]] && break;
done
IFS=$oldIFS
}
Expand Down

0 comments on commit f0c50d1

Please sign in to comment.