mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-22 01:13:00 +02:00
Previously, post-image.sh was able to create QEMU images from an existing release tarball. This was useful when you wanted to test a new bootloader build without having to wait for a full Infix build. Restore this capability by adding a separate image target for it, and then allow image-itb-qcow to source its input images from that instead of a locally build squash+aux.
26 lines
722 B
Bash
Executable File
26 lines
722 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
squash="${BINARIES_DIR}"/rootfs.squashfs
|
|
aux="${BINARIES_DIR}"/aux.ext4
|
|
|
|
[ -f "${squash}" ] && [ -f "${aux}" ] && exit 0
|
|
|
|
archive="${WORKDIR}/$(basename ${URL})"
|
|
[ -f "${archive}" ] || wget -O"${archive}" "${URL}"
|
|
|
|
echo "Unpacking..."
|
|
tar -xa --strip-components=1 -C "${BINARIES_DIR}" -f "${archive}"
|
|
|
|
auxsize=$(stat -c %s "${aux}")
|
|
if [ "${auxsize}" -gt $((8 << 20)) ]; then
|
|
# In older releases, 16M aux.ext4 images were generated. In order
|
|
# to keep the image-itb-qcow logic simpler, trim it 8M, which we
|
|
# always generate nowadays.
|
|
echo "WARNING: Auxiliary partition is unexpectedly large. Resizing..."
|
|
resize2fs "${aux}" 8M
|
|
truncate -s 8M "${aux}"
|
|
tune2fs -l "${aux}"
|
|
fi
|