mirror of
https://github.com/AuxXxilium/arc.git
synced 2024-11-24 02:09:52 +07:00
tree: rework more logic
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
parent
e339aad9e2
commit
60f9bcf768
@ -326,7 +326,7 @@ function arcVersion() {
|
||||
URLVER="$(echo "${PV}" | cut -d'.' -f1,2)"
|
||||
[ "${PRODUCTVER}" != "${URLVER}" ] && PRODUCTVER="${URLVER}"
|
||||
writeConfigKey "productver" "${PRODUCTVER}" "${USER_CONFIG_FILE}"
|
||||
[ -n "${PAT_URL}" ] && [ -n "${PAT_HASH}" ] && break
|
||||
[ -n "${PAT_URL}" ] && [ -n "${PAT_HASH}" ] && VALID="true" && break
|
||||
fi
|
||||
done
|
||||
if [ -z "${PAT_URL}" ] || [ -z "${PAT_HASH}" ]; then
|
||||
@ -341,8 +341,8 @@ function arcVersion() {
|
||||
return 1 # 1 or 255 # cancel-button or ESC
|
||||
PAT_URL="$(cat "${TMP_PATH}/resp" | sed -n '1p')"
|
||||
PAT_HASH="$(cat "${TMP_PATH}/resp" | sed -n '2p')"
|
||||
[ -n "${PAT_URL}" ] && [ -n "${PAT_HASH}" ] && VALID="true"
|
||||
fi
|
||||
VALID="true"
|
||||
elif [ "${AUTOMATED}" == "true" ]; then
|
||||
PAT_URL="$(readConfigKey "paturl" "${USER_CONFIG_FILE}")"
|
||||
PAT_HASH="$(readConfigKey "pathash" "${USER_CONFIG_FILE}")"
|
||||
@ -359,6 +359,7 @@ function arcVersion() {
|
||||
fi
|
||||
fi
|
||||
sleep 2
|
||||
mkdir -p "${USER_UP_PATH}"
|
||||
DSM_FILE="${USER_UP_PATH}/${PAT_HASH}.tar"
|
||||
if [ ! -f "${DSM_FILE}" ] && [ "${OFFLINE}" == "false" ] && [ "${VALID}" == "true" ]; then
|
||||
dialog --backtitle "$(backtitle)" --colors --title "DSM Version" \
|
||||
|
@ -84,11 +84,11 @@ if grep -q "automated_arc" /proc/cmdline; then
|
||||
else
|
||||
writeConfigKey "automated" "false" "${USER_CONFIG_FILE}"
|
||||
fi
|
||||
[ -f "${PART3_PATH}/automated" ] && rm -f "${PART3_PATH}/automated" >/dev/null 2>&1 || true
|
||||
if [ -f "${PART1_PATH}/ARC-BRANCH" ]; then
|
||||
ARCBRANCH=$(cat "${PART1_PATH}/ARC-BRANCH") && writeConfigKey "arc.branch" "${ARCBRANCH}" "${USER_CONFIG_FILE}"
|
||||
rm -f "${PART1_PATH}/ARC-BRANCH" >/dev/null 2>&1 || true
|
||||
fi
|
||||
[ -f "${PART3_PATH}/automated" ] && rm -f "${PART3_PATH}/automated" >/dev/null 2>&1 || true
|
||||
# Check for compatibility
|
||||
compatboot
|
||||
|
||||
|
@ -32,6 +32,7 @@ fi
|
||||
|
||||
# Get Config Status
|
||||
CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")"
|
||||
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
|
||||
|
||||
# Get Keymap and Timezone Config
|
||||
ntpCheck
|
||||
@ -65,19 +66,17 @@ function arcUpdate() {
|
||||
# Ask for Boot
|
||||
dialog --backtitle "$(backtitle)" --title "Update Loader" --aspect 18 \
|
||||
--infobox "Update successful!" 0 0
|
||||
if [ "${CONFDONE}" == "true" ] && [ ! -f "${PART3_PATH}/automated" ]; then
|
||||
echo "${ARC_VERSION}-${MODEL}-${PRODUCTVER}-custom" >"${PART3_PATH}/automated"
|
||||
fi
|
||||
boot
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
# Calls boot.sh to boot into DSM kernel/ramdisk
|
||||
function boot() {
|
||||
CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")"
|
||||
if [ "${CONFDONE}" == "true" ]; then
|
||||
BUILDDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")"
|
||||
if [ "${BUILDDONE}" == "true" ]; then
|
||||
dialog --backtitle "$(backtitle)" --title "Arc Boot" \
|
||||
--infobox "Rebooting to automated Build Mode...\nPlease stay patient!" 4 30
|
||||
[ ! -f "${PART3_PATH}/automated" ] && echo "${ARC_VERSION}-${MODEL}-${PRODUCTVER}" >"${PART3_PATH}/automated"
|
||||
sleep 3
|
||||
rebootTo automated
|
||||
else
|
||||
|
@ -86,17 +86,6 @@ set color_normal=white/black
|
||||
set ARC_CMDLINE="earlyprintk earlycon=uart8250,io,0x3f8,115200n8 console=ttyS0,115200n8 root=/dev/ram rootwait net.ifnames=0 panic=0 pcie_aspm=off"
|
||||
|
||||
search --set=root --label "ARC3"
|
||||
if [ -e /automated ]; then
|
||||
menuentry 'Arc Automated Mode' --id automated {
|
||||
set_gfxpayload
|
||||
echo "Loading Arc Kernel..."
|
||||
linux /bzImage-arc ${ARC_CMDLINE} ${arc_cmdline} automated_arc
|
||||
echo "Loading Arc Initramfs..."
|
||||
initrd /initrd-arc
|
||||
echo "Booting..."
|
||||
}
|
||||
fi
|
||||
|
||||
if [ -s /zImage-dsm -a -s /initrd-dsm ]; then
|
||||
if [ "${default}" = "direct" ]; then
|
||||
set timeout="1"
|
||||
@ -120,6 +109,17 @@ if [ -s /zImage-dsm -a -s /initrd-dsm ]; then
|
||||
}
|
||||
fi
|
||||
|
||||
if [ -e /automated ]; then
|
||||
menuentry 'Arc Automated Mode' --id automated {
|
||||
set_gfxpayload
|
||||
echo "Loading Arc Kernel..."
|
||||
linux /bzImage-arc ${ARC_CMDLINE} ${arc_cmdline} automated_arc
|
||||
echo "Loading Arc Initramfs..."
|
||||
initrd /initrd-arc
|
||||
echo "Booting..."
|
||||
}
|
||||
fi
|
||||
|
||||
menuentry 'Arc Config Mode' --id config {
|
||||
set_gfxpayload
|
||||
echo "Loading Arc Kernel..."
|
||||
|
Loading…
Reference in New Issue
Block a user