feat: add container image support
This commit is contained in:
parent
cbdd6d822a
commit
b4c70c48c7
2 changed files with 74 additions and 3 deletions
69
container-image.yaml
Normal file
69
container-image.yaml
Normal file
|
|
@ -0,0 +1,69 @@
|
||||||
|
track: "base"
|
||||||
|
|
||||||
|
modules:
|
||||||
|
- name: exec
|
||||||
|
run: |
|
||||||
|
for cmd in "$@"; do
|
||||||
|
bash -s <<< "$cmd"
|
||||||
|
done
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- module: exec
|
||||||
|
inputs:
|
||||||
|
- |
|
||||||
|
git clone --revision 5ec321bcb0a1019d6e64ad66e3dc55b5f1248e50 --depth 1 https://git.ruds.io/rs2009/akshara /akshara
|
||||||
|
cd /akshara
|
||||||
|
cp -a usr/lib/akshara /usr/lib/akshara
|
||||||
|
cp -a usr/lib/dracut/modules.d/10akshara /usr/lib/dracut/modules.d/10akshara
|
||||||
|
cp usr/bin/akshara /usr/bin/akshara
|
||||||
|
- rm -rf /akshara
|
||||||
|
|
||||||
|
override:
|
||||||
|
- path: /var/cache/blendOS/
|
||||||
|
keep: old
|
||||||
|
|
||||||
|
auto-update:
|
||||||
|
enabled: true
|
||||||
|
interval: 3600
|
||||||
|
|
||||||
|
distro-config:
|
||||||
|
before-stages: |
|
||||||
|
set -e
|
||||||
|
|
||||||
|
mkdir -p /var/cache/blendOS/container/blobs
|
||||||
|
|
||||||
|
if [[ -z "$IMAGE_NAME" ]]; then
|
||||||
|
echo "E: no image name specified"
|
||||||
|
echo "I: (define IMAGE_NAME in env section)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
skopeo copy "$IMAGE_NAME" --dest-shared-blob-dir=/var/cache/blendOS/blobs oci:image:main
|
||||||
|
rm -rf image/blobs
|
||||||
|
ln -s /var/cache/blendOS/blobs image/blobs
|
||||||
|
umoci unpack --image image:main bundle
|
||||||
|
rm image/blobs
|
||||||
|
|
||||||
|
cp -ax bundle/"$(jq '.root.path // "rootfs"' -Mcrj bundle/config.json)"/* .
|
||||||
|
jq '.annotations."org.opencontainers.image.revision" // empty' -Mcrj bundle/config.json > ./usr/revision
|
||||||
|
rm -rf bundle
|
||||||
|
|
||||||
|
mkdir -p ./var/cache/blendOS
|
||||||
|
mount --bind /var/cache/blendOS ./var/cache/blendOS
|
||||||
|
|
||||||
|
ln -sfn usr/lib64 ./lib64
|
||||||
|
ln -sfn usr/sbin ./sbin
|
||||||
|
|
||||||
|
cp /etc/locale.gen ./etc
|
||||||
|
cp /etc/locale.conf ./etc
|
||||||
|
|
||||||
|
after-stages: |
|
||||||
|
umount -l ./var/cache/blendOS &>/dev/null
|
||||||
|
systemd-nspawn -D . locale-gen &>/dev/null
|
||||||
|
systemd-nspawn -D . dracut --force --regenerate-all
|
||||||
|
|
||||||
|
should-update: |
|
||||||
|
[[ "$(cat /usr/revision)" == "$(skopeo inspect "$IMAGE_NAME" | jq '.Labels."org.opencontainers.image.revision" // "none"' -Mcrj)" ]]
|
||||||
|
|
||||||
|
env:
|
||||||
|
IMAGE_NAME: ""
|
||||||
|
|
@ -18,6 +18,7 @@ modules:
|
||||||
stages:
|
stages:
|
||||||
- module: pacman-install
|
- module: pacman-install
|
||||||
inputs:
|
inputs:
|
||||||
|
- "jq"
|
||||||
- "git"
|
- "git"
|
||||||
- "sudo"
|
- "sudo"
|
||||||
- "grub"
|
- "grub"
|
||||||
|
|
@ -25,6 +26,8 @@ stages:
|
||||||
- "linux"
|
- "linux"
|
||||||
- "linux-firmware"
|
- "linux-firmware"
|
||||||
- "dracut"
|
- "dracut"
|
||||||
|
- "skopeo"
|
||||||
|
- "umoci"
|
||||||
- "pacman-contrib"
|
- "pacman-contrib"
|
||||||
- "python"
|
- "python"
|
||||||
- "python-yaml"
|
- "python-yaml"
|
||||||
|
|
@ -35,7 +38,7 @@ stages:
|
||||||
- module: exec
|
- module: exec
|
||||||
inputs:
|
inputs:
|
||||||
- |
|
- |
|
||||||
git clone --revision eb7a52e5d690bab70063b9dc705d9546e77509ad --depth 1 https://git.ruds.io/rs2009/akshara /akshara
|
git clone --revision 2a08830ac0fa9d4d4a2491e7dd0c534cb9bf37cc --depth 1 https://git.ruds.io/rs2009/akshara /akshara
|
||||||
cd /akshara
|
cd /akshara
|
||||||
cp -a usr/lib/akshara /usr/lib/akshara
|
cp -a usr/lib/akshara /usr/lib/akshara
|
||||||
cp -a usr/lib/dracut/modules.d/10akshara /usr/lib/dracut/modules.d/10akshara
|
cp -a usr/lib/dracut/modules.d/10akshara /usr/lib/dracut/modules.d/10akshara
|
||||||
|
|
@ -53,8 +56,7 @@ override:
|
||||||
keep: old
|
keep: old
|
||||||
|
|
||||||
auto-update:
|
auto-update:
|
||||||
enabled: true
|
enabled: false
|
||||||
interval: 3600
|
|
||||||
|
|
||||||
distro-config:
|
distro-config:
|
||||||
before-stages: |
|
before-stages: |
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue