disable xen and drm support

This commit is contained in:
Ing 2024-08-09 20:06:13 +08:00
parent a536eecee3
commit fb4a789607
3 changed files with 3 additions and 36 deletions

View File

@ -161,8 +161,6 @@ CMDLINE['loglevel']="15"
CMDLINE['log_buf_len']="32M"
CMDLINE['panic']="${KERNELPANIC:-0}"
CMDLINE['pcie_aspm']="off"
CMDLINE['nox2apic']=""
CMDLINE['nomodeset']=""
CMDLINE['modprobe.blacklist']="${MODBLACKLIST}"
# if [ -n "$(ls /dev/mmcblk* 2>/dev/null)" ] && [ ! "${BUS}" = "mmc" ] && [ ! "${EMMCBOOT}" = "true" ]; then
@ -206,14 +204,6 @@ done
CMDLINE_LINE=$(echo "${CMDLINE_LINE}" | sed 's/^ //') # Remove leading space
echo -e "$(TEXT "Cmdline:\n")\033[1;36m${CMDLINE_LINE}\033[0m"
# Save command line to grubenv
if echo "apollolake geminilake purley" | grep -wq "${PLATFORM}"; then
if grep -q "^flags.*x2apic.*" /proc/cpuinfo; then
checkCmdline "rr_cmdline" "nox2apic" || addCmdline "rr_cmdline" "nox2apic"
fi
else
checkCmdline "rr_cmdline" "nox2apic" && delCmdline "rr_cmdline" "nox2apic"
fi
DIRECT="$(readConfigKey "directboot" "${USER_CONFIG_FILE}")"
if [ "${DIRECT}" = "true" ]; then
CMDLINE_DIRECT=$(echo ${CMDLINE_LINE} | sed 's/>/\\\\>/g') # Escape special chars
@ -328,15 +318,8 @@ else
[ -w "/dev/${T}" ] && echo -e "\n\033[1;43m$(TEXT "[This interface will not be operational. Please wait a few minutes.\nFind DSM via http://find.synology.com/ or Synology Assistant and connect.]")\033[0m\n" >"/dev/${T}" 2>/dev/null || true
done
# Unload all network interfaces
for D in $(readlink /sys/class/net/*/device/driver); do rmmod -f "$(basename ${D})" 2>/dev/null || true; done
# Unload all graphics drivers
# for D in $(readlink /sys/class/drm/*/device/driver); do rmmod -f "$(basename ${D})" 2>/dev/null || true; done
for D in $(lsmod | grep -E '^(nouveau|amdgpu|radeon|i915)' | awk '{print $1}'); do rmmod -f "${D}" 2>/dev/null || true; done
for I in $(find /sys/devices -name uevent -exec bash -c 'cat {} 2>/dev/null | grep -Eq "PCI_CLASS=0?30[0|1|2]00" && dirname {}' \;); do
[ -e ${I}/reset ] && cat ${I}/vendor >/dev/null | grep -iq 0x10de && echo 1 >${I}/reset || true # Proc open nvidia driver when booting
done
# # Unload all network interfaces
# for D in $(readlink /sys/class/net/*/device/driver); do rmmod -f "$(basename ${D})" 2>/dev/null || true; done
# Reboot
KERNELWAY="$(readConfigKey "kernelway" "${USER_CONFIG_FILE}")"

View File

@ -2388,10 +2388,6 @@ function advancedMenu() {
echo "i \"$(TEXT "Timeout of get ip in boot:") \Z4${BOOTIPWAIT}\Zn\"" >>"${TMP_PATH}/menu"
echo "w \"$(TEXT "Timeout of boot wait:") \Z4${BOOTWAIT}\Zn\"" >>"${TMP_PATH}/menu"
echo "k \"$(TEXT "kernel switching method:") \Z4${KERNELWAY}\Zn\"" >>"${TMP_PATH}/menu"
if false; then # Some GPU have compatibility issues, so this function is temporarily disabled. RR_CMDLINE= ... nomodeset
checkCmdline "rr_cmdline" "nomodeset" && POWEROFFDISPLAY="false" || POWEROFFDISPLAY="true"
echo "7 \"$(TEXT "Power off display after boot: ") \Z4${POWEROFFDISPLAY}\Zn\"" >>"${TMP_PATH}/menu"
fi
fi
echo "n \"$(TEXT "Reboot on kernel panic:") \Z4${KERNELPANIC}\Zn\"" >>"${TMP_PATH}/menu"
if [ -n "$(ls /dev/mmcblk* 2>/dev/null)" ]; then
@ -2517,18 +2513,6 @@ function advancedMenu() {
writeConfigKey "kernelway" "${KERNELWAY}" "${USER_CONFIG_FILE}"
NEXT="k"
;;
7)
DIALOG --title "$(TEXT "Advanced")" \
--yesno "$(TEXT "Modifying this item requires a reboot, continue?")" 0 0
RET=$?
[ ${RET} -ne 0 ] && continue
checkCmdline "rr_cmdline" "nomodeset" && delCmdline "rr_cmdline" "nomodeset" || addCmdline "rr_cmdline" "nomodeset"
DIALOG --title "$(TEXT "Advanced")" \
--infobox "$(TEXT "Reboot to RR")" 0 0
rebootTo config
exit 0
NEXT="7"
;;
n)
rm -f "${TMP_PATH}/opts"
echo "5 \"Reboot after 5 seconds\"" >>"${TMP_PATH}/opts"

View File

@ -75,7 +75,7 @@ function set_gfxpayload {
fi
}
set RR_CMDLINE="earlyprintk earlycon=uart8250,io,0x3f8,115200n8 console=ttyS0,115200n8 root=/dev/ram rootwait net.ifnames=0 panic=5 pcie_aspm=off nox2apic nomodeset"
set RR_CMDLINE="earlyprintk earlycon=uart8250,io,0x3f8,115200n8 console=ttyS0,115200n8 root=/dev/ram rootwait net.ifnames=0 panic=5 pcie_aspm=off"
search --set=root --label "RR3"
if [ -s /zImage-dsm -a -s /initrd-dsm ]; then