Fix kickstarts patching

Ostree doesn't manage the /var filesystem. Anything
installed there during initial filesystem setup becomes
unpatchable [1]. As a result, the kickstart install dir
/var/www/pages/feed/rel-${platform_release}/kickstart
is not updated according to patch changes.

This commit changes the platform-kickstarts install paths
to a place that ostree handles,
/usr/share/platform-kickstarts/rel-${platform_release}
in this case and symlinks it to
/var/www/pages/feed/rel-${platform_release}/kickstarts.

[1] https://review.opendev.org/c/starlingx/ha/+/890918

Test Plan:
1. PASS: ISO install and verify symlink created:
         /var/www/pages/feed/rel-${platform_release}/kickstarts ->
         /usr/share/platform-kickstarts/rel-${platform_release}
2. PASS: Verify that the centos/ dir, kickstart.cfg & miniboot.cfg
         are installed to /usr/share/platform-kickstarts/
         rel-${platform_release}
3. PASS: Verify PATCH apply, ensure that changes are applied to
         /var/www/pages/feed/rel-${platform_release}/kickstarts
4. PASS: Manually remove/re-install the platform-kickstarts package
         and verify kickstarts dir and symlink

Closes-Bug: 2034753
Closes-Bug: 2035109

Change-Id: I307d28c086bb3d9f0e4d6792db44e55c99358a50
Signed-off-by: Salman Rana <salman.rana@windriver.com>
This commit is contained in:
Salman Rana 2023-09-07 16:11:29 -04:00
parent 7a1fb6333c
commit 0366f8552d
3 changed files with 14 additions and 5 deletions

View File

@ -1 +1,3 @@
var/www/pages/feed/*
usr/share/platform-kickstarts/*
usr/lib/tmpfiles.d/platform-kickstarts.conf

View File

@ -10,15 +10,21 @@ export platform_release="$(shell grep SW_VERSION /usr/include/build_info.h | cut
override_dh_auto_configure:
sed -i s/xxxPLATFORM_RELEASExxx/$(platform_release)/g kickstart.cfg
sed -i s/xxxPLATFORM_RELEASExxx/$(platform_release)/g miniboot.cfg
sed -i s/xxxPLATFORM_RELEASExxx/$(platform_release)/g debian/tmpfiles.conf
dh_auto_configure
override_dh_install:
install -d -m 755 $(ROOT)/var/www/pages/feed/rel-${platform_release}/kickstart
install -d -m 755 $(ROOT)/var/www/pages/feed/rel-${platform_release}/kickstart/centos
install -d -m 755 $(ROOT)/usr/share/platform-kickstarts/rel-${platform_release}/centos
# kickstart.cfg must be copied to /var/../kickstarts for system installation.
# It's eventually symlinked from /usr/../platform-kickstarts.
install -p -D -m 700 kickstart.cfg $(ROOT)/var/www/pages/feed/rel-${platform_release}/kickstart
install -p -D -m 700 miniboot.cfg $(ROOT)/var/www/pages/feed/rel-${platform_release}/kickstart
install -p -D -m 700 centos/miniboot_controller_ks.cfg $(ROOT)/var/www/pages/feed/rel-${platform_release}/kickstart/centos
install -p -D -m 700 centos/miniboot_smallsystem_ks.cfg $(ROOT)/var/www/pages/feed/rel-${platform_release}/kickstart/centos
install -p -D -m 700 centos/miniboot_smallsystem_lowlatency_ks.cfg $(ROOT)/var/www/pages/feed/rel-${platform_release}/kickstart/centos
install -p -D -m 700 centos/prestaged_installer_ks.cfg $(ROOT)/var/www/pages/feed/rel-${platform_release}/kickstart/centos
install -p -D -m 700 kickstart.cfg $(ROOT)/usr/share/platform-kickstarts/rel-${platform_release}
install -p -D -m 700 miniboot.cfg $(ROOT)/usr/share/platform-kickstarts/rel-${platform_release}
install -p -D -m 700 centos/miniboot_controller_ks.cfg $(ROOT)/usr/share/platform-kickstarts/rel-${platform_release}/centos
install -p -D -m 700 centos/miniboot_smallsystem_ks.cfg $(ROOT)/usr/share/platform-kickstarts/rel-${platform_release}/centos
install -p -D -m 700 centos/miniboot_smallsystem_lowlatency_ks.cfg $(ROOT)/usr/share/platform-kickstarts/rel-${platform_release}/centos
install -p -D -m 700 centos/prestaged_installer_ks.cfg $(ROOT)/usr/share/platform-kickstarts/rel-${platform_release}/centos
install -p -D -m 644 debian/tmpfiles.conf $(ROOT)/usr/lib/tmpfiles.d/platform-kickstarts.conf
dh_install

View File

@ -0,0 +1 @@
L+ /var/www/pages/feed/rel-xxxPLATFORM_RELEASExxx/kickstart - - - - /usr/share/platform-kickstarts/rel-xxxPLATFORM_RELEASExxx