|
|
|
|
@@ -58,17 +58,19 @@ MACSYS="$(readConfigKey "arc.macsys" "${USER_CONFIG_FILE}")"
|
|
|
|
|
ODP="$(readConfigKey "arc.odp" "${USER_CONFIG_FILE}")"
|
|
|
|
|
HDDSORT="$(readConfigKey "arc.hddsort" "${USER_CONFIG_FILE}")"
|
|
|
|
|
USBMOUNT="$(readConfigKey "arc.usbmount" "${USER_CONFIG_FILE}")"
|
|
|
|
|
STATICIP="$(readConfigKey "arc.staticip" "${USER_CONFIG_FILE}")"
|
|
|
|
|
ARCIPV6="$(readConfigKey "arc.ipv6" "${USER_CONFIG_FILE}")"
|
|
|
|
|
EMMCBOOT="$(readConfigKey "arc.emmcboot" "${USER_CONFIG_FILE}")"
|
|
|
|
|
OFFLINE="$(readConfigKey "arc.offline" "${USER_CONFIG_FILE}")"
|
|
|
|
|
|
|
|
|
|
# Update Check
|
|
|
|
|
NEWTAG="$(curl --insecure -s https://api.github.com/repos/AuxXxilium/arc/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}')"
|
|
|
|
|
if [ "${OFFLINE}" = "false" ]; then
|
|
|
|
|
# Update Check
|
|
|
|
|
NEWTAG="$(curl --insecure -s https://api.github.com/repos/AuxXxilium/arc/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}')"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
|
# Mounts backtitle dynamically
|
|
|
|
|
function backtitle() {
|
|
|
|
|
if [ ! "${NEWTAG}" = "${ARC_VERSION}" ]; then
|
|
|
|
|
if [ ! "${NEWTAG}" = "${ARC_VERSION}" ] && [ "${OFFLINE}" = "false" ]; then
|
|
|
|
|
ARC_TITLE="${ARC_TITLE} -> Update: ${NEWTAG}"
|
|
|
|
|
fi
|
|
|
|
|
if [ ! -n "${MODEL}" ]; then
|
|
|
|
|
@@ -396,6 +398,7 @@ function make() {
|
|
|
|
|
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
|
|
|
|
|
KVER="$(readModelKey "${MODEL}" "productvers.[${PRODUCTVER}].kver")"
|
|
|
|
|
USBMOUNT="$(readConfigKey "arc.usbmount" "${USER_CONFIG_FILE}")"
|
|
|
|
|
EMMCBOOT="$(readConfigKey "arc.emmcboot" "${USER_CONFIG_FILE}")"
|
|
|
|
|
if [ "${PLATFORM}" = "epyc7002" ]; then
|
|
|
|
|
KVER="${PRODUCTVER}-${KVER}"
|
|
|
|
|
fi
|
|
|
|
|
@@ -428,9 +431,12 @@ function make() {
|
|
|
|
|
fi
|
|
|
|
|
done < <(readConfigMap "addons" "${USER_CONFIG_FILE}")
|
|
|
|
|
# Check for eMMC Boot
|
|
|
|
|
if [[ ! "${LOADER_DISK}" = /dev/mmcblk* ]]; then
|
|
|
|
|
if [ "${EMMCBOOT}" = "false" ]; then
|
|
|
|
|
deleteConfigKey "modules.mmc_block" "${USER_CONFIG_FILE}"
|
|
|
|
|
deleteConfigKey "modules.mmc_core" "${USER_CONFIG_FILE}"
|
|
|
|
|
else
|
|
|
|
|
writeConfigKey "modules.mmc_block" "" "${USER_CONFIG_FILE}"
|
|
|
|
|
writeConfigKey "modules.mmc_core" "" "${USER_CONFIG_FILE}"
|
|
|
|
|
fi
|
|
|
|
|
# Check for offline Mode
|
|
|
|
|
if [ "${OFFLINE}" = "true" ]; then
|
|
|
|
|
@@ -2006,7 +2012,7 @@ function sysinfo() {
|
|
|
|
|
TEXT+="\n Modules loaded: \Zb${MODULESINFO}\Zn"
|
|
|
|
|
TEXT+="\n\Z4>> Settings\Zn"
|
|
|
|
|
TEXT+="\n MacSys: \Zb${MACSYS}\Zn"
|
|
|
|
|
TEXT+="\n StaticIP | IPv6: \Zb${STATICIP} | ${ARCIPV6}\Zn"
|
|
|
|
|
TEXT+="\n IPv6: \Zb${ARCIPV6}\Zn"
|
|
|
|
|
TEXT+="\n Offline Mode: \Zb${OFFLINE}\Zn"
|
|
|
|
|
TEXT+="\n Sort Drives: \Zb${HDDSORT}\Zn"
|
|
|
|
|
if [[ "${REMAP}" = "acports" || "${REMAP}" = "maxports" ]]; then
|
|
|
|
|
@@ -2226,7 +2232,7 @@ function fullsysinfo() {
|
|
|
|
|
TEXT+="\n"
|
|
|
|
|
TEXT+="\nSettings"
|
|
|
|
|
TEXT+="\nMacSys: ${MACSYS}"
|
|
|
|
|
TEXT+="\nStaticIP | IPv6: ${STATICIP} | ${ARCIPV6}"
|
|
|
|
|
TEXT+="\nIPv6: ${ARCIPV6}"
|
|
|
|
|
TEXT+="\nOffline Mode: ${OFFLINE}"
|
|
|
|
|
TEXT+="\nSort Drives: ${HDDSORT}"
|
|
|
|
|
if [[ "${REMAP}" = "acports" || "${REMAP}" = "maxports" ]]; then
|
|
|
|
|
@@ -2419,22 +2425,18 @@ function credits() {
|
|
|
|
|
function staticIPMenu() {
|
|
|
|
|
# Get Amount of NIC
|
|
|
|
|
ETHX=$(ls /sys/class/net/ | grep -v lo) || true
|
|
|
|
|
writeConfigKey "arc.staticip" "false" "${USER_CONFIG_FILE}"
|
|
|
|
|
if findAndMountDSMRoot; then
|
|
|
|
|
for ETH in ${ETHX}; do
|
|
|
|
|
[ -f "${DSMROOT_PATH}/etc/sysconfig/network-scripts/ifcfg-${ETH}" ] && cp -f "${DSMROOT_PATH}/etc/sysconfig/network-scripts/ifcfg-${ETH}" "${TMP_PATH}/ifcfg-${ETH}"
|
|
|
|
|
[ ! -f "${DSMROOT_PATH}/etc/sysconfig/network-scripts/ifcfg-${ETH}" ] && continue
|
|
|
|
|
done
|
|
|
|
|
for ETH in ${ETHX}; do
|
|
|
|
|
BOOTPROTO=$(cat "${TMP_PATH}/ifcfg-${ETH}" | grep BOOTPROTO | awk -F'=' '{print $2}')
|
|
|
|
|
BOOTPROTO=$(cat "${DSMROOT_PATH}/etc/sysconfig/network-scripts/ifcfg-${ETH}" | grep BOOTPROTO | awk -F'=' '{print $2}')
|
|
|
|
|
DRIVER=$(ls -ld /sys/class/net/${ETH}/device/driver 2>/dev/null | awk -F '/' '{print $NF}')
|
|
|
|
|
TEXT=""
|
|
|
|
|
TEXT+="This feature will allow you to set a static IP for your NIC.\n"
|
|
|
|
|
TEXT+="Actual Settings are:\n"
|
|
|
|
|
TEXT+="\nNIC: ${ETH}\n"
|
|
|
|
|
TEXT+="\nNIC: ${ETH} (${DRIVER})\n"
|
|
|
|
|
TEXT+="Mode: ${BOOTPROTO}\n"
|
|
|
|
|
if [ "${BOOTPROTO}" = "static" ]; then
|
|
|
|
|
IPADDR="$(cat "${TMP_PATH}/ifcfg-${ETH}" | grep IPADDR | awk -F'=' '{print $2}')"
|
|
|
|
|
NETMASK="$(cat "${TMP_PATH}/ifcfg-${ETH}" | grep NETMASK | awk -F'=' '{print $2}')"
|
|
|
|
|
IPADDR="$(cat "${DSMROOT_PATH}/etc/sysconfig/network-scripts/ifcfg-${ETH}" | grep IPADDR | awk -F'=' '{print $2}')"
|
|
|
|
|
NETMASK="$(cat "${DSMROOT_PATH}/etc/sysconfig/network-scripts/ifcfg-${ETH}" | grep NETMASK | awk -F'=' '{print $2}')"
|
|
|
|
|
TEXT+="IP: ${IPADDR}\n"
|
|
|
|
|
TEXT+="NETMASK: ${NETMASK}\n"
|
|
|
|
|
else
|
|
|
|
|
@@ -2443,10 +2445,10 @@ function staticIPMenu() {
|
|
|
|
|
fi
|
|
|
|
|
TEXT+=""
|
|
|
|
|
TEXT+="Do you want to change Config?"
|
|
|
|
|
dialog --backtitle "$(backtitle)" --title "DHCP/Static IP" \
|
|
|
|
|
dialog --backtitle "$(backtitle)" --title "DHCP/StaticIP" \
|
|
|
|
|
--yesno "${TEXT}" 0 0
|
|
|
|
|
[ $? -ne 0 ] && continue
|
|
|
|
|
dialog --clear --backtitle "$(backtitle)" --title "DHCP/Static IP" \
|
|
|
|
|
dialog --clear --backtitle "$(backtitle)" --title "DHCP/StaticIP" \
|
|
|
|
|
--menu "DHCP or STATIC?" 0 0 0 \
|
|
|
|
|
1 "DHCP" \
|
|
|
|
|
2 "STATIC" \
|
|
|
|
|
@@ -2454,28 +2456,29 @@ function staticIPMenu() {
|
|
|
|
|
opts="$(<"${TMP_PATH}/opts")"
|
|
|
|
|
[ -z "${opts}" ] && continue
|
|
|
|
|
if [ ${opts} -eq 1 ]; then
|
|
|
|
|
echo -e "DEVICE=${ETH}\nBOOTPROTO=dhcp\nONBOOT=yes\nIPV6INIT=off" >"${TMP_PATH}/ifcfg-${ETH}"
|
|
|
|
|
writeConfigKey "static.${ETH}" "false" "${USER_CONFIG_FILE}"
|
|
|
|
|
elif [ ${opts} -eq 2 ]; then
|
|
|
|
|
dialog --backtitle "$(backtitle)" --title "DHCP/Static IP" \
|
|
|
|
|
dialog --backtitle "$(backtitle)" --title "DHCP/StaticIP" \
|
|
|
|
|
--inputbox "Type a Static IP\nEq: 192.168.0.1" 0 0 "${IPADDR}" \
|
|
|
|
|
2>"${TMP_PATH}/resp"
|
|
|
|
|
[ $? -ne 0 ] && continue
|
|
|
|
|
IPADDR="$(<"${TMP_PATH}/resp")"
|
|
|
|
|
dialog --backtitle "$(backtitle)" --title "DHCP/Static IP" \
|
|
|
|
|
dialog --backtitle "$(backtitle)" --title "DHCP/StaticIP" \
|
|
|
|
|
--inputbox "Type a Netmask\nEq: 255.255.255.0" 0 0 "${NETMASK}" \
|
|
|
|
|
2>"${TMP_PATH}/resp"
|
|
|
|
|
[ $? -ne 0 ] && continue
|
|
|
|
|
NETMASK="$(<"${TMP_PATH}/resp")"
|
|
|
|
|
writeConfigKey "static.${ETH}" "true" "${USER_CONFIG_FILE}"
|
|
|
|
|
writeConfigKey "ip.${ETH}" "${IPADDR}" "${USER_CONFIG_FILE}"
|
|
|
|
|
writeConfigKey "netmask.${ETH}" "${NETMASK}" "${USER_CONFIG_FILE}"
|
|
|
|
|
echo -e "DEVICE=${ETH}\nBOOTPROTO=static\nONBOOT=yes\nIPV6INIT=off\nIPADDR=${IPADDR}\nNETMASK=${NETMASK}" >"${TMP_PATH}/ifcfg-${ETH}"
|
|
|
|
|
writeConfigKey "static.${ETH}" "true" "${USER_CONFIG_FILE}"
|
|
|
|
|
NETMASK=$(convert_netmask "${NETMASK}")
|
|
|
|
|
ip addr add ${IPADDR}/${NETMASK} dev ${ETH}
|
|
|
|
|
fi
|
|
|
|
|
[ -f "${TMP_PATH}/ifcfg-${ETH}" ] && cp -f "${TMP_PATH}/ifcfg-${ETH}" "${DSMROOT_PATH}/etc/sysconfig/network-scripts/ifcfg-${ETH}"
|
|
|
|
|
done
|
|
|
|
|
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
|
|
|
|
|
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
|
|
|
|
|
dialog --backtitle "$(backtitle)" --title "DHCP/StaticIP" \
|
|
|
|
|
--msgbox "Settings written to Config.\nWill be applied to DSM while Build." 5 40
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -2668,11 +2671,10 @@ function resetLoader() {
|
|
|
|
|
initConfigKey "arc.paturl" "" "${USER_CONFIG_FILE}"
|
|
|
|
|
initConfigKey "arc.pathash" "" "${USER_CONFIG_FILE}"
|
|
|
|
|
initConfigKey "arc.sn" "" "${USER_CONFIG_FILE}"
|
|
|
|
|
initConfigKey "arc.staticip" "false" "${USER_CONFIG_FILE}"
|
|
|
|
|
initConfigKey "arc.ipv6" "false" "${USER_CONFIG_FILE}"
|
|
|
|
|
initConfigKey "arc.emmcboot" "false" "${USER_CONFIG_FILE}"
|
|
|
|
|
initConfigKey "arc.offline" "false" "${USER_CONFIG_FILE}"
|
|
|
|
|
initConfigKey "arc.directboot" "false" "${USER_CONFIG_FILE}"
|
|
|
|
|
initConfigKey "arc.remap" "" "${USER_CONFIG_FILE}"
|
|
|
|
|
initConfigKey "arc.usbmount" "false" "${USER_CONFIG_FILE}"
|
|
|
|
|
initConfigKey "arc.patch" "false" "${USER_CONFIG_FILE}"
|
|
|
|
|
initConfigKey "arc.pathash" "" "${USER_CONFIG_FILE}"
|
|
|
|
|
@@ -2687,16 +2689,9 @@ function resetLoader() {
|
|
|
|
|
initConfigKey "ip" "{}" "${USER_CONFIG_FILE}"
|
|
|
|
|
initConfigKey "netmask" "{}" "${USER_CONFIG_FILE}"
|
|
|
|
|
initConfigKey "mac" "{}" "${USER_CONFIG_FILE}"
|
|
|
|
|
deleteConfigKey "cmdline.SataPortMap" "${USER_CONFIG_FILE}"
|
|
|
|
|
deleteConfigKey "cmdline.DiskIdxMap" "${USER_CONFIG_FILE}"
|
|
|
|
|
deleteConfigKey "cmdline.sata_remap" "${USER_CONFIG_FILE}"
|
|
|
|
|
initConfigKey "static" "{}" "${USER_CONFIG_FILE}"
|
|
|
|
|
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
|
|
|
|
|
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
|
|
|
|
|
LKM="$(readConfigKey "lkm" "${USER_CONFIG_FILE}")"
|
|
|
|
|
if [ -n "${MODEL}" ]; then
|
|
|
|
|
PLATFORM="$(readModelKey "${MODEL}" "platform")"
|
|
|
|
|
DT="$(readModelKey "${MODEL}" "dt")"
|
|
|
|
|
fi
|
|
|
|
|
CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")"
|
|
|
|
|
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
|
|
|
|
|
dialog --backtitle "$(backtitle)" --title "Reset Loader" --aspect 18 \
|
|
|
|
|
@@ -2835,6 +2830,7 @@ while true; do
|
|
|
|
|
echo "o \"Switch MacSys: \Z4${MACSYS}\Zn \" " >>"${TMP_PATH}/menu"
|
|
|
|
|
echo "u \"Switch LKM version: \Z4${LKM}\Zn \" " >>"${TMP_PATH}/menu"
|
|
|
|
|
echo "c \"Use IPv6: \Z4${ARCIPV6}\Zn \" " >>"${TMP_PATH}/menu"
|
|
|
|
|
echo "c \"Enable eMMC Boot: \Z4${EMMCBOOT}\Zn \" " >>"${TMP_PATH}/menu"
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
if [ "${DEVOPTS}" = "true" ]; then
|
|
|
|
|
@@ -2905,6 +2901,26 @@ while true; do
|
|
|
|
|
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
|
|
|
|
|
NEXT="c"
|
|
|
|
|
;;
|
|
|
|
|
E) [ "${EMMCBOOT}" = "true" ] && EMMCBOOT='false' || EMMCBOOT='true'
|
|
|
|
|
if [ "${EMMCBOOT}" = "false" ]; then
|
|
|
|
|
writeConfigKey "arc.emmcboot" "false" "${USER_CONFIG_FILE}"
|
|
|
|
|
deleteConfigKey "cmdline.root" "${USER_CONFIG_FILE}"
|
|
|
|
|
deleteConfigKey "synoinfo.disk_swap" "${USER_CONFIG_FILE}"
|
|
|
|
|
deleteConfigKey "synoinfo.supportraid" "${USER_CONFIG_FILE}"
|
|
|
|
|
deleteConfigKey "synoinfo.support_emmc_boot" "${USER_CONFIG_FILE}"
|
|
|
|
|
deleteConfigKey "synoinfo.support_install_only_dev" "${USER_CONFIG_FILE}"
|
|
|
|
|
elif [ "${EMMCBOOT}" = "true" ]; then
|
|
|
|
|
writeConfigKey "arc.emmcboot" "true" "${USER_CONFIG_FILE}"
|
|
|
|
|
writeConfigKey "cmdline.root" "/dev/mmcblk0p1" "${USER_CONFIG_FILE}"
|
|
|
|
|
writeConfigKey "synoinfo.disk_swap" "no" "${USER_CONFIG_FILE}"
|
|
|
|
|
writeConfigKey "synoinfo.supportraid" "no" "${USER_CONFIG_FILE}"
|
|
|
|
|
writeConfigKey "synoinfo.support_emmc_boot" "yes" "${USER_CONFIG_FILE}"
|
|
|
|
|
writeConfigKey "synoinfo.support_install_only_dev" "yes" "${USER_CONFIG_FILE}"
|
|
|
|
|
fi
|
|
|
|
|
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
|
|
|
|
|
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
|
|
|
|
|
NEXT="E"
|
|
|
|
|
;;
|
|
|
|
|
# Advanced Section
|
|
|
|
|
5) [ "${ADVOPTS}" = "true" ] && ADVOPTS='false' || ADVOPTS='true'
|
|
|
|
|
ADVOPTS="${ADVOPTS}"
|
|
|
|
|
|