Every change made to kernel_params is done by updating the
/boot/efi/EFI/BOOT/boot.env file. This modification consists of
rewriting the file with addition/removal of some kernel_params.
This addition/removal is done by running the
stx-puppet/puppet-manifests/src/bin/puppet-update-grub-env.py file.
After adding a long string of parameters and then performing a removal,
the /boot/efi/EFI/BOOT/boot.env file becomes corrupted and cannot be
updated. If a new update is made, the following error is encountered:
grub-editenv: error:environment block too small.
This affects the host when any changes made by "system host-modify-cpu"
command are executed, causing potential reboot loop when the host is
unlocked, and eventually it gets in degraded state.
The fix for this bug is unset kernel_params before every writing occurs
in grubenv file. Unset is a way to sanitize the kernel_params variable,
which contains the parameters modified by the command
"system host-modify-cpu", before a new writing occurs to that variable
again.
Test plan
PASS: Run initial bootstrap for CentOS/Debian successfully
PASS: Run system host-modify-cpu and unlock host successfully
PASS: kernel_params, in grubenv file, is unset every time a writing
occurs
PASS: grubenv file updated with no issues even after a long string of parameters being added/removed
Closes-bug: 1981745
Signed-off-by: Samuel Presa Toledo <email address hidden>
Change-Id: I6f6854a0273765f17954cd5cb7131a22d73c8e97
Reviewed: https:/ /review. opendev. org/c/starlingx /stx-puppet/ +/850577 /opendev. org/starlingx/ stx-puppet/ commit/ a13ffba3b80064e 61568d1a5d42e0e 818b489350
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit a13ffba3b80064e 61568d1a5d42e0e 818b489350
Author: Samuel Presa Toledo <email address hidden>
Date: Wed Jul 20 14:31:08 2022 -0400
grubenv file got corrupted after writing on it
Every change made to kernel_params is done by updating the efi/EFI/ BOOT/boot. env file. This modification consists of puppet/ puppet- manifests/ src/bin/ puppet- update- grub-env. py file. EFI/BOOT/ boot.env file becomes corrupted and cannot be
/boot/
rewriting the file with addition/removal of some kernel_params.
This addition/removal is done by running the
stx-
After adding a long string of parameters and then performing a removal,
the /boot/efi/
updated. If a new update is made, the following error is encountered:
grub-editenv: error:environment block too small.
This affects the host when any changes made by "system host-modify-cpu"
command are executed, causing potential reboot loop when the host is
unlocked, and eventually it gets in degraded state.
The fix for this bug is unset kernel_params before every writing occurs
in grubenv file. Unset is a way to sanitize the kernel_params variable,
which contains the parameters modified by the command
"system host-modify-cpu", before a new writing occurs to that variable
again.
Test plan
parameters being added/removed
PASS: Run initial bootstrap for CentOS/Debian successfully
PASS: Run system host-modify-cpu and unlock host successfully
PASS: kernel_params, in grubenv file, is unset every time a writing
occurs
PASS: grubenv file updated with no issues even after a long string of
Closes-bug: 1981745
Signed-off-by: Samuel Presa Toledo <email address hidden> f17954cd5cb7131 a22d73c8e97
Change-Id: I6f6854a0273765