lz4 test (and better build)
This commit is contained in:
parent
12bfa6cfd6
commit
d69f2f27ee
@ -4,3 +4,5 @@ dist/*
|
|||||||
go.work
|
go.work
|
||||||
go.work.sum
|
go.work.sum
|
||||||
modd.*conf
|
modd.*conf
|
||||||
|
test-initrd*
|
||||||
|
test-initrd/**/*
|
||||||
|
11
Dockerfile
11
Dockerfile
@ -9,7 +9,9 @@ run go test ./...
|
|||||||
run go build -o /go/bin/init -trimpath .
|
run go build -o /go/bin/init -trimpath .
|
||||||
|
|
||||||
# ------------------------------------------------------------------------
|
# ------------------------------------------------------------------------
|
||||||
from alpine:3.18.4
|
from alpine:3.18.4 as initrd
|
||||||
|
|
||||||
|
run apk add --no-cache xz
|
||||||
|
|
||||||
workdir /layer
|
workdir /layer
|
||||||
run wget -O- https://dl-cdn.alpinelinux.org/alpine/v3.18/releases/x86_64/alpine-minirootfs-3.18.4-x86_64.tar.gz |tar zxv
|
run wget -O- https://dl-cdn.alpinelinux.org/alpine/v3.18/releases/x86_64/alpine-minirootfs-3.18.4-x86_64.tar.gz |tar zxv
|
||||||
@ -22,4 +24,9 @@ copy --from=build /go/bin/init .
|
|||||||
# check viability
|
# check viability
|
||||||
run chroot /layer /init hello
|
run chroot /layer /init hello
|
||||||
|
|
||||||
entrypoint ["sh","-c","find |cpio -H newc -o |base64"]
|
run find |cpio -H newc -o >/initrd
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------
|
||||||
|
from alpine:3.18.4
|
||||||
|
copy --from=initrd /initrd /
|
||||||
|
entrypoint ["base64","/initrd"]
|
||||||
|
@ -3,7 +3,8 @@ modd.test.conf {}
|
|||||||
dist/initrd dist/cpiocat dist/testconf test-initrd/**/* {
|
dist/initrd dist/cpiocat dist/testconf test-initrd/**/* {
|
||||||
prep: dist/testconf test-initrd/config.yaml
|
prep: dist/testconf test-initrd/config.yaml
|
||||||
prep: cp -f dist/initrd test-initrd.cpio
|
prep: cp -f dist/initrd test-initrd.cpio
|
||||||
prep: cd test-initrd && ../dist/cpiocat <../dist/initrd >../test-initrd.cpio *
|
prep: cd test-initrd && cat ../dist/initrd | ../dist/cpiocat * |lz4 -l9v >../test-initrd.cpio.new
|
||||||
prep: if cpio -t -F test-initrd.cpio 2>&1 |grep bytes.of.junk; then echo "bad cpio archive"; exit 1; fi
|
prep: mv test-initrd.cpio.new test-initrd.cpio
|
||||||
|
prep: if lz4cat test-initrd.cpio | cpio -t 2>&1 |grep bytes.of.junk; then echo "bad cpio archive"; exit 1; fi
|
||||||
prep: kill $(<qemu.pid)
|
prep: kill $(<qemu.pid)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user