arc-a: sync to arc

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-03-02 21:06:51 +01:00
parent 8258423996
commit 676d76103b
12 changed files with 3015 additions and 290 deletions

File diff suppressed because it is too large Load Diff

View File

@ -95,22 +95,32 @@ declare -A CMDLINE
if grep -q "force_junior" /proc/cmdline; then
CMDLINE['force_junior']=""
fi
[ ${EFI} -eq 1 ] && CMDLINE['withefi']="" || CMDLINE['noefi']=""
if grep -q "recovery" /proc/cmdline; then
CMDLINE['force_junior']=""
CMDLINE['recovery']=""
fi
if [ ${EFI} -eq 1 ]; then
CMDLINE['withefi']=""
else
CMDLINE['noefi']=""
fi
if [ ! "${BUS}" = "usb" ]; then
LOADER_DEVICE_NAME=$(echo ${LOADER_DISK} | sed 's|/dev/||')
SIZE=$(($(cat /sys/block/${LOADER_DISK/\/dev\//}/size) / 2048 + 10))
# Read SATADoM type
DOM="$(readModelKey "${MODEL}" "dom")"
CMDLINE['synoboot_satadom']="${DOM}"
CMDLINE['dom_szmax']="${SIZE}"
fi
CMDLINE['syno_hw_version']="${MODEL}"
MODELID="$(readModelKey ${MODEL} "id")"
CMDLINE['syno_hw_version']="${MODELID:-${MODEL}}"
[ -z "${VID}" ] && VID="0x46f4" # Sanity check
[ -z "${PID}" ] && PID="0x0001" # Sanity check
CMDLINE['vid']="${VID}"
CMDLINE['pid']="${PID}"
CMDLINE['panic']="${KERNELPANIC:-0}"
CMDLINE['panic']="${KERNELPANIC:-5}"
CMDLINE['console']="ttyS0,115200n8"
CMDLINE['no_console_suspend']="1"
CMDLINE['consoleblank']="0"
CMDLINE['earlyprintk']=""
CMDLINE['earlycon']="uart8250,io,0x3f8,115200n8"
if [ "${EMMCBOOT}" = "false" ]; then
@ -120,9 +130,8 @@ elif [ "${EMMCBOOT}" = "true" ]; then
fi
CMDLINE['loglevel']="15"
CMDLINE['log_buf_len']="32M"
CMDLINE['sn']="${SN}"
CMDLINE['net.ifnames']="0"
CMDLINE['biosdevname']="0"
CMDLINE['sn']="${SN}"
if [ -n "$(ls /dev/mmcblk* 2>/dev/null)" ] && [ ! "${BUS}" = "mmc" ] && [ ! "${EMMCBOOT}" = "true" ]; then
[ ! "${CMDLINE['modprobe.blacklist']}" = "" ] && CMDLINE['modprobe.blacklist']+=","
@ -188,22 +197,11 @@ elif [ "${DIRECTBOOT}" = "false" ]; then
echo -e " \033[1;34mDetected ${N} NIC.\033[0m \033[1;37mWaiting for Connection:\033[0m"
for ETH in ${ETHX}; do
IP=""
STATICIP="$(readConfigKey "static.${ETH}" "${USER_CONFIG_FILE}")"
DRIVER=$(ls -ld /sys/class/net/${ETH}/device/driver 2>/dev/null | awk -F '/' '{print $NF}')
COUNT=0
while true; do
ARCIP="$(readConfigKey "ip.${ETH}" "${USER_CONFIG_FILE}")"
if [[ "${STATICIP}" = "true" && -n "${ARCIP}" ]]; then
NETMASK="$(readConfigKey "netmask.${ETH}" "${USER_CONFIG_FILE}")"
IP="${ARCIP}"
NETMASK=$(convert_netmask "${NETMASK}")
[ ! -n "${NETMASK}" ] && NETMASK="16"
ip addr add ${IP}/${NETMASK} dev ${ETH}
MSG="STATIC"
else
IP="$(getIP ${ETH})"
MSG="DHCP"
fi
IP="$(getIP ${ETH})"
MSG="DHCP"
if [ -n "${IP}" ]; then
SPEED=$(ethtool ${ETH} | grep "Speed:" | awk '{print $2}')
echo -e "\r \033[1;37m${DRIVER} (${SPEED} | ${MSG}):\033[0m Access \033[1;34mhttp://${IP}:5000\033[0m to connect to DSM via web."

View File

@ -45,21 +45,24 @@ function checkAddonExist() {
###############################################################################
# Install Addon into ramdisk image
# 1 - Addon id
# 2 - Platform
# 3 - Kernel Version
# Return ERROR if not installed
function installAddon() {
if [ -z "${1}" ]; then
return 1
fi
ADDON="${1}"
local ADDON="${1}"
mkdir -p "${TMP_PATH}/${ADDON}"
HAS_FILES=0
local HAS_FILES=0
# First check generic files
if [ -f "${ADDONS_PATH}/${ADDON}/all.tgz" ]; then
tar zxf "${ADDONS_PATH}/${ADDON}/all.tgz" -C "${TMP_PATH}/${ADDON}"
tar -zxf "${ADDONS_PATH}/${ADDON}/all.tgz" -C "${TMP_PATH}/${ADDON}"
HAS_FILES=1
fi
# Now check specific platform files
if [ -f "${ADDONS_PATH}/${ADDON}/${PLATFORM}-${KVER}.tgz" ]; then
tar zxf "${ADDONS_PATH}/${ADDON}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/${ADDON}"
if [ -f "${ADDONS_PATH}/${ADDON}/${2}-${3}.tgz" ]; then
tar -zxf "${ADDONS_PATH}/${ADDON}/${2}-${3}.tgz" -C "${TMP_PATH}/${ADDON}"
HAS_FILES=1
fi
# If has files to copy, copy it, else return error
@ -67,7 +70,7 @@ function installAddon() {
cp -f "${TMP_PATH}/${ADDON}/install.sh" "${RAMDISK_PATH}/addons/${ADDON}.sh" 2>"${LOG_FILE}"
chmod +x "${RAMDISK_PATH}/addons/${ADDON}.sh"
[ -d ${TMP_PATH}/${ADDON}/root ] && (cp -rnf "${TMP_PATH}/${ADDON}/root/"* "${RAMDISK_PATH}/" 2>"${LOG_FILE}")
rm -rf "${TMP_PATH}/${ADDON:?}"
rm -rf "${TMP_PATH}/${ADDON}"
return 0
}
@ -82,8 +85,8 @@ function untarAddon() {
fi
rm -rf "${TMP_PATH}/addon"
mkdir -p "${TMP_PATH}/addon"
tar xaf "${1}" -C "${TMP_PATH}/addon" || return
ADDON=$(readConfigKey "name" "${TMP_PATH}/addon/manifest.yml")
tar -xaf "${1}" -C "${TMP_PATH}/addon" || return
local ADDON=$(readConfigKey "name" "${TMP_PATH}/addon/manifest.yml")
[ -z "${ADDON}" ] && return
rm -rf "${ADDONS_PATH}/${ADDON:?}"
mv -f "${TMP_PATH}/addon" "${ADDONS_PATH}/${ADDON}"
@ -94,11 +97,11 @@ function untarAddon() {
# Detect if has new local plugins to install/reinstall
function updateAddons() {
for F in $(ls ${PART3_PATH}/*.addon 2>/dev/null); do
ADDON=$(basename "${F}" | sed 's|.addon||')
local ADDON=$(basename "${F}" | sed 's|.addon||')
rm -rf "${ADDONS_PATH}/${ADDON:?}"
mkdir -p "${ADDONS_PATH}/${ADDON}"
echo "Installing ${F} to ${ADDONS_PATH}/${ADDON}"
tar xaf "${F}" -C "${ADDONS_PATH}/${ADDON}"
tar -xaf "${F}" -C "${ADDONS_PATH}/${ADDON}"
rm -f "${F}"
done
}

View File

@ -30,6 +30,7 @@ MODULES_PATH="${PART3_PATH}/modules"
MODEL_CONFIG_PATH="${PART3_PATH}/configs"
PATCH_PATH="${PART3_PATH}/patches"
LKM_PATH="${PART3_PATH}/lkms"
CUSTOM_PATH="${PART3_PATH}/custom"
USER_UP_PATH="${PART3_PATH}/users"
BACKUPDIR="${PART3_PATH}/backup"
BB_USER_CONFIG_FILE="${BACKUPDIR}/user-config.yml"

View File

@ -3,8 +3,8 @@
# 1 - Platform
# 2 - Kernel Version
function getAllModules() {
PLATFORM=${1}
KVER=${2}
local PLATFORM=${1}
local KVER=${2}
if [[ -z "${PLATFORM}" || -z "${KVER}" ]]; then
echo ""
@ -13,27 +13,76 @@ function getAllModules() {
# Unzip modules for temporary folder
rm -rf "${TMP_PATH}/modules"
mkdir -p "${TMP_PATH}/modules"
tar zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules"
local KERNEL="$(readConfigKey "arc.kernel" "${USER_CONFIG_FILE}")"
if [ "${KERNEL}" = "custom" ]; then
tar -zxf "${CUSTOM_PATH}/modules.tgz" -C "${TMP_PATH}/modules"
else
tar -zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules"
fi
# Get list of all modules
for F in $(ls ${TMP_PATH}/modules/*.ko 2>/dev/null); do
X=$(basename ${F})
M=${X:0:-3}
DESC=$(modinfo ${F} | awk -F':' '/description:/{ print $2}' | awk '{sub(/^[ ]+/,""); print}')
local X=$(basename ${F})
local M=${X:0:-3}
local DESC=$(modinfo ${F} | awk -F':' '/description:/{ print $2}' | awk '{sub(/^[ ]+/,""); print}')
[ -z "${DESC}" ] && DESC="${X}"
echo "${M} \"${DESC}\""
done
rm -rf "${TMP_PATH}/modules"
}
###############################################################################
# Return list of all modules available
# 1 - Platform
# 2 - Kernel Version
# 3 - Module list
function installModules() {
local PLATFORM=${1}
local KVER=${2}
shift 2
local MLIST="${@}"
if [[ -z "${PLATFORM}" || -z "${KVER}" ]]; then
echo ""
return 1
fi
# Unzip modules for temporary folder
rm -rf "${TMP_PATH}/modules"
mkdir -p "${TMP_PATH}/modules"
local KERNEL="$(readConfigKey "arc.kernel" "${USER_CONFIG_FILE}")"
if [ "${KERNEL}" = "custom" ]; then
tar -zxf "${CUSTOM_PATH}/modules-${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules"
else
tar -zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules"
fi
local ODP="$(readConfigKey "arc.odp" "${USER_CONFIG_FILE}")"
for F in $(ls "${TMP_PATH}/modules/"*.ko 2>/dev/null); do
local M=$(basename ${F})
[ "${ODP}" = "true" ] && [ -f "${RAMDISK_PATH}/usr/lib/modules/${M}" ] && continue
if echo "${MLIST}" | grep -wq "${M:0:-3}"; then
cp -f "${F}" "${RAMDISK_PATH}/usr/lib/modules/${M}"
else
rm -f "${RAMDISK_PATH}/usr/lib/modules/${M}"
fi
done
mkdir -p "${RAMDISK_PATH}/usr/lib/firmware"
if [ "${KERNEL}" = "custom" ]; then
tar -zxf "${CUSTOM_PATH}/firmware.tgz" -C "${RAMDISK_PATH}/usr/lib/firmware"
else
tar -zxf "${MODULES_PATH}/firmware.tgz" -C "${RAMDISK_PATH}/usr/lib/firmware"
fi
# Clean
rm -rf "${TMP_PATH}/modules"
}
###############################################################################
# add a ko of modules.tgz
# 1 - Platform
# 2 - Kernel Version
# 3 - ko file
function addToModules() {
PLATFORM=${1}
KVER=${2}
KOFILE=${3}
local PLATFORM=${1}
local KVER=${2}
local KOFILE=${3}
if [[ -z "${PLATFORM}" || -z "${KVER}" || -z "${KOFILE}" ]]; then
echo ""
@ -42,9 +91,9 @@ function addToModules() {
# Unzip modules for temporary folder
rm -rf "${TMP_PATH}/modules"
mkdir -p "${TMP_PATH}/modules"
tar zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules"
tar -zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules"
cp -f ${KOFILE} ${TMP_PATH}/modules
tar zcf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" .
tar -zcf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" .
}
###############################################################################
@ -53,9 +102,9 @@ function addToModules() {
# 2 - Kernel Version
# 3 - ko name
function delToModules() {
PLATFORM=${1}
KVER=${2}
KONAME=${3}
local PLATFORM=${1}
local KVER=${2}
local KONAME=${3}
if [[ -z "${PLATFORM}" || -z "${KVER}" || -z "${KOFILE}" ]]; then
echo ""
@ -64,9 +113,9 @@ function delToModules() {
# Unzip modules for temporary folder
rm -rf "${TMP_PATH}/modules"
mkdir -p "${TMP_PATH}/modules"
tar zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules"
tar -zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules"
rm -f ${TMP_PATH}/modules/${KONAME}
tar zcf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" .
tar -zcf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" .
}
###############################################################################
@ -86,9 +135,9 @@ function getdepends() {
fi
fi
}
PLATFORM=${1}
KVER=${2}
KONAME=${3}
local PLATFORM=${1}
local KVER=${2}
local KONAME=${3}
if [[ -z "${PLATFORM}" || -z "${KVER}" || -z "${KOFILE}" ]]; then
echo ""
@ -97,7 +146,7 @@ function getdepends() {
# Unzip modules for temporary folder
rm -rf "${TMP_PATH}/modules"
mkdir -p "${TMP_PATH}/modules"
tar zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules"
tar -zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules"
DPS=($(_getdepends ${KONAME} | tr ' ' '\n' | sort -u))
echo ${DPS[@]}
rm -rf "${TMP_PATH}/modules"

View File

@ -53,13 +53,21 @@ initConfigKey "arc.kernelload" "power" "${USER_CONFIG_FILE}"
initConfigKey "arc.kernelpanic" "5" "${USER_CONFIG_FILE}"
initConfigKey "arc.macsys" "hardware" "${USER_CONFIG_FILE}"
initConfigKey "arc.odp" "false" "${USER_CONFIG_FILE}"
initConfigKey "arc.modulescopy" "false" "${USER_CONFIG_FILE}"
initConfigKey "arc.hddsort" "false" "${USER_CONFIG_FILE}"
initConfigKey "arc.kernel" "official" "${USER_CONFIG_FILE}"
initConfigKey "arc.version" "${ARC_VERSION}" "${USER_CONFIG_FILE}"
initConfigKey "device" "{}" "${USER_CONFIG_FILE}"
initConfigKey "ip" "{}" "${USER_CONFIG_FILE}"
initConfigKey "netmask" "{}" "${USER_CONFIG_FILE}"
initConfigKey "mac" "{}" "${USER_CONFIG_FILE}"
initConfigKey "static" "{}" "${USER_CONFIG_FILE}"
# KVM Check
if grep -q -E "(vmx|svm)" /proc/cpuinfo; then
writeConfigKey "arc.kvm" "true" "${USER_CONFIG_FILE}"
else
writeConfigKey "arc.kvm" "false" "${USER_CONFIG_FILE}"
fi
# Init Network
ETHX=$(ls /sys/class/net/ | grep -v lo) || true
@ -80,7 +88,6 @@ for ETH in ${ETHX}; do
fi
echo
fi
ethtool -s ${ETH} wol g 2>/dev/null
N=$((${N} + 1))
done
# Write NIC Amount to config
@ -127,7 +134,7 @@ if grep -q "force_arc" /proc/cmdline; then
echo -e "\033[1;34mUser requested edit settings.\033[0m"
elif [ "${BUILDDONE}" = "true" ]; then
echo -e "\033[1;34mLoader is configured!\033[0m"
boot.sh && sleep 2 && exit 0
boot.sh && exit 0
else
echo -e "\033[1;34mUser requested edit settings.\033[0m"
fi
@ -146,7 +153,7 @@ for ETH in ${ETHX}; do
if [[ "${STATICIP}" = "true" && -n "${ARCIP}" ]]; then
NETMASK="$(readConfigKey "netmask.${ETH}" "${USER_CONFIG_FILE}")"
IP="${ARCIP}"
NETMASK=$(convert_netmask "${NETMASK}")
#NETMASK=$(convert_netmask "${NETMASK}")
[ ! -n "${NETMASK}" ] && NETMASK="16"
ip addr add ${IP}/${NETMASK} dev ${ETH}
MSG="STATIC"

View File

@ -31,9 +31,10 @@ SN="$(readConfigKey "arc.sn" "${USER_CONFIG_FILE}")"
LAYOUT="$(readConfigKey "layout" "${USER_CONFIG_FILE}")"
KEYMAP="$(readConfigKey "keymap" "${USER_CONFIG_FILE}")"
PLATFORM="$(readModelKey "${MODEL}" "platform")"
ODP="$(readConfigKey "arc.odp" "${USER_CONFIG_FILE}")"
HDDSORT="$(readConfigKey "arc.hddsort" "${USER_CONFIG_FILE}")"
USBMOUNT="$(readConfigKey "arc.usbmount" "${USER_CONFIG_FILE}")"
KVMSUPPORT="$(readConfigKey "arc.kvm" "${USER_CONFIG_FILE}")"
MODULESCOPY="$(readConfigKey "arc.modulescopy" "${USER_CONFIG_FILE}")"
# Check if DSM Version changed
. "${RAMDISK_PATH}/etc/VERSION"
@ -54,6 +55,8 @@ if [ "${PRODUCTVERDSM}" != "${PRODUCTVER}" ]; then
writeConfigKey "productver" "${USER_CONFIG_FILE}"
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
KVER="$(readModelKey "${MODEL}" "productvers.[${PRODUCTVER}].kver")"
PATURL=""
PATSUM=""
fi
# Sanity check
@ -119,22 +122,7 @@ sed -e "/@@@CONFIG-GENERATED@@@/ {" -e "r ${TMP_PATH}/rp.txt" -e 'd' -e '}' -i "
rm -f "${TMP_PATH}/rp.txt"
# Extract Modules to Ramdisk
rm -rf "${TMP_PATH}/modules"
mkdir -p "${TMP_PATH}/modules"
tar zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules"
for F in $(ls "${TMP_PATH}/modules/"*.ko 2>/dev/null); do
M=$(basename ${F})
[[ "${ODP}" = "true" && -f "${RAMDISK_PATH}/usr/lib/modules/${M}" ]] && continue
if arrayExistItem "${M:0:-3}" "${!MODULES[@]}"; then
cp -f "${F}" "${RAMDISK_PATH}/usr/lib/modules/${M}"
else
rm -f "${RAMDISK_PATH}/usr/lib/modules/${M}"
fi
done
mkdir -p "${RAMDISK_PATH}/usr/lib/firmware"
tar zxf "${MODULES_PATH}/firmware.tgz" -C "${RAMDISK_PATH}/usr/lib/firmware"
# Clean
rm -rf "${TMP_PATH}/modules"
installModules "${PLATFORM}" "${KVER}" "${!MODULES[@]}"
# Copying fake modprobe
cp -f "${PATCH_PATH}/iosched-trampoline.sh" "${RAMDISK_PATH}/usr/sbin/modprobe"
@ -145,7 +133,7 @@ gzip -dc "${LKM_PATH}/rp-${PLATFORM}-${KVER}-${LKM}.ko.gz" >"${RAMDISK_PATH}/usr
mkdir -p "${RAMDISK_PATH}/addons"
echo "#!/bin/sh" >"${RAMDISK_PATH}/addons/addons.sh"
echo 'echo "addons.sh called with params ${@}"' >>"${RAMDISK_PATH}/addons/addons.sh"
echo "export LOADERLABEL=ARC-A" >>"${RAMDISK_PATH}/addons/addons.sh"
echo "export LOADERLABEL=ARC" >>"${RAMDISK_PATH}/addons/addons.sh"
echo "export LOADERVERSION=${ARC_VERSION}" >>"${RAMDISK_PATH}/addons/addons.sh"
echo "export PLATFORM=${PLATFORM}" >>"${RAMDISK_PATH}/addons/addons.sh"
echo "export MODEL=${MODEL}" >>"${RAMDISK_PATH}/addons/addons.sh"
@ -156,30 +144,30 @@ echo "export KEYMAP=${KEYMAP}" >>"${RAMDISK_PATH}/addons/addons.sh"
chmod +x "${RAMDISK_PATH}/addons/addons.sh"
# Required Addons: revert
installAddon revert
installAddon "revert" "${PLATFORM}" "${KVER}"
echo "/addons/revert.sh \${1} " >>"${RAMDISK_PATH}/addons/addons.sh" 2>"${LOG_FILE}" || dieLog
# Install System Addons
installAddon eudev
echo "/addons/eudev.sh \${1} " >>"${RAMDISK_PATH}/addons/addons.sh" 2>"${LOG_FILE}" || dieLog
installAddon disks
echo "/addons/disks.sh \${1} ${HDDSORT} ${USBMOUNT}" >>"${RAMDISK_PATH}/addons/addons.sh" 2>"${LOG_FILE}" || dieLog
installAddon misc
installAddon "eudev" "${PLATFORM}" "${KVER}"
echo "/addons/eudev.sh \${1} ${MODULESCOPY} ${KVMSUPPORT} " >>"${RAMDISK_PATH}/addons/addons.sh" 2>"${LOG_FILE}" || dieLog
installAddon "disks" "${PLATFORM}" "${KVER}"
echo "/addons/disks.sh \${1} ${HDDSORT} ${USBMOUNT} " >>"${RAMDISK_PATH}/addons/addons.sh" 2>"${LOG_FILE}" || dieLog
installAddon "misc" "${PLATFORM}" "${KVER}"
echo "/addons/misc.sh \${1} " >>"${RAMDISK_PATH}/addons/addons.sh" 2>"${LOG_FILE}" || dieLog
installAddon localrss
installAddon "localrss" "${PLATFORM}" "${KVER}"
echo "/addons/localrss.sh \${1} " >>"${RAMDISK_PATH}/addons/addons.sh" 2>"${LOG_FILE}" || dieLog
installAddon wol
installAddon "wol" "${PLATFORM}" "${KVER}"
echo "/addons/wol.sh \${1} " >>"${RAMDISK_PATH}/addons/addons.sh" 2>"${LOG_FILE}" || dieLog
# User Addons check
for ADDON in ${!ADDONS[@]}; do
PARAMS=${ADDONS[${ADDON}]}
if ! installAddon ${ADDON}; then
if ! installAddon "${ADDON}" "${PLATFORM}" "${KVER}"; then
echo -n "${ADDON} is not available for this Platform!" | tee -a "${LOG_FILE}"
echo
exit 1
fi
echo "/addons/${ADDON}.sh \${1} ${PARAMS}" >>"${RAMDISK_PATH}/addons/addons.sh" 2>"${LOG_FILE}" || dieLog
echo "/addons/${ADDON}.sh \${1} ${PARAMS} " >>"${RAMDISK_PATH}/addons/addons.sh" 2>"${LOG_FILE}" || dieLog
done
# Enable Telnet
@ -200,25 +188,13 @@ fi
IPV6="$(readConfigKey "arc.ipv6" "${USER_CONFIG_FILE}")"
ETHX=$(ls /sys/class/net/ | grep -v lo) || true
for ETH in ${ETHX}; do
STATICIP="$(readConfigKey "static.${ETH}" "${USER_CONFIG_FILE}")"
if [ "${STATICIP}" = "true" ]; then
IPADDR="$(readConfigKey "ip.${ETH}" "${USER_CONFIG_FILE}")"
NETMASK="$(readConfigKey "netmask.${ETH}" "${USER_CONFIG_FILE}")"
if [ "${IPV6}" = "true" ]; then
echo -e "DEVICE=${ETH}\nBOOTPROTO=static\nONBOOT=yes\nIPV6INIT=dhcp\nIPV6_ACCEPT_RA=1\nIPADDR=${IPADDR}\nNETMASK=${NETMASK}" >"${RAMDISK_PATH}/etc/sysconfig/network-scripts/ifcfg-${ETH}"
else
echo -e "DEVICE=${ETH}\nBOOTPROTO=static\nONBOOT=yes\nIPV6INIT=no\nIPADDR=${IPADDR}\nNETMASK=${NETMASK}" >"${RAMDISK_PATH}/etc/sysconfig/network-scripts/ifcfg-${ETH}"
fi
if [ "${IPV6}" = "true" ]; then
echo -e "DEVICE=${ETH}\nBOOTPROTO=dhcp\nONBOOT=yes\nIPV6INIT=dhcp\nIPV6_ACCEPT_RA=1" >"${RAMDISK_PATH}/etc/sysconfig/network-scripts/ifcfg-${ETH}"
else
if [ "${IPV6}" = "true" ]; then
echo -e "DEVICE=${ETH}\nBOOTPROTO=dhcp\nONBOOT=yes\nIPV6INIT=dhcp\nIPV6_ACCEPT_RA=1" >"${RAMDISK_PATH}/etc/sysconfig/network-scripts/ifcfg-${ETH}"
else
echo -e "DEVICE=${ETH}\nBOOTPROTO=dhcp\nONBOOT=yes\nIPV6INIT=no" >"${RAMDISK_PATH}/etc/sysconfig/network-scripts/ifcfg-${ETH}"
fi
echo -e "DEVICE=${ETH}\nBOOTPROTO=dhcp\nONBOOT=yes\nIPV6INIT=no" >"${RAMDISK_PATH}/etc/sysconfig/network-scripts/ifcfg-${ETH}"
fi
done
# SA6400 patches
if [ "${PLATFORM}" = "epyc7002" ]; then
echo -e "Apply Epyc7002 Fixes"
@ -226,6 +202,12 @@ if [ "${PLATFORM}" = "epyc7002" ]; then
sed -i '/^echo "START/a \\nmknod -m 0666 /dev/console c 1 3' ${RAMDISK_PATH}/linuxrc.syno
fi
# Broadwellntbap patches
if [ "${PLATFORM}" = "broadwellntbap" ]; then
echo -e "Apply Broadwellntbap Fixes"
sed -i 's/IsUCOrXA="yes"/XIsUCOrXA="yes"/g; s/IsUCOrXA=yes/XIsUCOrXA=yes/g' ${RAMDISK_PATH}/usr/syno/share/environments.sh
fi
# Call user patch scripts
for F in $(ls -1 ${SCRIPTS_PATH}/*.sh 2>/dev/null); do
echo "Calling ${F}" >>"${LOG_FILE}" 2>&1

View File

@ -9,15 +9,23 @@ set -o pipefail # Get exit code from process piped
# Sanity check
[ -f "${ORI_ZIMAGE_FILE}" ] || (die "${ORI_ZIMAGE_FILE} not found!" | tee -a "${LOG_FILE}")
echo -e "Patching zImage"
rm -f "${MOD_ZIMAGE_FILE}"
# Extract vmlinux
${ARC_PATH}/bzImage-to-vmlinux.sh "${ORI_ZIMAGE_FILE}" "${TMP_PATH}/vmlinux" >"${LOG_FILE}" 2>&1 || dieLog
# Patch boot params and ramdisk check
${ARC_PATH}/kpatch "${TMP_PATH}/vmlinux" "${TMP_PATH}/vmlinux-mod" >"${LOG_FILE}" 2>&1 || dieLog
# rebuild zImage
${ARC_PATH}/vmlinux-to-bzImage.sh "${TMP_PATH}/vmlinux-mod" "${MOD_ZIMAGE_FILE}" >"${LOG_FILE}" 2>&1 || dieLog
# Remove old Files
rm -f "${TMP_PATH}/vmlinux" "${TMP_PATH}/vmlinux-mod"
KERNEL="$(readConfigKey "arc.kernel" "${USER_CONFIG_FILE}")"
if [ "${KERNEL}" = "custom" ]; then
echo -e "Using customized zImage"
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
PLATFORM="$(readModelKey "${MODEL}" "platform")"
KVER="$(readModelKey "${MODEL}" "productvers.[${PRODUCTVER}].kver")"
# Extract bzImage
gzip -dc "${CUSTOM_PATH}/bzImage-${PLATFORM}-${PRODUCTVER}-${KVER}.gz" >"${MOD_ZIMAGE_FILE}"
else
echo -e "Patching zImage"
# Extract vmlinux
${ARC_PATH}/bzImage-to-vmlinux.sh "${ORI_ZIMAGE_FILE}" "${TMP_PATH}/vmlinux" >"${LOG_FILE}" 2>&1 || dieLog
# Patch boot params and ramdisk check
${ARC_PATH}/kpatch "${TMP_PATH}/vmlinux" "${TMP_PATH}/vmlinux-mod" >"${LOG_FILE}" 2>&1 || dieLog
# rebuild zImage
${ARC_PATH}/vmlinux-to-bzImage.sh "${TMP_PATH}/vmlinux-mod" "${MOD_ZIMAGE_FILE}" >"${LOG_FILE}" 2>&1 || dieLog
fi

View File

@ -73,7 +73,7 @@ search --set=root --label "ARC3"
if [ -s /zImage-dsm -a -s /initrd-dsm ]; then
if [ "${default}" = "direct" ]; then
set timeout="1"
menuentry 'Direct DSM Mode' --id direct {
menuentry 'DSM direct Mode' --id direct {
set_gfxpayload
echo "cmdline:"
echo "${dsm_cmdline}"
@ -85,7 +85,7 @@ if [ -s /zImage-dsm -a -s /initrd-dsm ]; then
echo "Access http://find.synology.com/ to connect the DSM via web."
}
fi
menuentry 'DSM Mode' --id boot {
menuentry 'Arc DSM Mode' --id boot {
set_gfxpayload
echo "Loading Arc Kernel..."
linux /bzImage-arc ${ARC_CMDLINE}
@ -95,7 +95,7 @@ if [ -s /zImage-dsm -a -s /initrd-dsm ]; then
}
fi
menuentry 'Config Mode' --id config {
menuentry 'Arc Config Mode' --id config {
set_gfxpayload
echo "Loading Arc Kernel..."
linux /bzImage-arc ${ARC_CMDLINE} force_arc
@ -105,6 +105,14 @@ menuentry 'Config Mode' --id config {
}
if [ -s /zImage-dsm -a -s /initrd-dsm ]; then
menuentry 'DSM Recovery' --id recovery {
set_gfxpayload
echo "Loading Arc Kernel..."
linux /bzImage-arc ${ARC_CMDLINE} recovery
echo "Loading Arc Initramfs..."
initrd /initrd-arc
echo "Booting..."
}
menuentry 'DSM force Reinstall' --id junior {
set_gfxpayload
echo "Loading Arc Kernel..."

Binary file not shown.

Binary file not shown.

Binary file not shown.