commit:     5dad511caccc8832b08f299796d9a5adc8d5adf3
Author:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Wed May  7 20:37:37 2025 +0000
Commit:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Sun May 11 10:57:06 2025 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=5dad511c

Ensure that the qcow2 can executes its binaries by copying interpreter in

Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>

 targets/support/create-qcow2.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/targets/support/create-qcow2.sh b/targets/support/create-qcow2.sh
index 3fca589d..499197f2 100755
--- a/targets/support/create-qcow2.sh
+++ b/targets/support/create-qcow2.sh
@@ -78,10 +78,25 @@ exec_in_qcow2() {
         # Ensure the file has the executable bit set
         chmod +x "${mymountpoint}/tmp/${file_name}" || qcow2die
 
+       # Copy binary interpreter
+       if [[ -n "${clst_interpreter}" ]] ; then
+               echo "clst_interpreter is \"${clst_interpreter}\""
+               for myfile in ${clst_interpreter} ; do
+                       cp -pv "${myfile}" "${mymountpoint}/${myfile}" || 
qcow2die
+               done
+       fi
+
         echo "Running ${file_name} in qcow2:"
         echo "    ${clst_CHROOT} ${mymountpoint} /tmp/${file_name}"
         ${clst_CHROOT} "${mymountpoint}" "/tmp/${file_name}" || qcow2die
 
+       # Remove binary interpreter
+       if [[ -n "${clst_interpreter}" ]] ; then
+               for myfile in ${clst_interpreter} ; do
+                       rm -v "${mymountpoint}/${myfile}" || qcow2die
+               done
+       fi
+
         rm -f "${mymountpoint}/tmp/${file_name}" || qcow2die
         rm -f "${mymountpoint}/tmp/chroot-functions.sh" || qcow2die
 

Reply via email to