Skip to content

Commit 392342e

Browse files
committed
feat: pack .zip along with .wsl
- functionize - use static download link for wsldl, jq no longer needed - update docs
1 parent a44d20c commit 392342e

3 files changed

Lines changed: 82 additions & 42 deletions

File tree

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ jobs:
2525
- name: build
2626
run: |
2727
mkdir -p release
28-
sudo apt install -y curl jq pigz tar unzip zip
28+
sudo apt install -y curl pigz tar unzip zip
2929
sudo ./build.sh
30-
mv Devuan.zip* release/
30+
mv Devuan.* release/
3131
- name: upload as artifact
3232
uses: actions/upload-artifact@v5
3333
with:
3434
retention-days: 90
3535
path: release/*
3636
- name: upload as release
37-
run: gh release upload "${TAG}" --clobber release/Devuan.zip*
37+
run: gh release upload "${TAG}" --clobber release/Devuan.*
3838
env:
3939
GH_TOKEN: ${{ github.token }}
4040
TAG: action-build

README.md

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,46 @@ THIS REPO IS NOT AFFILIATE TO THE OFFICIAL "DEVUAN LINUX" DISTRIBUTION IN ANY WA
1212

1313
## Install
1414

15-
1. Download installer zip from [releases](https://github.com/Vinfall/DevuanWSL/releases/tag/action-build)
16-
2. (Optinally) verify hash to avoid file corruption
15+
Traditional `.zip` with rootfs+wsldl and the new `.wsl` format are both provided.
16+
17+
`.zip` is recommended and [#Usage](#usage)/[#Backup](#backup) only applies to this.
18+
19+
You can use `.wsl` if:
20+
21+
- you don't mind installing WSL to system drive
22+
- just want one-off shot on DevuanWSL
23+
24+
### `.zip`
25+
26+
1. Download `Devuan.zip` and `Devuan.zip.sha512` from [releases](https://github.com/Vinfall/DevuanWSL/releases/tag/action-build)
27+
2. Verify hash to avoid file corruption
1728
3. Extract all files in zip file to same directory (e.g. `D:\WSL\Devuan`)
18-
4. Run `Devuan.exe` to extract rootfs and Register to WSL
29+
4. Run `Devuan.exe` to extract rootfs and register to WSL
1930

20-
`Devuan.exe` is used as WSL distro label.
31+
`Devuan` in `Devuan.exe` is used as WSL distro label.
2132
It's possible to have multiple installs by renaming it to something like `Dedede.exe`.
2233

23-
## Uninstall
34+
To uninstall:
2435

2536
```powershell
37+
# path to DevuanWSL directory
38+
# cd D:\WSL\Devuan
2639
.\Devuan.exe clean
2740
```
2841

42+
### `.wsl`
43+
44+
1. Download `Devuan.wsl` and `Devuan.wsl.sha512` from [releases](https://github.com/Vinfall/DevuanWSL/releases/tag/action-build)
45+
2. Verify hash to avoid file corruption
46+
3. Click `Devuan.wsl` to install
47+
4. Finish the prompted oobe and create a new user
48+
49+
To uninstall:
50+
51+
```powershell
52+
wsl --unregister Devuan
53+
```
54+
2955
## Usage
3056

3157
<details><summary>Click to expand</summary>
@@ -75,14 +101,14 @@ Usage:
75101

76102
DevuanWSL can be built on GNU/Linux or WSL.
77103

78-
`curl`, `jq`, `unzip` and `zip` is required for build.
104+
`curl`, `unzip` and `zip` is required for build.
79105
`pigz` is recommended over `gzip` and used by default.
80106

81107
```bash
82108
# Install build tools
83-
sudo apt install -y curl jq pigz tar unzip zip
109+
sudo apt install -y curl pigz tar unzip zip
84110
# Make release
85-
# Use `sudo` here as partitions mounted via WSL are owned by current user
111+
# use `sudo` here as partitions mounted via WSL are owned by current user
86112
# (e.g. UID 1000) but rootfs requires root aka. UID 0
87113
sudo ./build.sh
88114
```

build.sh

Lines changed: 45 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,49 @@
11
#!/bin/bash
22
set -euo pipefail
3+
IFS=$'\n\t'
34
# shellcheck disable=SC2035
45

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

Comments
 (0)