feat: preseed support

This commit is contained in:
Lance R. Vick 2024-02-17 10:19:47 -08:00
parent 73fd88ccc0
commit 66a5605f20
No known key found for this signature in database
GPG key ID: 8E47A1EC35A1551D
2 changed files with 21 additions and 0 deletions

View file

@ -32,6 +32,10 @@ all: \
compat:
./src/compat.sh
.PHONY: preseed
preseed:
./src/preseed.sh
.PHONY: digests
digests:
@for each in $$(find out -iname "index.json"| sort); do \

17
src/preseed.sh Executable file
View file

@ -0,0 +1,17 @@
#!/bin/sh
set -eu
fetch(){
line=${1?}
local package=$(echo ${line} | sed 's/^[a-z0-9]\+ \(.*\)/\1/g');
local hash=$(echo ${line} | sed 's/^\([a-z0-9]\+\) .*/\1/g');
local ref=$(printf "stagex/%s@sha256:%s" "$package" "$hash");
docker pull ${ref}
rm -rf "out/${package}"
mkdir -p "out/${package}"
docker save ${ref} | tar -xC out/${package}
}
while read line; do
fetch "${line}"
done < digests.txt