-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[arm] Refactor installer and build to allow arm builds targeted at grub platforms #11341
Conversation
@stepanblyschak could you please help to review sonic-installer part? |
installer/install.sh
Outdated
if [ -r ./onie-image-arm64.conf ]; then | ||
. ./onie-image-arm64.conf | ||
if [ -r ./onie-image*.conf ]; then | ||
. ./onie-image*.conf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there are multiple files matching the wildcard, only one is executed.
$ . a.sh
a
$ . b.sh
b
$ . *.sh
a
``` #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems there is a case of onie-image.conf
and onie-image-*.conf
both exist for one platform.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still applicable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still applicable.
Not sure the reasoning of this comment @qiluo-msft no changes went in between your two comments, maybe I am misunderstanding.
Anyway, I think this should be resolved now. I have made a couple changes elsewhere (that should have been there in the first place) that make it such that only the needed onie-image files are loaded into an image given the target architecture. Then I load in the generic and the arch-specific version in the installer. This should resolve any concerns.
@alexrallen looks like one of the template variable (%%EXTRA_CMDLINE_LINUX%%) is not replaced. Is it relative to the change? The grub.cfg in the latest vs image may be not correct. log:
And Grub settings: see %%EXTRA_CMDLINE_LINUX%% in linux.
|
@@ -1,119 +1,5 @@ | |||
#!/bin/sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not ideal that we have .conf file with so complex bash code. And there are many variables need replacement, like %%SONIC_ROOT%%
.
Related work items: sonic-net#284, sonic-net#288, sonic-net#624, sonic-net#630, sonic-net#640, sonic-net#2164, sonic-net#2206, sonic-net#2207, sonic-net#2233, sonic-net#2234, sonic-net#2238, sonic-net#8857, sonic-net#10034, sonic-net#10519, sonic-net#10685, sonic-net#10711, sonic-net#10987, sonic-net#10990, sonic-net#11047, sonic-net#11070, sonic-net#11117, sonic-net#11186, sonic-net#11207, sonic-net#11213, sonic-net#11215, sonic-net#11220, sonic-net#11221, sonic-net#11257, sonic-net#11291, sonic-net#11298, sonic-net#11301, sonic-net#11326, sonic-net#11333, sonic-net#11335, sonic-net#11341, sonic-net#11344, sonic-net#11347, sonic-net#11359, sonic-net#11366, sonic-net#11368, sonic-net#11370, sonic-net#11372, sonic-net#11375, sonic-net#11385, sonic-net#11386, sonic-net#11394, sonic-net#11397, sonic-net#11401, sonic-net#11402, sonic-net#11403, sonic-net#11405, sonic-net#11414
Why I did it Issue was caused by this #11341 *.bin image structure in 202205: vkarri@19d5638dde2d:/sonic$ ls -l /tmp/tmp.9ibWSipeRw/installer/x86_64/ total 12 drwxr-xr-x 2 vkarri dip 12288 Oct 14 13:16 platforms However install.sh which runs on ONiE parition expects the platform specific kernel cmd line conf file under platform/$onie_platform_string file https://github.com/sonic-net/sonic-buildimage/blob/master/installer/install.sh#L102 Thus, any platform which defines and depends on these params might be broken on master label. How I did it Since we are already filtering the conf files based on TARGET_PLATFORM in build_image.sh, i've just updated the location to installer/platforms instead of installer/$arch/platforms Signed-off-by: Vivek Reddy Karri <[email protected]>
Refactors the SONiC Installer to support greater flexibility in building for a given architecture and bootloader.
Why I did it
Currently the SONiC installer assumes that if a platform is ARM based that it uses the
uboot
bootloader and uses thegrub
bootloader otherwise. This is not a correct assumption to make as ARM is not strictly tied to uboot and x86 is not strictly tied to grub.How I did it
To implement this I introduce the following changes:
installer/
directoryinstaller/installer.sh
installer/default_platform.conf
default_platform.conf
file and also callplatform/[platform]/patform.conf
file as well to override as neededbuild_image.sh
scriptTARGET_BOOTLOADER
variable that is by defaultuboot
for ARM devices andgrub
for x86 unless overridden inplatform/[platform]/rules.mk
build_debian.sh
to be based onTARGET_BOOTLOADER
instead ofTARGET_ARCH
and to reference the grub package in a generic mannerHow to verify it
This has been tested on a ARM test platform as well as on Mellanox amd64 switches as well to ensure there was no impact.
Which release branch to backport (provide reason below if selected)
Description for the changelog
[arm] Refactor installer and build to allow arm builds targeted at grub platforms
Link to config_db schema for YANG module changes
N/A
A picture of a cute animal (not mandatory but encouraged)