Skip to content

Commit 7738f00

Browse files
Apply more compression to sd compress
1 parent 28a4b41 commit 7738f00

4 files changed

Lines changed: 15 additions & 10 deletions

File tree

.github/workflows/build-image.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
- name: Build SD image
6262
timeout-minutes: 120
6363
run: |
64-
nix build .#sdImage -L --out-link result-sdimage
64+
nix build .#sdImageUncompressed -L --out-link result-sdimage
6565
ls -lah result-sdimage/sd-image
6666
6767
- name: Build and push system toplevel for OTA updates
@@ -74,7 +74,7 @@ jobs:
7474
- name: Collect artefacts
7575
run: |
7676
mkdir -p dist
77-
cp -v result-sdimage/sd-image/*.img.zst dist/
77+
zstd -T0 --ultra -22 result-sdimage/sd-image/*.img -o dist/lnbitsbox-${GITHUB_REF_NAME#v}.img.zst
7878
sha256sum dist/*.img.zst | tee dist/SHA256SUMS.txt
7979
8080
- name: Create update manifest

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ All directories are owned by their respective system users and persist across re
4949
### Step 1: Download the image
5050

5151
1. Go to **[Releases](../../releases)**
52-
2. Download the latest `nixos-sd-image-*-aarch64-linux.img.zst` file
52+
2. Download the latest `lnbitsbox-<version>.img.zst` file
5353
3. (Optional) Download `SHA256SUMS.txt` to verify integrity
5454

5555
### Step 2: Flash to SD card
@@ -81,8 +81,8 @@ lsblk
8181
sudo umount /dev/sdX*
8282

8383
# Decompress first, then write
84-
zstd -d nixos-sd-image-*.img.zst
85-
sudo dd if=nixos-sd-image-*.img of=/dev/sdX bs=4M status=progress conv=fsync
84+
zstd -d lnbitsbox-*.img.zst
85+
sudo dd if=lnbitsbox-*.img of=/dev/sdX bs=4M status=progress conv=fsync
8686
```
8787

8888
**macOS:**
@@ -94,7 +94,7 @@ diskutil list
9494
diskutil unmountDisk /dev/diskX
9595

9696
# Write the image (use rdiskX for faster writing)
97-
zstd -dc nixos-sd-image-*.img.zst | sudo dd of=/dev/rdiskX bs=4m
97+
zstd -dc lnbitsbox-*.img.zst | sudo dd of=/dev/rdiskX bs=4m
9898

9999
# Eject when complete
100100
diskutil eject /dev/diskX

docs/development.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ You can build two variants of the SD image:
1111

1212
| Build Type | Command | Output | Use Case |
1313
|------------|---------|--------|----------|
14-
| **Compressed** (default) | `nix build .#sdImage -L` | `*.img.zst` | For distribution, GitHub releases (smaller file size) |
14+
| **Compressed** | `nix build .#sdImage -L` | `*.img.zst` | For distribution, GitHub releases (smaller file size) |
1515
| **Uncompressed** | `nix build .#sdImageUncompressed -L` | `*.img` | For local testing (faster build, faster flashing) |
1616
| **Quick Test** | `./build-test.sh` | `*.img` (copied to repo root) | Fastest way to build and prepare for flashing |
1717

@@ -133,7 +133,7 @@ Build the SD image:
133133
./build-test.sh
134134

135135
# OR: Manual builds
136-
# Compressed image (default, smaller for distribution)
136+
# Compressed image (smaller for distribution)
137137
nix build .#sdImage -L
138138

139139
# Uncompressed image (faster for local testing, skips compression)
@@ -160,8 +160,8 @@ Copy the image to a distribution directory:
160160
```bash
161161
mkdir -p dist
162162

163-
# For compressed images (releases)
164-
cp -v result/sd-image/*.img.zst dist/
163+
# For release images, build uncompressed first and recompress aggressively
164+
zstd -T0 --ultra -22 result/sd-image/*.img -o dist/lnbitsbox-$(git describe --tags --always | sed "s/^v//").img.zst
165165
sha256sum dist/*.img.zst > dist/SHA256SUMS.txt
166166

167167
# For uncompressed images (if using build-test.sh, already in repo root)

nixos/configuration.nix

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55

66
sdImage.imageName = "lnbitsbox-${version}.img";
77

8+
documentation.enable = false;
9+
documentation.doc.enable = false;
10+
documentation.info.enable = false;
11+
documentation.man.enable = false;
12+
813
# Write version to filesystem for the admin app to read
914
environment.etc."lnbitsbox-version".text = version;
1015

0 commit comments

Comments
 (0)