Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f4cb31962 | ||
|
|
3b62345e5a | ||
|
|
f564167e9d | ||
|
|
67e3d5c0f8 | ||
|
|
80d3118e7d | ||
|
|
39e00baf57 | ||
|
|
3378fb5a93 | ||
|
|
7e481182b1 | ||
|
|
6b0d2dad68 | ||
|
|
8b8a7bcc99 | ||
|
|
a4a3c1998b | ||
|
|
1ecf4db983 | ||
|
|
8adb3026f7 | ||
|
|
c9c320c2ca |
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##*/}"
|
||||
|
||||
@@ -286,6 +286,9 @@ function modulesMenu() {
|
||||
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
|
||||
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
|
||||
;;
|
||||
*)
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
return
|
||||
@@ -496,6 +499,9 @@ function cmdlineMenu() {
|
||||
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
|
||||
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
|
||||
;;
|
||||
*)
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
return
|
||||
@@ -591,6 +597,9 @@ function synoinfoMenu() {
|
||||
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
|
||||
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
|
||||
;;
|
||||
*)
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
return
|
||||
@@ -678,6 +687,9 @@ function sequentialIOMenu() {
|
||||
--msgbox "SequentialIO disabled" 0 0
|
||||
SEQUENTIAL="false"
|
||||
;;
|
||||
*)
|
||||
break
|
||||
;;
|
||||
esac
|
||||
writeConfigKey "addons.sequentialio" "${SEQUENTIAL}" "${USER_CONFIG_FILE}"
|
||||
break
|
||||
@@ -694,8 +706,9 @@ function backupMenu() {
|
||||
NEXT="1"
|
||||
USERID="$(readConfigKey "arc.userid" "${USER_CONFIG_FILE}")"
|
||||
ARCOFFLINE="$(readConfigKey "arc.offline" "${USER_CONFIG_FILE}")"
|
||||
CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")"
|
||||
while true; do
|
||||
if [ -n "${USERID}" ] && [ "${ARCOFFLINE}" != "true" ]; then
|
||||
if [ -n "${USERID}" ] && [ "${ARCOFFLINE}" != "true" ] && [ "${CONFDONE}" = "true" ]; then
|
||||
dialog --backtitle "$(backtitle)" --title "Backup" --cancel-label "Exit" --menu "Choose an Option" 0 0 0 \
|
||||
1 "Restore Arc Config from DSM" \
|
||||
2 "Restore HW Encryption Key from DSM" \
|
||||
@@ -703,6 +716,13 @@ function backupMenu() {
|
||||
4 "Restore Arc Config from Online" \
|
||||
5 "Backup Arc Config to Online" \
|
||||
2>"${TMP_PATH}/resp"
|
||||
elif [ -n "${USERID}" ] && [ "${ARCOFFLINE}" != "true" ]; then
|
||||
dialog --backtitle "$(backtitle)" --title "Backup" --cancel-label "Exit" --menu "Choose an Option" 0 0 0 \
|
||||
1 "Restore Arc Config from DSM" \
|
||||
2 "Restore HW Encryption Key from DSM" \
|
||||
3 "Backup HW Encryption Key to DSM" \
|
||||
4 "Restore Arc Config from Online" \
|
||||
2>"${TMP_PATH}/resp"
|
||||
else
|
||||
dialog --backtitle "$(backtitle)" --title "Backup" --cancel-label "Exit" --menu "Choose an Option" 0 0 0 \
|
||||
1 "Restore Arc Config from DSM" \
|
||||
@@ -867,6 +887,9 @@ function backupMenu() {
|
||||
dialog --backtitle "$(backtitle)" --title "Online Backup" --msgbox "Online Backup failed!" 5 40
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
@@ -933,6 +956,9 @@ function updateMenu() {
|
||||
fi
|
||||
writeConfigKey "arc.branch" "${ARC_BRANCH}" "${USER_CONFIG_FILE}"
|
||||
;;
|
||||
*)
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
return
|
||||
@@ -1193,24 +1219,20 @@ function sysinfo() {
|
||||
NUMPORTS=$((${NUMPORTS} + ${PORTNUM}))
|
||||
fi
|
||||
TEXT+="\n Total Disks: \Zb${NUMPORTS}\Zn"
|
||||
if [ -n "${USERID}" ]; then
|
||||
if [ -n "${USERID}" ] && [ "${CONFDONE}" = "true" ]; then
|
||||
echo -e "${TEXT}" >"${TMP_PATH}/sysinfo.yml"
|
||||
while true; do
|
||||
dialog --backtitle "$(backtitle)" --colors --ok-label "Exit" --help-button --help-label "Show Cmdline" \
|
||||
--extra-button --extra-label "Upload" --title "Sysinfo" --msgbox "${TEXT}" 0 0
|
||||
RET=$?
|
||||
case ${RET} in
|
||||
0) # ok-button
|
||||
return 0
|
||||
break
|
||||
;;
|
||||
2) # help-button
|
||||
2)
|
||||
getCMDline
|
||||
;;
|
||||
3) # extra-button
|
||||
3)
|
||||
uploadDiag
|
||||
;;
|
||||
255) # ESC-button
|
||||
*)
|
||||
return 0
|
||||
break
|
||||
;;
|
||||
@@ -1222,14 +1244,10 @@ function sysinfo() {
|
||||
--title "Sysinfo" --msgbox "${TEXT}" 0 0
|
||||
RET=$?
|
||||
case ${RET} in
|
||||
0) # ok-button
|
||||
return 0
|
||||
break
|
||||
;;
|
||||
2) # help-button
|
||||
2)
|
||||
getCMDline
|
||||
;;
|
||||
255) # ESC-button
|
||||
*)
|
||||
return 0
|
||||
break
|
||||
;;
|
||||
@@ -1386,7 +1404,7 @@ function staticIPMenu() {
|
||||
2>"${TMP_PATH}/resp"
|
||||
RET=$?
|
||||
case ${RET} in
|
||||
0) # ok-button
|
||||
0)
|
||||
address="$(sed -n '1p' "${TMP_PATH}/resp" 2>/dev/null)"
|
||||
netmask="$(sed -n '2p' "${TMP_PATH}/resp" 2>/dev/null)"
|
||||
gateway="$(sed -n '3p' "${TMP_PATH}/resp" 2>/dev/null)"
|
||||
@@ -1425,10 +1443,10 @@ function staticIPMenu() {
|
||||
--progressbox "Setting IP ..." 20 100
|
||||
break
|
||||
;;
|
||||
1) # cancel-button
|
||||
1)
|
||||
break
|
||||
;;
|
||||
255) # ESC
|
||||
*)
|
||||
break 2
|
||||
;;
|
||||
esac
|
||||
@@ -1658,12 +1676,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 +1699,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,12 +1752,17 @@ 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
|
||||
break
|
||||
;;
|
||||
255) # ESC
|
||||
*)
|
||||
break
|
||||
;;
|
||||
esac
|
||||
@@ -2238,7 +2263,7 @@ function dtsMenu() {
|
||||
3 "Edit dts file" \
|
||||
2>${TMP_PATH}/resp
|
||||
[ $? -ne 0 ] && break
|
||||
case "$(cat ${TMP_PATH}/resp)" in %) ;;
|
||||
case "$(cat ${TMP_PATH}/resp)" in
|
||||
1)
|
||||
if ! tty 2>/dev/null | grep -q "/dev/pts"; then #if ! tty 2>/dev/null | grep -q "/dev/pts" || [ -z "${SSH_TTY}" ]; then
|
||||
MSG=""
|
||||
@@ -2301,7 +2326,7 @@ function dtsMenu() {
|
||||
dialog --backtitle "$(backtitle)" --title "Edit with caution" \
|
||||
--editbox "${TMP_PATH}/model.dts" 0 0 2>"${TMP_PATH}/modelEdit.dts"
|
||||
[ $? -ne 0 ] && rm -f "${TMP_PATH}/model.dts" "${TMP_PATH}/modelEdit.dts" && return
|
||||
dtc -q -I dts -O dtb "${TMP_PATH}/modelEdit.dts" >"test.dtb" 2>"${DTC_ERRLOG}"
|
||||
dtc -q -I dts -O dtb "${TMP_PATH}/modelEdit.dts}" >"test.dtb" 2>"${DTC_ERRLOG}"
|
||||
if [ $? -ne 0 ]; then
|
||||
dialog --backtitle "$(backtitle)" --title "Custom DTS" \
|
||||
--msgbox "Not a valid dts file, please try again!\n\n$(cat "${DTC_ERRLOG}")" 0 0
|
||||
@@ -2315,6 +2340,9 @@ function dtsMenu() {
|
||||
fi
|
||||
done
|
||||
;;
|
||||
*)
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
@@ -2411,7 +2439,7 @@ function checkHardwareID() {
|
||||
writeConfigKey "arc.userid" "" "${USER_CONFIG_FILE}"
|
||||
[ -f "${S_FILE}.bak" ] && mv -f "${S_FILE}.bak" "${S_FILE}" 2>/dev/null
|
||||
fi
|
||||
return
|
||||
return 0
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -59,7 +59,7 @@ BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
|
||||
###############################################################################
|
||||
# Mounts backtitle dynamically
|
||||
function backtitle() {
|
||||
BACKTITLE="${ARC_TITLE}$([ -n "${NEWTAG}" ] && [ ${ARC_VERSION//[!0-9]/} -lt ${NEWTAG//[!0-9]/} ] && echo " > ${NEWTAG}") | "
|
||||
BACKTITLE="${ARC_TITLE}$([ -n "${NEWTAG}" ] && [ -n "${ARC_VERSION}" ] && [ ${ARC_VERSION//[!0-9]/} -lt ${NEWTAG//[!0-9]/} ] && echo " > ${NEWTAG}") | "
|
||||
BACKTITLE+="${MODEL:-(Model)} | "
|
||||
BACKTITLE+="${PRODUCTVER:-(Version)} | "
|
||||
BACKTITLE+="${IPCON:-(IP)} | "
|
||||
@@ -165,25 +165,21 @@ function arcModel() {
|
||||
--file "${TMP_PATH}/menu" 2>"${TMP_PATH}/resp"
|
||||
RET=$?
|
||||
case ${RET} in
|
||||
0) # ok-button
|
||||
0)
|
||||
resp=$(cat ${TMP_PATH}/resp)
|
||||
[ -z "${resp}" ] && return 1
|
||||
break
|
||||
;;
|
||||
1) # cancel-button -> Show all Models
|
||||
1)
|
||||
[ ${RESTRICT} -eq 1 ] && RESTRICT=0 || RESTRICT=1
|
||||
;;
|
||||
2) # help-button -> Exit
|
||||
return 1
|
||||
break
|
||||
;;
|
||||
3) # extra-button -> Platform Info
|
||||
3)
|
||||
resp=$(cat ${TMP_PATH}/resp)
|
||||
PLATFORM="$(grep -w "${resp}" "${TMP_PATH}/modellist" | awk '{print $2}' | head -n 1)"
|
||||
dialog --backtitle "$(backtitlep)" --colors \
|
||||
--title "Platform Info" --textbox "./informations/${PLATFORM}.yml" 70 80
|
||||
;;
|
||||
255) # ESC -> Exit
|
||||
*)
|
||||
return 1
|
||||
break
|
||||
;;
|
||||
|
||||
@@ -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.
@@ -519,7 +519,7 @@ function onlineCheck() {
|
||||
writeConfigKey "keymap" "${KEYMAP}" "${USER_CONFIG_FILE}"
|
||||
fi
|
||||
fi
|
||||
[ $(echo "${ARC_VERSION}" | grep "dev" | wc -l) -eq 0 ] && NEWTAG="$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | grep -v "dev" | sort -rV | head -1)" || NEWTAG="$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | grep "dev" | sort -rV | head -1)"
|
||||
NEWTAG="$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | grep -v "dev" | sort -rV | head -1)"
|
||||
if [ -n "${NEWTAG}" ]; then
|
||||
writeConfigKey "arc.offline" "false" "${USER_CONFIG_FILE}"
|
||||
updateOffline
|
||||
@@ -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
|
||||
|
||||
@@ -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}"
|
||||
|
||||
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
|
||||
@@ -63,7 +63,7 @@ function set_gfxpayload {
|
||||
fi
|
||||
}
|
||||
|
||||
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 intel_pstate=disable nox2apic nomodeset 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
|
||||
|
||||
@@ -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