diff options
Diffstat
| -rw-r--r-- | .dockerignore | 9 | +0 −9 |
| -rw-r--r-- | .github/workflows/build.yml | 29 | +5 −24 |
| -rw-r--r-- | .github/workflows/legal.yml | 2 | +0 −2 |
| -rw-r--r-- | .gitignore | 2 | +1 −1 |
| -rw-r--r-- | .mailmap | 3 | +0 −3 |
| -rw-r--r-- | Cargo.toml | 2 | +1 −1 |
| -rw-r--r-- | README.md | 9 | +5 −4 |
| -rw-r--r-- | REUSE.toml | 1 | +0 −1 |
| -rwxr-xr-x | images/alpine/genimg | 14 | +7 −7 |
| -rwxr-xr-x | images/debian/genimg | 18 | +7 −11 |
| -rwxr-xr-x | images/fedora/genimg | 9 | +1 −8 |
| -rwxr-xr-x | images/ubuntu/genimg | 15 | +4 −11 |
| -rw-r--r-- | mise.lock | 48 | +0 −48 |
| -rw-r--r-- | mise.toml | 6 | +1 −5 |
14 files changed, 32 insertions, 135 deletions
diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 --- a/.dockerignore +++ /dev/null @@ -1,9 +0,0 @@ -# SPDX-FileCopyrightText: 2026 Nikolay Govorov -# SPDX-License-Identifier: Apache-2.0 - -.git -.github -.recluse-state -dist -target -*.lcov diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index be7c3ff..17a282e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,20 +6,14 @@ name: Build on: push: branches: [main] - tags: ["v*"] pull_request: branches: [main] permissions: contents: read -concurrency: - group: hule-build-${{ github.ref }} - cancel-in-progress: true - env: CARGO_TERM_COLOR: always - RELEASE_TAG: nightly jobs: lint: @@ -28,22 +22,15 @@ jobs: steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - - uses: jdx/mise-action@5228313ee0372e111a38da051671ca30fc5a96db # v3 + - uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable with: - version: 2026.7.5 - experimental: true - install: false - - name: Install dependencies - run: mise bootstrap --locked --yes --update + components: clippy, rustfmt - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2 - - name: formatting + - name: Check formatting run: cargo fmt --all --check - - name: shellcheck - run: shellcheck images/*/genimg - - - name: clippy + - name: Run Clippy run: cargo clippy --workspace --all-targets --all-features --release --locked -- -D warnings build: @@ -61,13 +48,7 @@ jobs: steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - - uses: jdx/mise-action@5228313ee0372e111a38da051671ca30fc5a96db # v3 - with: - version: 2026.7.5 - experimental: true - install: false - - name: Install dependencies - run: mise bootstrap --locked --yes + - uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2 - name: Build diff --git a/.github/workflows/legal.yml b/.github/workflows/legal.yml index b5a2fad..2d5d69c 100644 --- a/.github/workflows/legal.yml +++ b/.github/workflows/legal.yml @@ -6,7 +6,6 @@ name: Legal on: push: branches: [main] - tags: ["v*"] pull_request: branches: [main] @@ -26,7 +25,6 @@ jobs: with: version: 2026.7.5 experimental: true - install: false - name: Check contribution sign-off run: mise run signoff diff --git a/.gitignore b/.gitignore index ea96d7d..ba46a2d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,8 @@ # SPDX-FileCopyrightText: 2026 Nikolay Govorov # SPDX-License-Identifier: Apache-2.0 -/dist /target +/dist mise.local.toml mise.*.local.toml diff --git a/.mailmap b/.mailmap index d364a7b..d8e0402 100644 --- a/.mailmap +++ b/.mailmap @@ -1,6 +1,3 @@ -# SPDX-FileCopyrightText: 2026 Nikolay Govorov -# SPDX-License-Identifier: Apache-2.0 -# # Add new entries in alphabetical order Nikolay Govorov <me@govorov.online> diff --git a/Cargo.toml b/Cargo.toml index 825ad03..6c27a41 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ edition = "2024" version = "0.1.0" license = "Apache-2.0" authors = ["Nikolay Govorov <me@govorov.online>"] -repository = "https://git.dimidiumlabs.io/hule" +repository = "https://github.com/dimidiumlabs/hule" [workspace.dependencies] # local dependencies diff --git a/README.md b/README.md index f335062..ce66a80 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,14 @@ stories. If you are making a contribution for the first time or from a new email, please add yourself to the `.mailmap`. -### Signoff +### Contributor License Agreement To include your code, we ask that you read and agree to the [CLA](./CLA.md). To sign, add a `CLA-Version: 1.0` and a `Signed-off-by` trailer to every commit (`git commit -s --trailer "CLA-Version: 1.0"`). Each commit in a pull request must carry a valid `Signed-off-by` line matching the commit author. Please use -your real name. We cannot include code from anonymous contributors. +your real name or your public nickname. We cannot include code from anonymous +contributors. AI agents MUST NOT add Signed-off-by tags. Only humans can legally certify the Contributor License Agreement. @@ -36,8 +37,8 @@ Remember, AI agents should make software better, not worse. ## Licensing -Hule source code is licensed under Apache-2.0. Documentation is licensed under -CC-BY-4.0. +Hule source code is licensed under the Apache License 2.0. Documentation is +licensed under CC BY 4.0. The image-generation scripts in `images/*/genimg` are derived from code originally published by Drew DeVault as part of [SourceHut](https://sr.ht) and diff --git a/REUSE.toml b/REUSE.toml index 9ad56a8..29ec511 100644 --- a/REUSE.toml +++ b/REUSE.toml @@ -7,7 +7,6 @@ version = 1 path = [ "Cargo.toml", "Cargo.lock", - "mise.lock", ] SPDX-FileCopyrightText = "2026 Nikolay Govorov" SPDX-License-Identifier = "Apache-2.0" diff --git a/images/alpine/genimg b/images/alpine/genimg index f5446ce..6d34e3e 100755 --- a/images/alpine/genimg +++ b/images/alpine/genimg @@ -56,7 +56,7 @@ qemu-img create -f qcow2 -o compat=1.1 "$out"/root.hmi "${size_gib}G" modprobe nbd max_part=16 qemu-nbd --connect=/dev/nbd0 "$out"/root.hmi for i in $(seq 1 5); do - sleep "0.$i" + sleep 0.$i partprobe /dev/nbd0 && break done trap cleanup EXIT @@ -82,13 +82,13 @@ swapon /dev/nbd0p2 # TODO: Remove bash apk add -U \ - -X "http://dl-cdn.alpinelinux.org/alpine/$release/main/" \ - -X "http://dl-cdn.alpinelinux.org/alpine/$release/community/" \ + -X http://dl-cdn.alpinelinux.org/alpine/$release/main/ \ + -X http://dl-cdn.alpinelinux.org/alpine/$release/community/ \ --allow-untrusted \ --arch="$apk_arch" \ --root=/mnt \ --initdb \ - acct alpine-base alpine-conf alpine-sdk linux-firmware-none "$linux" \ + acct alpine-base alpine-conf alpine-sdk linux-firmware-none $linux \ git mercurial openssh sudo syslinux tzdata gnupg haveged bash curl \ doas qemu-guest-agent @@ -200,11 +200,11 @@ cat >/mnt/etc/docker/daemon.json <<EOF EOF pkg_version() { - name=$(run_root apk list "$1" | grep installed | cut -d' ' -f1) - echo "${name##"$1"-}" + name=$(run_root apk list $1 | grep installed | cut -d' ' -f1) + echo ${name##$1-} } -run_root apk add "$linux=$(pkg_version "$linux")" +run_root apk add $linux=$(pkg_version $linux) sync diff --git a/images/debian/genimg b/images/debian/genimg index 2dedba5..c710088 100755 --- a/images/debian/genimg +++ b/images/debian/genimg @@ -21,16 +21,19 @@ case $arch in amd64) darch=amd64 iface=ens3 + qarch=x86_64 kpkg=linux-image-amd64 ;; arm64) darch=arm64 iface=enp0s1 + qarch=aarch64 kpkg=linux-image-arm64 ;; ppc64le) darch=ppc64el iface=enp0s0 + qarch=ppc64le kpkg=linux-image-powerpc64le ;; *) @@ -64,7 +67,7 @@ qemu-img create -f qcow2 -o compat=1.1 "$out/root.hmi" "${size_gib}G" modprobe nbd max_part=16 qemu-nbd --connect=/dev/nbd0 "$out/root.hmi" for i in $(seq 1 5); do - sleep "0.$i" + sleep 0.$i partprobe /dev/nbd0 && break done trap cleanup EXIT @@ -88,9 +91,9 @@ mkdir /mnt/boot mount /dev/nbd0p1 /mnt/boot if [ "$arch" = "amd64" ]; then - debootstrap --include=gnupg2 --arch="$darch" "$release" /mnt + debootstrap --include=gnupg2 --arch=$darch $release /mnt else - ./qemu-debootstrap --include=gnupg2 --arch="$darch" "$release" /mnt + ./qemu-debootstrap --include=gnupg2 --arch=$darch $release /mnt fi mount --bind /dev /mnt/dev @@ -156,14 +159,7 @@ EOF run_root update-initramfs -u -kernel_path= -for candidate in /mnt/boot/vmlinuz-*; do - [ -e "$candidate" ] || continue - kernel_path=$candidate - break -done -[ -n "$kernel_path" ] -linuxver=${kernel_path##*/vmlinuz-} +linuxver=$(ls /mnt/boot | grep vmlinuz | cut -d- -f2-) # Reference partitions by PARTUUID so boot survives whatever the VMM names the # disk. cmdline is canonical: identical for every boot protocol (extlinux append diff --git a/images/fedora/genimg b/images/fedora/genimg index 8215ec5..eff48da 100755 --- a/images/fedora/genimg +++ b/images/fedora/genimg @@ -150,14 +150,7 @@ run_root dnf clean all cat >/mnt/etc/dracut.conf.d/virtio-blk.conf <<EOF add_drivers="virtio-blk" EOF -kernel_path= -for candidate in /mnt/boot/vmlinuz-*."$fedora_arch"; do - [ -e "$candidate" ] || continue - kernel_path=$candidate - break -done -[ -n "$kernel_path" ] -kernel_version=${kernel_path##*/vmlinuz-} +kernel_version=$(ls /mnt/boot | grep "vmlinuz.*.$fedora_arch" | cut -d- -f2-) run_root dracut --force --kver "$kernel_version" run_root grub2-install --target=i386-pc $NBD_DEVICE diff --git a/images/ubuntu/genimg b/images/ubuntu/genimg index 1980803..ec4b26c 100755 --- a/images/ubuntu/genimg +++ b/images/ubuntu/genimg @@ -81,7 +81,7 @@ export DEBIAN_FRONTEND=noninteractive debootstrap \ --include=gnupg,ubuntu-keyring \ - --arch="$arch" "$release" \ + --arch=$arch $release \ /mnt http://archive.ubuntu.com/ubuntu/ mount --bind /dev /mnt/dev @@ -111,9 +111,9 @@ echo 'nameserver 1.1.1.1' >>/mnt/etc/resolv.conf net_mode=static net_address=10.0.2.15/24 net_gateway=10.0.2.2 -cat >"/mnt/etc/systemd/network/25-$iface.network" <<EOF +cat >/mnt/etc/systemd/network/25-ens3.network <<EOF [Match] -Name=$iface +Name=ens3 [Network] Address=$net_address @@ -172,14 +172,7 @@ EOF run_root update-initramfs -u -kernel_path= -for candidate in /mnt/boot/vmlinuz-[0-9]*; do - [ -e "$candidate" ] || continue - kernel_path=$candidate - break -done -[ -n "$kernel_path" ] -linuxver=${kernel_path##*/vmlinuz-} +linuxver=$(ls /mnt/boot | grep 'vmlinuz-[0-9].*' | cut -d- -f2-) # Reference partitions by PARTUUID so boot works regardless of how the VMM names # the disk (vda/sda/nvme...). cmdline is canonical: identical for every boot diff --git a/mise.lock b/mise.lock deleted file mode 100644 --- a/mise.lock +++ /dev/null @@ -1,48 +0,0 @@ -# @generated - this file is auto-generated by `mise lock` https://mise.jdx.dev/dev-tools/mise-lock.html - -[[tools.rust]] -version = "1.97.1" -backend = "core:rust" - -[tools.rust.options] -components = "clippy,llvm-tools-preview,rustfmt" -profile = "minimal" - -[[tools.shellcheck]] -version = "0.11.0" -backend = "aqua:koalaman/shellcheck" - -[tools.shellcheck."platforms.linux-arm64"] -checksum = "sha256:12b331c1d2db6b9eb13cfca64306b1b157a86eb69db83023e261eaa7e7c14588" -url = "https://github.com/koalaman/shellcheck/releases/download/v0.11.0/shellcheck-v0.11.0.linux.aarch64.tar.xz" -url_api = "https://api.github.com/repos/koalaman/shellcheck/releases/assets/279056934" - -[tools.shellcheck."platforms.linux-arm64-musl"] -checksum = "sha256:12b331c1d2db6b9eb13cfca64306b1b157a86eb69db83023e261eaa7e7c14588" -url = "https://github.com/koalaman/shellcheck/releases/download/v0.11.0/shellcheck-v0.11.0.linux.aarch64.tar.xz" -url_api = "https://api.github.com/repos/koalaman/shellcheck/releases/assets/279056934" - -[tools.shellcheck."platforms.linux-x64"] -checksum = "sha256:8c3be12b05d5c177a04c29e3c78ce89ac86f1595681cab149b65b97c4e227198" -url = "https://github.com/koalaman/shellcheck/releases/download/v0.11.0/shellcheck-v0.11.0.linux.x86_64.tar.xz" -url_api = "https://api.github.com/repos/koalaman/shellcheck/releases/assets/279056942" - -[tools.shellcheck."platforms.linux-x64-musl"] -checksum = "sha256:8c3be12b05d5c177a04c29e3c78ce89ac86f1595681cab149b65b97c4e227198" -url = "https://github.com/koalaman/shellcheck/releases/download/v0.11.0/shellcheck-v0.11.0.linux.x86_64.tar.xz" -url_api = "https://api.github.com/repos/koalaman/shellcheck/releases/assets/279056942" - -[tools.shellcheck."platforms.macos-arm64"] -checksum = "sha256:56affdd8de5527894dca6dc3d7e0a99a873b0f004d7aabc30ae407d3f48b0a79" -url = "https://github.com/koalaman/shellcheck/releases/download/v0.11.0/shellcheck-v0.11.0.darwin.aarch64.tar.xz" -url_api = "https://api.github.com/repos/koalaman/shellcheck/releases/assets/279056932" - -[tools.shellcheck."platforms.macos-x64"] -checksum = "sha256:3c89db4edcab7cf1c27bff178882e0f6f27f7afdf54e859fa041fca10febe4c6" -url = "https://github.com/koalaman/shellcheck/releases/download/v0.11.0/shellcheck-v0.11.0.darwin.x86_64.tar.xz" -url_api = "https://api.github.com/repos/koalaman/shellcheck/releases/assets/279056930" - -[tools.shellcheck."platforms.windows-x64"] -checksum = "sha256:8a4e35ab0b331c85d73567b12f2a444df187f483e5079ceffa6bda1faa2e740e" -url = "https://github.com/koalaman/shellcheck/releases/download/v0.11.0/shellcheck-v0.11.0.zip" -url_api = "https://api.github.com/repos/koalaman/shellcheck/releases/assets/279056944" diff --git a/mise.toml b/mise.toml index 9d541da..0502c53 100644 --- a/mise.toml +++ b/mise.toml @@ -6,12 +6,8 @@ min_version = "2026.7.5" [settings] experimental = true -[tools] -rust = { version = "1.97.1", profile = "minimal", components = [ "clippy", "llvm-tools-preview", "rustfmt" ] } -shellcheck = "0.11.0" - [task_config] dir = "{{cwd}}" includes = [ - "git::https://git.dimidiumlabs.io/platform.git//tasks?ref=e5ca3be4349af3d1da2dde9d1165d52fb014a371", + "git::https://github.com/dimidiumlabs/infra.git//tasks?ref=1934f5fb264ab046031d5d1b61227de2e1f8dde9", ] |
