Skip to content

Commit 69d856f

Browse files
iavigorpecovnik
authored andcommitted
helios4: workaround fancontrol for mvebu >=6.18 (no J17 timer patch)
J17 PWM on Helios4 depends on the out-of-tree timer-assignment patch, which is currently .disabled from mvebu-6.18 onwards while it's ported to the refactored pwm chip API. Without the patch, /dev/fan-j17/pwm1 does not appear and fancontrol.service aborts on start. Add a post_family_tweaks_bsp hook in the helios4 board config that comments out the J17 references in /etc/fancontrol when KERNEL_MAJOR_MINOR >= 6.18 (via linux-version compare), keeping the original line as a commented reference so the file also serves as documentation of the historical config. Drop this hook once the patch is ported.
1 parent 645e134 commit 69d856f

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

config/boards/helios4.conf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,23 @@ function post_family_config__helios4_extra_packages() {
2020
add_packages_to_image "fancontrol"
2121
add_packages_to_image "ethtool"
2222
}
23+
24+
# J17 PWM on Helios4 depends on the out-of-tree timer-assignment patch, which
25+
# is currently .disabled from mvebu-6.18 onwards (needs porting to the
26+
# refactored pwm chip API). Comment out original J17 references in
27+
# /etc/fancontrol so the service starts with J10-only; drop this hook once
28+
# the patch is ported and re-enabled.
29+
function post_family_tweaks_bsp__helios4_j17_disable_until_patch_ported() {
30+
linux-version compare "${KERNEL_MAJOR_MINOR}" ge 6.18 || return 0
31+
[[ -s "${destination}/etc/fancontrol" ]] || return 0
32+
display_alert "${BOARD}" "fancontrol: commenting out J17 (no >=6.18 timer patch)" "info"
33+
awk '
34+
BEGIN { print "# J17 PWM disabled: mvebu >=6.18 lacks the timer-assignment patch." }
35+
/\/dev\/fan-j17\/pwm1/ {
36+
print "# " $0
37+
gsub(/ ?\/dev\/fan-j17\/pwm1=[^ ]+/, "")
38+
}
39+
{ print }
40+
' "${destination}/etc/fancontrol" > "${destination}/etc/fancontrol.new"
41+
mv "${destination}/etc/fancontrol.new" "${destination}/etc/fancontrol"
42+
}

0 commit comments

Comments
 (0)