Fix check for valid boot options

-r will always succeed since the file will be generated regardless
of number of boot entries found. Use -s instead to check for zero
file size.

Signed-off-by: Matt DeVillier <matt.devillier@puri.sm>
This commit is contained in:
Matt DeVillier 2020-07-28 22:26:20 -05:00
parent 4c64ca631a
commit 97143953e8
No known key found for this signature in database
GPG Key ID: 2BBB776A35B978FD
2 changed files with 2 additions and 2 deletions

View File

@ -173,7 +173,7 @@ scan_options() {
kexec-parse-bls "$bootdir" "$i" "$bootdir/loader/entries" >> $option_file
done
fi
if [ ! -r $option_file ]; then
if [ ! -s $option_file ]; then
die "Failed to parse any boot options"
fi
if [ "$unique" = 'y' ]; then

View File

@ -209,7 +209,7 @@ set_default_boot_option()
kexec-parse-bls "/boot" "$i" "/boot/loader/entries" >> $option_file
done
fi
[ ! -r $option_file ] \
[ ! -s $option_file ] \
&& whiptail_error_die "Failed to parse any boot options"
# sort boot options