Fix /etc/update.d being created as a file

If the update.d does not exist, the cp command in the pre-start script
creates update.d as a file, not a directory. Causing the system to fail
later when trying to deploy a new patch.

Test-Plan:
PASS: Run pre-start script when the update.d does not exist
      and check that it was correctly created

Closes-Bug: 2127202

Change-Id: Ie1707864d34e098ba758d9daddf21cd8811cda7c
Signed-off-by: Lindley Vieira <lindley.vieira@windriver.com>
This commit is contained in:
Lindley Vieira
2025-10-09 14:07:35 -04:00
parent 6d0ee72139
commit ed837541ad

View File

@@ -29,7 +29,10 @@ fi
# WA to upload the activate script
echo "Copying activate script"
if [[ -f "$extra_script" ]]; then
cp "$extra_script" "$patch_migration_script_dir"
# Ensure the directory exists
mkdir -p "$patch_migration_script_dir"
cp "$extra_script" "${patch_migration_script_dir}/${activate_script_name}"
chmod +x "${patch_migration_script_dir}/${activate_script_name}"
echo "Copied ${activate_script_name} to ${patch_migration_script_dir}"
else