mirror of
https://github.com/RROrg/rr.git
synced 2025-06-21 05:51:05 +08:00
add "Deselect i915 with dependencies"
This commit is contained in:
parent
cba3c62611
commit
25e73affee
@ -311,7 +311,7 @@ function getLogo() {
|
||||
rm -f "${PART3_PATH}/logo.png"
|
||||
fastest=$(_get_fastest "www.synology.com" "www.synology.cn")
|
||||
STATUS=$(curl -skL -w "%{http_code}" "https://${fastest}/api/products/getPhoto?product=${MODEL/+/%2B}&type=img_s&sort=0" -o "${PART3_PATH}/logo.png")
|
||||
if [ $? -ne 0 -o ${STATUS} -ne 200 -o -f "${PART3_PATH}/logo.png" ]; then
|
||||
if [ $? -ne 0 -o ${STATUS:-0} -ne 200 -o -f "${PART3_PATH}/logo.png" ]; then
|
||||
convert -rotate 180 "${PART3_PATH}/logo.png" "${PART3_PATH}/logo.png" 2>/dev/null
|
||||
magick montage "${PART3_PATH}/logo.png" -background 'none' -tile '3x3' -geometry '350x210' "${PART3_PATH}/logo.png" 2>/dev/null
|
||||
convert -rotate 180 "${PART3_PATH}/logo.png" "${PART3_PATH}/logo.png" 2>/dev/null
|
||||
@ -350,7 +350,7 @@ function rebootTo() {
|
||||
# connect wlanif
|
||||
# 1 netif name
|
||||
function connectwlanif() {
|
||||
[ ! -d "/sys/class/net/${1}" ] && return 1
|
||||
[ -z "${1}" -o ! -d "/sys/class/net/${1}" ] && return 1
|
||||
|
||||
CONF=""
|
||||
[ -z "${CONF}" -a -f "${PART1_PATH}/wpa_supplicant.conf.${1}" ] && CONF="${PART1_PATH}/wpa_supplicant.conf.${1}"
|
||||
|
@ -78,7 +78,7 @@ function getdepends() {
|
||||
function _getdepends() {
|
||||
if [ -f "${TMP_PATH}/modules/${1}.ko" ]; then
|
||||
depends=($(modinfo "${TMP_PATH}/modules/${1}.ko" | grep depends: | awk -F: '{print $2}' | awk '$1=$1' | sed 's/,/ /g'))
|
||||
if [ ${#depends[*]} -gt 0 ]; then
|
||||
if [ ${#depends[@]} -gt 0 ]; then
|
||||
for k in ${depends[@]}; do
|
||||
echo "${k}"
|
||||
_getdepends "${k}"
|
||||
|
@ -189,8 +189,8 @@ if [ "${DSMLOGO}" = "true" -a -c "/dev/fb0" ]; then
|
||||
fi
|
||||
|
||||
# Check memory
|
||||
RAM=$(free -m | awk '/Mem:/{print$2}')
|
||||
if [ ${RAM} -le 3500 ]; then
|
||||
RAM=$(free -m 2>/dev/null | awk '/Mem:/{print$2}')
|
||||
if [ ${RAM:-0} -le 3500 ]; then
|
||||
echo -e "\033[1;33m$(TEXT "You have less than 4GB of RAM, if errors occur in loader creation, please increase the amount of memory.")\033[0m\n"
|
||||
fi
|
||||
|
||||
|
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
@ -421,7 +421,7 @@ function ParsePat() {
|
||||
SPACELEFT=$(df --block-size=1 | grep ${LOADER_DISK_PART3} | awk '{print $4}')
|
||||
# Discover remote file size
|
||||
FILESIZE=$(du -sb "${PAT_PATH}" | awk '{print$1}')
|
||||
if [ 0${FILESIZE} -ge 0${SPACELEFT} ]; then
|
||||
if [ ${FILESIZE:-0} -ge ${SPACELEFT:-0} ]; then
|
||||
# No disk space to copy, mv it to dl
|
||||
mv -f "${PAT_PATH}" "${PART3_PATH}/dl/${MODEL}-${PRODUCTVER}.pat"
|
||||
else
|
||||
@ -629,6 +629,7 @@ function moduleMenu() {
|
||||
s "$(TEXT "Show/Select modules")" \
|
||||
l "$(TEXT "Select loaded modules")" \
|
||||
u "$(TEXT "Upload a external module")" \
|
||||
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")" \
|
||||
e "$(TEXT "Exit")" \
|
||||
@ -741,6 +742,26 @@ function moduleMenu() {
|
||||
--msgbox "$(TEXT "Not a valid file, please try again!")" 0 0
|
||||
fi
|
||||
;;
|
||||
i)
|
||||
DEPS="$(getdepends "${PLATFORM}" "$([ -n "${KPRE}" ] && echo "${KPRE}-")${KVER}" i915) i915"
|
||||
DELS=()
|
||||
while IFS=': ' read KEY VALUE; do
|
||||
[ -z "${KEY}" ] && continue
|
||||
if echo "${DEPS}" | grep -wq "${KEY}"; then
|
||||
DELS+=("${KEY}")
|
||||
fi
|
||||
done < <(readConfigMap "modules" "${USER_CONFIG_FILE}")
|
||||
if [ ${#DELS[@]} -eq 0 ]; then
|
||||
DIALOG --title "$(TEXT "Modules")" \
|
||||
--msgbox "$(TEXT "No i915 with dependencies module to deselect.")" 0 0
|
||||
else
|
||||
for ID in ${DELS[@]}; do
|
||||
deleteConfigKey "modules.\"${ID}\"" "${USER_CONFIG_FILE}"
|
||||
done
|
||||
DIALOG --title "$(TEXT "Modules")" \
|
||||
--msgbox "$(printf "$(TEXT "Module %s deselected.\n")" "${DELS[@]}")" 0 0
|
||||
fi
|
||||
;;
|
||||
p)
|
||||
[ "${ODP}" = "false" ] && ODP='true' || ODP='false'
|
||||
writeConfigKey "odp" "${ODP}" "${USER_CONFIG_FILE}"
|
||||
@ -1006,7 +1027,7 @@ function getSynoExtractor() {
|
||||
|
||||
STATUS=$(curl -k -w "%{http_code}" -L "${OLDPAT_URL}" -o "${OLDPAT_PATH}")
|
||||
RET=$?
|
||||
if [ ${RET} -ne 0 -o ${STATUS} -ne 200 ]; then
|
||||
if [ ${RET} -ne 0 -o ${STATUS:-0} -ne 200 ]; then
|
||||
rm -f "${OLDPAT_PATH}"
|
||||
MSG="$(printf "$(TEXT "Check internet or cache disk space.\nError: %d:%d")" "${RET}" "${STATUS}")"
|
||||
echo -e "${MSG}" >"${MKERR_FILE}"
|
||||
@ -1134,13 +1155,13 @@ function extractDsmFiles() {
|
||||
echo "$(printf "$(TEXT "Downloading %s ...")" "${PAT_FILE}")"
|
||||
# Discover remote file size
|
||||
FILESIZE=$(curl -k -sLI "${PATURL}" | grep -i Content-Length | awk '{print$2}')
|
||||
if [ 0${FILESIZE} -ge 0${SPACELEFT} ]; then
|
||||
if [ ${FILESIZE:-0} -ge ${SPACELEFT:-0} ]; then
|
||||
# No disk space to download, change it to RAMDISK
|
||||
PAT_PATH="${TMP_PATH}/${PAT_FILE}"
|
||||
fi
|
||||
STATUS=$(curl -k -w "%{http_code}" -L "${PATURL}" -o "${PAT_PATH}")
|
||||
RET=$?
|
||||
if [ ${RET} -ne 0 -o ${STATUS} -ne 200 ]; then
|
||||
if [ ${RET} -ne 0 -o ${STATUS:-0} -ne 200 ]; then
|
||||
rm -f "${PAT_PATH}"
|
||||
MSG="$(printf "$(TEXT "Check internet or cache disk space.\nError: %d:%d")" "${RET}" "${STATUS}")"
|
||||
echo -e "${MSG}" >"${MKERR_FILE}"
|
||||
@ -1208,7 +1229,7 @@ function make() {
|
||||
|
||||
# Check disk space left
|
||||
SPACELEFT=$(df --block-size=1 | grep ${LOADER_DISK_PART3} | awk '{print $4}')
|
||||
[ ${SPACELEFT} -le 268435456 ] && rm -rf "${PART3_PATH}/dl"
|
||||
[ ${SPACELEFT:-0} -le 268435456 ] && rm -rf "${PART3_PATH}/dl"
|
||||
|
||||
${WORK_PATH}/zimage-patch.sh
|
||||
if [ $? -ne 0 ]; then
|
||||
@ -2094,7 +2115,7 @@ function languageMenu() {
|
||||
done < <(ls ${WORK_PATH}/lang/*.mo 2>/dev/null | sort | sed -r 's/.*\/(.*)\.mo$/\1/')
|
||||
|
||||
DIALOG \
|
||||
--default-item "${LAYOUT}" --menu "$(TEXT "Choose a language")" 0 0 0 --file "${TMP_PATH}/menu" \
|
||||
--default-item "${LAYOUT}" --menu "$(TEXT "Choose a language")" 0 0 0 --file "${TMP_PATH}/menu" \
|
||||
2>${TMP_PATH}/resp
|
||||
[ $? -ne 0 ] && return
|
||||
resp=$(cat ${TMP_PATH}/resp 2>/dev/null)
|
||||
@ -2178,7 +2199,7 @@ function downloadExts() {
|
||||
RET=$?
|
||||
) 2>&1 | DIALOG --title "${T}" \
|
||||
--progressbox "$(TEXT "Downloading ...")" 20 100
|
||||
if [ ${RET} -ne 0 -o ${STATUS} -ne 200 ]; then
|
||||
if [ ${RET} -ne 0 -o ${STATUS:-0} -ne 200 ]; then
|
||||
if [ ! "${5}" = "0" ]; then
|
||||
DIALOG --title "${T}" \
|
||||
--infobox "$(printf "$(TEXT "Error downloading new version.\nError: %d:%d")" "${RET}" "${STATUS}")" 0 0
|
||||
|
@ -72,7 +72,7 @@ RD_COMPRESSED="$(readModelKey "${MODEL}" "productvers.[${PRODUCTVER}].rd-compres
|
||||
|
||||
declare -A SYNOINFO
|
||||
declare -A ADDONS
|
||||
declare -A USERMODULES
|
||||
declare -A MODULES
|
||||
|
||||
# Read synoinfo and addons from config
|
||||
while IFS=': ' read KEY VALUE; do
|
||||
@ -84,7 +84,7 @@ done < <(readConfigMap "addons" "${USER_CONFIG_FILE}")
|
||||
|
||||
# Read modules from user config
|
||||
while IFS=': ' read KEY VALUE; do
|
||||
[ -n "${KEY}" ] && USERMODULES["${KEY}"]="${VALUE}"
|
||||
[ -n "${KEY}" ] && MODULES["${KEY}"]="${VALUE}"
|
||||
done < <(readConfigMap "modules" "${USER_CONFIG_FILE}")
|
||||
|
||||
# Patches (diff -Naru OLDFILE NEWFILE > xxx.patch)
|
||||
@ -135,7 +135,7 @@ tar -zxf "${MODULES_PATH}/${PLATFORM}-$([ -n "${KPRE}" ] && echo "${KPRE}-")${KV
|
||||
for F in $(ls "${TMP_PATH}/modules/"*.ko 2>/dev/null); do
|
||||
M=$(basename ${F})
|
||||
[ "${ODP}" = "true" -a -f "${RAMDISK_PATH}/usr/lib/modules/${M}" ] && continue
|
||||
if arrayExistItem "${M:0:-3}" "${!USERMODULES[@]}"; then
|
||||
if arrayExistItem "${M:0:-3}" "${!MODULES[@]}"; then
|
||||
cp -f "${F}" "${RAMDISK_PATH}/usr/lib/modules/${M}"
|
||||
else
|
||||
rm -f "${RAMDISK_PATH}/usr/lib/modules/${M}"
|
||||
|
@ -34,7 +34,7 @@ function getExtractor() {
|
||||
local PAT_URL="https://global.synologydownload.com/download/DSM/release/7.0.1/42218/DSM_DS3622xs%2B_42218.pat"
|
||||
local PAT_FILE="DSM_DS3622xs+_42218.pat"
|
||||
local STATUS=$(curl -# -w "%{http_code}" -L "${PAT_URL}" -o "${CACHE_DIR}/${PAT_FILE}")
|
||||
if [ $? -ne 0 -o ${STATUS} -ne 200 ]; then
|
||||
if [ $? -ne 0 -o ${STATUS:-0} -ne 200 ]; then
|
||||
echo "[E] DSM_DS3622xs%2B_42218.pat download error!"
|
||||
rm -rf ${CACHE_DIR}
|
||||
exit 1
|
||||
@ -83,11 +83,11 @@ function getBuildroot() {
|
||||
if [ "${NAME}" = "bzImage" ]; then
|
||||
STATUS=$(curl -w "%{http_code}" -kLH "Authorization: token ${TOKEN}" -H "Accept: application/octet-stream" "https://api.github.com/repos/RROrg/rr-buildroot/releases/assets/${ID}" -o "${DEST_PATH}/bzImage-rr")
|
||||
echo "TAG=${TAG}; Status=${STATUS}"
|
||||
[ ${STATUS} -ne 200 ] && exit 1
|
||||
[ ${STATUS:-0} -ne 200 ] && exit 1
|
||||
elif [ "${NAME}" = "rootfs.cpio.xz" ]; then
|
||||
STATUS=$(curl -w "%{http_code}" -kLH "Authorization: token ${TOKEN}" -H "Accept: application/octet-stream" "https://api.github.com/repos/RROrg/rr-buildroot/releases/assets/${ID}" -o "${DEST_PATH}/initrd-rr")
|
||||
echo "TAG=${TAG}; Status=${STATUS}"
|
||||
[ ${STATUS} -ne 200 ] && exit 1
|
||||
[ ${STATUS:-0} -ne 200 ] && exit 1
|
||||
fi
|
||||
done < <(curl -skLH "Authorization: Bearer ${TOKEN}" "https://api.github.com/repos/RROrg/rr-buildroot/releases/tags/${TAG}" | jq -r '.assets[] | "\(.id) \(.name)"')
|
||||
|
||||
@ -111,7 +111,7 @@ function getLKMs() {
|
||||
if [ "${NAME}" = "rp-lkms.zip" ]; then
|
||||
STATUS=$(curl -w "%{http_code}" -kLH "Authorization: token ${TOKEN}" -H "Accept: application/octet-stream" "https://api.github.com/repos/RROrg/rr-lkms/releases/assets/${ID}" -o "${CACHE_FILE}")
|
||||
echo "TAG=${TAG}; Status=${STATUS}"
|
||||
[ ${STATUS} -ne 200 ] && exit 1
|
||||
[ ${STATUS:-0} -ne 200 ] && exit 1
|
||||
fi
|
||||
done < <(curl -skLH "Authorization: Bearer ${TOKEN}" "https://api.github.com/repos/RROrg/rr-lkms/releases/tags/${TAG}" | jq -r '.assets[] | "\(.id) \(.name)"')
|
||||
[ ! -f "${CACHE_FILE}" ] && exit 1
|
||||
@ -140,7 +140,7 @@ function getAddons() {
|
||||
if [ "${NAME}" = "addons.zip" ]; then
|
||||
STATUS=$(curl -w "%{http_code}" -kLH "Authorization: token ${TOKEN}" -H "Accept: application/octet-stream" "https://api.github.com/repos/RROrg/rr-addons/releases/assets/${ID}" -o "${CACHE_FILE}")
|
||||
echo "TAG=${TAG}; Status=${STATUS}"
|
||||
[ ${STATUS} -ne 200 ] && exit 1
|
||||
[ ${STATUS:-0} -ne 200 ] && exit 1
|
||||
fi
|
||||
done < <(curl -skLH "Authorization: Bearer ${TOKEN}" "https://api.github.com/repos/RROrg/rr-addons/releases/tags/${TAG}" | jq -r '.assets[] | "\(.id) \(.name)"')
|
||||
[ ! -f "${CACHE_FILE}" ] && exit 1
|
||||
@ -178,7 +178,7 @@ function getModules() {
|
||||
if [ "${NAME}" = "modules.zip" ]; then
|
||||
STATUS=$(curl -w "%{http_code}" -kLH "Authorization: token ${TOKEN}" -H "Accept: application/octet-stream" "https://api.github.com/repos/RROrg/rr-modules/releases/assets/${ID}" -o "${CACHE_FILE}")
|
||||
echo "TAG=${TAG}; Status=${STATUS}"
|
||||
[ ${STATUS} -ne 200 ] && exit 1
|
||||
[ ${STATUS:-0} -ne 200 ] && exit 1
|
||||
fi
|
||||
done < <(curl -skLH "Authorization: Bearer ${TOKEN}" "https://api.github.com/repos/RROrg/rr-modules/releases/tags/${TAG}" | jq -r '.assets[] | "\(.id) \(.name)"')
|
||||
[ ! -f "${CACHE_FILE}" ] && exit 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user