Skip to content

Extending Arieltune for Alpine Linux LTS - #29

Open
infinitevalence wants to merge 53 commits into
cachenetics:mainfrom
infinitevalence:ALPINE
Open

infinitevalence wants to merge 53 commits into
cachenetics:mainfrom
infinitevalence:ALPINE

Conversation

@infinitevalence

Copy link
Copy Markdown

Updated install arieltune script to allow building on ALPINE. Added script to patch amdgpu, modified patch 7 & 8 to work on Alpine 6.18.53 LTS kernel.

@studebaker8

Copy link
Copy Markdown
Contributor

Three files conflict against main (cu.rs, smm.rs, umc.rs) - everything else (all 29 alpine-6.18.53 patches, bc250-enable-40cu-alpine.sh, both install.sh files) merges clean.

Root cause: this branch forked before commit 189ede0 landed on main (apu/bios/mem: fix ioctl request type for musl (Alpine) builds - itself a fix made in response to an earlier report from this same contributor, building on Alpine). That commit changed the same three ioctl call sites from a hardcoded glibc-only cast to as libc::Ioctl, which resolves to the correct type per target (c_ulong on glibc, c_int on musl) - zero behavior change on the actual BC-250/glibc build, and it fixes the musl build. This branch's two commits independently hardcode as i32 at the same three call sites instead, which is already fixed upstream and would be a regression on the glibc target.

Suggested fix, no rebase needed - on the ALPINE branch:

git fetch https://github.com/cachenetics/project-ariel.git main
git checkout FETCH_HEAD -- arieltune/crates/apu/src/cu.rs arieltune/crates/bios/src/smm.rs arieltune/crates/mem/src/umc.rs
git commit -m "drop redundant ioctl portability tweaks, already fixed upstream (189ede0)"
git push

infinitevalence and others added 26 commits September 25, 2026 15:54
- Switch shebang from #!/usr/bin/env bash to #!/usr/bin/env sh for Alpine compatibility
- Remove pipefail from set flags (bashism not supported by busybox ash)
- Add privilege elevation detection: prefers sudo (most distros), falls back to doas (Alpine), errors if neither available
- Replace all hardcoded sudo calls with $SUDO_CMD
…hen omitted

The detect_kbuild_tree() and resolve_kbuild_tree() functions were
already present but the build/all cases required the user to pass
<kbuild-tree> as a positional argument. Removed the mandatory-arg
guards so both args now auto-detect when omitted, and updated the
usage comments to reflect this.
Add /etc/alpine-release check to print mkimage for Alpine instead of
mkinitcpio -P. Update CONTEXT.md instructions and ALPINE_WORK_ORDERS
to reflect completed fixes and updated line numbers.
…vice suffix

rc-update add 'arieltune-gpu.service' looks for /etc/init.d/arieltune-gpu.service
which doesn't exist. OpenRC init scripts are named without the .service suffix.

Fix: strip '.service' from all OpenRC-specific paths via a shared strip_rc_unit()
helper — init_op enable/disable/start/stop/restart, install_enable, enabled,
gpu_unit_installed, gpu_unit_active, and remove_legacy_units.

This fixes the rc-update add arieltune-gpu.service default exit status: 1 error.
rc-update add fails silently (exit 1) if the init script isn't executable;
std::fs::write sets default 0644. Now install_enable sets 0755 for OpenRC
and 0644 for systemd unit files.
The shebang #!/usr/bin/env openrc caused OpenRC to report
"not a valid runlevel" because it cannot parse unrecognized
shebangs for runlevel detection. Use #!/sbin/openrc instead.
…install_headers() function

- Alpine branch now detects kver_base from uname -r (strips postdash suffix for detection) and uses it to look up linux-headers-
- Alpine header detection now tries the stripped base version first (e.g. linux-headers-7.0.9), falls back to the full version string (e.g. linux-headers-7.0.9-17-pve) before trying linux-lts-headers
- Added linux-tools- to the Alpine install list for sensors-cli and hwmon support
- Added linux-headers-common as a dependency in the Alpine branch
- Alpine headers are now installed in build mode (not install mode) to get KBUILD_TREE
- install_headers now passes kver_base instead of raw uname -r output, fixing broken Alpine header installs
- Added install mode: both build + install to keep it clean and traceable for the user.

build-and-install.sh removed bash from Alpine install list - no bash required for #! /usr/bin/env sh

build-and-install.sh removed bash from Alpine install list - no bash required for #! /usr/bin/env sh
Bug 1: enabled() now checks /etc/runlevel/default/{rc} (matching rc-update default)
Bug 2: generate_openrc_script() uses pidfile= + start-stop-daemon --background --pidfile
infinitevalence and others added 24 commits September 29, 2026 20:26
…e compile

Add `make -C MODSRC -j$(nproc)` between `modules_prepare` and amdgpu
module build. This generates top-level Module.symvers which fixes modpost
7 undefined symbol errors (kobj_sysfs_ops, drm_writeback_queue_job,
memmove, etc.).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants