Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential busybox-static python3 bzip2 cpio curl parted dosfstools mtools e2fsprogs gdisk squashfs-tools musl-tools musl-dev byacc bison
sudo apt-get install -y build-essential busybox-static python3 bzip2 cpio curl parted dosfstools mtools e2fsprogs gdisk squashfs-tools musl-tools musl-dev byacc bison xz-utils

- name: Build rootfs and initramfs
run: |
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ jobs:
- name: Dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential busybox-static python3 musl-tools musl-dev byacc bison shellcheck openssl cppcheck
sudo apt-get install -y build-essential busybox-static python3 musl-tools musl-dev byacc bison shellcheck openssl cppcheck curl xz-utils

- name: Fetch prebuilt package payloads
run: make prebuilt

- name: Static analysis (cppcheck)
run: |
Expand Down Expand Up @@ -158,7 +161,7 @@ jobs:
- name: Dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential busybox-static python3 musl-tools musl-dev byacc bison bzip2 cpio qemu-system-x86 curl
sudo apt-get install -y build-essential busybox-static python3 musl-tools musl-dev byacc bison bzip2 cpio qemu-system-x86 curl xz-utils

- name: rootfs + initramfs from source (BUSYBOX_MODE=auto)
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-image-boot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential busybox-static python3 bzip2 cpio curl parted dosfstools mtools e2fsprogs gdisk squashfs-tools qemu-system-x86 ovmf musl-tools musl-dev byacc bison
sudo apt-get install -y build-essential busybox-static python3 bzip2 cpio curl parted dosfstools mtools e2fsprogs gdisk squashfs-tools qemu-system-x86 ovmf musl-tools musl-dev byacc bison xz-utils

- name: Build rootfs and initramfs
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential busybox-static python3 bzip2 cpio curl parted dosfstools mtools e2fsprogs gdisk squashfs-tools qemu-system-x86 ovmf musl-tools musl-dev byacc bison
sudo apt-get install -y build-essential busybox-static python3 bzip2 cpio curl parted dosfstools mtools e2fsprogs gdisk squashfs-tools qemu-system-x86 ovmf musl-tools musl-dev byacc bison xz-utils

- name: Build rootfs and initramfs
run: |
Expand Down
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,31 @@ __pycache__/
/distro/qemu.log
/distro/qemu-image*.log

# payload paket: build output, bukan source. Ambil dengan `make prebuilt`.
packages/*/x/bin/
packages/busybox/x/sbin/
packages/*/x/sbin/init
packages/*/x/boot/
packages/*/x/lib/ld-musl-*.so.*
packages/*/x/lib/modules/
packages/*/x/usr/bin/curl
packages/*/x/usr/bin/doas
packages/*/x/usr/bin/limine
packages/*/x/usr/bin/openssl
packages/*/x/usr/bin/ocspcheck
packages/*/x/usr/bin/wpa_cli
packages/*/x/usr/bin/wpa_supplicant
packages/*/x/usr/lib/*.a
packages/*/x/usr/lib/*.o
packages/*/x/usr/lib/*.so*
packages/*/x/usr/sbin/
packages/*/x/usr/share/limine/
packages/*/x/etc/ssl/cert.pem

# generated package manifests (build-package.sh regenerates deterministically)
packages/*/.META/files
packages/*/.META/sha256

# dokumen operasional & laporan lokal
LAPORAN-*.md
AUDIT-*.md
Expand Down
26 changes: 15 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ TEST_SCRIPTS := scripts/smoke-test.sh scripts/test-sigterm.sh scripts/test-confi
scripts/test-network.sh scripts/test-network-fault.sh \
scripts/test-reliability.sh scripts/test-zombie-reap-500.sh

test: $(TESTBIN)
test: prebuilt $(TESTBIN)
@PRE_CGROUPS=$$(ls -d /sys/fs/cgroup/ninit* 2>/dev/null || true); \
for t in $(TEST_SCRIPTS); do BIN=./$(TESTBIN) sh ./$$t || exit 1; done; \
POST_CGROUPS=$$(ls -d /sys/fs/cgroup/ninit* 2>/dev/null || true); \
Expand All @@ -79,7 +79,7 @@ test: $(TESTBIN)
exit 1; \
fi

rootfs:
rootfs: prebuilt
sh ./scripts/build-rootfs.sh

qemu: rootfs
Expand Down Expand Up @@ -118,6 +118,7 @@ clean-distro:
lint:
python3 ./scripts/lint-log-patterns.py
python3 ./scripts/verify-format-strings.py
python3 ./scripts/check-tracked-binaries.py
$(MAKE) lint-shell

# Real, failing gate over the 13 production shell scripts. Test, smoke, fuzz
Expand All @@ -133,31 +134,34 @@ lint-shell:
scripts/sane-reliability scripts/spm \
packages/ninit/x/usr/bin/sane-net packages/ninit/x/usr/bin/sane-ctl

packages: $(BIN)
prebuilt:
sh ./scripts/fetch-prebuilt-packages.sh

packages: prebuilt $(BIN)
bash ./packages/build-all.sh

clawrza:
bash ./packages/clawrza-build-all.sh

test-accounts:
test-accounts: prebuilt
sh ./scripts/test-accounts.sh

test-pkg:
test-pkg: prebuilt
bash ./scripts/test-build-package.sh

test-network:
test-network: prebuilt
sh ./scripts/test-network.sh

test-reliability:
test-reliability: prebuilt
sh ./scripts/test-reliability.sh

test-network-fault:
test-network-fault: prebuilt
sh ./scripts/test-network-fault.sh

test-build-rootfs:
test-build-rootfs: prebuilt
sh ./scripts/test-build-rootfs.sh

test-spm:
test-spm: prebuilt
bash ./scripts/test-spm.sh

image: packages
Expand Down Expand Up @@ -185,4 +189,4 @@ test-lifecycle:
test-installer installer-test: packages
sudo bash ./scripts/test-installer.sh

.PHONY: all test test-panic fuzz rootfs qemu integration clean clean-distro lint lint-shell packages clawrza test-pkg test-spm image test-image test-image-bios test-image-uefi test-installer installer-test test-lifecycle test-accounts test-network test-network-fault test-build-rootfs test-reliability ubsan
.PHONY: all test prebuilt test-panic fuzz rootfs qemu integration clean clean-distro lint lint-shell packages clawrza test-pkg test-spm image test-image test-image-bios test-image-uefi test-installer installer-test test-lifecycle test-accounts test-network test-network-fault test-build-rootfs test-reliability ubsan
3 changes: 3 additions & 0 deletions RELEASE-NOTES-v1.2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ original v1.2.0 release. It does not change the historical feature list above.
<https://github.com/Iky969/sane-linux/releases/tag/v1.2.1-source>. It
contains the kernel bundle, both BusyBox source variants, the dosfstools
source package, and the pinned `build-rootfs-1.36.1.sh` script.
- Generated package payloads are published separately as
`v1.2.1-prebuilt` and are no longer committed to git; `make prebuilt` fetches
and verifies the asset.
- `packages/kernel/PROVENANCE` and `packages/disk-tools/PROVENANCE` record the
exact upstreams, hashes, and build paths of the shipped kernel and
dosfstools binaries.
Expand Down
6 changes: 4 additions & 2 deletions SOURCE-OFFER.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ Two BusyBox binaries are distributed by this project, and both are covered.

### Ubuntu package binary (1.37.0)

The binary committed at `packages/busybox/x/bin/busybox` identifies itself as
The BusyBox binary distributed in the `v1.2.1-prebuilt` package-payload asset
(path `packages/busybox/x/bin/busybox` inside that archive) identifies itself as
`BusyBox v1.37.0 (Ubuntu 1:1.37.0-7ubuntu1)`. Its complete corresponding
source, including the Ubuntu packaging patches, is published as:

Expand All @@ -58,7 +59,8 @@ BusyBox is included alongside the tarball:

## GPL-3.0 components and Installation Information

The `mkfs.fat` binary in `packages/disk-tools/x/usr/sbin/mkfs.fat` is
The `mkfs.fat` binary distributed in the `v1.2.1-prebuilt` package-payload
asset (path `packages/disk-tools/x/usr/sbin/mkfs.fat` inside that archive) is
dosfstools 4.2, built by `GCC: (Ubuntu 15.2.0-16ubuntu1) 15.2.0` (Ubuntu
Resolute 26.04). Its complete corresponding source is published as:

Expand Down
13 changes: 13 additions & 0 deletions doc/distro-builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@ make qemu # scripts/run-qemu.sh -> interactive boot (Ctrl-A X to
SECS=5 make qemu # automated 5-second boot + milestone checks + console report
```

## Prebuilt package payloads

The binaries under `packages/*/x` are build outputs and are **not committed**.
They are published as the `sane-packages-prebuilt-v1.2.1.tar.xz` asset in the
[`v1.2.1-prebuilt`](https://github.com/Iky969/sane-linux/releases/tag/v1.2.1-prebuilt)
release. Use `make prebuilt` to download and verify the asset; `make rootfs`,
`make packages`, and the test targets fetch it automatically when a required
payload is missing. Set `SANE_PREBUILT_MODE=none` to skip the prebuilt fetch and
build from source where supported, or `force` to re-download and re-extract.
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
The asset is pinned by SHA-256 in `scripts/fetch-prebuilt-packages.sh`.
`packages/*/.META/files` and `packages/*/.META/sha256` are generated by
`scripts/build-package.sh` and are ignored as build outputs too.

## Workflow Summary

| Stage | Script | Output |
Expand Down
13 changes: 13 additions & 0 deletions doc/id/distro-builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@ make qemu # scripts/run-qemu.sh -> boot interaktif (Ctrl-A X untuk
SECS=5 make qemu # boot otomatis 5 detik + pemeriksaan penanda + laporan konsol
```

## Payload paket prebuilt

Biner di bawah `packages/*/x` adalah hasil build dan **tidak di-commit**. Payload
tersebut dipublikasikan sebagai asset `sane-packages-prebuilt-v1.2.1.tar.xz` di
release [`v1.2.1-prebuilt`](https://github.com/Iky969/sane-linux/releases/tag/v1.2.1-prebuilt).
Jalankan `make prebuilt` untuk mengunduh dan memverifikasi asset; target
`make rootfs`, `make packages`, dan test akan mengambilnya otomatis saat payload
yang dibutuhkan belum ada. Set `SANE_PREBUILT_MODE=none` untuk melewati prebuilt
dan membangun dari source bila didukung, atau `force` untuk mengunduh ulang.
SHA-256 asset dipatok di `scripts/fetch-prebuilt-packages.sh`.
`packages/*/.META/files` dan `packages/*/.META/sha256` dihasilkan oleh
`scripts/build-package.sh` dan juga diabaikan sebagai output build.

## Ringkas alur

| Tahap | Script | Hasil |
Expand Down
8 changes: 8 additions & 0 deletions licenses/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ For the GPL-2.0-only binaries shipped in S.A.N.E Linux images, see
[`SOURCE-OFFER.md`](../SOURCE-OFFER.md) and
[`THIRD_PARTY_LICENSES.md`](../THIRD_PARTY_LICENSES.md).

## Prebuilt package payloads

The binaries under `packages/*/x` are build outputs and are not committed to
git. They are published as `sane-packages-prebuilt-v1.2.1.tar.xz` in the
[`v1.2.1-prebuilt`](https://github.com/Iky969/sane-linux/releases/tag/v1.2.1-prebuilt)
release and fetched by `scripts/fetch-prebuilt-packages.sh`. The source offer
and license notices above apply to those payloads as well.

## License artifact allowlist

`allowlist.json` is consumed by `scripts/check-license-artifacts.py` and by the
Expand Down
4 changes: 4 additions & 0 deletions packages/build-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ PACKAGES_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
REPO_ROOT="$(cd "$PACKAGES_DIR/.." && pwd -P)"
OUT_DIR="${1:-$REPO_ROOT/distro/packages}"

# Package payloads are build outputs and live in a release asset. Fetch them
# when missing; use SANE_PREBUILT_MODE=none to force source builds instead.
sh "$REPO_ROOT/scripts/fetch-prebuilt-packages.sh"

mkdir -p "$OUT_DIR"

PACKAGES=(
Expand Down
87 changes: 0 additions & 87 deletions packages/busybox/.META/files

This file was deleted.

2 changes: 0 additions & 2 deletions packages/busybox/.META/sha256

This file was deleted.

24 changes: 21 additions & 3 deletions packages/busybox/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,28 @@ PKG_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
REPO_ROOT="$(cd "$PKG_DIR/../.." && pwd -P)"
OUT_DIR="${1:-$REPO_ROOT/distro/packages}"

# Find busybox binary
# Fetch the published payload only when no source-built or package-local
# BusyBox exists. A source-built binary must not depend on the network.
if [ -z "${BUSYBOX_BIN:-}" ] && \
[ ! -x "$REPO_ROOT/distro/rootfs/bin/busybox" ] && \
[ ! -x "$REPO_ROOT/distro/build/busybox-1.36.1/busybox" ] && \
[ ! -x "$PKG_DIR/x/bin/busybox" ] && \
[ "${REBUILD:-0}" != "1" ]; then
sh "$REPO_ROOT/scripts/fetch-prebuilt-packages.sh"
fi

# Find busybox binary. A source-built rootfs/build binary wins; otherwise the
# published prebuilt payload is used. The host /bin/busybox requires an opt-in.
BB_BIN="${BUSYBOX_BIN:-}"
if [ -z "$BB_BIN" ]; then
if [ -x "$REPO_ROOT/distro/rootfs/bin/busybox" ]; then
BB_BIN="$REPO_ROOT/distro/rootfs/bin/busybox"
elif [ -x "$REPO_ROOT/distro/build/busybox-1.36.1/busybox" ]; then
BB_BIN="$REPO_ROOT/distro/build/busybox-1.36.1/busybox"
elif [ -x "/bin/busybox" ]; then
elif [ -x "$PKG_DIR/x/bin/busybox" ] && [ "${REBUILD:-0}" != "1" ]; then
# Published prebuilt payload, used when no source-built rootfs exists.
BB_BIN="$PKG_DIR/x/bin/busybox"
elif [ -x "/bin/busybox" ] && [ "${ALLOW_HOST_BUSYBOX:-0}" = "1" ]; then
BB_BIN="/bin/busybox"
else
printf 'ERROR: No static busybox binary found. Run make rootfs first.\n' >&2
Expand Down Expand Up @@ -53,7 +67,11 @@ fi
mkdir -p "$OUT_DIR" "$PKG_DIR/x/bin" "$PKG_DIR/x/sbin" "$PKG_DIR/x/usr/share/udhcpc"
[ -f "$PKG_DIR/x/usr/share/udhcpc/default.script" ] && chmod 0755 "$PKG_DIR/x/usr/share/udhcpc/default.script"

install -m 0755 "$BB_BIN" "$PKG_DIR/x/bin/busybox"
if [ "$BB_BIN" != "$PKG_DIR/x/bin/busybox" ]; then
install -m 0755 "$BB_BIN" "$PKG_DIR/x/bin/busybox"
else
chmod 0755 "$PKG_DIR/x/bin/busybox"
fi

# Core /bin applets
BIN_APPLETS=(
Expand Down
1 change: 0 additions & 1 deletion packages/busybox/x/bin/ash

This file was deleted.

1 change: 0 additions & 1 deletion packages/busybox/x/bin/awk

This file was deleted.

Binary file removed packages/busybox/x/bin/busybox
Binary file not shown.
1 change: 0 additions & 1 deletion packages/busybox/x/bin/cat

This file was deleted.

1 change: 0 additions & 1 deletion packages/busybox/x/bin/chmod

This file was deleted.

Loading