mirror of
https://github.com/AuxXxilium/arc-v.git
synced 2024-11-23 15:01:04 +07:00
arc: add new usb mount options and some rewrites
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
parent
dbff7bd920
commit
8a7c50ed86
@ -890,7 +890,7 @@ function modulesMenu() {
|
||||
TEXT+="This function is experimental and dangerous. If you don't know much, please exit.\n"
|
||||
TEXT+="The imported .ko of this function will be implanted into the corresponding arch's modules package, which will affect all models of the arch.\n"
|
||||
TEXT+="This program will not determine the availability of imported modules or even make type judgments, as please double check if it is correct.\n"
|
||||
TEXT+="If you want to remove it, please go to the \"Update Menu\" -> \"Update modules\" to forcibly update the modules. All imports will be reset.\n"
|
||||
TEXT+="If you want to remove it, please go to the \"Update Menu\" -> \"Update Modules\" to forcibly update the modules. All imports will be reset.\n"
|
||||
TEXT+="Do you want to continue?"
|
||||
dialog --backtitle "$(backtitle)" --title "Add external Module" \
|
||||
--yesno "${TEXT}" 0 0
|
||||
@ -1288,35 +1288,45 @@ function keymapMenu() {
|
||||
function usbMenu() {
|
||||
CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")"
|
||||
if [ "${CONFDONE}" = "true" ]; then
|
||||
dialog --backtitle "$(backtitle)" --menu "Choose an Option" 0 0 0 \
|
||||
dialog --backtitle "$(backtitle)" --title "Mount USB Options" \
|
||||
--menu "Choose an Option" 0 0 0 \
|
||||
1 "Mount USB as Internal" \
|
||||
2 "Mount USB as Normal" \
|
||||
2 "Mount USB as Device" \
|
||||
3 "Mount USB automatically" \
|
||||
2>"${TMP_PATH}/resp"
|
||||
[ $? -ne 0 ] && return 1
|
||||
case "$(<"${TMP_PATH}/resp")" in
|
||||
1)
|
||||
writeConfigKey "synoinfo.maxdisks" "24" "${USER_CONFIG_FILE}"
|
||||
writeConfigKey "synoinfo.usbportcfg" "0" "${USER_CONFIG_FILE}"
|
||||
writeConfigKey "synoinfo.internalportcfg" "0xffffffff" "${USER_CONFIG_FILE}"
|
||||
writeConfigKey "arc.usbmount" "true" "${USER_CONFIG_FILE}"
|
||||
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
|
||||
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
|
||||
dialog --backtitle "$(backtitle)" --title "Mount USB as Internal" \
|
||||
dialog --backtitle "$(backtitle)" --title "Mount USB Options" \
|
||||
--aspect 18 --msgbox "Mount USB as Internal - successful!" 0 0
|
||||
;;
|
||||
2)
|
||||
deleteConfigKey "synoinfo.maxdisks" "${USER_CONFIG_FILE}"
|
||||
deleteConfigKey "synoinfo.usbportcfg" "${USER_CONFIG_FILE}"
|
||||
deleteConfigKey "synoinfo.internalportcfg" "${USER_CONFIG_FILE}"
|
||||
writeConfigKey "synoinfo.maxdisks" "24" "${USER_CONFIG_FILE}"
|
||||
writeConfigKey "synoinfo.usbportcfg" "0xffffffff" "${USER_CONFIG_FILE}"
|
||||
writeConfigKey "arc.usbmount" "false" "${USER_CONFIG_FILE}"
|
||||
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
|
||||
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
|
||||
dialog --backtitle "$(backtitle)" --title "Mount USB as Normal" \
|
||||
--aspect 18 --msgbox "Mount USB as Normal - successful!" 0 0
|
||||
dialog --backtitle "$(backtitle)" --title "Mount USB Options" \
|
||||
--aspect 18 --msgbox "Mount USB as Device - successful!" 0 0
|
||||
;;
|
||||
3)
|
||||
deleteConfigKey "synoinfo.maxdisks" "${USER_CONFIG_FILE}"
|
||||
deleteConfigKey "synoinfo.usbportcfg" "${USER_CONFIG_FILE}"
|
||||
deleteConfigKey "synoinfo.internalportcfg" "${USER_CONFIG_FILE}"
|
||||
writeConfigKey "arc.usbmount" "auto" "${USER_CONFIG_FILE}"
|
||||
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
|
||||
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
|
||||
dialog --backtitle "$(backtitle)" --title "Mount USB Options" \
|
||||
--aspect 18 --msgbox "Mount USB automatically - successful!" 0 0
|
||||
;;
|
||||
esac
|
||||
else
|
||||
dialog --backtitle "$(backtitle)" --title "Mount USB as Internal" \
|
||||
dialog --backtitle "$(backtitle)" --title "Mount USB Options" \
|
||||
--aspect 18 --msgbox "Please configure your System first." 0 0
|
||||
return 1
|
||||
fi
|
||||
@ -1602,7 +1612,7 @@ function updateMenu() {
|
||||
TAG="$(curl --insecure -s https://api.github.com/repos/AuxXxilium/arc/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}')"
|
||||
if [[ $? -ne 0 || -z "${TAG}" ]]; then
|
||||
dialog --backtitle "$(backtitle)" --title "Upgrade Loader" --aspect 18 \
|
||||
--msgbox "Error checking new version!" 0 0
|
||||
--msgbox "Error checking new Version!" 0 0
|
||||
return 1
|
||||
fi
|
||||
elif [ ${opts} -eq 2 ]; then
|
||||
@ -1623,7 +1633,7 @@ function updateMenu() {
|
||||
STATUS=$(curl --insecure -w "%{http_code}" -L "https://github.com/AuxXxilium/arc/releases/download/${TAG}/arc-${TAG}.img.zip" -o "${TMP_PATH}/arc-${TAG}.img.zip")
|
||||
if [[ $? -ne 0 || ${STATUS} -ne 200 ]]; then
|
||||
dialog --backtitle "$(backtitle)" --title "Upgrade Loader" --aspect 18 \
|
||||
--msgbox "Error downloading update file" 0 0
|
||||
--msgbox "Error downloading update File!" 0 0
|
||||
return 1
|
||||
fi
|
||||
unzip -oq "${TMP_PATH}/arc-${TAG}.img.zip" -d "${TMP_PATH}"
|
||||
@ -1683,7 +1693,7 @@ function updateMenu() {
|
||||
STATUS=$(curl --insecure -s -w "%{http_code}" -L "https://github.com/AuxXxilium/arc-addons/releases/download/${TAG}/addons.zip" -o "${TMP_PATH}/addons.zip")
|
||||
if [[ $? -ne 0 || ${STATUS} -ne 200 ]]; then
|
||||
dialog --backtitle "$(backtitle)" --title "Update Addons" --aspect 18 \
|
||||
--msgbox "Error downloading!" 0 0
|
||||
--msgbox "Error downloading update File!" 0 0
|
||||
return 1
|
||||
fi
|
||||
dialog --backtitle "$(backtitle)" --title "Update Addons" --aspect 18 \
|
||||
@ -1734,7 +1744,7 @@ function updateMenu() {
|
||||
STATUS=$(curl --insecure -s -w "%{http_code}" -L "https://github.com/AuxXxilium/arc-patches/releases/download/${TAG}/patches.zip" -o "${TMP_PATH}/patches.zip")
|
||||
if [[ $? -ne 0 || ${STATUS} -ne 200 ]]; then
|
||||
dialog --backtitle "$(backtitle)" --title "Update Patches" --aspect 18 \
|
||||
--msgbox "Error downloading!" 0 0
|
||||
--msgbox "Error downloading update File!" 0 0
|
||||
return 1
|
||||
fi
|
||||
dialog --backtitle "$(backtitle)" --title "Update Patches" --aspect 18 \
|
||||
@ -1776,7 +1786,7 @@ function updateMenu() {
|
||||
STATUS=$(curl -k -s -w "%{http_code}" -L "https://github.com/AuxXxilium/arc-modules/releases/download/${TAG}/modules.zip" -o "${TMP_PATH}/modules.zip")
|
||||
if [[ $? -ne 0 || ${STATUS} -ne 200 ]]; then
|
||||
dialog --backtitle "$(backtitle)" --title "Update Modules" --aspect 18 \
|
||||
--msgbox "Error downloading!" 0 0
|
||||
--msgbox "Error downloading update File!" 0 0
|
||||
return 1
|
||||
fi
|
||||
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
|
||||
@ -1832,7 +1842,7 @@ function updateMenu() {
|
||||
STATUS=$(curl --insecure -s -w "%{http_code}" -L "https://github.com/AuxXxilium/arc-configs/releases/download/${TAG}/configs.zip" -o "${TMP_PATH}/configs.zip")
|
||||
if [[ $? -ne 0 || ${STATUS} -ne 200 ]]; then
|
||||
dialog --backtitle "$(backtitle)" --title "Update Configs" --aspect 18 \
|
||||
--msgbox "Error downloading!" 0 0
|
||||
--msgbox "Error downloading update File!" 0 0
|
||||
return 1
|
||||
fi
|
||||
dialog --backtitle "$(backtitle)" --title "Update Configs" --aspect 18 \
|
||||
@ -1874,7 +1884,7 @@ function updateMenu() {
|
||||
STATUS=$(curl --insecure -s -w "%{http_code}" -L "https://github.com/AuxXxilium/redpill-lkm/releases/download/${TAG}/rp-lkms.zip" -o "${TMP_PATH}/rp-lkms.zip")
|
||||
if [[ $? -ne 0 || ${STATUS} -ne 200 ]]; then
|
||||
dialog --backtitle "$(backtitle)" --title "Update LKMs" --aspect 18 \
|
||||
--msgbox "Error downloading" 0 0
|
||||
--msgbox "Error downloading update File" 0 0
|
||||
return 1
|
||||
fi
|
||||
dialog --backtitle "$(backtitle)" --title "Update LKMs" --aspect 18 \
|
||||
@ -2757,8 +2767,8 @@ while true; do
|
||||
echo "f \"Network Config \" " >>"${TMP_PATH}/menu"
|
||||
if [ "${DT}" = "false" ]; then
|
||||
echo "g \"Storage Map \" " >>"${TMP_PATH}/menu"
|
||||
echo "h \"USB Port Config \" " >>"${TMP_PATH}/menu"
|
||||
fi
|
||||
echo "h \"USB Mount Options \" " >>"${TMP_PATH}/menu"
|
||||
echo "p \"Arc Settings \" " >>"${TMP_PATH}/menu"
|
||||
echo ". \"DHCP/Static Loader IP \" " >>"${TMP_PATH}/menu"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user