thttpd does not remove its pidfile when it dies, so a crash left the
file behind pointing at a dead pid. The boot guard only tested that the
file existed, concluded the server was up and skipped the restart, so
nothing was listening while the loader carried on and reported an ip.
That is the connection refused on a running system. Test the pid with
kill -0 instead and clear the file before restarting.
The shipped init script had no monitor loop to catch this later, and its
stop() bailed out with FAIL when the pidfile was missing, so restart
could not recover a thttpd that was running without one. Fall back to
killall in that case, and never signal a recorded pid that is no longer
alive since the number may have been recycled.
loaderPorts compared the new port against HTTPPORT, which arc.conf had
already been rewritten to hold, so the restart was skipped on a real
change. Capture the running port before the rewrite.
CONFIG_NR_CPUS is compiled into the kernel image, so it refuses any CPU
past its ceiling during SMP bring-up on its own. maxcpus only moved
where that cap happened and did not change the resulting online count,
so ccnt now just drives a warning.
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
The cap raised PLTCNT to 128 for every non-official kernel, but only
full is built for that many threads. legacy and upstreamed were left
effectively uncapped, so they now fall back to the platform ccnt.
Guard the ceiling against a missing or non-numeric ccnt as well; the
value went straight into -gt, which errors on anything but an integer.
The kernel menus only probed for -legacy and -upstreamed, so a -full
image on the loader was never offered. Probe for it too, and replace the
bare option labels with what each kernel actually is.
Three gates tested for legacy or upstreamed by name to decide whether to
read from CUSTOM_PATH. Selecting full would have fallen through to the
official branch and booted the stock kernel with stock modules. Test for
official instead, as boot.sh already does, so further variants need no
change here.
Widen both menus to auto width; the descriptions do not fit in 50 cols.
Opening the notification menu, pressing Test or cancelling out no longer
invalidates the build. The webhook/discord flags and the webhook url are
snapshotted on entry and compared on exit, so a rebuild is only forced
when a value that gets baked into the ramdisk actually changed.
registerAccessToken keeps forcing a rebuild, but via resetBuildstatus so
it no longer writes the build flag into CONFDONE.
The modules tgz of the igpu platforms ships a backported i915 stack in
an update/ folder, 11 modules for epyc7002 and geminilakenk. Five of
them (drm, ttm, drm_kms_helper, intel-gtt,
drm_panel_orientation_quirks) also exist in the root folder as an older
build, update/ overrides those the same way the kernel does.
getdepends only looked at the root folder, so "getdepends i915"
returned nothing but i915 itself: i915.ko does not exist in root, and
even a prefixed name broke the recursion because dmabuf, drm_buddy,
drm_display_helper and i915-compat are update/ only. Deps that do exist
in both were read from the stale root copy. As a result the i915
deselect menu left all dependencies selected.
Add MODULE_DIRS as the single search order plus resolveModule() and
moduleName() to resolve a module to its file and to its list name.
getdepends now follows dependencies across both folders, returns folder
prefixed names and guards against cycles. addToModules replaces a
module in place so an update/ ko keeps precedence, delToModules drops
every copy so the older root module does not come back.
Match module names as exact tokens in installModules and in the i915
deselect, "grep -w" treats the slash as a word boundary and let a
selected update/drm pull in the older root drm as well.
Also fix the packagModules typo in addToModules and delToModules, both
never repacked the tgz.
lspci -d ::300 only matches the VGA subclass (0300), so display
devices reporting 0301 (XGA), 0302 (3D controller) or 0380 (other)
were missing from sysinfo. This hid NVIDIA compute cards and the
discrete GPU of hybrid setups.
Add getPciClass() to match a PCI class prefix via
/sys/bus/pci/devices/*/class, so 03 covers every display subclass,
and getIgpuId() to find the first Intel display device regardless of
subclass. Use them for the TUI and web GPU lists as well as the
iGPU/i915 detection for the model feature matrix and default addons.
The Linux 5.x / DSM 7.3+ dialog framed the custom kernel as a fix for
boot issues. Present it as an available choice instead and retitle the
dialog from "DSM 7.3+ Warning" to "Custom Kernel".
Add getPciId/getNicId helpers and append the vendor:device id to the
NIC driver line and to every controller entry (SATA, RAID, HBA, SCSI,
USB, MMC, NVME) in both the TUI and the WebUI sysinfo output.
getNicId resolves ids from sysfs, falling back to the parent node for
USB nics where idVendor/idProduct live one level up.
The legacy/upstreamed branch extracted ${CUSTOM_PATH}/firmware.tgz, but
arc-custom only ships kernel-flavor artifacts (bzImage-*-legacy.gz,
bzImage-*-upstreamed.gz, modules-*-${KERNEL}.tgz) -- it has never
contained a firmware.tgz. That path read a nonexistent file, and because
the $? check below tested the if/else rather than tar, the failure was
silent.
Firmware blobs are kernel-flavor independent, so one package serves all
flavors. Modules stay split per flavor in unpackModules/packModules,
matching the gate in updateModules that already requires firmware.tgz
under ${MODULES_PATH}.
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
dme1737, lm95245 and w83781d ship in arc-modules on all 45 platforms
and are already modprobed by the eudev addon, but were never listed
here - so on official kernels they were loaded during install and then
lost, since installModules only copies what this file names.
Also drops acpi_cpufreq.ko (the file is built as acpi-cpufreq.ko, so
the entry never matched anything), the cpufreq governors, dca and
rfkill, and adds button.ko.
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
auth.cgi was the only Python CGI in the image and failed at import
time on cgi, cgitb and crypt, all removed from the stdlib in Python
3.13 by PEP 594. The import sits at the top of the file, so the script
died before emitting any headers and thttpd received a zero-byte CGI
response, killing the connection. A wrong password was simply the
path that made this visible; the verify path hit the same wall but was
swallowed by a catch in app.js.
Rewrite in bash to match the other seven CGIs. The JSON contract
consumed by app.js is unchanged, so no frontend changes are needed.
- Verify passwords with openssl passwd using the id and salt parsed
from the stored hash, the same primitive loaderPassword uses to
write it, so the two cannot drift.
- Always emit a valid header block via an ERR trap, so the webserver
never sees an empty response.
- Generate tokens with openssl rand -hex 32.
Also fixes a path traversal: the previous version joined the
attacker-controlled token straight into a filesystem path, so
action=logout&token=../../../etc/shadow reached os.remove() as root.
Tokens are now rejected unless they are pure lowercase hex before any
rm. Locked accounts of the form !$6$... are now detected too; the old
membership test against ['*', '!', '!!'] missed them.
- boot.sh: cap kernel-visible CPU threads via maxcpus= cmdline when the
detected thread count exceeds what the platform (or custom/legacy/
upstreamed kernel, capped at 128) supports.
- netfix now cycles true -> force -> false; static IP network.* cmdline
values are only injected when netfix is set to "force", while the MAC
remap and driver unload fixes apply for both true and force.
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
- automated boot marker: write/clean on p1 (grub reads /automated from p1) instead of p3
- livepatch: rebuild PAT url/hash lookup from stored config instead of unset $resp, fall back to existing values when no match
- arcVersion: offer custom kernel selection on DSM 7.3+ warning for 5.x platforms (now includes r1000nk/v1000nk), reset kernel to official on version change
- fancontrol: gate on physical MEV first, require detected sensor before offering/enabling
- ledcontrol: skip UGREEN *GT* models
- netfix: convert submenu to a direct toggle, matching other arc.sh options
The Kernel dialog in arc.sh now checks CUSTOM_PATH for a matching
bzImage-<platform>-<kpre->-<kver>-<variant>.gz before listing
legacy/upstreamed, so users can't pick a variant that has no build
for the current platform/DSM version. official/legacy labels show
the platform's real kver instead of a hardcoded version.
Pre-existing configs from before the official/legacy/upstreamed
kernel selector may still have kernel: custom on disk, which no
downstream script recognizes anymore. Rewrite it to legacy on every
boot, before the already-initialized fast path to arc.sh.
Kernel menu in arc.sh is now a 3-way dialog (official/legacy/
upstreamed) writing distinct config values instead of toggling
official/custom. zimage-patch.sh and include/modules.sh select
bzImage/modules filenames with a -legacy/-upstreamed suffix
accordingly. Removed the now-dead customKernel() helper (only used
by the just-removed evo.sh Easy UI) and simplified the matching
recoverDSM() branch in arc-functions.sh.
Kernel selection is now a 3-way dialog (official/legacy/upstreamed)
writing distinct config values, with bzImage/modules filenames
suffixed accordingly. Removed the unused Easy UI (evo.sh) and its
dead customKernel() helper, which had drifted out of sync with the
Advanced UI's kernel handling.
set default="boot" pointed to a menuentry id that no longer exists
(renamed to --id dsm in 370d4850). GRUB silently fell back to the
first defined entry instead, which is Arc Config Mode when DSM
images aren't present yet, causing boot to land on Config Mode
instead of DSM Mode.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>