mirror of
https://github.com/linuxboot/heads.git
synced 2025-02-21 01:31:26 +00:00
Merge pull request #1341 from tlaurion/fix_kexec-save-default_initrd_removal
ikexec-save-default: fix case when no crypttab found in initrd
This commit is contained in:
commit
6ee4b1cbe1
@ -169,18 +169,21 @@ if [ "$save_key" = "y" ]; then
|
||||
done
|
||||
done
|
||||
|
||||
cd - > /dev/null
|
||||
|
||||
#insert current default boot's initrd crypttab locations into tracking file to be overwritten into initramfs at kexec-inject-key
|
||||
echo "+++ The following OS crypttab file:entry were modified from default boot's initrd:"
|
||||
cat $bootdir/kexec_initrd_crypttab_overrides.txt
|
||||
echo "+++ Heads added /secret.key in those entries and saved them under $bootdir/kexec_initrd_crypttab_overrides.txt"
|
||||
echo "+++ Those overrides will be part of detached signed digests and used to prepare cpio injected at kexec of selected default boot entry."
|
||||
else
|
||||
echo "+++ No crypttab file found in extracted initrd. Removing $bootdir/kexec_initrd_crypttab_overrides.txt"
|
||||
rm -f "$bootdir/kexec_initrd_crypttab_overrides.txt" || true
|
||||
echo "+++ No crypttab file found in extracted initrd. A generic crypttab will be generated"
|
||||
if [ -e "$bootdir/kexec_initrd_crypttab_overrides.txt" ]; then
|
||||
echo "+++ Removing $bootdir/kexec_initrd_crypttab_overrides.txt"
|
||||
rm -f "$bootdir/kexec_initrd_crypttab_overrides.txt"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Cleanup
|
||||
cd /
|
||||
rm -rf /tmp/initrd_extract || true
|
||||
fi
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user