From b6245d0b62c928a149c7fc827d2f0e0a44447b0f Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Sat, 23 Dec 2023 19:16:42 +0100 Subject: [PATCH] ramdisk: enable usb install Signed-off-by: AuxXxilium --- files/initrd/opt/arc/ramdisk-patch.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/files/initrd/opt/arc/ramdisk-patch.sh b/files/initrd/opt/arc/ramdisk-patch.sh index 565dade..545829e 100755 --- a/files/initrd/opt/arc/ramdisk-patch.sh +++ b/files/initrd/opt/arc/ramdisk-patch.sh @@ -190,10 +190,20 @@ done # SA6400 patches if [ "${PLATFORM}" = "epyc7002" ]; then + echo -e "Apply Epyc7002 Fixes" sed -i 's#/dev/console#/var/log/lrc#g' ${RAMDISK_PATH}/usr/bin/busybox sed -i '/^echo "START/a \\nmknod -m 0666 /dev/console c 1 3' ${RAMDISK_PATH}/linuxrc.syno sed -i 's/WithInternal=0/WithInternal=1/' ${RAMDISK_PATH}/linuxrc.syno.impl - echo -e "Apply Epyc7002 Fixes" +fi + +# USB install +USBINSTALL="$(readConfigKey "arc.usbinstall" "${USER_CONFIG_FILE}")" +USBDEVICE="$(readConfigKey "arc.usbdevice" "${USER_CONFIG_FILE}")" +if [ "${USBINSTALL}" = "true" ]; then + echo -e "Apply USBInstall Fixes" + sed -i 's/WithInternal=0/WithInternal=1/' ${RAMDISK_PATH}/linuxrc.syno.impl + sed -i 's/buildin_storage_node="/dev/sda"/buildin_storage_node="${USBDEVICE}"/' ${RAMDISK_PATH}/usr/syno/web/webman/get_state.cgi + _set_conf_kv "SupportBuildinStorage" "true" "${RAMDISK_PATH}/etc/synoinfo.conf" >"${LOG_FILE}" 2>&1 || dieLog fi # Reassembly ramdisk