mirror of
https://github.com/linuxkit/linuxkit.git
synced 2026-02-22 04:11:12 +00:00
* add erofs as output option Signed-off-by: Avi Deitcher <avi@deitcher.net> * unify nearly identical functions Signed-off-by: Avi Deitcher <avi@deitcher.net> --------- Signed-off-by: Avi Deitcher <avi@deitcher.net>
23 lines
447 B
Bash
Executable File
23 lines
447 B
Bash
Executable File
#!/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;
|
|
|
|
mkfs.erofs ./rootfs.img rootfs
|
|
)
|
|
cat rootfs.img
|