mirror of
https://github.com/linuxboot/heads.git
synced 2025-01-18 02:39:59 +00:00
fix: update chesksums of filenames with spaces (#847)
Signed-off-by: Tom Hiller <thrilleratplay@gmail.com>
This commit is contained in:
parent
3c24460f1a
commit
636e40456e
@ -25,9 +25,9 @@ confirm_gpg_card
|
|||||||
|
|
||||||
# update hashes in /boot before signing
|
# update hashes in /boot before signing
|
||||||
if [ "$update" = "y" ]; then
|
if [ "$update" = "y" ]; then
|
||||||
(
|
(
|
||||||
cd /boot
|
cd /boot
|
||||||
find ./ -type f ! -name '*kexec*' | xargs sha256sum > /boot/kexec_hashes.txt
|
find ./ -type f ! -name '*kexec*' -print0 | xargs -0 sha256sum > /boot/kexec_hashes.txt
|
||||||
if [ -e /boot/kexec_default_hashes.txt ]; then
|
if [ -e /boot/kexec_default_hashes.txt ]; then
|
||||||
DEFAULT_FILES=$(cat /boot/kexec_default_hashes.txt | cut -f3 -d ' ')
|
DEFAULT_FILES=$(cat /boot/kexec_default_hashes.txt | cut -f3 -d ' ')
|
||||||
echo $DEFAULT_FILES | xargs sha256sum > /boot/kexec_default_hashes.txt
|
echo $DEFAULT_FILES | xargs sha256sum > /boot/kexec_default_hashes.txt
|
||||||
|
@ -157,8 +157,8 @@ generate_checksums()
|
|||||||
set_default_boot_option
|
set_default_boot_option
|
||||||
|
|
||||||
# generate hashes
|
# generate hashes
|
||||||
find /boot -type f ! -name '*kexec*' \
|
find /boot -type f ! -name '*kexec*' -print0 \
|
||||||
| xargs sha256sum > /boot/kexec_hashes.txt 2>/dev/null \
|
| xargs -0 sha256sum > /boot/kexec_hashes.txt 2>/dev/null \
|
||||||
|| whiptail_error_die "Error generating kexec hashes"
|
|| whiptail_error_die "Error generating kexec hashes"
|
||||||
|
|
||||||
param_files=`find /boot/kexec*.txt`
|
param_files=`find /boot/kexec*.txt`
|
||||||
|
@ -313,7 +313,7 @@ detect_boot_device()
|
|||||||
|
|
||||||
# generate list of possible boot devices
|
# generate list of possible boot devices
|
||||||
fdisk -l | grep "Disk" | cut -f2 -d " " | cut -f1 -d ":" > /tmp/disklist
|
fdisk -l | grep "Disk" | cut -f2 -d " " | cut -f1 -d ":" > /tmp/disklist
|
||||||
|
|
||||||
# filter out extraneous options
|
# filter out extraneous options
|
||||||
> /tmp/boot_device_list
|
> /tmp/boot_device_list
|
||||||
for i in `cat /tmp/disklist`; do
|
for i in `cat /tmp/disklist`; do
|
||||||
@ -325,7 +325,7 @@ detect_boot_device()
|
|||||||
ls $i* | tail -${DEV_NUM_PARTITIONS} >> /tmp/boot_device_list
|
ls $i* | tail -${DEV_NUM_PARTITIONS} >> /tmp/boot_device_list
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# iterate thru possible options and check for grub dir
|
# iterate thru possible options and check for grub dir
|
||||||
for i in `cat /tmp/boot_device_list`; do
|
for i in `cat /tmp/boot_device_list`; do
|
||||||
umount /boot 2>/dev/null
|
umount /boot 2>/dev/null
|
||||||
|
Loading…
Reference in New Issue
Block a user