mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-09-10 03:10:32 +00:00
erofs output (#4162)
* 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>
This commit is contained in:
15
tools/mkimage-erofs/Dockerfile
Normal file
15
tools/mkimage-erofs/Dockerfile
Normal file
@@ -0,0 +1,15 @@
|
||||
FROM linuxkit/alpine:6090baae063eb5023c9601966e88df831f789a70 AS mirror
|
||||
RUN mkdir -p /out/etc/apk && cp -r /etc/apk/* /out/etc/apk/
|
||||
RUN apk add --no-cache --initdb -p /out \
|
||||
alpine-baselayout \
|
||||
busybox \
|
||||
libarchive-tools \
|
||||
erofs-utils \
|
||||
&& true
|
||||
RUN mv /out/etc/apk/repositories.upstream /out/etc/apk/repositories
|
||||
|
||||
FROM scratch
|
||||
WORKDIR /
|
||||
COPY --from=mirror /out/ /
|
||||
COPY . .
|
||||
ENTRYPOINT [ "/make-erofs" ]
|
1
tools/mkimage-erofs/build.yml
Normal file
1
tools/mkimage-erofs/build.yml
Normal file
@@ -0,0 +1 @@
|
||||
image: mkimage-erofs
|
22
tools/mkimage-erofs/make-erofs
Executable file
22
tools/mkimage-erofs/make-erofs
Executable file
@@ -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;
|
||||
|
||||
mkfs.erofs ./rootfs.img rootfs
|
||||
)
|
||||
cat rootfs.img
|
Reference in New Issue
Block a user