tree: rework automated

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-07-13 18:07:43 +02:00
parent aa714f49c4
commit 4695813e50
3 changed files with 7 additions and 38 deletions

View File

@ -807,17 +807,10 @@ function make() {
###############################################################################
# Finish Building Loader
function arcFinish() {
# Verify Files exist
AUTOMATED="$(readConfigKey "automated" "${USER_CONFIG_FILE}")"
rm -f "${LOG_FILE}" >/dev/null
# Check for Automated Mode
if grep -q "automated_arc" /proc/cmdline; then
if [ "${AUTOMATED}" == "true" ]; then
boot
elif [ "${AUTOMATED}" == "true" ]; then
[ ! -f "${PART3_PATH}/automated" ] && echo "${ARC_VERSION}-${MODEL}-${PRODUCTVER}-custom" >"${PART3_PATH}/automated"
boot
elif [ "${AUTOMATED}" == "false" ]; then
[ -f "${PART3_PATH}/automated" ] && rm -f "${PART3_PATH}/automated" >/dev/null
else
# Ask for Boot
dialog --clear --backtitle "$(backtitle)" --title "Build done"\
--no-cancel --menu "Boot now?" 7 40 0 \
@ -868,9 +861,9 @@ function boot() {
###############################################################################
# Main loop
# Check for Automated Mode
if grep -q "automated_arc" /proc/cmdline; then
if [ "${AUTOMATED}" == "true" ]; then
# Check for Custom Build
if [ "${AUTOMATED}" == "true" ]; then
if [ "${BUILDDONE}" == "false" ]; then
arcModel
else
make
@ -972,9 +965,6 @@ else
if [ "${LOADEROPTS}" == "true" ]; then
echo "= \"\Z4========= Loader =========\Zn \" " >>"${TMP_PATH}/menu"
echo "= \"\Z4=== Edit with caution! ===\Zn \" " >>"${TMP_PATH}/menu"
if [ "${OFFLINE}" == "false" ]; then
echo "R \"Automated Mode: \Z4${AUTOMATED}\Zn \" " >>"${TMP_PATH}/menu"
fi
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"
@ -1031,15 +1021,6 @@ else
Q) sequentialIOMenu; NEXT="Q" ;;
p) ONLYPATCH="true" && arcPatch; NEXT="p" ;;
D) staticIPMenu; NEXT="D" ;;
R) [ "${AUTOMATED}" == "false" ] && AUTOMATED='true' || AUTOMATED='false'
writeConfigKey "automated" "${AUTOMATED}" "${USER_CONFIG_FILE}"
if [ "${AUTOMATED}" == "true" ]; then
[ ! -f "${PART3_PATH}/automated" ] && echo "${ARC_VERSION}-${MODEL}-${PRODUCTVER}-custom" >"${PART3_PATH}/automated"
elif [ "${AUTOMATED}" == "false" ]; then
[ -f "${PART3_PATH}/automated" ] && rm -f "${PART3_PATH}/automated" >/dev/null
fi
NEXT="R"
;;
# Boot Section
6) [ "${BOOTOPTS}" == "true" ] && BOOTOPTS='false' || BOOTOPTS='true'
BOOTOPTS="${BOOTOPTS}"

View File

@ -82,6 +82,7 @@ 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
# Check for compatibility
compatboot

View File

@ -81,10 +81,9 @@ set color_normal=white/black
set ARC_CMDLINE="earlyprintk earlycon=ttyS0,115200 console=ttyS0,115200 root=/dev/ram rootwait pcie_aspm=off net.ifnames=0 ipv6.disable=1"
search --set=root --label "ARC1"
if [ -s /.build ]; then
search --set=root --label "ARC3"
if [ -s /automated ]; then
menuentry 'Arc Automated Config Mode' --id automated {
search --set=root --label "ARC3"
set_gfxpayload
echo "Loading Arc Kernel..."
linux /bzImage-arc ${ARC_CMDLINE} ${arc_cmdline} automated_arc
@ -94,7 +93,6 @@ if [ -s /.build ]; then
}
fi
search --set=root --label "ARC3"
if [ -s /zImage-dsm -a -s /initrd-dsm ]; then
if [ "${default}" = "direct" ]; then
set timeout="1"
@ -118,17 +116,6 @@ if [ -s /zImage-dsm -a -s /initrd-dsm ]; then
}
fi
if [ -s /automated ]; then
menuentry 'Arc Automated Config 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..."