Skip to content

Commit

Permalink
fix "Power off display after boot"
Browse files Browse the repository at this point in the history
  • Loading branch information
wjz304 committed Jul 26, 2024
1 parent eb6e0f2 commit 7075467
Show file tree
Hide file tree
Showing 19 changed files with 6,147 additions and 6,168 deletions.
8 changes: 8 additions & 0 deletions files/initrd/opt/rr/boot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,14 @@ else
# Clear logs for dbgutils addons
rm -rf "${PART1_PATH}/logs" >/dev/null 2>&1 || true

# Unload all network interfaces
for D in $(readlink /sys/class/net/*/device/driver); do modprobe -r --force "$(basename ${D})" 2>/dev/null || true; done

# Unload all graphics drivers
POWEROFFDISPLAY="$(readConfigKey "poweroffdisplay" "${USER_CONFIG_FILE}")"
[ "${POWEROFFDISPLAY}" = "true" ] && for D in $(lsmod | grep -E '^(nouveau|amdgpu|radeon|i915)' | awk '{print $1}'); do modprobe -r --force "${D}" 2>/dev/null || true; done

# Reboot
KERNELWAY="$(readConfigKey "kernelway" "${USER_CONFIG_FILE}")"
[ "${KERNELWAY}" = "kexec" ] && kexec -a -e || poweroff
exit 0
Expand Down
2 changes: 2 additions & 0 deletions files/initrd/opt/rr/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ initConfigKey "prerelease" "false" "${USER_CONFIG_FILE}"
initConfigKey "bootwait" "10" "${USER_CONFIG_FILE}"
initConfigKey "bootipwait" "10" "${USER_CONFIG_FILE}"
initConfigKey "kernelway" "power" "${USER_CONFIG_FILE}"
initConfigKey "poweroffdisplay" "true" "${USER_CONFIG_FILE}"
initConfigKey "kernelpanic" "5" "${USER_CONFIG_FILE}"
initConfigKey "odp" "false" "${USER_CONFIG_FILE}"
initConfigKey "hddsort" "false" "${USER_CONFIG_FILE}"
Expand Down Expand Up @@ -100,6 +101,7 @@ if [ ! "LOCALBUILD" = "${LOADER_DISK}" ]; then
sleep 1
fi
[ "${ETH::3}" = "eth" ] && ethtool -s ${ETH} wol g 2>/dev/null || true
[ "${ETH::3}" = "eth" ] && ethtool -K ${ETH} rxhash off 2>/dev/null || true
done
fi

Expand Down
Loading

0 comments on commit 7075467

Please sign in to comment.