sonic-buildimage/installer
Guohan Lu b1a8634358
Merge pull request #16691 from pbudds/pbudds-partition_size
Why I did it

fixes #15949
Problem 1: Setting ONIE_IMAGE_PART_SIZE using env variable or using "make ONIE_IMAGE_PART_SIZE=65536 USERNAME=test PASSWORD=test all" did not work.

Problem 2: The platform specific file for example "device/x86_64-8201_32fh_o-r0/installer.conf" cannot override it by setting value of ONIE_IMAGE_PART_SIZE in the file. change 2 adds support to do that.

How I did it
Change 1: when ONIE_IMAGE_PART_SIZE, the files Makefile.work and slave.mk should pass that setting along all the way to build_image.sh. Please see commit 1.

Change 2: In installer/install.sh, save the value set during build time string replace into a value and then let this value be overridden later when installer.conf get read which is platform specific. If platform does not override it, the original value will continue to work. Please see commit 2.

How to verify it
1: The below command works now
make ONIE_IMAGE_PART_SIZE=65536 USERNAME=test PASSWORD=test all"

The image properly was installed using ONIE and the partition size reflects what was passed in the above build command.
If the above value is not set, the default from "onie-image.conf" takes effect and still works.

2: Set ONIE_IMAGE_PART_SIZE in platform specific file like below example
--------------Diff----
device/x86_64-8201_32fh_o-r0/installer.conf
@@ -1 +1,2 @@
ONIE_PLATFORM_EXTRA_CMDLINE_LINUX=" intel_iommu=off"
+ONIE_IMAGE_PART_SIZE=128000

and built the image using "make USERNAME=test PASSWORD=test all" and verified that the final installation properly partitioned the disk to the requested value from installer.conf file.
2023-09-29 09:29:54 -07:00
..
tests [arm] Refactor installer and build to allow arm builds targeted at grub platforms (#11341) 2022-07-12 15:00:57 -07:00
default_platform.conf Update to Linux 5.10.179 (#15926) 2023-09-20 15:24:39 -07:00
install.sh allow ONIE_IMAGE_PART_SIZE customization in device specific installer.conf file 2023-09-25 16:39:12 -07:00
sharch_body.sh Add support for secure upgrade (#11862) 2023-06-26 12:04:40 +03:00