arc: rework III

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium
2024-07-02 16:33:11 +02:00
parent 82066f3267
commit 01dbfe92dc
3 changed files with 32 additions and 11 deletions

View File

@@ -44,6 +44,7 @@ DIRECTBOOT="$(readConfigKey "arc.directboot" "${USER_CONFIG_FILE}")"
EMMCBOOT="$(readConfigKey "arc.emmcboot" "${USER_CONFIG_FILE}")"
CPUGOVERNOR="$(readConfigKey "arc.governor" "${USER_CONFIG_FILE}")"
HDDSORT="$(readConfigKey "arc.hddsort" "${USER_CONFIG_FILE}")"
IPV6="$(readConfigKey "arc.ipv6" "${USER_CONFIG_FILE}")"
KERNEL="$(readConfigKey "arc.kernel" "${USER_CONFIG_FILE}")"
KERNELLOAD="$(readConfigKey "arc.kernelload" "${USER_CONFIG_FILE}")"
KERNELPANIC="$(readConfigKey "arc.kernelpanic" "${USER_CONFIG_FILE}")"
@@ -962,18 +963,19 @@ else
echo "T \"Force enable SSH in DSM \" " >>"${TMP_PATH}/menu"
fi
fi
if [ "${DEVOPTS}" == "true" ]; then
if [ "${LOADEROPTS}" == "true" ]; then
echo "8 \"\Z1Hide Loader Options\Zn \" " >>"${TMP_PATH}/menu"
else
echo "8 \"\Z1Show Loader Options\Zn \" " >>"${TMP_PATH}/menu"
fi
if [ "${DEVOPTS}" == "true" ]; then
if [ "${LOADEROPTS}" == "true" ]; then
echo "= \"\Z4========= Loader =========\Zn \" " >>"${TMP_PATH}/menu"
echo "= \"\Z4=== Edit with caution! ===\Zn \" " >>"${TMP_PATH}/menu"
echo "R \"Automated Mode: \Z4${AUTOMATED}\Zn \" " >>"${TMP_PATH}/menu"
echo "R \"Automated Mode: \Z4${AUTOMATED}\Zn \" " >>"${TMP_PATH}/menu"
echo "W \"RD Compression: \Z4${RD_COMPRESSED}\Zn \" " >>"${TMP_PATH}/menu"
echo "X \"Sata DOM: \Z4${SATADOM}\Zn \" " >>"${TMP_PATH}/menu"
echo "u \"Switch LKM version: \Z4${LKM}\Zn \" " >>"${TMP_PATH}/menu"
echo "u \"Switch LKM Version: \Z4${LKM}\Zn \" " >>"${TMP_PATH}/menu"
echo "c \"Switch IPv6 Support: \Z4${IPV6}\Zn \" " >>"${TMP_PATH}/menu"
echo "B \"Grep DSM Config from Backup \" " >>"${TMP_PATH}/menu"
echo "L \"Grep Logs from dbgutils \" " >>"${TMP_PATH}/menu"
echo "w \"Reset Loader to Defaults \" " >>"${TMP_PATH}/menu"
@@ -1128,10 +1130,21 @@ else
NEXT="u"
;;
# Loader Section
8) [ "${DEVOPTS}" == "true" ] && DEVOPTS='false' || DEVOPTS='true'
DEVOPTS="${DEVOPTS}"
8) [ "${LOADEROPTS}" == "true" ] && LOADEROPTS='false' || LOADEROPTS='true'
LOADEROPTS="${LOADEROPTS}"
NEXT="8"
;;
c) [ "${IPV6}" == "true" ] && IPV6='false' || IPV6='true'
if "{$IPV6}" == "true"; then
writeConfigKey "arc.ipv6" "true" "${USER_CONFIG_FILE}"
sed -i 's/ipv6.disable=1/ipv6.disable=0/g' "${GRUB_CONFIG_FILE}"
elif "{$IPV6}" == "false"; then
writeConfigKey "arc.ipv6" "false" "${USER_CONFIG_FILE}"
sed -i 's/ipv6.disable=0/ipv6.disable=1/g' "${GRUB_CONFIG_FILE}"
fi
rebootTo "config"
NEXT="c"
;;
l) editUserConfig; NEXT="l" ;;
w) resetLoader; NEXT="w" ;;
v) saveMenu; NEXT="v" ;;

View File

@@ -497,14 +497,22 @@ function ntpCheck() {
###############################################################################
# Offline Check
function offlineCheck() {
NEWTAG="$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | sort -rV | head -1)"
CNT=0
while true; do
NEWTAG="$(curl -m 5 -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | sort -rV | head -1)"
CNT=$((${CNT} + 1))
if [ -n "${NEWTAG}" ]; then
break
elif [ -z "${NEWTAG}" ] && [ ${CNT} -ge 3 ]; then
break
fi
if [ -n "${NEWTAG}" ]; then
[ -z "${ARCNIC}" ] && ARCNIC="auto"
elif [ -z "${NEWTAG}" ]; then
ETHX="$(ls /sys/class/net/ 2>/dev/null | grep eth)"
for ETH in ${ETHX}; do
# Update Check
NEWTAG="$(curl --interface ${ETH} -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | sort -rV | head -1)"
NEWTAG="$(curl --interface ${ETH} -m 5 -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | sort -rV | head -1)"
if [ -n "${NEWTAG}" ]; then
[ -z "${ARCNIC}" ] && ARCNIC="${ETH}"
break
@@ -513,11 +521,11 @@ function offlineCheck() {
if [ -n "${ARCNIC}" ]; then
writeConfigKey "arc.offline" "false" "${USER_CONFIG_FILE}"
elif [ -z "${ARCNIC}" ] && [ "${AUTOMATED}" == "false" ]; then
dialog --backtitle "$(backtitle)" --title "Online Check" \
--msgbox "Could not connect to Github.\nSwitch to Offline Mode!" 0 0
writeConfigKey "arc.offline" "true" "${USER_CONFIG_FILE}"
cp -f "${PART3_PATH}/configs/offline.json" "${ARC_PATH}/include/offline.json"
[ -z "${ARCNIC}" ] && ARCNIC="auto"
dialog --backtitle "$(backtitle)" --title "Online Check" \
--msgbox "Could not connect to Github.\nSwitch to Offline Mode!" 0 0
elif [ -z "${ARCNIC}" ] && [ "${AUTOMATED}" == "true" ]; then
dialog --backtitle "$(backtitle)" --title "Online Check" \
--infobox "Could not connect to Github.\nReboot to try again!" 0 0

View File

@@ -78,7 +78,7 @@ set menu_color_normal=white/black
set menu_color_highlight=white/red
set color_normal=white/black
set ARC_CMDLINE="console=tty2 root=/dev/ram net.ifnames=0"
set ARC_CMDLINE="console=tty2 root=/dev/ram net.ifnames=0 ipv6.disable=1"
# set ARC_CONFIG_CMDLINE="console=tty2 root=/dev/ram net.ifnames=0 ipv6.disable=1"
search --set=root --label "ARC3"