forked from VPraharsha03/DevuanWSL
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·49 lines (41 loc) · 1.54 KB
/
build.sh
File metadata and controls
executable file
·49 lines (41 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
# shellcheck disable=SC2035
download(){
echo "Downloading wsldl..."
curl -Lo icons.zip "https://github.com/yuk7/wsldl/releases/latest/download/icons.zip"
echo "Downloading tarball..."
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"
}
build(){
echo "Extracting..."
unzip -u icons.zip Devuan.exe
echo "Packing wsl..."
mkdir ziproot
mkdir -p ziproot/usr/lib/wsl
cp rootfs.tar.xz ziproot/rootfs.tar.xz
tar -C ziproot -xf rootfs.tar.xz
install -pm644 fs/etc/wsl-distribution.conf ziproot/etc/wsl-distribution.conf
install -pm755 fs/usr/lib/wsl/oobe ziproot/usr/lib/wsl/oobe
install -pm644 fs/usr/lib/wsl/devuan.ico ziproot/usr/lib/wsl/devuan.ico
install -pm644 fs/usr/lib/wsl/terminal-profile.json ziproot/usr/lib/wsl/terminal-profile.json
tar -C ziproot --numeric-owner --absolute-names --create . | pigz > Devuan.wsl
# tar -C ziproot --numeric-owner --absolute-names --create . | gzip --best Devuan.wsl
rm -rf ziproot
sha512sum Devuan.wsl > Devuan.wsl.sha512
echo "Packing zip..."
cp rootfs.tar.xz ziproot/rootfs.tar.xz
cp Devuan.exe ziproot/Devuan.exe
zip -j Devuan.zip ziproot/*
# sudo chown "$(whoami):$(whoami)" Devuan.zip
sha512sum Devuan.zip > Devuan.zip.sha512
}
clean(){
echo "Cleaning..."
rm -rf ziproot Devuan.exe
# rm -r icons.zip rootfs.tar.xz
}
download
build
clean