Remove extra spaces from GRUB_CMDLINE_LINUX_DEFAULT

Remove extra spaces from GRUB_CMDLINE_LINUX_DEFAULT in the
/etc/default/grub when there is no boot laber and/or fips
not enabled.

TrivialFix

Change-Id: Ie83781b9ceca16ff63e08e3d1f887aa6d33fec99
Signed-off-by: Maksim Malchuk <maksim.malchuk@gmail.com>
This commit is contained in:
Maksim Malchuk 2023-09-15 17:11:22 +03:00
parent 1897b12ee9
commit c2853c6f2c

View File

@ -105,10 +105,10 @@ sed -i 's/\ boot=[0-9A-Za-z/=\-]\+//' /etc/default/grub
# is a separate filesystem, and convey this fact as a boot
# argument so dracut does not halt the system on boot.
BOOT_FS=""
if [[ -n "${DIB_BOOT_LABEL}" ]]; then
BOOT_FS="boot=LABEL=${DIB_BOOT_LABEL}"
else
BOOT_FS=""
BOOT_FS=" boot=LABEL=${DIB_BOOT_LABEL}"
fi
# NOTE(TheJulia): While on the subject of FIPS, if there is not an
@ -128,7 +128,7 @@ if [[ -x /bin/fips-mode-setup ]]; then
is_fips_enabled=$?
set -e
if [ $is_fips_enabled -eq 1 ]; then
BOOT_FIPS="fips=1"
BOOT_FIPS=" fips=1"
fi
fi
@ -152,7 +152,7 @@ else
fi
GRUB_CMDLINE_LINUX_DEFAULT="${VIRTUAL_TERMINAL} ${SERIAL_CONSOLE} no_timer_check"
echo "GRUB_CMDLINE_LINUX_DEFAULT=\"${GRUB_CMDLINE_LINUX_DEFAULT} ${DIB_BOOTLOADER_DEFAULT_CMDLINE} ${BOOT_FS} ${BOOT_FIPS}\"" >>/etc/default/grub
echo "GRUB_CMDLINE_LINUX_DEFAULT=\"${GRUB_CMDLINE_LINUX_DEFAULT} ${DIB_BOOTLOADER_DEFAULT_CMDLINE}${BOOT_FS}${BOOT_FIPS}\"" >>/etc/default/grub
echo 'GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"' >>/etc/default/grub
# os-prober leaks /dev/sda into config file in dual-boot host