Skip to content

Commit ff26d90

Browse files
xumiayxieca
authored andcommitted
Fix the invalid variable issue when set-fips in uboot (#2834)
What I did Reproduce the issue: /home/admin# sonic-installer set-fips Command: /usr/bin/fw_setenv linuxargs net.ifnames=0 loopfstype=squashfs loop=image-20220531.27/fs.squashfs systemd.unified_cgroup_hierarchy=0 varlog_size=4096 loglevel=4 sonic_fips=1 Error: illegal character '=' in variable name "loopfstype=squashfs" Work item tracking Microsoft ADO (number only): 22333116 How I did it Add the double quotation marks when calling the command. How to verify it It works fine when calling the following command: /usr/bin/fw_setenv linuxargs "net.ifnames=0 loopfstype=squashfs loop=image-20220531.27/fs.squashfs systemd.unified_cgroup_hierarchy=0 varlog_size=4096 loglevel=4 sonic_fips=1"
1 parent d98033f commit ff26d90

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sonic_installer/bootloader/uboot.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ def set_fips(self, image, enable):
8989
cmdline = out.strip()
9090
cmdline = re.sub('^linuxargs=', '', cmdline)
9191
cmdline = re.sub(r' sonic_fips=[^\s]', '', cmdline) + " sonic_fips=" + fips
92-
run_command('/usr/bin/fw_setenv linuxargs ' + cmdline)
92+
cmdline = '"' + cmdline + '"'
93+
run_command('/usr/bin/fw_setenv linuxargs ' + cmdline )
9394
click.echo('Done')
9495

9596
def get_fips(self, image):

0 commit comments

Comments
 (0)