Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
80d3118e7d | ||
|
|
39e00baf57 | ||
|
|
3378fb5a93 | ||
|
|
7e481182b1 | ||
|
|
6b0d2dad68 | ||
|
|
8b8a7bcc99 | ||
|
|
a4a3c1998b | ||
|
|
1ecf4db983 | ||
|
|
8adb3026f7 | ||
|
|
c9c320c2ca | ||
|
|
4902d10167 | ||
|
|
04890fecd5 | ||
|
|
28c68c9043 | ||
|
|
6f6778f3a3 | ||
|
|
bedf2d0a6b |
2
.github/workflows/data.yml
vendored
2
.github/workflows/data.yml
vendored
@@ -43,7 +43,7 @@ jobs:
|
||||
|
||||
TAG=""
|
||||
if [ "${PRERELEASE}" = "true" ]; then
|
||||
TAG="$(curl -skL --connect-timeout 10 "${REPO}/tags" | grep /refs/tags/.*\.zip | sed -r 's/.*\/refs\/tags\/(.*)\.zip.*$/\1/' | sort -rV | head -1)"
|
||||
TAG="$(curl -skL --connect-timeout 10 "${REPO}/tags" | grep /refs/tags/.*\.zip | sed -E 's/.*\/refs\/tags\/(.*)\.zip.*$/\1/' | sort -rV | head -1)"
|
||||
else
|
||||
LATESTURL="$(curl -skL --connect-timeout 10 -w %{url_effective} -o /dev/null "${REPO}/releases/latest")"
|
||||
TAG="${LATESTURL##*/}"
|
||||
|
||||
@@ -1658,12 +1658,14 @@ function loaderPassword() {
|
||||
# Change Arc Loader Password
|
||||
function loaderPorts() {
|
||||
MSG="Modify Ports (0-65535) (Leave empty for default):"
|
||||
HTTPPORT=$(grep -i '^HTTP_PORT=' /etc/arc.conf 2>/dev/null | cut -d'=' -f2)
|
||||
DUFSPORT=$(grep -i '^DUFS_PORT=' /etc/arc.conf 2>/dev/null | cut -d'=' -f2)
|
||||
TTYDPORT=$(grep -i '^TTYD_PORT=' /etc/arc.conf 2>/dev/null | cut -d'=' -f2)
|
||||
unset HTTP_PORT DUFS_PORT TTYD_PORT
|
||||
[ -f "/etc/arc.conf" ] && source "/etc/arc.conf" 2>/dev/null
|
||||
local HTTP=${HTTP_PORT:-7080}
|
||||
local DUFS=${DUFS_PORT:-7304}
|
||||
local TTYD=${TTYD_PORT:-7681}
|
||||
while true; do
|
||||
dialog --backtitle "$(backtitle)" --title "Loader Ports" \
|
||||
--form "${MSG}" 11 70 3 "HTTP" 1 1 "${HTTPPORT:-8080}" 1 10 55 0 "DUFS" 2 1 "${DUFSPORT:-7304}" 2 10 55 0 "TTYD" 3 1 "${TTYDPORT:-7681}" 3 10 55 0 \
|
||||
--form "${MSG}" 11 70 3 "HTTP" 1 1 "${HTTPPORT}" 1 10 55 0 "DUFS" 2 1 "${DUFSPORT}" 2 10 55 0 "TTYD" 3 1 "${TTYDPORT}" 3 10 55 0 \
|
||||
2>"${TMP_PATH}/resp"
|
||||
RET=$?
|
||||
case ${RET} in
|
||||
@@ -1679,9 +1681,9 @@ function loaderPorts() {
|
||||
[ $? -eq 0 ] && continue || break
|
||||
fi
|
||||
rm -f "/etc/arc.conf"
|
||||
[ ! "${HTTPPORT:-8080}" = "8080" ] && (echo "HTTP_PORT=${HTTPPORT}" >>"/etc/arc.conf"; /etc/init.d/S90thttpd restart >/dev/null 2>&1)
|
||||
[ ! "${DUFSPORT:-7304}" = "7304" ] && (echo "DUFS_PORT=${DUFSPORT}" >>"/etc/arc.conf"; /etc/init.d/S99dufs restart >/dev/null 2>&1)
|
||||
[ ! "${TTYDPORT:-7681}" = "7681" ] && (echo "TTYD_PORT=${TTYDPORT}" >>"/etc/arc.conf"; /etc/init.d/S99ttyd restart >/dev/null 2>&1)
|
||||
[ "${HTTPPORT:-8080}" != "8080" ] && echo "HTTP_PORT=${HTTPPORT}" >>"/etc/arc.conf"
|
||||
[ "${DUFSPORT:-7304}" != "7304" ] && echo "DUFS_PORT=${DUFSPORT}" >>"/etc/arc.conf"
|
||||
[ "${TTYDPORT:-7681}" != "7681" ] && echo "TTYD_PORT=${TTYDPORT}" >>"/etc/arc.conf"
|
||||
RDXZ_PATH="${TMP_PATH}/rdxz_tmp"
|
||||
rm -rf "${RDXZ_PATH}"
|
||||
mkdir -p "${RDXZ_PATH}"
|
||||
@@ -1732,6 +1734,14 @@ function loaderPorts() {
|
||||
[ ! -f "/etc/arc.conf" ] && MSG="Ports for TTYD/DUFS/HTTP restored." || MSG="Ports for TTYD/DUFS/HTTP changed."
|
||||
dialog --backtitle "$(backtitle)" --title "Loader Ports" \
|
||||
--msgbox "${MSG}" 0 0
|
||||
rm -f "${TMP_PATH}/restartS.sh"
|
||||
{
|
||||
[ ! "${HTTP:-8080}" = "${HTTP_PORT:-8080}" ] && echo "/etc/init.d/S90thttpd restart"
|
||||
[ ! "${DUFS:-7304}" = "${DUFS_PORT:-7304}" ] && echo "/etc/init.d/S99dufs restart"
|
||||
[ ! "${TTYD:-7681}" = "${TTYD_PORT:-7681}" ] && echo "/etc/init.d/S99ttyd restart"
|
||||
} >"${TMP_PATH}/restartS.sh"
|
||||
chmod +x "${TMP_PATH}/restartS.sh"
|
||||
nohup "${TMP_PATH}/restartS.sh" >/dev/null 2>&1
|
||||
break
|
||||
;;
|
||||
1) # cancel-button
|
||||
|
||||
@@ -414,6 +414,7 @@ function arcPatch() {
|
||||
ARCCONF="$(readConfigKey "${MODEL}.serial" "${S_FILE}")"
|
||||
[ -n "${ARCCONF}" ] && SN="$(generateSerial "${MODEL}" "true")" || SN="$(generateSerial "${MODEL}" "false")"
|
||||
[ -n "${ARCCONF}" ] && writeConfigKey "arc.patch" "true" "${USER_CONFIG_FILE}" || writeConfigKey "arc.patch" "false" "${USER_CONFIG_FILE}"
|
||||
writeConfigKey "sn" "${SN}" "${USER_CONFIG_FILE}"
|
||||
elif [ "${ARCMODE}" = "config" ]; then
|
||||
dialog --clear --backtitle "$(backtitlep)" \
|
||||
--nocancel --title "SN/Mac Options"\
|
||||
@@ -458,8 +459,8 @@ function arcPatch() {
|
||||
done
|
||||
writeConfigKey "arc.patch" "user" "${USER_CONFIG_FILE}"
|
||||
fi
|
||||
writeConfigKey "sn" "${SN}" "${USER_CONFIG_FILE}"
|
||||
fi
|
||||
writeConfigKey "sn" "${SN}" "${USER_CONFIG_FILE}"
|
||||
ARCPATCH="$(readConfigKey "arc.patch" "${USER_CONFIG_FILE}")"
|
||||
arcSettings
|
||||
}
|
||||
|
||||
@@ -119,23 +119,23 @@ fi
|
||||
declare -A CMDLINE
|
||||
|
||||
# Automated Cmdline
|
||||
CMDLINE['syno_hw_version']="${MODELID:-${MODEL}}"
|
||||
CMDLINE['vid']="${VID:-"0x46f4"}" # Sanity check
|
||||
CMDLINE['pid']="${PID:-"0x0001"}" # Sanity check
|
||||
CMDLINE['sn']="${SN}"
|
||||
CMDLINE["syno_hw_version"]="${MODELID:-${MODEL}}"
|
||||
CMDLINE["vid"]="${VID:-"0x46f4"}" # Sanity check
|
||||
CMDLINE["pid"]="${PID:-"0x0001"}" # Sanity check
|
||||
CMDLINE["sn"]="${SN}"
|
||||
|
||||
# Boot Cmdline
|
||||
if grep -q "force_junior" /proc/cmdline; then
|
||||
CMDLINE['force_junior']=""
|
||||
CMDLINE["force_junior"]=""
|
||||
fi
|
||||
if grep -q "recovery" /proc/cmdline; then
|
||||
CMDLINE['force_junior']=""
|
||||
CMDLINE['recovery']=""
|
||||
CMDLINE["force_junior"]=""
|
||||
CMDLINE["recovery"]=""
|
||||
fi
|
||||
if [ ${EFI} -eq 1 ]; then
|
||||
CMDLINE['withefi']=""
|
||||
CMDLINE["withefi"]=""
|
||||
else
|
||||
CMDLINE['noefi']=""
|
||||
CMDLINE["noefi"]=""
|
||||
fi
|
||||
|
||||
# DSM Cmdline
|
||||
@@ -146,10 +146,10 @@ if [ $(echo "${KVER:-4}" | cut -d'.' -f1) -lt 5 ]; then
|
||||
SIZE=$((${SZ:-0} * ${SS:-0} / 1024 / 1024 + 10))
|
||||
# Read SATADoM type
|
||||
SATADOM="$(readConfigKey "satadom" "${USER_CONFIG_FILE}")"
|
||||
CMDLINE['synoboot_satadom']="${SATADOM:-2}"
|
||||
CMDLINE['dom_szmax']="${SIZE}"
|
||||
CMDLINE["synoboot_satadom"]="${SATADOM:-2}"
|
||||
CMDLINE["dom_szmax"]="${SIZE}"
|
||||
fi
|
||||
CMDLINE["elevator"]="elevator"
|
||||
CMDLINE['elevator']="elevator"
|
||||
else
|
||||
CMDLINE["split_lock_detect"]="off"
|
||||
fi
|
||||
@@ -163,39 +163,37 @@ else
|
||||
fi
|
||||
CMDLINE["HddHotplug"]="1"
|
||||
CMDLINE["vender_format_version"]="2"
|
||||
CMDLINE['skip_vender_mac_interfaces']="0,1,2,3,4,5,6,7"
|
||||
CMDLINE['earlyprintk']=""
|
||||
CMDLINE['earlycon']="uart8250,io,0x3f8,115200n8"
|
||||
CMDLINE['console']="ttyS0,115200n8"
|
||||
CMDLINE['consoleblank']="600"
|
||||
CMDLINE["skip_vender_mac_interfaces"]="0,1,2,3,4,5,6,7"
|
||||
CMDLINE["earlyprintk"]=""
|
||||
CMDLINE["earlycon"]="uart8250,io,0x3f8,115200n8"
|
||||
CMDLINE["console"]="ttyS0,115200n8"
|
||||
CMDLINE["consoleblank"]="600"
|
||||
# CMDLINE['no_console_suspend']="1"
|
||||
CMDLINE['root']="/dev/md0"
|
||||
CMDLINE['loglevel']="15"
|
||||
CMDLINE['log_buf_len']="32M"
|
||||
CMDLINE['rootwait']=""
|
||||
CMDLINE['panic']="${KERNELPANIC:-0}"
|
||||
CMDLINE["root"]="/dev/md0"
|
||||
CMDLINE["loglevel"]="15"
|
||||
CMDLINE["log_buf_len"]="32M"
|
||||
CMDLINE["rootwait"]=""
|
||||
CMDLINE["panic"]="${KERNELPANIC:-0}"
|
||||
|
||||
# DSM Specific Cmdline
|
||||
CMDLINE['pcie_aspm']="off"
|
||||
CMDLINE['modprobe.blacklist']="${MODBLACKLIST}"
|
||||
CMDLINE["pcie_aspm"]="off"
|
||||
CMDLINE["modprobe.blacklist"]="${MODBLACKLIST}"
|
||||
[ $(cat /proc/cpuinfo | grep Intel | wc -l) -gt 0 ] && CMDLINE["intel_pstate"]="passive"
|
||||
[ $(cat /proc/cpuinfo | grep AMD | wc -l) -gt 0 ] && CMDLINE["amd_pstate"]="passive"
|
||||
CMDLINE['intremap']="no_x2apic_optout"
|
||||
# CMDLINE['split_lock_detect']="off" # no need
|
||||
# CMDLINE['nomodeset']=""
|
||||
# CMDLINE["nomodeset"]=""
|
||||
if echo "apollolake geminilake purley" | grep -wq "${PLATFORM}"; then
|
||||
CMDLINE["nox2apic"]=""
|
||||
fi
|
||||
#if [ -n "$(ls /dev/mmcblk* 2>/dev/null)" ] && [ "${BUS}" != "mmc" ] && [ "${EMMCBOOT}" != "true" ]; then
|
||||
# if ! echo "${CMDLINE['modprobe.blacklist']}" | grep -q "sdhci"; then
|
||||
# [ ! "${CMDLINE['modprobe.blacklist']}" = "" ] && CMDLINE['modprobe.blacklist']+=","
|
||||
# CMDLINE['modprobe.blacklist']+="sdhci,sdhci_pci,sdhci_acpi"
|
||||
# if ! echo "${CMDLINE["modprobe.blacklist"]}" | grep -q "sdhci"; then
|
||||
# [ ! "${CMDLINE["modprobe.blacklist"]}" = "" ] && CMDLINE["modprobe.blacklist"]+=","
|
||||
# CMDLINE["modprobe.blacklist"]+="sdhci,sdhci_pci,sdhci_acpi"
|
||||
# fi
|
||||
# fi
|
||||
if [ "${DT}" = "true" ] && ! echo "epyc7002 purley broadwellnkv2" | grep -wq "${PLATFORM}"; then
|
||||
if ! echo "${CMDLINE['modprobe.blacklist']}" | grep -q "mpt3sas"; then
|
||||
[ ! "${CMDLINE['modprobe.blacklist']}" = "" ] && CMDLINE['modprobe.blacklist']+=","
|
||||
CMDLINE['modprobe.blacklist']+="mpt3sas"
|
||||
[ ! "${CMDLINE['modprobe.blacklist']}" = "" ] && CMDLINE["modprobe.blacklist"]+=","
|
||||
CMDLINE["modprobe.blacklist"]+="mpt3sas"
|
||||
fi
|
||||
fi
|
||||
# CMDLINE['kvm.ignore_msrs']="1"
|
||||
@@ -219,7 +217,7 @@ for N in ${ETHX}; do
|
||||
[ ${NIC} -le ${ETHM} ] && CMDLINE["mac${NIC}"]="${MAC}"
|
||||
[ ${NIC} -ge ${ETHM} ] && break
|
||||
done
|
||||
CMDLINE['netif_num']="${NIC}"
|
||||
CMDLINE["netif_num"]="${NIC}"
|
||||
|
||||
# Read user network settings
|
||||
while IFS=': ' read -r KEY VALUE; do
|
||||
@@ -233,7 +231,7 @@ done < <(readConfigMap "cmdline" "${USER_CONFIG_FILE}")
|
||||
|
||||
# Prepare command line
|
||||
CMDLINE_LINE=""
|
||||
for KEY in ${!CMDLINE[@]}; do
|
||||
for KEY in "${!CMDLINE[@]}"; do
|
||||
VALUE="${CMDLINE[${KEY}]}"
|
||||
CMDLINE_LINE+=" ${KEY}"
|
||||
[ -n "${VALUE}" ] && CMDLINE_LINE+="=${VALUE}"
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Calculate the amount of space needed to run the kernel, including room for
|
||||
# the .bss and .brk sections.
|
||||
#
|
||||
# Usage:
|
||||
# objdump -h a.out | sh calc_run_size.sh
|
||||
|
||||
NUM='\([0-9a-fA-F]*[ \t]*\)'
|
||||
OUT=$(sed -n 's/^[ \t0-9]*.b[sr][sk][ \t]*'"${NUM}${NUM}${NUM}${NUM}"'.*/0x\1 0x\4/p')
|
||||
|
||||
if [ -z "${OUT}" ]; then
|
||||
echo "Never found .bss or .brk file offset" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
read -r sizeA offsetA sizeB offsetB <<<$(echo ${OUT} | awk '{printf "%d %d %d %d", strtonum($1), strtonum($2), strtonum($3), strtonum($4)}')
|
||||
|
||||
runSize=$((offsetA + sizeA + sizeB))
|
||||
|
||||
# BFD linker shows the same file offset in ELF.
|
||||
if [ "${offsetA}" -ne "${offsetB}" ]; then
|
||||
# Gold linker shows them as consecutive.
|
||||
endSize=$((offsetB + sizeB))
|
||||
if [ "${endSize}" -ne "${runSize}" ]; then
|
||||
printf "sizeA: 0x%x\n" ${sizeA} >&2
|
||||
printf "offsetA: 0x%x\n" ${offsetA} >&2
|
||||
printf "sizeB: 0x%x\n" ${sizeB} >&2
|
||||
printf "offsetB: 0x%x\n" ${offsetB} >&2
|
||||
echo ".bss and .brk are non-contiguous" >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
printf "%d\n" ${runSize}
|
||||
exit 0
|
||||
Binary file not shown.
@@ -609,11 +609,11 @@ function _bootwait() {
|
||||
busybox w 2>/dev/null | awk '{print $1" "$2" "$4" "$5" "$6}' >WB
|
||||
MSG=""
|
||||
while test ${BOOTWAIT} -ge 0; do
|
||||
MSG="\033[1;33mAccess SSH/Web will interrupt boot...\033[0m"
|
||||
MSG="\033[1;33mAccess to SSH/Web will interrupt boot...\033[0m"
|
||||
echo -en "\r${MSG}"
|
||||
busybox w 2>/dev/null | awk '{print $1" "$2" "$4" "$5" "$6}' >WC
|
||||
if ! diff WB WC >/dev/null 2>&1; then
|
||||
echo -en "\r\033[1;33mAccess SSH/Web detected and boot is interrupted.\033[0m\n"
|
||||
echo -en "\r\033[1;33mAccess to SSH/Web detected and boot is interrupted.\033[0m\n"
|
||||
rm -f WB WC
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@@ -22,7 +22,7 @@ function getnet() {
|
||||
for N in ${ETHX}; do
|
||||
while true; do
|
||||
dialog --backtitle "$(backtitle)" --title "Mac Setting" \
|
||||
--inputbox "Type a custom Mac for ${N} (Eq. 001132a1b2c3).\nA custom Mac will not be applied to NIC!" 7 50\
|
||||
--inputbox "Type a custom Mac for ${N} (Eq. 001132a1b2c3).\nA custom Mac will not be applied to NIC!" 8 50\
|
||||
2>"${TMP_PATH}/resp"
|
||||
[ $? -ne 0 ] && break
|
||||
MAC=$(cat "${TMP_PATH}/resp")
|
||||
|
||||
@@ -13,7 +13,7 @@ function getmap() {
|
||||
DISKIDXMAP=""
|
||||
let DISKIDXMAPIDXMAX=0
|
||||
DISKIDXMAPMAX=""
|
||||
for PCI in $(lspci -d ::106 | awk '{print $1}'); do
|
||||
for PCI in $(lspci -d ::106 2>/dev/null | awk '{print $1}'); do
|
||||
NUMPORTS=0
|
||||
CONPORTS=0
|
||||
unset HOSTPORTS
|
||||
@@ -46,7 +46,7 @@ function getmap() {
|
||||
# SAS Disks
|
||||
SASDRIVES=0
|
||||
if [ $(lspci -d ::107 2>/dev/null | wc -l) -gt 0 ]; then
|
||||
for PCI in $(lspci -d ::107 | awk '{print $1}'); do
|
||||
for PCI in $(lspci -d ::107 2>/dev/null | awk '{print $1}'); do
|
||||
NAME=$(lspci -s "${PCI}" | sed "s/\ .*://")
|
||||
PORT=$(ls -l /sys/class/scsi_host | grep "${PCI}" | awk -F'/' '{print $NF}' | sed 's/host//' | sort -n 2>/dev/null)
|
||||
PORTNUM=$(lsscsi -b | grep -v - | grep "\[${PORT}:" | wc -l)
|
||||
@@ -56,7 +56,7 @@ function getmap() {
|
||||
# SCSI Disks
|
||||
SCSIDRIVES=0
|
||||
if [ $(lspci -d ::100 2>/dev/null | wc -l) -gt 0 ]; then
|
||||
for PCI in $(lspci -d ::100 | awk '{print $1}'); do
|
||||
for PCI in $(lspci -d ::100 2>/dev/null | awk '{print $1}'); do
|
||||
NAME=$(lspci -s "${PCI}" | sed "s/\ .*://")
|
||||
PORT=$(ls -l /sys/class/scsi_host | grep "${PCI}" | awk -F'/' '{print $NF}' | sed 's/host//' | sort - 2>/dev/null)
|
||||
PORTNUM=$(lsscsi -b | grep -v - | grep "\[${PORT}:" | wc -l)
|
||||
@@ -66,7 +66,7 @@ function getmap() {
|
||||
# Raid Disks
|
||||
RAIDDRIVES=0
|
||||
if [ $(lspci -d ::104 2>/dev/null | wc -l) -gt 0 ]; then
|
||||
for PCI in $(lspci -d ::104 | awk '{print $1}'); do
|
||||
for PCI in $(lspci -d ::104 2>/dev/null | awk '{print $1}'); do
|
||||
NAME=$(lspci -s "${PCI}" | sed "s/\ .*://")
|
||||
PORT=$(ls -l /sys/class/scsi_host | grep "${PCI}" | awk -F'/' '{print $NF}' | sed 's/host//' | sort -n 2>/dev/null)
|
||||
PORTNUM=$(lsscsi -b | grep -v - | grep "\[${PORT}:" | wc -l)
|
||||
@@ -76,7 +76,7 @@ function getmap() {
|
||||
# USB Disks
|
||||
USBDRIVES=0
|
||||
if [ $(ls -l /sys/class/scsi_host 2>/dev/null | grep usb | wc -l) -gt 0 ]; then
|
||||
for PCI in $(lspci -d ::c03 | awk '{print $1}'); do
|
||||
for PCI in $(lspci -d ::c03 2>/dev/null | awk '{print $1}'); do
|
||||
NAME=$(lspci -s "${PCI}" | sed "s/\ .*://")
|
||||
PORT=$(ls -l /sys/class/scsi_host | grep "${PCI}" | awk -F'/' '{print $NF}' | sed 's/host//' | sort -n 2>/dev/null)
|
||||
PORTNUM=$(lsscsi -b | grep -v - | grep "\[${PORT}:" | wc -l)
|
||||
@@ -88,7 +88,7 @@ function getmap() {
|
||||
MMCDRIVES=0
|
||||
if [ $(ls -l /sys/block/mmc* 2>/dev/null | wc -l) -gt 0 ]; then
|
||||
for PCI in $(lspci -d ::805 | awk '{print $1}'); do
|
||||
NAME=$(lspci -s "${PCI}" | sed "s/\ .*://")
|
||||
NAME=$(lspci -s "${PCI}" 2>/dev/null | sed "s/\ .*://")
|
||||
PORTNUM=$(ls -l /sys/block/mmc* | grep "${PCI}" | wc -l 2>/dev/null)
|
||||
[ ${PORTNUM} -eq 0 ] && continue
|
||||
MMCDRIVES=$((${MMCDRIVES} + ${PORTNUM}))
|
||||
@@ -97,7 +97,7 @@ function getmap() {
|
||||
# NVMe Disks
|
||||
NVMEDRIVES=0
|
||||
if [ $(lspci -d ::108 2>/dev/null | wc -l) -gt 0 ]; then
|
||||
for PCI in $(lspci -d ::108 | awk '{print $1}'); do
|
||||
for PCI in $(lspci -d ::108 2>/dev/null | awk '{print $1}'); do
|
||||
NAME=$(lspci -s "${PCI}" | sed "s/\ .*://")
|
||||
PORT=$(ls -l /sys/class/nvme | grep "${PCI}" | awk -F'/' '{print $NF}' | sed 's/nvme//' | sort -n 2>/dev/null)
|
||||
PORTNUM=$(lsscsi -b | grep -v - | grep "\[N:${PORT}:" | wc -l)
|
||||
@@ -117,7 +117,7 @@ function getmap() {
|
||||
writeConfigKey "device.drives" "${DRIVES}" "${USER_CONFIG_FILE}"
|
||||
writeConfigKey "device.harddrives" "${HARDDRIVES}" "${USER_CONFIG_FILE}"
|
||||
# Check for Sata Boot
|
||||
if [ $(lspci -d ::106 | wc -l) -gt 0 ]; then
|
||||
if [ $(lspci -d ::106 2>/dev/null | wc -l) -gt 0 ]; then
|
||||
LASTDRIVE=0
|
||||
while read -r D; do
|
||||
if [ "${BUS}" = "sata" ] && [ "${MACHINE}" != "Native" ] && [ ${D} -eq 0 ]; then
|
||||
@@ -228,22 +228,22 @@ function getmapSelection() {
|
||||
}
|
||||
|
||||
# Check for Controller // 104=RAID // 106=SATA // 107=SAS // 100=SCSI // c03=USB
|
||||
SATACONTROLLER=$(lspci -d ::106 | wc -l)
|
||||
SATACONTROLLER=$(lspci -d ::106 2>/dev/null | wc -l)
|
||||
writeConfigKey "device.satacontroller" "${SATACONTROLLER}" "${USER_CONFIG_FILE}"
|
||||
if [ ${SATACONTROLLER} -gt 0 ]; then
|
||||
writeConfigKey "device.externalcontroller" "false" "${USER_CONFIG_FILE}"
|
||||
fi
|
||||
SASCONTROLLER=$(lspci -d ::107 | wc -l)
|
||||
SASCONTROLLER=$(lspci -d ::107 2>/dev/null | wc -l)
|
||||
writeConfigKey "device.sascontroller" "${SASCONTROLLER}" "${USER_CONFIG_FILE}"
|
||||
if [ ${SASCONTROLLER} -gt 0 ]; then
|
||||
writeConfigKey "device.externalcontroller" "true" "${USER_CONFIG_FILE}"
|
||||
fi
|
||||
SCSICONTROLLER=$(lspci -d ::100 | wc -l)
|
||||
SCSICONTROLLER=$(lspci -d ::100 2>/dev/null | wc -l)
|
||||
writeConfigKey "device.scsicontroller" "${SCSICONTROLLER}" "${USER_CONFIG_FILE}"
|
||||
if [ ${SCSICONTROLLER} -gt 0 ]; then
|
||||
writeConfigKey "device.externalcontroller" "true" "${USER_CONFIG_FILE}"
|
||||
fi
|
||||
RAIDCONTROLLER=$(lspci -d ::104 | wc -l)
|
||||
RAIDCONTROLLER=$(lspci -d ::104 2>/dev/null | wc -l)
|
||||
writeConfigKey "device.raidcontroller" "${RAIDCONTROLLER}" "${USER_CONFIG_FILE}"
|
||||
if [ ${RAIDCONTROLLER} -gt 0 ]; then
|
||||
writeConfigKey "device.externalcontroller" "true" "${USER_CONFIG_FILE}"
|
||||
|
||||
@@ -43,9 +43,15 @@ function updateLoader() {
|
||||
dialog --gauge "Download Update: ${TAG}..." 14 72 4>&-
|
||||
} 4>&1
|
||||
if [ -f "${TMP_PATH}/update.zip" ] && [ $(ls -s "${TMP_PATH}/update.zip" | cut -d' ' -f1) -gt 300000 ]; then
|
||||
mkdir -p "${TMP_PATH}/update"
|
||||
dialog --backtitle "$(backtitle)" --title "Update Loader" \
|
||||
--infobox "Updating Loader..." 3 50
|
||||
if unzip -oq "${TMP_PATH}/update.zip" -d "/mnt"; then
|
||||
if unzip -oq "${TMP_PATH}/update.zip" -d "${TMP_PATH}/update"; then
|
||||
cp -rf "${TMP_PATH}/update"/* "/mnt"
|
||||
rm -rf "${TMP_PATH}/update"
|
||||
rm -f "${TMP_PATH}/update.zip"
|
||||
fi
|
||||
if [ "$(cat "${PART1_PATH}/ARC-VERSION")" = "${TAG}" ]; then
|
||||
dialog --backtitle "$(backtitle)" --title "Update Loader" \
|
||||
--infobox "Update Loader successful!" 3 50
|
||||
sleep 2
|
||||
|
||||
Binary file not shown.
@@ -128,13 +128,17 @@ done
|
||||
grep -v -e '^[\t ]*#' -e '^$' "${PATCH_PATH}/config-manipulators.sh" >"${TMP_PATH}/rp.txt"
|
||||
sed -e "/@@@CONFIG-MANIPULATORS-TOOLS@@@/ {" -e "r ${TMP_PATH}/rp.txt" -e 'd' -e '}' -i "${RAMDISK_PATH}/sbin/init.post"
|
||||
rm -f "${TMP_PATH}/rp.txt"
|
||||
touch "${TMP_PATH}/rp.txt"
|
||||
echo "_set_conf_kv 'SN' '${SN}' '/tmpRoot/etc/synoinfo.conf'" >>"${TMP_PATH}/rp.txt"
|
||||
echo "_set_conf_kv 'SN' '${SN}' '/tmpRoot/etc.defaults/synoinfo.conf'" >>"${TMP_PATH}/rp.txt"
|
||||
for KEY in ${!SYNOINFO[@]}; do
|
||||
echo "_set_conf_kv '${KEY}' '${SYNOINFO[${KEY}]}' '/tmpRoot/etc/synoinfo.conf'" >>"${TMP_PATH}/rp.txt"
|
||||
echo "_set_conf_kv '${KEY}' '${SYNOINFO[${KEY}]}' '/tmpRoot/etc.defaults/synoinfo.conf'" >>"${TMP_PATH}/rp.txt"
|
||||
done
|
||||
|
||||
# Generate synoinfo configurations
|
||||
{
|
||||
echo "_set_conf_kv 'SN' '${SN}' '/tmpRoot/etc/synoinfo.conf'"
|
||||
echo "_set_conf_kv 'SN' '${SN}' '/tmpRoot/etc.defaults/synoinfo.conf'"
|
||||
for KEY in "${!SYNOINFO[@]}"; do
|
||||
echo "_set_conf_kv '${KEY}' '${SYNOINFO[${KEY}]}' '/tmpRoot/etc/synoinfo.conf'"
|
||||
echo "_set_conf_kv '${KEY}' '${SYNOINFO[${KEY}]}' '/tmpRoot/etc.defaults/synoinfo.conf'"
|
||||
done
|
||||
} >"${TMP_PATH}/rp.txt"
|
||||
|
||||
sed -e "/@@@CONFIG-GENERATED@@@/ {" -e "r ${TMP_PATH}/rp.txt" -e 'd' -e '}' -i "${RAMDISK_PATH}/sbin/init.post"
|
||||
rm -f "${TMP_PATH}/rp.txt"
|
||||
|
||||
|
||||
@@ -3,11 +3,36 @@
|
||||
|
||||
[[ -z "${ARC_PATH}" || ! -d "${ARC_PATH}/include" ]] && ARC_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)"
|
||||
|
||||
. "${ARC_PATH}/include/functions.sh"
|
||||
calculate_run_size() {
|
||||
NUM='\([0-9a-fA-F]*[ \t]*\)'
|
||||
OUT=$(sed -n 's/^[ \t0-9]*.b[sr][sk][ \t]*'"${NUM}${NUM}${NUM}${NUM}"'.*/0x\1 0x\4/p')
|
||||
|
||||
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
|
||||
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
|
||||
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")"
|
||||
if [ -z "${OUT}" ]; then
|
||||
echo "Never found .bss or .brk file offset" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
read -r sizeA offsetA sizeB offsetB <<<$(echo ${OUT} | awk '{printf "%d %d %d %d", strtonum($1), strtonum($2), strtonum($3), strtonum($4)}')
|
||||
|
||||
runSize=$((offsetA + sizeA + sizeB))
|
||||
|
||||
# BFD linker shows the same file offset in ELF.
|
||||
if [ "${offsetA}" -ne "${offsetB}" ]; then
|
||||
# Gold linker shows them as consecutive.
|
||||
endSize=$((offsetB + sizeB))
|
||||
if [ "${endSize}" -ne "${runSize}" ]; then
|
||||
printf "sizeA: 0x%x\n" ${sizeA} >&2
|
||||
printf "offsetA: 0x%x\n" ${offsetA} >&2
|
||||
printf "sizeB: 0x%x\n" ${sizeB} >&2
|
||||
printf "offsetB: 0x%x\n" ${offsetB} >&2
|
||||
echo ".bss and .brk are non-contiguous" >&2
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
printf "%d\n" ${runSize}
|
||||
return 0
|
||||
}
|
||||
|
||||
# Adapted from: scripts/Makefile.lib
|
||||
# Usage: size_append FILE [FILE2] [FILEn]...
|
||||
@@ -34,6 +59,8 @@ size_le() {
|
||||
|
||||
VMLINUX_MOD=${1}
|
||||
ZIMAGE_MOD=${2}
|
||||
|
||||
KVER=$(strings "${VMLINUX_MOD}" | grep -Eo "Linux version [0-9]+\.[0-9]+\.[0-9]+" | head -1 | awk '{print $3}')
|
||||
if [ "$(echo "${KVER:-4}" | cut -d'.' -f1)" -lt 5 ]; then
|
||||
# Kernel version 4.x or 3.x (bromolow)
|
||||
# zImage_head 16494
|
||||
@@ -56,7 +83,7 @@ if [ "$(echo "${KVER:-4}" | cut -d'.' -f1)" -lt 5 ]; then
|
||||
file_size_le "${VMLINUX_MOD}" | dd of="${ZIMAGE_MOD}" bs=15745134 seek=1 conv=notrunc || exit 1
|
||||
file_size_le "${VMLINUX_MOD}" | dd of="${ZIMAGE_MOD}" bs=15745244 seek=1 conv=notrunc || exit 1
|
||||
|
||||
RUN_SIZE=$(objdump -h "${VMLINUX_MOD}" | sh "${ARC_PATH}/calc_run_size.sh")
|
||||
RUN_SIZE=$(objdump -h "${VMLINUX_MOD}" | calc_run_size)
|
||||
size_le "${RUN_SIZE}" | dd of="${ZIMAGE_MOD}" bs=15745210 seek=1 conv=notrunc || exit 1
|
||||
size_le "$((16#$(crc32 "${ZIMAGE_MOD}" | awk '{print $1}') ^ 0xFFFFFFFF))" | dd of="${ZIMAGE_MOD}" conv=notrunc oflag=append || exit 1
|
||||
else
|
||||
@@ -66,7 +93,7 @@ else
|
||||
dd if="${VMLINUX_MOD}" of="${ZIMAGE_MOD}" bs=14561 seek=1 conv=notrunc || exit 1
|
||||
file_size_le "${VMLINUX_MOD}" | dd of="${ZIMAGE_MOD}" bs=34463421 seek=1 conv=notrunc || exit 1
|
||||
file_size_le "${VMLINUX_MOD}" | dd of="${ZIMAGE_MOD}" bs=34479132 seek=1 conv=notrunc || exit 1
|
||||
# RUN_SIZE=$(objdump -h "${VMLINUX_MOD}" | sh "${ARC_PATH}/calc_run_size.sh")
|
||||
# RUN_SIZE=$(objdump -h "${VMLINUX_MOD}" | calc_run_size)
|
||||
# size_le "${RUN_SIZE}" | dd of="${ZIMAGE_MOD}" bs=34626904 seek=1 conv=notrunc || exit 1
|
||||
size_le "$((16#$(crc32 "${ZIMAGE_MOD}" | awk '{print $1}') ^ 0xFFFFFFFF))" | dd of="${ZIMAGE_MOD}" conv=notrunc oflag=append || exit 1
|
||||
fi
|
||||
@@ -1,27 +1,14 @@
|
||||
insmod search
|
||||
insmod echo
|
||||
insmod terminal
|
||||
insmod test
|
||||
insmod font
|
||||
insmod loadenv
|
||||
insmod serial
|
||||
insmod usb_keyboard
|
||||
insmod linux
|
||||
insmod gzio
|
||||
insmod fat
|
||||
insmod ext2
|
||||
insmod ata
|
||||
insmod btrfs
|
||||
insmod part_msdos
|
||||
insmod part_gpt
|
||||
|
||||
set default="boot"
|
||||
set timeout="5"
|
||||
set timeout_style="menu"
|
||||
set pager=1
|
||||
set vesa_mode=1
|
||||
set menu_color_normal=white/black
|
||||
set menu_color_highlight=white/red
|
||||
set color_normal=white/black
|
||||
|
||||
if [ -s $prefix/grubenv ]; then
|
||||
load_env
|
||||
if [ -s ${prefix}/grubenv ]; then
|
||||
load_env --skip-sig
|
||||
fi
|
||||
if [ "${next_entry}" ]; then
|
||||
set default="${next_entry}"
|
||||
@@ -32,26 +19,29 @@ if [ "${vesa_mode}" ]; then
|
||||
set vesa_mode=${vesa_mode}
|
||||
fi
|
||||
|
||||
function load_video {
|
||||
if [ x$feature_all_video_module = xy ]; then
|
||||
insmod all_video
|
||||
else
|
||||
insmod efi_gop
|
||||
insmod efi_uga
|
||||
insmod ieee1275_fb
|
||||
insmod vbe
|
||||
insmod vga
|
||||
insmod video_bochs
|
||||
insmod video_cirrus
|
||||
fi
|
||||
}
|
||||
terminal_input console
|
||||
terminal_output console
|
||||
|
||||
if [ "${feature_all_video_module}" = "y" ]; then
|
||||
insmod all_video
|
||||
else
|
||||
insmod efi_gop
|
||||
insmod efi_uga
|
||||
insmod vbe
|
||||
insmod vga
|
||||
insmod video_bochs
|
||||
insmod video_cirrus
|
||||
fi
|
||||
|
||||
load_video
|
||||
if loadfont unicode; then
|
||||
insmod gfxterm
|
||||
set gfxmode=1024x768
|
||||
set gfxmode=auto
|
||||
set gfxpayload=auto
|
||||
terminal_output gfxterm
|
||||
if [ "${grub_platform}" = "efi" ]; then
|
||||
terminal_output --append gfxterm
|
||||
else
|
||||
terminal_output gfxterm
|
||||
fi
|
||||
insmod gfxmenu
|
||||
loadfont ${prefix}/theme/dejavu_bold_14.pf2
|
||||
loadfont ${prefix}/theme/dejavu_mono_12.pf2
|
||||
@@ -60,9 +50,9 @@ if loadfont unicode; then
|
||||
export theme
|
||||
fi
|
||||
|
||||
if serial --unit=0 --speed=115200; then
|
||||
terminal_input --append serial_com0
|
||||
terminal_output --append serial_com0
|
||||
if serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1; then
|
||||
terminal_input --append serial
|
||||
terminal_output --append serial
|
||||
fi
|
||||
|
||||
function set_gfxpayload {
|
||||
@@ -73,11 +63,7 @@ function set_gfxpayload {
|
||||
fi
|
||||
}
|
||||
|
||||
set menu_color_normal=white/black
|
||||
set menu_color_highlight=white/red
|
||||
set color_normal=white/black
|
||||
|
||||
set ARC_CMDLINE="earlyprintk earlycon=uart8250,io,0x3f8,115200n8 console=ttyS0,115200n8 root=/dev/ram rootwait nomodeset intremap=no_x2apic_optout net.ifnames=0 panic=5 split_lock_detect=off pcie_aspm=off intel_pstate=passive amd_pstate=passive"
|
||||
set ARC_CMDLINE="earlyprintk earlycon=uart8250,io,0x3f8,115200n8 console=ttyS0,115200n8 root=/dev/ram rootwait intremap=off net.ifnames=0 panic=5 split_lock_detect=off pcie_aspm=off nox2apic nomodeset intel_pstate=passive amd_pstate=passive"
|
||||
|
||||
search --set=root --label "ARC3"
|
||||
if [ -s /zImage-dsm -a -s /initrd-dsm ]; then
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -37,7 +37,7 @@ sudo mount ${LOOPX}p1 "/tmp/p1"
|
||||
sudo mount ${LOOPX}p3 "/tmp/p3"
|
||||
|
||||
ARC_BUILD="`date +'%y%m%d'`"
|
||||
ARC_VERSION="13.37.dev"
|
||||
ARC_VERSION="13.3.7"
|
||||
ARC_BRANCH="next"
|
||||
echo "${ARC_BUILD}" >files/p1/ARC-BUILD
|
||||
echo "${ARC_VERSION}" >files/p1/ARC-VERSION
|
||||
|
||||
@@ -36,7 +36,7 @@ sudo mount ${LOOPX}p1 "/tmp/p1"
|
||||
sudo mount ${LOOPX}p3 "/tmp/p3"
|
||||
|
||||
ARC_BUILD="`date +'%y%m%d'`"
|
||||
ARC_VERSION="13.37.dev"
|
||||
ARC_VERSION="13.3.7"
|
||||
ARC_BRANCH="stable"
|
||||
echo "${ARC_BUILD}" >files/p1/ARC-BUILD
|
||||
echo "${ARC_VERSION}" >files/p1/ARC-VERSION
|
||||
|
||||
BIN
kpatch/kpatch
BIN
kpatch/kpatch
Binary file not shown.
@@ -489,4 +489,4 @@ int main(int argc, char *argv[])
|
||||
close(fd);
|
||||
printf("Finish!\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -441,8 +441,17 @@ function convertova() {
|
||||
rm -rf "VMX_${VMNAME}"
|
||||
}
|
||||
|
||||
# createvmc
|
||||
# $1 vhd file
|
||||
# $2 vmc file
|
||||
function createvmc() {
|
||||
cat <<_EOF_ >"${1:-arc.vmc}"
|
||||
local BLIMAGE=${1:-arc.vhd}
|
||||
local VMCPATH=${2:-arc.vmc}
|
||||
|
||||
BLIMAGE="$(basename "${BLIMAGE}")"
|
||||
VMCPATH="$(realpath "${VMCPATH}")"
|
||||
|
||||
cat <<_EOF_ >"${VMCPATH}"
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<preferences>
|
||||
<version type="string">2.0</version>
|
||||
@@ -456,7 +465,7 @@ function createvmc() {
|
||||
<location id="0">
|
||||
<drive_type type="integer">1</drive_type>
|
||||
<pathname>
|
||||
<relative type="string">arc.vhd</relative>
|
||||
<relative type="string">${BLIMAGE}</relative>
|
||||
</pathname>
|
||||
</location>
|
||||
</ide_controller>
|
||||
|
||||
Reference in New Issue
Block a user