arc: rework dynamic mode to dev branch

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-08-03 13:30:04 +02:00
parent 4f0f912de7
commit 374c165ee1
3 changed files with 30 additions and 31 deletions

View File

@ -847,7 +847,7 @@ function updateMenu() {
NEWVER="$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | sort -rV | head -1)"
OLDVER="$(cat ${PART1_PATH}/ARC-VERSION)"
dialog --clear --backtitle "$(backtitle)" --title "Upgrade Loader" \
--menu "Current: ${OLDVER} -> Which Version?" 0 0 0 \
--menu "Current: ${OLDVER} -> Which Version?" 7 50 0 \
1 "Latest ${NEWVER}" \
2 "Select Version" \
2>"${TMP_PATH}/opts"
@ -874,7 +874,7 @@ function updateMenu() {
NEWVER="$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | sort -rV | head -1)"
OLDVER="$(cat ${PART1_PATH}/ARC-VERSION)"
dialog --clear --backtitle "$(backtitle)" --title "Update Loader" \
--menu "Current: ${OLDVER} -> Which Version?" 0 0 0 \
--menu "Current: ${OLDVER} -> Which Version?" 7 50 0 \
1 "Latest ${NEWVER}" \
2 "Select Version" \
2>"${TMP_PATH}/opts"
@ -900,7 +900,7 @@ function updateMenu() {
NEWVER="$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc-addons/releases" | jq -r ".[].tag_name" | sort -rV | head -1)"
OLDVER="$(cat ${ADDONS_PATH}/VERSION)"
dialog --clear --backtitle "$(backtitle)" --title "Update Addons" \
--menu "Current: ${OLDVER} -> Which Version?" 0 0 0 \
--menu "Current: ${OLDVER} -> Which Version?" 7 50 0 \
1 "Latest ${NEWVER}" \
2 "Select Version" \
2>"${TMP_PATH}/opts"
@ -926,7 +926,7 @@ function updateMenu() {
NEWVER="$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc-configs/releases" | jq -r ".[].tag_name" | sort -rV | head -1)"
OLDVER="$(cat ${MODEL_CONFIG_PATH}/VERSION)"
dialog --clear --backtitle "$(backtitle)" --title "Update Configs" \
--menu "Current: ${OLDVER} -> Which Version?" 0 0 0 \
--menu "Current: ${OLDVER} -> Which Version?" 7 50 0 \
1 "Latest ${NEWVER}" \
2 "Select Version" \
2>"${TMP_PATH}/opts"
@ -953,7 +953,7 @@ function updateMenu() {
NEWVER="$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc-lkm/releases" | jq -r ".[].tag_name" | sort -rV | head -1)"
OLDVER="$(cat ${LKMS_PATH}/VERSION)"
dialog --clear --backtitle "$(backtitle)" --title "Update LKMs" \
--menu "Current: ${OLDVER} -> Which Version?" 0 0 0 \
--menu "Current: ${OLDVER} -> Which Version?" 7 50 0 \
1 "Latest ${NEWVER}" \
2 "Select Version" \
2>"${TMP_PATH}/opts"
@ -978,7 +978,7 @@ function updateMenu() {
NEWVER="$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc-modules/releases" | jq -r ".[].tag_name" | sort -rV | head -1)"
OLDVER="$(cat ${MODULES_PATH}/VERSION)"
dialog --clear --backtitle "$(backtitle)" --title "Update Modules" \
--menu "Current: ${OLDVER} -> Which Version?" 0 0 0 \
--menu "Current: ${OLDVER} -> Which Version?" 7 50 0 \
1 "Latest ${NEWVER}" \
2 "Select Version" \
2>"${TMP_PATH}/opts"
@ -1003,7 +1003,7 @@ function updateMenu() {
NEWVER="$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc-patches/releases" | jq -r ".[].tag_name" | sort -rV | head -1)"
OLDVER="$(cat ${PATCH_PATH}/VERSION)"
dialog --clear --backtitle "$(backtitle)" --title "Update Patches" \
--menu "Current: ${OLDVER} -> Which Version?" 0 0 0 \
--menu "Current: ${OLDVER} -> Which Version?" 7 50 0 \
1 "Latest ${NEWVER}" \
2 "Select Version" \
2>"${TMP_PATH}/opts"
@ -1029,7 +1029,7 @@ function updateMenu() {
NEWVER="$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc-custom/releases" | jq -r ".[].tag_name" | sort -rV | head -1)"
OLDVER="$(cat ${CUSTOM_PATH}/VERSION)"
dialog --clear --backtitle "$(backtitle)" --title "Update Custom" \
--menu "Current: ${OLDVER} -> Which Version?" 0 0 0 \
--menu "Current: ${OLDVER} -> Which Version?" 7 50 0 \
1 "Latest ${NEWVER}" \
2 "Select Version" \
2>"${TMP_PATH}/opts"
@ -1050,10 +1050,10 @@ function updateMenu() {
;;
0)
# Ask for Arc Branch
dialog --clear --backtitle "$(backtitle)" --title "Switch Buildroot" \
--menu "Which Branch?" 0 0 0 \
1 "x - latest" \
2 "s - stable" \
dialog --clear --backtitle "$(backtitle)" --title "Switch Buildsystem" \
--menu "Which Branch?" 7 50 0 \
1 "x - latest Buildsystem" \
2 "s - stable Buildsystem" \
2>"${TMP_PATH}/opts"
opts=$(cat ${TMP_PATH}/opts)
[ -z "${opts}" ] && return 1
@ -1063,7 +1063,7 @@ function updateMenu() {
writeConfigKey "arc.branch" "s" "${USER_CONFIG_FILE}"
fi
ARCBRANCH="$(readConfigKey "arc.branch" "${USER_CONFIG_FILE}")"
dialog --backtitle "$(backtitle)" --title "Switch Buildroot" --aspect 18 \
dialog --backtitle "$(backtitle)" --title "Switch Buildsystem" --aspect 18 \
--msgbox "Updates are using ${ARCBRANCH} Branch.\nYou need to Update the Loader now!" 0 0
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
@ -2086,17 +2086,17 @@ function rebootMenu() {
rm -f "${TMP_PATH}/opts" >/dev/null
touch "${TMP_PATH}/opts"
# Selectable Reboot Options
echo -e "config \"Config Mode\"" >>"${TMP_PATH}/opts"
echo -e "update \"Automated Update Mode\"" >>"${TMP_PATH}/opts"
echo -e "recovery \"Recovery Mode\"" >>"${TMP_PATH}/opts"
echo -e "junior \"Reinstall Mode\"" >>"${TMP_PATH}/opts"
echo -e "config \"Arc - Config Mode\"" >>"${TMP_PATH}/opts"
echo -e "update \"Arc - Automated Update Mode\"" >>"${TMP_PATH}/opts"
echo -e "init \"Arc - Restart Loader Init\"" >>"${TMP_PATH}/opts"
echo -e "network \"Arc - Restart Network Service\"" >>"${TMP_PATH}/opts"
echo -e "recovery \"DSM - Recovery Mode\"" >>"${TMP_PATH}/opts"
echo -e "junior \"DSM - Reinstall Mode\"" >>"${TMP_PATH}/opts"
if efibootmgr | grep -q "^Boot0000"; then
echo -e "bios \"BIOS/UEFI\"" >>"${TMP_PATH}/opts"
echo -e "bios \"System - BIOS/UEFI\"" >>"${TMP_PATH}/opts"
fi
echo -e "poweroff \"Shutdown\"" >>"${TMP_PATH}/opts"
echo -e "poweroff \"System - Shutdown\"" >>"${TMP_PATH}/opts"
echo -e "shell \"Exit to Shell Cmdline\"" >>"${TMP_PATH}/opts"
echo -e "init \"Restart Loader Init\"" >>"${TMP_PATH}/opts"
echo -e "network \"Restart Network Service\"" >>"${TMP_PATH}/opts"
dialog --backtitle "$(backtitle)" --title "Power Menu" \
--menu "Choose a Destination" 0 0 0 --file "${TMP_PATH}/opts" \
2>${TMP_PATH}/resp

View File

@ -649,15 +649,15 @@ function systemCheck () {
function dynCheck () {
ARCDYN="$(readConfigKey "arc.dynamic" "${USER_CONFIG_FILE}")"
OFFLINE="$(readConfigKey "arc.offline" "${USER_CONFIG_FILE}")"
if [ "${ARCDYN}" == "true" ] && [ "${OFFLINE}" == "false" ] && [ ! -f "${PART1_PATH}/dynamic" ]; then
curl -skL "https://github.com/AuxXxilium/arc/archive/refs/heads/main.zip" -o "${TMP_PATH}/main.zip"
unzip -qq -o "${TMP_PATH}/main.zip" -d "${TMP_PATH}" 2>/dev/null
cp -rf "${TMP_PATH}/arc-main/files/initrd/opt" "${ARC_PATH}"
rm -rf "${TMP_PATH}/arc-main"
rm -f "${TMP_PATH}/main.zip"
echo "true" >"${PART1_PATH}/dynamic"
if [ "${ARCDYN}" == "true" ] && [ "${OFFLINE}" == "false" ] && [ ! -f "${TMP_PATH}/dynamic" ]; then
curl -skL "https://github.com/AuxXxilium/arc/archive/refs/heads/dev.zip" -o "${TMP_PATH}/dev.zip"
unzip -qq -o "${TMP_PATH}/dev.zip" -d "${TMP_PATH}" 2>/dev/null
cp -rf "${TMP_PATH}/arc-dev/files/initrd/opt" "${ARC_PATH}"
rm -rf "${TMP_PATH}/arc-dev"
rm -f "${TMP_PATH}/dev.zip"
echo "true" >"${TMP_PATH}/dynamic"
init.sh
else
[ -f "${PART1_PATH}/dynamic" ] && rm -f "${PART1_PATH}/dynamic" >/dev/null 2>&1 || true
elif [ "${ARCDYN}" == "false" ] || [ "${OFFLINE}" == "true" ]; then
[ -f "${TMP_PATH}/dynamic" ] && rm -f "${TMP_PATH}/dynamic" >/dev/null 2>&1 || true
fi
}

View File

@ -86,7 +86,6 @@ else
fi
[ $(echo "${ARC_VERSION}" | grep -q "s" | wc -l) -gt 0 ] && writeConfigKey "arc.branch" "s" "${USER_CONFIG_FILE}" || writeConfigKey "arc.branch" "" "${USER_CONFIG_FILE}"
[ -f "${PART3_PATH}/automated" ] && rm -f "${PART3_PATH}/automated" >/dev/null 2>&1 || true
[ -f "${PART1_PATH}/dynamic" ] && rm -f "${PART1_PATH}/dynamic" >/dev/null 2>&1 || true
# Check for compatibility
compatboot