patch-iso: Fix up paths

Commit c8c75e81b5 ("relocate /pxeboot to /var/pxeboot", 2021-12-15)
inadvertently introduced a few bugs to patch-iso that prevent successful
execution of this script when a patch with pxe-network-installer is
attempted to be used. This is necessary, for example, to be able to
patch kernel and initial RAM file system images in an ISO image.

Here is an example for the error messages:

  + cp --preserve=all pxeboot/pxelinux.0 pxeboot/menu.c32 \
    pxeboot/chain.c32 .../patchiso_build_XXXXXX/var/pxeboot/
  cp: target '.../patchiso_build_XXXXXX/var/pxeboot/' \
    is not a directory

This commit fixes the paths used by patch-iso so that such errors are
not encountered.

Verification:
- patch-iso is successfully executed against a patch file that includes
  a newer pxe-network-installer package.

Closes-Bug: 1968566

Change-Id: I4606d062b45ed03b64f514131d3d6e27434e7675
Signed-off-by: M. Vefa Bicakci <vefa.bicakci@windriver.com>
This commit is contained in:
M. Vefa Bicakci 2022-04-04 15:29:50 -04:00
parent 20d70f40f6
commit 1a9872ca9d

View File

@ -290,10 +290,10 @@ fi
extract_pkg_from_patch_repo pxe-network-installer
if [ $? -eq 0 ]; then
# Replace files
\rm -f ${BUILDDIR}/var/pxeboot/pxelinux.0 \
${BUILDDIR}/var/pxeboot/menu.c32 \
${BUILDDIR}/var/pxeboot/chain.c32 &&
\cp --preserve=all pxeboot/pxelinux.0 pxeboot/menu.c32 pxeboot/chain.c32 ${BUILDDIR}/var/pxeboot/
\rm -f ${BUILDDIR}/pxeboot/pxelinux.0 \
${BUILDDIR}/pxeboot/menu.c32 \
${BUILDDIR}/pxeboot/chain.c32 &&
\cp --preserve=all var/pxeboot/pxelinux.0 var/pxeboot/menu.c32 var/pxeboot/chain.c32 ${BUILDDIR}/pxeboot/
if [ $? -ne 0 ]; then
echo "Error: Could not copy all files from installer"
exit 1
@ -309,17 +309,17 @@ if [ $? -eq 0 ]; then
# Replace vmlinuz and initrd.img with our own pre-built ones
\rm -f \
${BUILDDIR}/vmlinuz \
${BUILDDIR}/images/var/pxeboot/vmlinuz \
${BUILDDIR}/images/pxeboot/vmlinuz \
${BUILDDIR}/initrd.img \
${BUILDDIR}/images/var/pxeboot/initrd.img &&
\cp --preserve=all pxeboot/rel-*/installer-bzImage_1.0 \
${BUILDDIR}/images/pxeboot/initrd.img &&
\cp --preserve=all var/pxeboot/rel-*/installer-bzImage_1.0 \
${BUILDDIR}/vmlinuz &&
\cp --preserve=all pxeboot/rel-*/installer-bzImage_1.0 \
${BUILDDIR}/images/var/pxeboot/vmlinuz &&
\cp --preserve=all pxeboot/rel-*/installer-intel-x86-64-initrd_1.0 \
\cp --preserve=all var/pxeboot/rel-*/installer-bzImage_1.0 \
${BUILDDIR}/images/pxeboot/vmlinuz &&
\cp --preserve=all var/pxeboot/rel-*/installer-intel-x86-64-initrd_1.0 \
${BUILDDIR}/initrd.img &&
\cp --preserve=all pxeboot/rel-*/installer-intel-x86-64-initrd_1.0 \
${BUILDDIR}/images/var/pxeboot/initrd.img
\cp --preserve=all var/pxeboot/rel-*/installer-intel-x86-64-initrd_1.0 \
${BUILDDIR}/images/pxeboot/initrd.img
if [ $? -ne 0 ]; then
echo "Error: Failed to copy installer images"
exit 1