Fix pxe files copy and permission during upload

This commit fixes an issue that was preventing load import
script from copying the TO release pxe files correctly from
the load, and also gives pxe-update-*.sh script execution
permission to avoid permission denied errors during host-unlock.

Test Plan
PASS: upload TO release load, verify the TO release pxe.cfg.linux
      files are copied to /var and that /etc/pxe-update script is
      updated to 755

Story: 2010676
Task: 49698

Signed-off-by: Heitor Matsui <heitorvieira.matsui@windriver.com>
Change-Id: I222b484d3a28c603ed8d7c42d0405481086735f0
This commit is contained in:
Heitor Matsui 2024-03-11 11:55:24 -03:00
parent 306ea5f631
commit 720b10f07c
1 changed files with 2 additions and 1 deletions

View File

@ -127,7 +127,7 @@ def load_import(from_release, to_release, iso_mount_dir):
# Copy to_release_feed/pxelinux.cfg.files to /var/pxeboot/pxelinux.cfg.files
pxeboot_cfg_files = glob.glob(os.path.join(to_feed_dir, 'pxeboot', 'pxelinux.cfg.files',
'*' + from_major_rel))
'*' + to_major_rel))
for pxeboot_cfg_file in pxeboot_cfg_files:
if os.path.isfile(pxeboot_cfg_file):
shutil.copyfile(pxeboot_cfg_file, os.path.join(VAR_PXEBOOT_DIR,
@ -139,6 +139,7 @@ def load_import(from_release, to_release, iso_mount_dir):
pxeboot_update_filename = "pxeboot-update-%s.sh" % to_major_rel
shutil.copyfile(os.path.join(to_feed_dir, "upgrades", pxeboot_update_filename),
os.path.join("/etc", pxeboot_update_filename))
os.chmod(os.path.join("/etc", pxeboot_update_filename), mode=0o755)
LOG.info("Copied pxeboot-update-%s.sh to %s", to_major_rel, "/etc")
except Exception as e: