diff --git a/tools/mkimage-squashfs/Dockerfile b/tools/mkimage-squashfs/Dockerfile new file mode 100644 index 000000000..72d24f2f3 --- /dev/null +++ b/tools/mkimage-squashfs/Dockerfile @@ -0,0 +1,12 @@ +FROM linuxkit/alpine:f3cd219615428b2bd943411723eb28875275fae7 + +RUN \ + apk update && apk upgrade && \ + apk add --no-cache \ + libarchive-tools \ + squashfs-tools \ + && true + +COPY . . + +ENTRYPOINT [ "/make-squashfs" ] diff --git a/tools/mkimage-squashfs/build.yml b/tools/mkimage-squashfs/build.yml new file mode 100644 index 000000000..04ab0c5b1 --- /dev/null +++ b/tools/mkimage-squashfs/build.yml @@ -0,0 +1 @@ +image: mkimage-squashfs diff --git a/tools/mkimage-squashfs/make-squashfs b/tools/mkimage-squashfs/make-squashfs new file mode 100755 index 000000000..f48c0b0a5 --- /dev/null +++ b/tools/mkimage-squashfs/make-squashfs @@ -0,0 +1,22 @@ +#!/bin/sh + +set -e + +mkdir -p /tmp/rootfs +cd /tmp/rootfs + +# input is a tarball of filesystem on stdin with the root filesytem +# output is a squashfs image on stdout + +# extract. BSD tar auto recognises compression, unlike GNU tar +# only if stdin is a tty, if so need files volume mounted... +[ -t 0 ] || bsdtar xzf - +cd /tmp + +# we want everything except the final result to stderr +( + exec 1>&2; + + mksquashfs rootfs ./rootfs.img +) +cat rootfs.img