Files
update/software/debian/deb_folder/rules
Heitor Matsui a77914160d Rename GA metadata file to fix upload/delete issue
Due to commit [1], the "software delete" command now fails with
"file not found" error when deleting an upgrade GA iso, the cause
being the dependence that currently exists between the release id
and the release metadata filename, i.e. for a release named "X",
the metadata file is expected to be called "X-metadata.xml" (refer
to [2] for example).

This commit renames the GA metadata file to match the expected
release id. Since "software upload" also uses the expected name
format to copy the GA metadata, it had to be changed as well.

[1] https://review.opendev.org/c/starlingx/update/+/898132
[2] 5c125d4225/software/software/software_controller.py (L1288)

Test Plan:
PASS: build the iso, install and verify the GA release id and
      the GA metadata filename matches the expected format
PASS: upload and delete an upgrade GA iso successfully

Story: 2010676
Task: 49128

Change-Id: I87a7fdf87cb2932ef3fd2d5b506270a844a38087
Signed-off-by: Heitor Matsui <heitorvieira.matsui@windriver.com>
2023-11-24 09:24:41 -03:00

76 lines
3.1 KiB
Makefile
Executable File

#!/usr/bin/make -f
export DH_VERBOSE = 1
export PYBUILD_NAME = software
export PBR_VERSION=1.0.0
PMONDIR := ${ROOT}/usr/share/starlingx/pmon.d
ROOT := $(CURDIR)/debian/tmp
export PLATFORM_RELEASE="$(shell grep SW_VERSION /usr/include/build_info.h | cut -d ' ' -f 3)"
export METADATA_FILE="starlingx-${PLATFORM_RELEASE}.0-metadata.xml"
%:
dh $@ --with python3 --buildsystem=pybuild
override_dh_auto_build:
cp service-files/starlingx-GA-metadata.xml ${METADATA_FILE}
sed -i "s/xxxPLATFORM_RELEASExxx/${PLATFORM_RELEASE}/g" ${METADATA_FILE}
override_dh_install:
python3 setup.py install -f --install-layout=deb --root=$(ROOT)
python3 setup.py bdist_wheel --universal -d $(CURDIR)/debian/$(PYBUILD_NAME)-wheels/usr/share/python-wheels
install -d -m 755 $(ROOT)/usr/bin
install -d -m 755 $(ROOT)/usr/sbin
install -d -m 755 $(ROOT)/run
install -m 755 -d ${ROOT}/etc/goenabled.d
install -m 755 -d ${ROOT}/etc/init.d
install -m 755 -d ${ROOT}/etc/logrotate.d
install -m 755 -d ${ROOT}/etc/software
install -m 755 -d ${ROOT}/etc/software/software-scripts
install -m 755 -d ${ROOT}/lib/systemd/system
install -m 755 -d ${PMONDIR}
install -m 500 service-files/software-controller-daemon-init.sh \
${ROOT}/etc/init.d/software-controller-daemon
install -m 500 service-files/software-agent-init.sh \
${ROOT}/etc/init.d/software-agent
install -m 500 service-files/software-init.sh \
${ROOT}/etc/init.d/software
install -m 500 service-files/software-controller-init.sh \
${ROOT}/etc/init.d/software-controller
install -m 600 service-files/software.conf \
${ROOT}/etc/software/software.conf
install -m 644 service-files/policy.json \
${ROOT}/etc/software/policy.json
install -m 444 service-files/pmon-software-controller-daemon.conf \
${PMONDIR}/software-controller-daemon.conf
install -m 444 service-files/pmon-software-agent.conf \
${PMONDIR}/software-agent.conf
install -m 444 service-files/*.service \
${ROOT}/lib/systemd/system
install -m 400 service-files/software-functions \
${ROOT}/etc/software/software-functions
install -m 444 service-files/software-tmpdirs.conf \
${ROOT}/run/software-tmpdirs.conf
install -m 500 service-files/run-software-scripts \
${ROOT}/usr/sbin/run-software-scripts
install -m 500 service-files/software-controller-daemon-restart \
${ROOT}/usr/sbin/software-controller-daemon-restart
install -m 500 service-files/software-agent-restart \
${ROOT}/usr/sbin/software-agent-restart
install -m 555 service-files/software_check_goenabled.sh \
${ROOT}/etc/goenabled.d/software_check_goenabled.sh
install -m 444 service-files/software.logrotate \
${ROOT}/etc/logrotate.d/software
install -m 755 scripts/deploy-precheck \
${ROOT}/usr/sbin/deploy-precheck
install -m 444 scripts/upgrade_utils.py \
${ROOT}/usr/sbin/upgrade_utils.py
install -m 755 scripts/prep-data-migration \
${ROOT}/usr/sbin/prep-data-migration
install -m 444 ${METADATA_FILE} \
${ROOT}/etc/software/${METADATA_FILE}
install -m 755 scripts/chroot_mounts.sh \
${ROOT}/usr/bin/chroot_mounts.sh
install -m 444 scripts/ostree_mounts.yaml \
${ROOT}/etc/software/ostree_mounts.yaml
dh_install