mirror of
https://github.com/linuxboot/heads.git
synced 2025-02-20 09:16:21 +00:00
Strip invalid leading/trailing '/' from script params
This commit is contained in:
parent
9d9af31e58
commit
e8f3d206c5
@ -22,7 +22,7 @@ if [ -z "$bootdir" -o -z "$entry" ]; then
|
||||
die "Usage: $0 -b /boot -e 'kexec params|...|...'"
|
||||
fi
|
||||
|
||||
bootdir=${bootdir%%"/"}
|
||||
bootdir="${bootdir%%/}"
|
||||
|
||||
kexectype=`echo $entry | cut -d\| -f2`
|
||||
kexecparams=`echo $entry | cut -d\| -f3- | tr '|' '\n'`
|
||||
|
@ -15,6 +15,8 @@ if ! [ -r "$ISOSIG" ]; then
|
||||
ISOSIG="$MOUNTED_ISO_PATH.asc"
|
||||
fi
|
||||
|
||||
ISO_PATH="${ISO_PATH##/}"
|
||||
|
||||
gpgv "$ISOSIG" "$MOUNTED_ISO_PATH" \
|
||||
|| die 'ISO signature failed'
|
||||
|
||||
@ -26,7 +28,7 @@ DEV_UUID=`blkid $DEV | tail -1 | tr " " "\n" | grep UUID | cut -d\" -f2`
|
||||
ADD="fromiso=/dev/disk/by-uuid/$DEV_UUID/$ISO_PATH"
|
||||
REMOVE=""
|
||||
|
||||
paramsdir="/media/kexec_iso/$ISO_PATH/"
|
||||
paramsdir="/media/kexec_iso/$ISO_PATH"
|
||||
check_config $paramsdir
|
||||
|
||||
ADD_FILE=/tmp/kexec/kexec_iso_add.txt
|
||||
@ -43,7 +45,7 @@ if [ -r $REMOVE_FILE ]; then
|
||||
fi
|
||||
|
||||
# Call kexec and indicate that hashes have been verified
|
||||
kexec-select-boot -b /boot -d /media/ -p "$paramsdir" \
|
||||
kexec-select-boot -b /boot -d /media -p "$paramsdir" \
|
||||
-a "$ADD" -r "$REMOVE" -c "*.cfg" -u -i
|
||||
|
||||
die "Something failed in selecting boot"
|
||||
|
@ -17,9 +17,9 @@ reset_entry() {
|
||||
}
|
||||
|
||||
filedir=`dirname $file`
|
||||
bootdir=${bootdir%%"/"}
|
||||
bootlen=${#bootdir}
|
||||
appenddir=${filedir:$bootlen}
|
||||
bootdir="${bootdir%%/}"
|
||||
bootlen="${#bootdir}"
|
||||
appenddir="${filedir:$bootlen}"
|
||||
|
||||
fix_path() {
|
||||
path="$@"
|
||||
|
@ -24,6 +24,10 @@ if [ -z "$paramsdir" ]; then
|
||||
paramsdir="$bootdir"
|
||||
fi
|
||||
|
||||
bootdir="${bootdir%%/}"
|
||||
paramsdev="${paramsdev%%/}"
|
||||
paramsdir="${paramsdir%%/}"
|
||||
|
||||
TMP_MENU_FILE="/tmp/kexec/kexec_menu.txt"
|
||||
ENTRY_FILE="$paramsdir/kexec_default.$index.txt"
|
||||
HASH_FILE="$paramsdir/kexec_default_hashes.txt"
|
||||
|
@ -22,6 +22,9 @@ if [ -z "$paramsdev" ]; then
|
||||
paramsdev="$paramsdir"
|
||||
fi
|
||||
|
||||
paramsdev="${paramsdev%%/}"
|
||||
paramsdir="${paramsdir%%/}"
|
||||
|
||||
if [ -n "$lvm_volume_group" ]; then
|
||||
lvm vgchange -a y $lvm_volume_group \
|
||||
|| die "Failed to activate the LVM group"
|
||||
|
@ -37,6 +37,10 @@ if [ -z "$paramsdir" ]; then
|
||||
paramsdir="$bootdir"
|
||||
fi
|
||||
|
||||
bootdir="${bootdir%%/}"
|
||||
paramsdev="${paramsdev%%/}"
|
||||
paramsdir="${paramsdir%%/}"
|
||||
|
||||
verify_global_hashes()
|
||||
{
|
||||
echo "+++ Checking verified boot hash file "
|
||||
|
@ -17,6 +17,8 @@ if [ -z "$paramsdir" ]; then
|
||||
die "Usage: $0 -p /boot [ -u | -c counter ]"
|
||||
fi
|
||||
|
||||
paramsdir="${paramsdir%%/}"
|
||||
|
||||
confirm_gpg_card
|
||||
|
||||
if [ "$rollback" = "y" ]; then
|
||||
|
@ -62,6 +62,6 @@ fi
|
||||
|
||||
echo "!!! Could not find any ISO, trying bootable USB"
|
||||
# Attempt to pull verified config from device
|
||||
kexec-select-boot -b /media/ -c "*.cfg" -u
|
||||
kexec-select-boot -b /media -c "*.cfg" -u
|
||||
|
||||
die "Something failed in selecting boot"
|
||||
|
Loading…
x
Reference in New Issue
Block a user