From 1a9872ca9d32b1af0517fd85a282c16efa37189e Mon Sep 17 00:00:00 2001 From: "M. Vefa Bicakci" Date: Mon, 4 Apr 2022 15:29:50 -0400 Subject: [PATCH] patch-iso: Fix up paths Commit c8c75e81b551 ("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 --- build-tools/patch-iso | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/build-tools/patch-iso b/build-tools/patch-iso index 6413b2f7..e73a3b90 100755 --- a/build-tools/patch-iso +++ b/build-tools/patch-iso @@ -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