sonic-buildimage/files
Lorne Long 7e525d96b3
[Build] Use apt-get to predictably support dependency ordered configuration of lazy packages (#12164)
Why I did it
The current lazy installer relies on a filename sort for both unpack and configuration steps. When systemd services are configured [started] by multiple packages the order is by filename not by the declared package dependencies. This can cause the start order of services to differ between first-boot and subsequent boots. Declared systemd service dependencies further exacerbate the issue (e.g. blocking the first-boot script).

The current installer leaves packages un-configured if the package dependency order does not match the filename order.

This also fixes a trivial bug in [Build]: Support to use symbol links for lazy installation targets to reduce the image size #10923 where externally downloaded dependencies are duplicated across lazy package device directories.

How I did it
Changed the staging and first-boot scripts to use apt-get:

dpkg -i /host/image-$SONIC_VERSION/platform/$platform/*.deb

becomes

apt-get -y install /host/image-$SONIC_VERSION/platform/$platform/*.deb

when dependencies are detected during image staging.

How to verify it
Apt-get critical rules

Add a Depends= to the control information of a package. Grep the syslog for rc.local between images and observe the configuration order of packages change.
2022-11-17 11:20:42 +08:00
..
Aboot Fix extraction of platform.tar.gz for firsttime (#11935) 2022-10-21 18:27:32 -07:00
apt [Build] Support j2 template for debian sources (#12557) 2022-11-09 08:09:53 +08:00
build_scripts [hostcfgd]: Add Ability To Configure Feature During Run-time (#6700) 2021-03-13 05:56:27 -08:00
build_templates [Build] Use apt-get to predictably support dependency ordered configuration of lazy packages (#12164) 2022-11-17 11:20:42 +08:00
dhcp ZTP infrastructure changes to support DHCP discovery provisioning data (#3298) 2019-12-10 08:16:56 -08:00
docker Enabling ipv6 support on docker container network. This is needed (#5418) 2020-09-22 08:32:17 -07:00
image_config [Build] Use apt-get to predictably support dependency ordered configuration of lazy packages (#12164) 2022-11-17 11:20:42 +08:00
initramfs-tools [Arista] Add initial support for 720DT-48S (#10656) 2022-06-29 09:56:24 -07:00
scripts Added Support to runtime render bgp and teamd feature state and lldp has_asic_scope flag (#11796) 2022-11-15 16:20:14 -08:00
sshd Remove SSH host keys after installing the custom version of sshd (#10633) 2022-04-25 10:38:52 -07:00