Compare commits

...

26 Commits
1.2.1 ... 1.2.2

Author SHA1 Message Date
AuxXxilium
adba4d3421 Merge pull request #5406 from AuxXxilium/dev
build: fix
2024-12-28 17:06:54 +01:00
AuxXxilium
8a1a314eb5 build: fix
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-12-28 17:06:39 +01:00
AuxXxilium
1026800376 Merge pull request #5405 from AuxXxilium/dev
bootscreen: fix config
2024-12-28 16:48:53 +01:00
AuxXxilium
a800767f0b bootscreen: fix config
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-12-28 16:48:11 +01:00
AuxXxilium
6d07ffcaad Merge pull request #5404 from AuxXxilium/dev
arc: fix logic
2024-12-28 16:09:53 +01:00
AuxXxilium
e8efec928a arc: fix logic
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-12-28 14:43:31 +01:00
AuxXxilium
af62a307e5 Merge pull request #5403 from AuxXxilium/dev
Dev
2024-12-28 13:43:54 +01:00
AuxXxilium
21630d6e33 arc: force reinit system after changes
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-12-28 13:41:33 +01:00
AuxXxilium
738a16514d tree: add more checks
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-12-28 13:33:25 +01:00
AuxXxilium
6debfe73b8 grub: cleanup
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-12-28 01:19:50 +01:00
AuxXxilium
ce7ea49481 Merge pull request #5395 from AuxXxilium/dev
Dev
2024-12-27 23:47:59 +01:00
AuxXxilium
7a6197f04d build: update local
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-12-27 23:28:07 +01:00
AuxXxilium
491c15ec63 tree: rework more
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-12-27 23:24:44 +01:00
AuxXxilium
3b94661c90 func: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-12-27 23:20:52 +01:00
AuxXxilium
e9463d990e tree: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-12-27 23:15:58 +01:00
AuxXxilium
90cc4520d8 func: fix
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-12-27 23:01:24 +01:00
AuxXxilium
4cf4efffbe func: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-12-27 22:59:38 +01:00
AuxXxilium
071ae09e1b func: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-12-27 22:54:46 +01:00
AuxXxilium
21b0f768f1 tree: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-12-27 22:34:58 +01:00
AuxXxilium
fe774756c0 tree: revert some changes
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-12-27 22:27:52 +01:00
AuxXxilium
6ab4bf3a5a grub: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-12-27 22:01:07 +01:00
AuxXxilium
0a7db3b4bb arc: rewrite logic and cleanup
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-12-27 15:33:48 +01:00
AuxXxilium
9849dc2ecc arc: fix register hwid
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-12-27 15:05:20 +01:00
AuxXxilium
b82c840e04 init: fix shortpath
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-12-27 15:03:00 +01:00
AuxXxilium
d762884775 arc: fix message
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-12-27 15:01:49 +01:00
AuxXxilium
33e0149dbf grub: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-12-27 00:58:35 +01:00
12 changed files with 129 additions and 93 deletions

View File

@@ -104,7 +104,7 @@ jobs:
echo "Create Arc Image"
IMAGE_FILE="arc.img"
gzip -dc "grub.img.gz" >"${IMAGE_FILE}"
gzip -dc "files/initrd/opt/arc/grub.img.gz" >"${IMAGE_FILE}"
fdisk -l "${IMAGE_FILE}"
LOOPX=$(sudo losetup -f)
@@ -185,7 +185,7 @@ jobs:
echo "Create Arc Image"
IMAGE_FILE="arc.img"
gzip -dc "grub.img.gz" >"${IMAGE_FILE}"
gzip -dc "files/initrd/opt/arc/grub.img.gz" >"${IMAGE_FILE}"
fdisk -l "${IMAGE_FILE}"
LOOPX=$(sudo losetup -f)

View File

@@ -96,6 +96,7 @@ jobs:
getTheme "files/p1/boot/grub"
getBuildrootx "brx"
getBuildroots "brs"
cp -f "files/initrd/opt/arc/grub.img.gz" "grub.img.gz"
# Export Dependencies Version to env
echo "ADDONTAG=${ADDONTAG}" >> $GITHUB_ENV
@@ -130,7 +131,8 @@ jobs:
echo "Create Arc Image"
IMAGE_FILE="arc.img"
gzip -dc "grub.img.gz" >"${IMAGE_FILE}"
cp -f "grub.img.gz" "files/initrd/opt/arc/grub.img.gz"
gzip -dc "files/initrd/opt/arc/grub.img.gz" >"${IMAGE_FILE}"
fdisk -l "${IMAGE_FILE}"
LOOPX=$(sudo losetup -f)
@@ -184,6 +186,7 @@ jobs:
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.vhd.zip" arc.vhd arc.vmc
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.ova.zip" arc.ova
(cd files && zip -r ../update-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.zip ./p1 ./p3)
sha256sum update-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.zip >"update-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.hash"
fi
# Cleanup
@@ -210,7 +213,8 @@ jobs:
echo "Create Arc Image"
IMAGE_FILE="arc.img"
gzip -dc "grub.img.gz" >"${IMAGE_FILE}"
cp -f "grub.img.gz" "files/initrd/opt/arc/grub.img.gz"
gzip -dc "files/initrd/opt/arc/grub.img.gz" >"${IMAGE_FILE}"
fdisk -l "${IMAGE_FILE}"
LOOPX=$(sudo losetup -f)
@@ -264,6 +268,7 @@ jobs:
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.vhd.zip" arc.vhd arc.vmc
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.ova.zip" arc.ova
(cd files && zip -r ../update-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.zip ./p1 ./p3)
sha256sum update-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.zip >"update-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.hash"
fi
# Publish a release if is a tag

View File

@@ -39,6 +39,9 @@ jobs:
if: success() && inputs.push == true
run: |
if [ -f "grub.img.gz" ]; then
echo "Copy img ..."
mv -f grub.img.gz files/initrd/opt/arc/grub.img.gz
echo "Git push ..."
git pull
status=$(git status -s | grep -E 'grub.img.gz' | awk '{printf " %s", $2}')

View File

@@ -781,7 +781,7 @@ function backupMenu() {
dialog --backtitle "$(backtitle)" --title "Restore Arc Config" \
--aspect 18 --infobox "Restore successful! -> Reload Arc Init now" 5 50
sleep 2
./init.sh
rm -f "${HOME}/.initialized" && exec init.sh
;;
2)
DSMROOTS="$(findDSMRoot)"
@@ -871,7 +871,7 @@ function backupMenu() {
dialog --backtitle "$(backtitle)" --title "Online Restore" \
--aspect 18 --infobox "Restore successful! -> Reload Arc Init now" 5 50
sleep 2
./init.sh
rm -f "${HOME}/.initialized" && exec init.sh
;;
5)
HWID="$(genHWID)"
@@ -2148,7 +2148,7 @@ function rebootMenu() {
elif [ "${REDEST}" = "network" ]; then
clear
/etc/init.d/S41dhcpcd restart
./init.sh
rm -f "${HOME}/.initialized" && exec init.sh
else
rebootTo ${REDEST}
exit 0
@@ -2408,22 +2408,28 @@ function genHardwareID() {
HWID="$(genHWID)"
while true; do
USERID="$(curl -skL -m 10 "https://arc.auxxxilium.tech?hwid=${HWID}" 2>/dev/null)"
if echo "${USERID}" | grep -vq "Hardware ID"; then
dialog --backtitle "$(backtitle)" --title "HardwareID" \
--msgbox "HardwareID: ${HWID}\nYour HardwareID is registered to UserID: ${USERID}!" 6 70
if echo "${USERID}" | grep -qE '^[0-9]+$'; then
writeConfigKey "arc.hardwareid" "${HWID}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.userid" "${USERID}" "${USER_CONFIG_FILE}"
writeConfigKey "bootscreen.hwidinfo" "true" "${USER_CONFIG_FILE}"
dialog --backtitle "$(backtitle)" --title "HardwareID" \
--msgbox "HardwareID: ${HWID}\nYour HardwareID is registered to UserID: ${USERID}!" 6 70
break
else
dialog --backtitle "$(backtitle)" --title "HardwareID" \
--yes-label "Retry" --no-label "Cancel" --yesno "HardwareID: ${HWID}\nRegister your HardwareID on\nhttps://arc.auxxxilium.tech (Discord Account needed).\nPress Retry after you registered it." 8 60
[ $? -ne 0 ] && break
USERID=""
writeConfigKey "arc.hardwareid" "" "${USER_CONFIG_FILE}"
writeConfigKey "arc.userid" "" "${USER_CONFIG_FILE}"
writeConfigKey "bootscreen.hwidinfo" "false" "${USER_CONFIG_FILE}"
dialog --backtitle "$(backtitle)" --title "HardwareID" \
--yes-label "Retry" --no-label "Cancel" --yesno "HardwareID: ${HWID}\nRegister your HardwareID at\nhttps://arc.auxxxilium.tech (Discord Account needed).\nPress Retry after you registered it." 8 60
[ $? -ne 0 ] && break
continue
fi
done
CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")"
if [ -n "${USERID}" ] && [ "${CONFDONE}" = "true"]; then
ONLYPATCH="true" && arcPatch
fi
return
}
@@ -2433,12 +2439,13 @@ function checkHardwareID() {
HWID="$(genHWID)"
USERID="$(curl -skL -m 10 "https://arc.auxxxilium.tech?hwid=${HWID}" 2>/dev/null)"
[ ! -f "${S_FILE}.bak" ] && cp -f "${S_FILE}" "${S_FILE}.bak" 2>/dev/null || true
if echo "${USERID}" | grep -vq "Hardware ID"; then
if echo "${USERID}" | grep -qE '^[0-9]+$'; then
if curl -skL -m 10 "https://arc.auxxxilium.tech?hwid=${HWID}&userid=${USERID}" -o "${S_FILE}" 2>/dev/null; then
writeConfigKey "arc.hardwareid" "${HWID}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.userid" "${USERID}" "${USER_CONFIG_FILE}"
writeConfigKey "bootscreen.hwidinfo" "true" "${USER_CONFIG_FILE}"
else
USERID=""
writeConfigKey "arc.hardwareid" "" "${USER_CONFIG_FILE}"
writeConfigKey "arc.userid" "" "${USER_CONFIG_FILE}"
writeConfigKey "bootscreen.hwidinfo" "false" "${USER_CONFIG_FILE}"
@@ -2451,7 +2458,7 @@ function checkHardwareID() {
writeConfigKey "bootscreen.hwidinfo" "false" "${USER_CONFIG_FILE}"
[ -f "${S_FILE}.bak" ] && mv -f "${S_FILE}.bak" "${S_FILE}" 2>/dev/null
fi
return 0
return
}
###############################################################################
@@ -2463,25 +2470,31 @@ function bootScreen () {
while IFS=': ' read -r KEY VALUE; do
[ -n "${KEY}" ] && BOOTSCREENS["${KEY}"]="${VALUE}"
done < <(readConfigMap "bootscreen" "${USER_CONFIG_FILE}")
echo -e "dsminfo" >"${TMP_PATH}/bootscreen"
echo -e "systeminfo" >>"${TMP_PATH}/bootscreen"
echo -e "diskinfo" >>"${TMP_PATH}/bootscreen"
echo -e "hwidinfo" >>"${TMP_PATH}/bootscreen"
echo -e "dsmlogo" >>"${TMP_PATH}/bootscreen"
while read -r BOOTSCREEN; do
arrayExistItem "${BOOTSCREEN}" "${!BOOTSCREENS[@]}" && ACT="on" || ACT="off"
echo -e "${BOOTSCREEN} \"${DESC}\" ${ACT}" >>"${TMP_PATH}/opts"
done < <(cat "${TMP_PATH}/bootscreen")
cat <<EOL >"${TMP_PATH}/bootscreen"
dsminfo: DSM Information
systeminfo: System Information
diskinfo: Disk Information
hwidinfo: HardwareID Information
dsmlogo: DSM Logo
EOL
while IFS=': ' read -r BOOTSCREEN BOOTDESCRIPTION; do
if [ "${BOOTSCREENS[${BOOTSCREEN}]}" = "true" ]; then
ACT="on"
else
ACT="off"
fi
echo -e "${BOOTSCREEN} \"${BOOTDESCRIPTION}\" ${ACT}" >>"${TMP_PATH}/opts"
done < "${TMP_PATH}/bootscreen"
dialog --backtitle "$(backtitle)" --title "Bootscreen" --colors --aspect 18 \
--checklist "Select Bootscreen Informations\Zn\nSelect with SPACE, Confirm with ENTER!" 0 0 0 \
--file "${TMP_PATH}/opts" 2>"${TMP_PATH}/resp"
[ $? -ne 0 ] && return 1
resp=$(cat ${TMP_PATH}/resp)
unset BOOTSCREENS
declare -A BOOTSCREENS
writeConfigKey "bootscreen" "{}" "${USER_CONFIG_FILE}"
for BOOTSCREEN in ${resp}; do
BOOTSCREENS["${BOOTSCREEN}"]=""
writeConfigKey "bootscreen.\"${BOOTSCREEN}\"" "true" "${USER_CONFIG_FILE}"
resp=$(cat "${TMP_PATH}/resp")
for BOOTSCREEN in dsminfo systeminfo diskinfo hwidinfo dsmlogo; do
if echo "${resp}" | grep -q "${BOOTSCREEN}"; then
writeConfigKey "bootscreen.${BOOTSCREEN}" "true" "${USER_CONFIG_FILE}"
else
writeConfigKey "bootscreen.${BOOTSCREEN}" "false" "${USER_CONFIG_FILE}"
fi
done
}

View File

@@ -167,7 +167,7 @@ function arcModel() {
case ${RET} in
0)
resp=$(cat ${TMP_PATH}/resp)
[ -z "${resp}" ] && return 1
[ -z "${resp}" ] && return
break
;;
1)
@@ -180,7 +180,7 @@ function arcModel() {
--title "Platform Info" --textbox "./informations/${PLATFORM}.yml" 70 80
;;
*)
return 1
return
break
;;
esac
@@ -242,9 +242,9 @@ function arcVersion() {
dialog --clear --no-items --nocancel --title "DSM Version" --backtitle "$(backtitlep)" \
--no-items --menu "Select DSM Version" 7 30 0 ${ITEMS} \
2>"${TMP_PATH}/resp"
[ $? -ne 0 ] && return 0
[ $? -ne 0 ] && return
resp=$(cat ${TMP_PATH}/resp)
[ -z "${resp}" ] && return 1
[ -z "${resp}" ] && return
if [ "${PRODUCTVER}" != "${resp}" ]; then
PRODUCTVER="${resp}"
writeConfigKey "productver" "${PRODUCTVER}" "${USER_CONFIG_FILE}"
@@ -386,7 +386,7 @@ function arcVersion() {
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
ONLYVERSION="false"
return 0
return
else
arcPatch
fi
@@ -396,7 +396,7 @@ function arcVersion() {
writeConfigKey "arc.confdone" "false" "${USER_CONFIG_FILE}"
CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")"
sleep 5
return 1
return
fi
}
@@ -478,7 +478,7 @@ function arcSettings() {
--infobox "Generating Network Config..." 3 40
sleep 2
getnet
[ $? -ne 0 ] && return 1
[ $? -ne 0 ] && return
fi
if [ "${ONLYPATCH}" = "true" ]; then
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
@@ -493,7 +493,7 @@ function arcSettings() {
--infobox "Generating Storage Map..." 3 40
sleep 2
getmapSelection
[ $? -ne 0 ] && return 1
[ $? -ne 0 ] && return
fi
# Check for Custom Build
if [ "${ARCMODE}" = "config" ]; then
@@ -502,14 +502,14 @@ function arcSettings() {
dialog --backtitle "$(backtitlep)" --colors --title "Addons" \
--infobox "Loading Addons Table..." 3 40
addonSelection
[ $? -ne 0 ] && return 1
[ $? -ne 0 ] && return
fi
# Check for CPU Frequency Scaling & Governor
if [ "${ARCMODE}" = "config" ] && [ "${MACHINE}" = "Native" ] && readConfigMap "addons" "${USER_CONFIG_FILE}" | grep -q "cpufreqscaling"; then
dialog --backtitle "$(backtitlep)" --colors --title "CPU Frequency Scaling" \
--infobox "Generating Governor Table..." 3 40
governorSelection
[ $? -ne 0 ] && return 1
[ $? -ne 0 ] && return
elif [ "${ARCMODE}" = "automated" ] && [ "${MACHINE}" = "Native" ] && readConfigMap "addons" "${USER_CONFIG_FILE}" | grep -q "cpufreqscaling"; then
[ "${PLATFORM}" = "epyc7002" ] && writeConfigKey "addons.cpufreqscaling" "schedutil" "${USER_CONFIG_FILE}" || writeConfigKey "addons.cpufreqscaling" "conservative" "${USER_CONFIG_FILE}"
fi
@@ -563,12 +563,12 @@ function arcSettings() {
2 "No - I want to make changes" \
2>"${TMP_PATH}/resp"
resp=$(cat ${TMP_PATH}/resp)
[ -z "${resp}" ] && return 1
[ -z "${resp}" ] && return
if [ ${resp} -eq 1 ]; then
arcSummary
elif [ ${resp} -eq 2 ]; then
dialog --clear --no-items --backtitle "$(backtitle)"
return 1
return
fi
else
# Build Loader
@@ -702,7 +702,7 @@ function make() {
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
sleep 2
return 1
return
fi
if [ -f "${ORI_ZIMAGE_FILE}" ] && [ -f "${ORI_RDGZ_FILE}" ] && [ "${CONFDONE}" = "true" ] && [ -n "${PAT_URL}" ] && [ -n "${PAT_HASH}" ]; then
(
@@ -717,7 +717,7 @@ function make() {
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
sleep 2
return 1
return
fi
if [ -f "${ORI_ZIMAGE_FILE}" ] && [ -f "${ORI_RDGZ_FILE}" ] && [ -f "${MOD_ZIMAGE_FILE}" ] && [ -f "${MOD_RDGZ_FILE}" ]; then
MODELID="$(echo ${MODEL} | sed 's/d$/D/; s/rp$/RP/; s/rp+/RP+/')"
@@ -731,7 +731,7 @@ function make() {
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
sleep 2
return 1
return
fi
}
@@ -754,11 +754,11 @@ function arcFinish() {
2 "No - I want to make changes" \
2>"${TMP_PATH}/resp"
resp=$(cat ${TMP_PATH}/resp)
[ -z "${resp}" ] && return 1
[ -z "${resp}" ] && return
if [ ${resp} -eq 1 ]; then
boot
elif [ ${resp} -eq 2 ]; then
return 0
return
fi
fi
fi
@@ -833,7 +833,9 @@ elif [ "${ARCMODE}" = "config" ]; then
echo "0 \"HardwareID for Arc Patch\" " >>"${TMP_PATH}/menu"
fi
echo "1 \"Choose Model \" " >>"${TMP_PATH}/menu"
if [ "${CONFDONE}" = "true" ]; then
if [ "${CONFDONE}" = "true" ] && [ -f "${MOD_ZIMAGE_FILE}" ] && [ -f "${MOD_RDGZ_FILE}" ]; then
echo "2 \"Rebuild Loader \" " >>"${TMP_PATH}/menu"
elif [ "${CONFDONE}" = "true" ]; then
echo "2 \"Build Loader \" " >>"${TMP_PATH}/menu"
fi
if [ "${BUILDDONE}" = "true" ]; then
@@ -1071,7 +1073,7 @@ elif [ "${ARCMODE}" = "config" ]; then
;;
c) ARCOFFLINE=$([ "${ARCOFFLINE}" = "true" ] && echo 'false' || echo 'true')
writeConfigKey "arc.offline" "${ARCOFFLINE}" "${USER_CONFIG_FILE}"
[ "${ARCOFFLINE}" = "false" ] && ./arc.sh
[ "${ARCOFFLINE}" = "false" ] && exec arc.sh
NEXT="c"
;;
D) staticIPMenu; NEXT="D" ;;
@@ -1110,7 +1112,7 @@ else
fi
# Inform user
echo -e "Call \033[1;34marc\033[0m to configure Loader"
echo -e "Call \033[1;34marc.sh\033[0m to configure Loader"
echo
echo -e "Web Terminal: \033[1;34mhttp://${IPCON}:${TTYDPORT:-7681}\033[0m"
echo -e "Web Filemanager: \033[1;34mhttp://${IPCON}:${DUFSPORT:-7304}\033[0m"

View File

@@ -43,13 +43,23 @@ function updateLoader() {
dialog --gauge "Download Update: ${TAG}..." 14 72 4>&-
} 4>&1
if [ -f "${TMP_PATH}/update.zip" ] && [ $(ls -s "${TMP_PATH}/update.zip" | cut -d' ' -f1) -gt 300000 ]; then
mkdir -p "${TMP_PATH}/update"
dialog --backtitle "$(backtitle)" --title "Update Loader" \
--infobox "Updating Loader..." 3 50
if unzip -oq "${TMP_PATH}/update.zip" -d "${TMP_PATH}/update"; then
cp -rf "${TMP_PATH}/update"/* "/mnt"
rm -rf "${TMP_PATH}/update"
rm -f "${TMP_PATH}/update.zip"
HASHURL="https://github.com/AuxXxilium/arc/releases/download/${TAG}/update-${TAG}-${ARC_BRANCH}.hash"
HASH="$(curl -skL "${HASHURL}" | awk '{print $1}')"
if [ "${HASH}" != "$(sha256sum "${TMP_PATH}/update.zip" | awk '{print $1}')" ]; then
dialog --backtitle "$(backtitle)" --title "Update Loader" --aspect 18 \
--infobox "Update failed - Hash mismatch!\nTry again later." 0 0
sleep 3
exec reboot
else
rm -rf "/mnt/update"
mkdir -p "${TMP_PATH}/update"
dialog --backtitle "$(backtitle)" --title "Update Loader" \
--infobox "Updating Loader..." 3 50
if unzip -oq "${TMP_PATH}/update.zip" -d "${TMP_PATH}/update"; then
cp -rf "${TMP_PATH}/update"/* "/mnt"
rm -rf "${TMP_PATH}/update"
rm -f "${TMP_PATH}/update.zip"
fi
fi
if [ "$(cat "${PART1_PATH}/ARC-VERSION")" = "${TAG}" ]; then
dialog --backtitle "$(backtitle)" --title "Update Loader" \
@@ -485,6 +495,6 @@ function dependenciesUpdate() {
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
sleep 3
clear
./arc.sh
exec arc.sh
fi
}

View File

@@ -5,26 +5,12 @@ set -e
. "${ARC_PATH}/include/functions.sh"
function loadArcOverlay() {
echo -e "\033[1;34mLoading Arc Overlay...\033[0m"
echo
echo -e "Use \033[1;34mDisplay Output\033[0m or \033[1;34mhttp://${IPCON}:${TTYDPORT:-7681}\033[0m to configure Loader."
# Check memory and load Arc
RAM=$(awk '/MemTotal:/ {printf "%.0f", $2 / 1024}' /proc/meminfo 2>/dev/null)
if [ ${RAM} -le 3500 ]; then
echo -e "\033[1;31mYou have less than 4GB of RAM, if errors occur in loader creation, please increase the amount of RAM.\033[0m\n\033[1;31mUse arc.sh to proceed. Not recommended!\033[0m"
else
./arc.sh
fi
}
# Get Loader Disk Bus
[ -z "${LOADER_DISK}" ] && die "Loader Disk not found!"
checkBootLoader || die "The loader is corrupted, please rewrite it!"
[ -f "${USER_CONFIG_FILE}" ] && sed -i "s/'/\"/g" "${USER_CONFIG_FILE}"
[ -f "${HOME}/.initialized" ] && loadArcOverlay && exit 0 || true
[ -f "${HOME}/.initialized" ] && exec arc.sh || true
[ -f "${USER_CONFIG_FILE}" ] && sed -i "s/'/\"/g" "${USER_CONFIG_FILE}" >/dev/null 2>&1 || true
BUS=$(getBus "${LOADER_DISK}")
EFI=$([ -d /sys/firmware/efi ] && echo 1 || echo 0)
@@ -174,7 +160,7 @@ elif [ "${ARCMODE}" = "update" ]; then
echo -e "\033[1;34mStarting Update Mode...\033[0m"
elif [ "${BUILDDONE}" = "true" ] && [ "${ARCMODE}" = "dsm" ]; then
echo -e "\033[1;34mStarting DSM Mode...\033[0m"
./boot.sh && exit 0
exec boot.sh && exit 0
else
echo -e "\033[1;34mStarting Config Mode...\033[0m"
fi
@@ -232,5 +218,15 @@ mkdir -p "${USER_UP_PATH}"
touch "${HOME}/.initialized"
# Load Arc Overlay
loadArcOverlay
echo -e "\033[1;34mLoading Arc Overlay...\033[0m"
echo
echo -e "Use \033[1;34mDisplay Output\033[0m or \033[1;34mhttp://${IPCON}:${TTYDPORT:-7681}\033[0m to configure Loader."
# Check memory and load Arc
RAM=$(awk '/MemTotal:/ {printf "%.0f", $2 / 1024}' /proc/meminfo 2>/dev/null)
if [ ${RAM} -le 3500 ]; then
echo -e "\033[1;31mYou have less than 4GB of RAM, if errors occur in loader creation, please increase the amount of RAM.\033[0m\n\033[1;31mUse arc.sh to proceed. Not recommended!\033[0m"
else
exec arc.sh
fi
exit 0

View File

@@ -1,7 +1,6 @@
set default="boot"
set timeout="5"
set timeout_style="menu"
set pager=1
set vesa_mode=1
set menu_color_normal=white/black
set menu_color_highlight=white/red
@@ -35,11 +34,11 @@ fi
if loadfont unicode; then
insmod gfxterm
set gfxmode=1024x768
set gfxpayload=auto
if [ "${grub_platform}" = "efi" ]; then
set gfxmode=auto
terminal_output --append gfxterm
else
set gfxmode=1024x768
terminal_output gfxterm
fi
insmod gfxmenu
@@ -63,7 +62,7 @@ function set_gfxpayload {
fi
}
set ARC_CMDLINE="earlyprintk earlycon=uart8250,io,0x3f8,115200n8 console=ttyS0,115200n8 root=/dev/ram rootwait intremap=off net.ifnames=0 panic=5 split_lock_detect=off pcie_aspm=off nox2apic nomodeset intel_pstate=disable"
set ARC_CMDLINE="earlyprintk earlycon=uart8250,io,0x3f8,115200n8 console=ttyS0,115200n8 root=/dev/ram rootwait intremap=off net.ifnames=0 panic=5 split_lock_detect=off pcie_aspm=off intel_pstate=disable nox2apic nomodeset"
search --set=root --label "ARC3"
if [ -s /zImage-dsm -a -s /initrd-dsm ]; then
@@ -169,6 +168,11 @@ menuentry 'Start Memtest86+' --id memtest {
linux ${prefix}/memtest
}
menuentry 'Poweroff' --id poweroff {
echo "System is powering off..."
halt
}
if [ ${vesa_mode} = 1 ]; then
menuentry 'Change Vesa to Text Output' --id videomode {
set vesa_mode=0

View File

@@ -7,6 +7,10 @@ sudo git clean -fdx
. scripts/func.sh "${AUX_TOKEN}"
# Unmount Image File
sudo umount "/tmp/p1" 2>/dev/null || true
sudo umount "/tmp/p3" 2>/dev/null || true
# Get extractor, LKM, addons and Modules
echo "Get Dependencies"
getAddons "files/p3/addons"
@@ -22,7 +26,7 @@ mkdir -p "brx"
# Sbase
IMAGE_FILE="arc.img"
gzip -dc "./grub.img.gz" >"${IMAGE_FILE}"
gzip -dc "files/initrd/opt/arc/grub.img.gz" >"${IMAGE_FILE}"
fdisk -l "${IMAGE_FILE}"
LOOPX=$(sudo losetup -f)
@@ -49,8 +53,6 @@ if [ -f "brx/bzImage-arc" ] && [ -f "brx/initrd-arc" ]; then
createArc
repackInitrd "brx/initrd-arc" "files/initrd" "files/p3/initrd-arc"
else
sudo umount "/tmp/p1"
sudo umount "/tmp/p3"
exit 1
fi
@@ -62,8 +64,8 @@ sync
echo "Unmount image file"
sudo umount "/tmp/p1"
sudo umount "/tmp/p3"
rmdir "/tmp/p1"
rmdir "/tmp/p3"
sudo rm -rf "/tmp/p1"
sudo rm -rf "/tmp/p3"
sudo losetup --detach ${LOOPX}

View File

@@ -7,6 +7,10 @@ sudo git clean -fdx
. scripts/func.sh "${AUX_TOKEN}"
# Unmount Image File
sudo umount "/tmp/p1" 2>/dev/null || true
sudo umount "/tmp/p3" 2>/dev/null || true
# Get extractor, LKM, addons and Modules
echo "Get Dependencies"
getAddons "files/p3/addons"
@@ -21,7 +25,7 @@ getOffline "files/p3/configs"
# Sbase
IMAGE_FILE="arc.img"
gzip -dc "./grub.img.gz" >"${IMAGE_FILE}"
gzip -dc "files/initrd/opt/arc/grub.img.gz" >"${IMAGE_FILE}"
fdisk -l "${IMAGE_FILE}"
LOOPX=$(sudo losetup -f)
@@ -48,8 +52,6 @@ if [ -f "brs/bzImage-arc" ] && [ -f "brs/initrd-arc" ]; then
createArc
repackInitrd "brs/initrd-arc" "files/initrd" "files/p3/initrd-arc"
else
sudo umount "/tmp/p1"
sudo umount "/tmp/p3"
exit 1
fi
@@ -61,8 +63,8 @@ sync
echo "Unmount image file"
sudo umount "/tmp/p1"
sudo umount "/tmp/p3"
rmdir "/tmp/p1"
rmdir "/tmp/p3"
sudo rm -rf "/tmp/p1"
sudo rm -rf "/tmp/p3"
sudo losetup --detach ${LOOPX}

View File

@@ -503,9 +503,8 @@ function copyBuildroot() {
# create arc executable
function createArc() {
./scripts/make/makeself.sh "../arc/files/initrd/opt/arc" arc "Arc Loader" "./init.sh" --current --base64 --chown --threads=0 --quiet
./scripts/make/makeself.sh --current --zstd --quiet "../arc/files/initrd/opt/arc" arc "Arc Loader" "./init.sh"
rm -rf "../arc/files/initrd/opt/arc"
mkdir -p "../arc/files/initrd/opt/arc"
mv -f "arc" "../arc/files/initrd/opt/arc/"
cp -f "./grub.img.gz" "files/initrd/opt/arc/grub.img.gz"
}