Skip to content

Commit

Permalink
Merge pull request #1042 from rear/jsmeix-only-last-LOADER_TYPE-matte…
Browse files Browse the repository at this point in the history
…rs_issue1038

Update 50_guess_bootloader.sh:
Added 'tail -n1' to get only the last value if there are more than one
because getting values from sysconfig files is like sourcing
a shell script it is the last setting that matters.
  • Loading branch information
jsmeix committed Oct 20, 2016
2 parents 140041f + d227515 commit 62bdb52
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion usr/share/rear/prep/default/50_guess_bootloader.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
# /var/lib/rear/recovery/bootloader
if [[ -f /etc/sysconfig/bootloader ]]; then
# openSUSE uses LOADER_TYPE, and others??
my_bootloader=$( grep ^LOADER_TYPE /etc/sysconfig/bootloader | cut -d= -f2 | sed -e 's/"//g' )
# getting values from sysconfig files is like sourcing shell scripts so that the last setting wins
my_bootloader=$( grep ^LOADER_TYPE /etc/sysconfig/bootloader | cut -d= -f2 | tail -n1 | sed -e 's/"//g' )
if [[ ! -z "$my_bootloader" ]]; then
echo "$my_bootloader" | tr '[a-z]' '[A-Z]' >$VAR_DIR/recovery/bootloader
return
Expand Down

0 comments on commit 62bdb52

Please sign in to comment.