mirror of
https://github.com/AuxXxilium/arc.git
synced 2024-11-24 00:19:52 +07:00
tree: changes for compatibility
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
parent
c288e229fb
commit
e883a0b43f
@ -1017,11 +1017,10 @@ function updateMenu() {
|
||||
opts=$(cat ${TMP_PATH}/opts)
|
||||
[ -z "${opts}" ] && return 1
|
||||
if [ ${opts} -eq 1 ]; then
|
||||
ARCBRANCH="x"
|
||||
writeConfigKey "arc.branch" "" "${USER_CONFIG_FILE}"
|
||||
elif [ ${opts} -eq 2 ]; then
|
||||
ARCBRANCH="s"
|
||||
writeConfigKey "arc.branch" "s" "${USER_CONFIG_FILE}"
|
||||
fi
|
||||
writeConfigKey "arc.branch" "${ARCBRANCH}" "${USER_CONFIG_FILE}"
|
||||
ARCBRANCH="$(readConfigKey "arc.branch" "${USER_CONFIG_FILE}")"
|
||||
dialog --backtitle "$(backtitle)" --title "Switch Buildroot" --aspect 18 \
|
||||
--msgbox "Updates are using ${ARCBRANCH} Branch!" 0 0
|
||||
|
@ -44,35 +44,39 @@ function upgradeLoader () {
|
||||
(
|
||||
# Download update file
|
||||
echo "Downloading ${TAG}"
|
||||
local URL="https://github.com/AuxXxilium/arc/releases/download/${TAG}/arc-${ARCBRANCH}-${TAG}.img.zip"
|
||||
if [ -n "${ARCBRANCH}" ]; then
|
||||
local URL="https://github.com/AuxXxilium/arc/releases/download/${TAG}/arc-${ARCBRANCH}-${TAG}.img.zip"
|
||||
else
|
||||
local URL="https://github.com/AuxXxilium/arc/releases/download/${TAG}/arc-${TAG}.img.zip"
|
||||
fi
|
||||
if [ "${ARCNIC}" == "auto" ]; then
|
||||
curl -#kL "${URL}" -o "${TMP_PATH}/arc-${ARCBRANCH}-${TAG}.img.zip" 2>&1 | while IFS= read -r -n1 char; do
|
||||
curl -#kL "${URL}" -o "${TMP_PATH}/arc.img.zip" 2>&1 | while IFS= read -r -n1 char; do
|
||||
[[ $char =~ [0-9] ]] && keep=1 ;
|
||||
[[ $char == % ]] && echo "Download: $progress%" && progress="" && keep=0 ;
|
||||
[[ $keep == 1 ]] && progress="$progress$char" ;
|
||||
done
|
||||
else
|
||||
curl --interface ${ARCNIC} -#kL "${URL}" -o "${TMP_PATH}/arc-${ARCBRANCH}-${TAG}.img.zip" 2>&1 | while IFS= read -r -n1 char; do
|
||||
curl --interface ${ARCNIC} -#kL "${URL}" -o "${TMP_PATH}/arc.img.zip" 2>&1 | while IFS= read -r -n1 char; do
|
||||
[[ $char =~ [0-9] ]] && keep=1 ;
|
||||
[[ $char == % ]] && echo "Download: $progress%" && progress="" && keep=0 ;
|
||||
[[ $keep == 1 ]] && progress="$progress$char" ;
|
||||
done
|
||||
fi
|
||||
if [ -f "${TMP_PATH}/arc-${ARCBRANCH}-${TAG}.img.zip" ]; then
|
||||
if [ -f "${TMP_PATH}/arc.img.zip" ]; then
|
||||
echo "Downloading Upgradefile successful!"
|
||||
else
|
||||
echo "Error downloading Upgradefile!"
|
||||
sleep 5
|
||||
return 1
|
||||
fi
|
||||
unzip -oq "${TMP_PATH}/arc-${ARCBRANCH}-${TAG}.img.zip" -d "${TMP_PATH}"
|
||||
rm -f "${TMP_PATH}/arc-${ARCBRANCH}-${TAG}.img.zip" >/dev/null
|
||||
unzip -oq "${TMP_PATH}/arc.img.zip" -d "${TMP_PATH}"
|
||||
rm -f "${TMP_PATH}/arc.img.zip" >/dev/null
|
||||
echo "Installing new Loader Image..."
|
||||
# Process complete update
|
||||
umount "${PART1_PATH}" "${PART2_PATH}" "${PART3_PATH}"
|
||||
dd if="${TMP_PATH}/arc-${ARCBRANCH}.img" of=$(blkid | grep 'LABEL="ARC3"' | cut -d3 -f1) bs=1M conv=fsync
|
||||
dd if="${TMP_PATH}/arc.img" of=$(blkid | grep 'LABEL="ARC3"' | cut -d3 -f1) bs=1M conv=fsync
|
||||
# Ask for Boot
|
||||
rm -f "${TMP_PATH}/arc-${ARCBRANCH}.img" >/dev/null
|
||||
rm -f "${TMP_PATH}/arc.img" >/dev/null
|
||||
echo "Upgrade done! -> Rebooting..."
|
||||
sleep 2
|
||||
) 2>&1 | dialog --backtitle "$(backtitle)" --title "Upgrade Loader" \
|
||||
@ -128,8 +132,13 @@ function updateLoader() {
|
||||
(
|
||||
# Download update file
|
||||
echo "Downloading ${TAG}"
|
||||
local URL="https://github.com/AuxXxilium/arc/releases/download/${TAG}/update-${ARCBRANCH}.zip"
|
||||
local SHA="https://github.com/AuxXxilium/arc/releases/download/${TAG}/checksum-${ARCBRANCH}.sha256"
|
||||
if [ -n "${ARCBRANCH}" ]; then
|
||||
local URL="https://github.com/AuxXxilium/arc/releases/download/${TAG}/update-${ARCBRANCH}.zip"
|
||||
local SHA="https://github.com/AuxXxilium/arc/releases/download/${TAG}/checksum-${ARCBRANCH}.sha256"
|
||||
else
|
||||
local URL="https://github.com/AuxXxilium/arc/releases/download/${TAG}/update.zip"
|
||||
local SHA="https://github.com/AuxXxilium/arc/releases/download/${TAG}/checksum.sha256"
|
||||
fi
|
||||
if [ "${ARCNIC}" == "auto" ]; then
|
||||
curl -#kL "${URL}" -o "${TMP_PATH}/update-${ARCBRANCH}.zip" 2>&1 | while IFS= read -r -n1 char; do
|
||||
[[ $char =~ [0-9] ]] && keep=1 ;
|
||||
|
@ -82,7 +82,7 @@ if grep -q "automated_arc" /proc/cmdline; then
|
||||
else
|
||||
writeConfigKey "automated" "false" "${USER_CONFIG_FILE}"
|
||||
fi
|
||||
[ $(echo "${ARC_VERSION}" | grep -q "s" | wc -l) -gt 0 ] && writeConfigKey "arc.branch" "s" "${USER_CONFIG_FILE}" || writeConfigKey "arc.branch" "x" "${USER_CONFIG_FILE}"
|
||||
[ $(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
|
||||
# Check for compatibility
|
||||
compatboot
|
||||
|
Loading…
Reference in New Issue
Block a user