Generate the install_uuid only once during install

This code only affects Debian.

The post operations are run more than once while ostree
layers are installed.

instflux=0 - /var not on a dedicated fluxdata partition.
instflux=1 - /var is part of the two different sysroot
deployments.

As a result the platform.conf and install_uuid can end
up being different when we generate the uuid and update
the platform.conf for each post.

This will confuse the patching system which compares
both values.

This fix simply ensures that the generation only happens
once, by reusing the generated uuid.

Test Plan:
  Build / Install / Boot  Debian ISO.
  Verify the /etc/platform/platform.conf install_uuid
matches the install_uuid under the feeds directory.
  Reboot and select the grub 'rollback' menu item, and
verify those values still match.

Story: 2009969
Task: 45200
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: Ic65136caec008aaceafa18a12c2090ca9124efbf
This commit is contained in:
Al Bailey 2022-04-27 20:05:33 +00:00
parent 1a6fd50e2c
commit 13cb098953

View File

@ -1881,9 +1881,17 @@ ilog "*** Post - Kickstart Finalize Install UUID ***"
ilog "****************************************************" ilog "****************************************************"
# Create a uuid specific to this installation # Create a uuid specific to this installation
# install_uuid under /var needs to match what is written to /etc/platform/platform.conf
# When instflux=0 (/var not on a dedicated fluxdata partition)
# When instflux=1 (/var is part of the two different sysroot deployments).
# Therefore check if the file has been written and use that, otherwise generate it
ilog "Add install uuid to feed and platform.conf" ilog "Add install uuid to feed and platform.conf"
if [ -e "${LAT_DIR}/INSTALL_UUID" ]; then
INSTALL_UUID=`uuidgen` INSTALL_UUID=$(< "${LAT_DIR}/INSTALL_UUID")
else
INSTALL_UUID=`uuidgen`
echo "${INSTALL_UUID}" > ${LAT_DIR}/INSTALL_UUID
fi
[ ! -d "/var/www/pages/feed/rel-xxxPLATFORM_RELEASExxx" ] && mkdir -p -m 0755 /var/www/pages/feed/rel-xxxPLATFORM_RELEASExxx [ ! -d "/var/www/pages/feed/rel-xxxPLATFORM_RELEASExxx" ] && mkdir -p -m 0755 /var/www/pages/feed/rel-xxxPLATFORM_RELEASExxx
echo ${INSTALL_UUID} > /var/www/pages/feed/rel-xxxPLATFORM_RELEASExxx/install_uuid echo ${INSTALL_UUID} > /var/www/pages/feed/rel-xxxPLATFORM_RELEASExxx/install_uuid