Sync from SUSE:SLFO:Main elemental-post-build-extract-iso revision dfa7314a7bcef4cbf91dd6fa0a984556

This commit is contained in:
Adrian Schröter 2024-10-11 10:01:16 +02:00
parent 73db0e3921
commit 2dc7d06b9c
2 changed files with 20 additions and 9 deletions

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Wed Sep 18 13:30:28 UTC 2024 - David Cassany <dcassany@suse.com>
- Extend the extraction script to also support disk images
-------------------------------------------------------------------
Tue Apr 2 09:42:17 UTC 2024 - Klaus Kämpf <kkaempf@suse.com>
- install to /usr/lib/build/post_build.d
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Apr 2 09:42:17 UTC 2024 - Klaus Kämpf <kkaempf@suse.com> Tue Apr 2 09:42:17 UTC 2024 - Klaus Kämpf <kkaempf@suse.com>

View File

@ -15,26 +15,27 @@ set -e
img=$(ls ${TOPDIR}/DOCKER/*.tar) || true img=$(ls ${TOPDIR}/DOCKER/*.tar) || true
# Only consider images with 'iso' as part of the name # Only consider images with 'iso' or 'disk' as part of the name
[ -f "${img}" ] || exit 0 [ -f "${img}" ] || exit 0
echo "${img}" | grep -q iso || exit 0 echo "${img}" | grep -q "iso\|disk" || exit 0
echo "Extracting ISO from container image" echo "Extracting image from container"
buildah from --name "${container}" "docker-archive:${img}" buildah from --name "${container}" "docker-archive:${img}"
mnt=$(buildah mount "${container}") mnt=$(buildah mount "${container}")
ls "${mnt}"
iso=$(ls "${mnt}"/elemental-iso/*.iso) || true iso=$(ls "${mnt}"/elemental-iso/*.iso) || true
disk=$(ls "${mnt}"/elemental-disk/*.raw) || true
[ -f "${iso}" ] || cleanup_and_exit
mkdir -p "${TOPDIR}/OTHER" mkdir -p "${TOPDIR}/OTHER"
if [ -f "${iso}" ]; then
cp "${iso}" "${TOPDIR}/OTHER" cp "${iso}" "${TOPDIR}/OTHER"
cp "${iso}.sha256" "${TOPDIR}/OTHER" cp "${iso}.sha256" "${TOPDIR}/OTHER"
elif [ -f "${disk}" ]; then
cp "${disk}" "${TOPDIR}/OTHER"
fi
cleanup_and_exit cleanup_and_exit