+4
-1
@@ -1,2 +1,5 @@
|
|||||||
[build]
|
[build]
|
||||||
# target = "armv7-unknown-linux-musleabihf"
|
target = "armv7-unknown-linux-musleabihf"
|
||||||
|
|
||||||
|
[target.armv7-unknown-linux-musleabihf]
|
||||||
|
linker = "rust-lld"
|
||||||
@@ -14,12 +14,12 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Ensure toolchain and cross
|
- name: Ensure toolchain and targets
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
rustc -V
|
rustc -V
|
||||||
cargo -V
|
cargo -V
|
||||||
if (-not (Get-Command cross -ErrorAction SilentlyContinue)) { cargo install cross --git https://github.com/cross-rs/cross }
|
rustup target add armv7-unknown-linux-musleabihf
|
||||||
|
|
||||||
- name: Cache cargo
|
- name: Cache cargo
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
@@ -33,7 +33,7 @@ jobs:
|
|||||||
- name: Build (armv7-musl)
|
- name: Build (armv7-musl)
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
./scripts/cross_build.ps1 -Release -Targets armv7-unknown-linux-musleabihf
|
cargo build --release --target armv7-unknown-linux-musleabihf
|
||||||
|
|
||||||
- name: Package rootfs tarball
|
- name: Package rootfs tarball
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
|
|||||||
@@ -2,15 +2,19 @@
|
|||||||
|
|
||||||
router shit
|
router shit
|
||||||
|
|
||||||
## compile
|
## usage
|
||||||
|
|
||||||
with [cross](https://crates.io/crates/cross).
|
- Build (Windows host OK):
|
||||||
|
- cargo build --release --target armv7-unknown-linux-musleabihf
|
||||||
|
- Run on a Linux box/router:
|
||||||
|
- copy target/armv7-unknown-linux-musleabihf/release/wakey to the device
|
||||||
|
- chmod +x wakey && ./wakey
|
||||||
|
- Install via release asset (OpenWrt):
|
||||||
|
- wget -O- `https://your.gitea/owner/repo/releases/download/vX.Y.Z/wakey-rootfs-vX.Y.Z-armv7-unknown-linux-musleabihf.tgz` | tar -xz -C /
|
||||||
|
- /etc/init.d/wakey enable && /etc/init.d/wakey start
|
||||||
|
|
||||||
|
Optional updater (fetch latest automatically on OpenWrt):
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cross build --release --target armv7-unknown-linux-musleabihf # my machine
|
WAKEY_HOST=git.ldlda.com WAKEY_OWNER=lda WAKEY_REPO=wakey sh /etc/ldlda_help/update_wakey.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
cross works with a random windows machine.
|
|
||||||
it works; those toolchains they tried to install: add them forcefully by hand.
|
|
||||||
|
|
||||||
it works. uses docker.
|
|
||||||
|
|||||||
+1
-1
@@ -37,7 +37,7 @@ WAKEY_HOST=git.ldlda.com WAKEY_OWNER=lda WAKEY_REPO=wakey sh /etc/ldlda_help/upd
|
|||||||
## Scripts overview
|
## Scripts overview
|
||||||
|
|
||||||
- `act_runner.ps1` — Start/seed the local Gitea runner. Use `-Attach` to see logs, `-ForceConfigure` to register non-interactively.
|
- `act_runner.ps1` — Start/seed the local Gitea runner. Use `-Attach` to see logs, `-ForceConfigure` to register non-interactively.
|
||||||
- `cross_build.ps1` — Simple wrapper for `cross build` per target (default: armv7-unknown-linux-musleabihf).
|
- `cross_build.ps1` — Simple wrapper for `cargo build` per target (default: armv7-unknown-linux-musleabihf).
|
||||||
- `package_rootfs.ps1` — Produces `dist/wakey-rootfs-<version>-<target>.tgz` with `/root/.bin/wakey` and `/etc/init.d/*`.
|
- `package_rootfs.ps1` — Produces `dist/wakey-rootfs-<version>-<target>.tgz` with `/root/.bin/wakey` and `/etc/init.d/*`.
|
||||||
- `package.ps1` — Dev bundle with binaries + init scripts (not a rootfs layout).
|
- `package.ps1` — Dev bundle with binaries + init scripts (not a rootfs layout).
|
||||||
- `publish.ps1` — Optional version bump + build + tag (and `cargo publish` only if you pass `-Publish`).
|
- `publish.ps1` — Optional version bump + build + tag (and `cargo publish` only if you pass `-Publish`).
|
||||||
|
|||||||
@@ -36,6 +36,16 @@ Get-ChildItem (Join-Path $root 'scripts/init/openwrt') -File | ForEach-Object {
|
|||||||
Copy-Item $_.FullName $dest -Force
|
Copy-Item $_.FullName $dest -Force
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Copy helper scripts intended for /etc/ldlda_help
|
||||||
|
$helpSrc = Join-Path $root 'scripts/ldlda_help'
|
||||||
|
if (Test-Path $helpSrc) {
|
||||||
|
$etcHelpDir = Join-Path $staging 'etc/ldlda_help'
|
||||||
|
New-Item -ItemType Directory -Force -Path $etcHelpDir | Out-Null
|
||||||
|
Get-ChildItem $helpSrc -File | ForEach-Object {
|
||||||
|
Copy-Item $_.FullName (Join-Path $etcHelpDir $_.Name) -Force
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# Create tarball
|
# Create tarball
|
||||||
$pkgName = "wakey-rootfs-$Version-$Target.tgz"
|
$pkgName = "wakey-rootfs-$Version-$Target.tgz"
|
||||||
Push-Location $staging
|
Push-Location $staging
|
||||||
@@ -54,4 +64,4 @@ Remove-Item -Recurse -Force $staging
|
|||||||
Write-Host "Rootfs package: " (Join-Path $dist $pkgName)
|
Write-Host "Rootfs package: " (Join-Path $dist $pkgName)
|
||||||
Write-Host "On router: wget -O- <URL/$pkgName> | tar -xz -C /"
|
Write-Host "On router: wget -O- <URL/$pkgName> | tar -xz -C /"
|
||||||
Write-Host "Then: chmod +x /etc/init.d/wakey && /etc/init.d/wakey enable && /etc/init.d/wakey start"
|
Write-Host "Then: chmod +x /etc/init.d/wakey && /etc/init.d/wakey enable && /etc/init.d/wakey start"
|
||||||
Write-Host "For any additional init scripts (e.g., update_tailscale), also chmod +x and enable/start as needed."
|
Write-Host "Helper scripts: /etc/ldlda_help/* (e.g., update_wakey.sh, update_tailscale.sh). Mark executable if needed: chmod +x /etc/ldlda_help/*.sh"
|
||||||
|
|||||||
+7
-4
@@ -1,11 +1,14 @@
|
|||||||
# One-shot: build with cross, package, and print artifact location.
|
# One-shot: build, package, and print artifact location (no cross required).
|
||||||
# Usage: ./scripts/release.ps1 -Version 0.1.0 -Targets armv7-unknown-linux-musleabihf
|
# Usage: ./scripts/release.ps1 -Version 0.1.0 -Targets armv7-unknown-linux-musleabihf
|
||||||
param(
|
param(
|
||||||
[Parameter(Mandatory=$true)][string]$Version,
|
[Parameter(Mandatory = $true)][string]$Version,
|
||||||
[string[]]$Targets = @("armv7-unknown-linux-musleabihf")
|
[string[]]$Targets = @("armv7-unknown-linux-musleabihf")
|
||||||
)
|
)
|
||||||
|
|
||||||
$ErrorActionPreference = 'Stop'
|
$ErrorActionPreference = 'Stop'
|
||||||
|
|
||||||
./scripts/cross_build.ps1 -Targets $Targets -Release
|
foreach ($t in $Targets) {
|
||||||
|
rustup target add $t
|
||||||
|
cargo build --release --target $t
|
||||||
|
}
|
||||||
./scripts/package.ps1 -Version $Version -Targets $Targets
|
./scripts/package.ps1 -Version $Version -Targets $Targets
|
||||||
|
|||||||
Reference in New Issue
Block a user