diff --git a/files/initrd/opt/arc/arc-functions.sh b/files/initrd/opt/arc/arc-functions.sh index 897de6fe..7107c27f 100755 --- a/files/initrd/opt/arc/arc-functions.sh +++ b/files/initrd/opt/arc/arc-functions.sh @@ -639,7 +639,7 @@ function juniorboot() { function bootcheck() { BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")" MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")" - if [ "${ARC_MODE}" != "automated" ] && [ "${BUILDDONE}" = "false" ]; then + if [ "${ARC_MODE}" != "automated" ] && ([ "${BUILDDONE}" = "false" ] || [ ! -f "${MOD_ZIMAGE_FILE}" ] || [ ! -f "${MOD_RDGZ_FILE}" ]); then dialog --backtitle "$(backtitle)" --title "Alert" \ --yesno "Config changed, you need to rebuild the Loader?" 0 0 if [ $? -eq 0 ]; then diff --git a/files/initrd/opt/arc/include/functions.sh b/files/initrd/opt/arc/include/functions.sh index 57e60099..1bd3bb85 100755 --- a/files/initrd/opt/arc/include/functions.sh +++ b/files/initrd/opt/arc/include/functions.sh @@ -256,8 +256,8 @@ function findDSMRoot() { # 1 - Netmask function convert_netmask() { bits=0 - for octet in $(echo $1| sed 's/\./ /g'); do - binbits=$(echo "obase=2; ibase=10; ${octet}"| bc | sed 's/0//g') + for octet in $(echo $1| sed 's/\./ /g'); do + binbits=$(echo "obase=2; ibase=10; ${octet}"| bc | sed 's/0//g') bits=$((${bits} + ${#binbits})) done echo "${bits}" @@ -335,7 +335,7 @@ function checkBIOS_VT_d() { # Rebooting function rebootTo() { BUILDDONE="$(readConfigKey "builddone" "${USER_CONFIG_FILE}")" - if [ "${CONFDONE}" = "true" ]; then + if [ "${CONFDONE}" = "true" ] && ([ "${1}" = "automated" ] || [ "${1}" = "junior" ] || [ "${1}" = "dsm" ]); then if [ "${BUILDDONE}" != "true" ] || [ ! -f "${MOD_ZIMAGE_FILE}" ] || [ ! -f "${MOD_RDGZ_FILE}" ]; then dialog --backtitle "$(backtitle)" --title "Reboot" \ --aspect 18 --yesno "Build is not complete!\nDSM will not boot.\nDo you want to continue?" 0 0 @@ -344,7 +344,7 @@ function rebootTo() { fi fi fi - local MODES="config recovery junior automated update uefi memtest" + local MODES="config recovery junior automated update uefi memtest dsm" [ -z "${1}" ] && exit 1 if ! echo "${MODES}" | grep -wq "${1}"; then exit 1; fi [ "${1}" = "automated" ] && echo "arc-${MODEL}-${PRODUCTVER}-${ARC_VERSION}" >"${PART3_PATH}/automated" @@ -625,7 +625,7 @@ function readData() { function write_menu() { echo "${1} \"${2}\" " >>"${TMP_PATH}/menu" } - + function write_menu_value() { echo "${1} \"${2}: \Z4${3:-none}\Zn\" " >>"${TMP_PATH}/menu" } @@ -785,4 +785,4 @@ function customKernel() { mergeConfigModules "$(getAllModules "${PLATFORM}" "${KPRE:+${KPRE}-}${KVER}" | awk '{print $1}')" "${USER_CONFIG_FILE}" fi done -} \ No newline at end of file +} diff --git a/files/p1/boot/grub/grub.cfg b/files/p1/boot/grub/grub.cfg index 6ed4194e..600f0796 100644 --- a/files/p1/boot/grub/grub.cfg +++ b/files/p1/boot/grub/grub.cfg @@ -116,7 +116,7 @@ if [ -s /zImage-dsm -a -s /initrd-dsm ]; then echo "Try http://find.synology.com/ to connect the DSM via web." } fi - menuentry 'Arc DSM Mode' --id boot { + menuentry 'Arc DSM Mode' --id dsm { gfxmode echo "Loading Arc (${system_version}) Kernel..." linux /bzImage-${system_version} ${ARC_CMDLINE} dsm_arc @@ -183,7 +183,7 @@ fi if [ -e ${prefix}/memtest ]; then menuentry 'System Memtest86+' --id memtest { echo "Loading memtest86+..." - linux ${prefix}/memtest + linux ${prefix}/memtest } fi @@ -229,4 +229,4 @@ else save_env linux_gfx_mode configfile ${prefix}/grub.cfg } -fi \ No newline at end of file +fi