From 93c039b7c2607189997b316409a584431f1946c1 Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Thu, 19 Sep 2024 21:09:25 +0200 Subject: [PATCH] tree: readd something old Signed-off-by: AuxXxilium --- files/initrd/opt/arc/arc-functions.sh | 3 +++ files/initrd/opt/arc/arc.sh | 11 +++++++++++ files/initrd/opt/arc/init.sh | 1 + files/initrd/opt/arc/ramdisk-patch.sh | 3 ++- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/files/initrd/opt/arc/arc-functions.sh b/files/initrd/opt/arc/arc-functions.sh index 442e3573..336503e5 100755 --- a/files/initrd/opt/arc/arc-functions.sh +++ b/files/initrd/opt/arc/arc-functions.sh @@ -1152,6 +1152,7 @@ function sysinfo() { OFFLINE="$(readConfigKey "arc.offline" "${USER_CONFIG_FILE}")" CONFIGVER="$(readConfigKey "arc.version" "${USER_CONFIG_FILE}")" HDDSORT="$(readConfigKey "hddsort" "${USER_CONFIG_FILE}")" + USBMOUNT="$(readConfigKey "usbmount" "${USER_CONFIG_FILE}")" EXTERNALCONTROLLER="$(readConfigKey "device.externalcontroller" "${USER_CONFIG_FILE}")" HARDDRIVES="$(readConfigKey "device.harddrives" "${USER_CONFIG_FILE}")" DRIVES="$(readConfigKey "device.drives" "${USER_CONFIG_FILE}")" @@ -1260,6 +1261,8 @@ function sysinfo() { fi if [ "${DT}" == "true" ]; then TEXT+="\n Hotplug: \Zb${HDDSORT}\Zn" + else + TEXT+="\n USB Mount: \Zb${USBMOUNT}\Zn" fi TEXT+="\n" # Check for Controller // 104=RAID // 106=SATA // 107=SAS // 100=SCSI // c03=USB diff --git a/files/initrd/opt/arc/arc.sh b/files/initrd/opt/arc/arc.sh index c53a147e..6b62fa5f 100755 --- a/files/initrd/opt/arc/arc.sh +++ b/files/initrd/opt/arc/arc.sh @@ -41,6 +41,7 @@ BOOTIPWAIT="$(readConfigKey "bootipwait" "${USER_CONFIG_FILE}")" DIRECTBOOT="$(readConfigKey "directboot" "${USER_CONFIG_FILE}")" EMMCBOOT="$(readConfigKey "emmcboot" "${USER_CONFIG_FILE}")" HDDSORT="$(readConfigKey "hddsort" "${USER_CONFIG_FILE}")" +USBMOUNT="$(readConfigKey "usbmount" "${USER_CONFIG_FILE}")" KERNEL="$(readConfigKey "kernel" "${USER_CONFIG_FILE}")" KERNELLOAD="$(readConfigKey "kernelload" "${USER_CONFIG_FILE}")" KERNELPANIC="$(readConfigKey "kernelpanic" "${USER_CONFIG_FILE}")" @@ -975,6 +976,8 @@ else fi if [ "${DT}" == "true" ]; then echo "H \"Hotplug/SortDrives: \Z4${HDDSORT}\Zn \" " >>"${TMP_PATH}/menu" + else + echo "h \"USB Mount: \Z4${USBMOUNT}\Zn \" " >>"${TMP_PATH}/menu" fi echo "O \"Official Driver Priority: \Z4${ODP}\Zn \" " >>"${TMP_PATH}/menu" echo "T \"Force enable SSH in DSM \" " >>"${TMP_PATH}/menu" @@ -1101,6 +1104,14 @@ else BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")" NEXT="H" ;; + h) [ "${USBMOUNT}" == "true" ] && USBMOUNT='false' || USBMOUNT='auto' + [ "${USBMOUNT}" == "false" ] && USBMOUNT='auto' || USBMOUNT='true' + [ "${USBMOUNT}" == "auto" ] && USBMOUNT='true' || USBMOUNT='false' + writeConfigKey "usbmount" "${USBMOUNT}" "${USER_CONFIG_FILE}" + writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}" + BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")" + NEXT="h" + ;; O) [ "${ODP}" == "false" ] && ODP='true' || ODP='false' writeConfigKey "odp" "${ODP}" "${USER_CONFIG_FILE}" writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}" diff --git a/files/initrd/opt/arc/init.sh b/files/initrd/opt/arc/init.sh index d7a0c97c..da14a83f 100755 --- a/files/initrd/opt/arc/init.sh +++ b/files/initrd/opt/arc/init.sh @@ -78,6 +78,7 @@ initConfigKey "rd-compressed" "false" "${USER_CONFIG_FILE}" initConfigKey "satadom" "2" "${USER_CONFIG_FILE}" initConfigKey "synoinfo" "{}" "${USER_CONFIG_FILE}" initConfigKey "time" "{}" "${USER_CONFIG_FILE}" +initConfigKey "usbmount" "auto" "${USER_CONFIG_FILE}" initConfigKey "zimage-hash" "" "${USER_CONFIG_FILE}" if grep -q "automated_arc" /proc/cmdline; then writeConfigKey "automated" "true" "${USER_CONFIG_FILE}" diff --git a/files/initrd/opt/arc/ramdisk-patch.sh b/files/initrd/opt/arc/ramdisk-patch.sh index 0e9b591e..e734692a 100755 --- a/files/initrd/opt/arc/ramdisk-patch.sh +++ b/files/initrd/opt/arc/ramdisk-patch.sh @@ -170,7 +170,8 @@ for ADDON in "redpill" "revert" "misc" "eudev" "disks" "localrss" "notify" "wol" PARAMS="" if [ "${ADDON}" == "disks" ]; then HDDSORT="$(readConfigKey "hddsort" "${USER_CONFIG_FILE}")" - PARAMS=${HDDSORT} + USBMOUNT="$(readConfigKey "usbmount" "${USER_CONFIG_FILE}")" + PARAMS="${HDDSORT} ${USBMOUNT}" [ -f "${USER_UP_PATH}/${MODEL}.dts" ] && cp -f "${USER_UP_PATH}/${MODEL}.dts" "${RAMDISK_PATH}/addons/model.dts" fi installAddon "${ADDON}" "${PLATFORM}" || exit 1