Browse Source

Fix update-iso.sh handling of existing timeout in grub.cfg

Fix a bug where the submenu timeout is corrupted by an incorrect sed
command.

In addition, update handling of 0 second timeout to set the timeout in
grub.cfg to 0.001, to avoid issues on some systems with timeout=0.

Change-Id: I0683f39eb906da512cacc77bde28f8420a73a001
Closes-Bug: 1856764
Signed-off-by: Don Penney <don.penney@windriver.com>
changes/08/699508/1
Don Penney 2 years ago
parent
commit
f7886f9950
1 changed files with 7 additions and 3 deletions
  1. +7
    -3
      utilities/platform-util/scripts/update-iso.sh

+ 7
- 3
utilities/platform-util/scripts/update-iso.sh View File

@ -299,10 +299,12 @@ function set_timeout {
done
for f in ${isodir}/EFI/BOOT/grub.cfg ${EFI_MOUNT}/EFI/BOOT/grub.cfg; do
sed -i "s/^timeout=.*/timeout=${GRUB_TIMEOUT}/" ${f}
grep -q "^ set timeout=" ${f}
if [ $? -eq 0 ]; then
# Submenu timeout is already added. Update the value
sed -i -e "s#^ set timeout=.*#${GRUB_TIMEOUT}#" ${f}
sed -i -e "s#^ set timeout=.*# set timeout=${GRUB_TIMEOUT}#" ${f}
if [ $? -ne 0 ]; then
echo "Failed to update grub timeout"
exit 1
@ -327,7 +329,7 @@ declare DEFAULT_LABEL=
declare DEFAULT_GRUB_ENTRY=
declare UPDATE_TIMEOUT="no"
declare -i TIMEOUT=0
declare -i GRUB_TIMEOUT=-1
declare GRUB_TIMEOUT=-1
declare EFI_MOUNT=
declare EFIBOOT_IMG_LOOP=
@ -381,7 +383,9 @@ while getopts "hi:o:a:p:d:t:" opt; do
let -i timeout_arg=${OPTARG}
if [ ${timeout_arg} -gt 0 ]; then
let -i TIMEOUT=${timeout_arg}*10
let -i GRUB_TIMEOUT=${timeout_arg}
GRUB_TIMEOUT=${timeout_arg}
elif [ ${timeout_arg} -eq 0 ]; then
GRUB_TIMEOUT=0.001
fi
UPDATE_TIMEOUT="yes"


Loading…
Cancel
Save