Include GRUB tools unconditionally and don't create $VAR_DIR/recovery/bootdisk in prep #3136
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Details:
Type: Bug Fix
Impact: Normal
Reference to related issue (URL): see discussion in commit ccae513
How was this pull request tested?
touch /boot/grub2FAIL
full backup and recovery. Original code fails to recover: "Installing GRUB Legacy boot loader:ERROR: Cannot install GRUB Legacy boot loader because there is no 'grub' program." New code works.
touch /boot/grub2FAIL && shopt -s nullglob && rear -d mkrescue && find /*/tmp/rear.*/rootfs /tmp/rear.*/rootfs -name grub\*-\* -executable
original code: nothing
new code:
grub*
in/boot
(e.g./boot/grub2FAIL
), the code got confused by the glob pattern intended to match/boot/grub
or/boot/grub2
and subsequently the rest of the script was skipped, asgrubdir
got assigned something like"/boot/grub2 /boot/grub2FAIL"
, which does not exist, sogrubdir
was set to/boot/grub
, which does not exist either, andgrub-probe
fails.As a result, the GRUB tools were not included in the recovery image.
The code have been proceeding anyway when neither
grub-probe
nor grub2-probe was found, so the tests have not been very useful.Fix and simplify by not checking for the existence of GRUB and just trying to include the GRUB tools always.
$VAR_DIR/recovery/bootdisk
inprep
. This file is unused and creating it in prep stage is against the guideline in prep/README: