add modblacklist

This commit is contained in:
Ing 2024-07-12 10:49:14 +08:00
parent 1cbe1d4b27
commit c75d16eece
19 changed files with 5554 additions and 5206 deletions

View File

@ -91,6 +91,7 @@ MAC1="$(readConfigKey "mac1" "${USER_CONFIG_FILE}")"
MAC2="$(readConfigKey "mac2" "${USER_CONFIG_FILE}")"
KERNELPANIC="$(readConfigKey "kernelpanic" "${USER_CONFIG_FILE}")"
EMMCBOOT="$(readConfigKey "emmcboot" "${USER_CONFIG_FILE}")"
MODBLACKLIST="$(readConfigKey "modblacklist" "${USER_CONFIG_FILE}")"
declare -A CMDLINE
@ -155,19 +156,21 @@ CMDLINE['rootwait']=""
CMDLINE['loglevel']="15"
CMDLINE['log_buf_len']="32M"
CMDLINE['panic']="${KERNELPANIC:-0}"
CMDLINE['modprobe.blacklist']="${MODBLACKLIST}"
# if [ -n "$(ls /dev/mmcblk* 2>/dev/null)" ] && [ ! "${BUS}" = "mmc" ] && [ ! "${EMMCBOOT}" = "true" ]; then
# [ ! "${CMDLINE['modprobe.blacklist']}" = "" ] && CMDLINE['modprobe.blacklist']+=","
# CMDLINE['modprobe.blacklist']+="sdhci,sdhci_pci,sdhci_acpi"
# if ! echo "${CMDLINE['modprobe.blacklist']}" | grep -q "sdhci"; then
# [ ! "${CMDLINE['modprobe.blacklist']}" = "" ] && CMDLINE['modprobe.blacklist']+=","
# CMDLINE['modprobe.blacklist']+="sdhci,sdhci_pci,sdhci_acpi"
# fi
# fi
if [ "${DT}" = "true" ] && ! echo "epyc7002 purley broadwellnkv2" | grep -wq "${PLATFORM}"; then
[ ! "${CMDLINE['modprobe.blacklist']}" = "" ] && CMDLINE['modprobe.blacklist']+=","
CMDLINE['modprobe.blacklist']+="mpt3sas"
fi
if true; then
[ ! "${CMDLINE['modprobe.blacklist']}" = "" ] && CMDLINE['modprobe.blacklist']+=","
CMDLINE['modprobe.blacklist']+="evbug"
if ! echo "${CMDLINE['modprobe.blacklist']}" | grep -q "mpt3sas"; then
[ ! "${CMDLINE['modprobe.blacklist']}" = "" ] && CMDLINE['modprobe.blacklist']+=","
CMDLINE['modprobe.blacklist']+="mpt3sas"
fi
fi
if echo "apollolake geminilake" | grep -wq "${PLATFORM}"; then
CMDLINE["intel_iommu"]="igfx_off"
fi

View File

@ -63,6 +63,7 @@ initConfigKey "addons.acpid" "" "${USER_CONFIG_FILE}"
initConfigKey "addons.mountloader" "" "${USER_CONFIG_FILE}"
initConfigKey "addons.reboottoloader" "" "${USER_CONFIG_FILE}"
initConfigKey "modules" "{}" "${USER_CONFIG_FILE}"
initConfigKey "modblacklist" "evbug,cdc_ether" "${USER_CONFIG_FILE}"
# for update
if [ -f "${PART2_PATH}/GRUB_VER" ]; then

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -667,6 +667,7 @@ function moduleMenu() {
i "$(TEXT "Deselect i915 with dependencies")" \
p "$(TEXT "Priority use of official drivers:") \Z4${ODP}\Zn" \
f "$(TEXT "Edit modules that need to be copied to DSM")" \
b "$(TEXT "modprobe blacklist")" \
e "$(TEXT "Exit")" \
2>${TMP_PATH}/resp
[ $? -ne 0 ] && break
@ -821,6 +822,28 @@ function moduleMenu() {
break
done
;;
b)
# modprobe.blacklist
MSG=""
MSG+="$(TEXT "The blacklist is used to prevent the kernel from loading specific modules.\n")"
MSG+="$(TEXT "The blacklist is a list of module names separated by ','.\n")"
MSG+="$(TEXT "For example: \Z4evbug,cdc_ether\Zn\n")"
while true; do
modblacklist="$(readConfigKey "modblacklist" "${USER_CONFIG_FILE}")"
DIALOG --title "$(TEXT "Modules")" \
--inputbox "${MSG}" 12 70 "${modblacklist}" \
2>${TMP_PATH}/resp
[ $? -ne 0 ] && break
VALUE="$(cat "${TMP_PATH}/resp")"
if [[ ${VALUE} = *" "* ]]; then
DIALOG --title "$(TEXT "Cmdline")" \
--yesno "$(TEXT "Invalid list, No spaces should appear, retry?")" 0 0
[ $? -eq 0 ] && continue || break
fi
writeConfigKey "modblacklist" "${VALUE}" "${USER_CONFIG_FILE}"
break
done
;;
e)
break
;;