Skip to content

Commit

Permalink
[Bug] Fix fw_setenv illegel character issue (sonic-net#3201)
Browse files Browse the repository at this point in the history
What I did
The bug can be reproduced by the following command:

root@bjw-can-7215-6:/home/admin# sonic-installer set-fips
Command: /usr/bin/fw_setenv linuxargs net.ifnames=0 loopfstype=squashfs loop=image-fips-armhf-202305.88981472-dde4d1d844/fs.squashfs systemd.unified_cgroup_hierarchy=0 varlog_size=4096 loglevel=4 logs_inram=on sonic_fips=1
Error: illegal character '=' in variable name "loopfstype=squashfs"

How I did it
It is to set the variable linuxargs to the the environment value cmdline, as the part of the Linux Kernel Cmdline. The environment variable cannot be split.
  • Loading branch information
xumia authored and mssonicbld committed Mar 9, 2024
1 parent 49af6df commit e2ac2b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sonic_installer/bootloader/uboot.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def set_fips(self, image, enable):
cmdline = out.strip()
cmdline = re.sub('^linuxargs=', '', cmdline)
cmdline = re.sub(r' sonic_fips=[^\s]', '', cmdline) + " sonic_fips=" + fips
run_command(['/usr/bin/fw_setenv', 'linuxargs'] + split(cmdline))
run_command(['/usr/bin/fw_setenv', 'linuxargs', cmdline])
click.echo('Done')

def get_fips(self, image):
Expand Down

0 comments on commit e2ac2b6

Please sign in to comment.