|
1 | 1 | #!/bin/bash |
2 | 2 | set -euo pipefail |
| 3 | +IFS=$'\n\t' |
3 | 4 | # shellcheck disable=SC2035 |
4 | 5 |
|
5 | | -# download |
6 | | -# echo "Downloading wsldl..." |
7 | | -# curl --silent --location "https://github.com/yuk7/wsldl/releases/download/$(curl https://api.github.com/repos/yuk7/wsldl/releases/latest -s | jq .name -r)/icons.zip" |
8 | | -# echo "Downloading tarball..." |
9 | | -# curl --silent --localtion "https://jenkins.linuxcontainers.org/view/Images/job/image-devuan/architecture=amd64,release=excalibur,variant=default/lastSuccessfulBuild/artifact/rootfs.tar.xz" |
10 | | - |
11 | | -# build |
12 | | -echo "Extracting..." |
13 | | -unzip -u icons.zip Devuan.exe |
14 | | - |
15 | | -mkdir -p ziproot/usr/lib/wsl # mkdir ziproot |
16 | | -cp rootfs.tar.xz ziproot/ |
17 | | - |
18 | | -tar -C ziproot -xf rootfs.tar.xz |
19 | | -install -pm644 fs/etc/wsl-distribution.conf ziproot/etc/wsl-distribution.conf |
20 | | -install -pm755 fs/usr/lib/wsl/oobe ziproot/usr/lib/wsl/oobe |
21 | | -install -pm644 fs/usr/lib/wsl/devuan.ico ziproot/usr/lib/wsl/devuan.ico |
22 | | -install -pm644 fs/usr/lib/wsl/terminal-profile.json ziproot/usr/lib/wsl/terminal-profile.json |
23 | | -tar -C ziproot --numeric-owner --absolute-names --create . | pigz > ziproot/Devuan.wsl |
24 | | -# tar -C ziproot --numeric-owner --absolute-names --create . | gzip --best > ziproot/Devuan.wsl |
25 | | -shopt -s extglob |
26 | | -rm -r -- ziproot/!(Devuan.wsl) |
27 | | - |
28 | | -cp Devuan.exe ziproot/Devuan.exe |
29 | | - |
30 | | -zip -j Devuan.zip ziproot/* |
31 | | -sha512sum Devuan.zip > Devuan.zip.sha512 |
32 | | - |
33 | | -# clean |
34 | | -rm -rf ziproot Devuan.exe |
35 | | -# rm -r icons.zip rootfs.tar.xz |
| 6 | +download(){ |
| 7 | + echo "Downloading wsldl..." |
| 8 | + curl -Lo icons.zip "https://github.com/yuk7/wsldl/releases/latest/download/icons.zip" |
| 9 | + echo "Downloading tarball..." |
| 10 | + curl -Lo rootfs.tar.xz "https://jenkins.linuxcontainers.org/view/Images/job/image-devuan/architecture=amd64,release=excalibur,variant=default/lastSuccessfulBuild/artifact/rootfs.tar.xz" |
| 11 | +} |
| 12 | + |
| 13 | +build(){ |
| 14 | + echo "Extracting..." |
| 15 | + unzip -u icons.zip Devuan.exe |
| 16 | + |
| 17 | + echo "Packing wsl..." |
| 18 | + mkdir ziproot |
| 19 | + mkdir -p ziproot/usr/lib/wsl |
| 20 | + cp rootfs.tar.xz ziproot/rootfs.tar.xz |
| 21 | + |
| 22 | + tar -C ziproot -xf rootfs.tar.xz |
| 23 | + install -pm644 fs/etc/wsl-distribution.conf ziproot/etc/wsl-distribution.conf |
| 24 | + install -pm755 fs/usr/lib/wsl/oobe ziproot/usr/lib/wsl/oobe |
| 25 | + install -pm644 fs/usr/lib/wsl/devuan.ico ziproot/usr/lib/wsl/devuan.ico |
| 26 | + install -pm644 fs/usr/lib/wsl/terminal-profile.json ziproot/usr/lib/wsl/terminal-profile.json |
| 27 | + tar -C ziproot --numeric-owner --absolute-names --create . | pigz > Devuan.wsl |
| 28 | + # tar -C ziproot --numeric-owner --absolute-names --create . | gzip --best Devuan.wsl |
| 29 | + |
| 30 | + rm -rf ziproot |
| 31 | + sha512sum Devuan.wsl > Devuan.wsl.sha512 |
| 32 | + |
| 33 | + echo "Packing zip..." |
| 34 | + cp rootfs.tar.xz ziproot/rootfs.tar.xz |
| 35 | + cp Devuan.exe ziproot/Devuan.exe |
| 36 | + zip -j Devuan.zip ziproot/* |
| 37 | + # sudo chown "$(whoami):$(whoami)" Devuan.zip |
| 38 | + sha512sum Devuan.zip > Devuan.zip.sha512 |
| 39 | +} |
| 40 | + |
| 41 | +clean(){ |
| 42 | + echo "Cleaning..." |
| 43 | + rm -rf ziproot Devuan.exe |
| 44 | + # rm -r icons.zip rootfs.tar.xz |
| 45 | +} |
| 46 | + |
| 47 | +download |
| 48 | +build |
| 49 | +clean |
0 commit comments