Skip to content

Commit e25142f

Browse files
committed
arc-functions/boot: rewrite some sanity checks
Signed-off-by: AuxXxilium <[email protected]>
1 parent 4dbd7e2 commit e25142f

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

files/initrd/opt/arc/arc-functions.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ function arcModel() {
5656
for F in ${FLAGS}; do
5757
grep -q "^flags.*${F}.*" /proc/cpuinfo || COMPATIBLE=0
5858
done
59-
for NF in ${NOFLAGS}; do
60-
grep -q "^flags.*${NF}.*" /proc/cpuinfo && COMPATIBLE=0
61-
done
59+
# for NF in ${NOFLAGS}; do
60+
# grep -q "^flags.*${NF}.*" /proc/cpuinfo && COMPATIBLE=0
61+
# done
6262
if is_in_array "${A}" "${KVER5L[@]}"; then
6363
if { [ "${NVMEDRIVES}" -eq 0 ] && [ "${BUS}" = "usb" ] && [ "${SATADRIVES}" -eq 0 ] && [ "${EXTERNALCONTROLLER}" = "false" ]; } ||
6464
{ [ "${NVMEDRIVES}" -eq 0 ] && [ "${BUS}" = "sata" ] && [ "${SATADRIVES}" -eq 1 ] && [ "${EXTERNALCONTROLLER}" = "false" ]; } ||

files/initrd/opt/arc/boot.sh

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,9 @@ RAMTOTAL="$(awk '/MemTotal:/ {printf "%.0f\n", $2 / 1024 / 1024 + 0.5}' /proc/me
6464
BOARD="$(getBoardName)"
6565
MEV="$(virt-what 2>/dev/null | head -1)"
6666
ETHX=($(find /sys/class/net/ -mindepth 1 -maxdepth 1 -name 'eth*' -exec basename {} \; | sort | head -n 2))
67-
DSMINFO="$(readConfigKey "bootscreen.dsminfo" "${USER_CONFIG_FILE}")"
68-
SYSTEMINFO="$(readConfigKey "bootscreen.systeminfo" "${USER_CONFIG_FILE}")"
69-
DISKINFO="$(readConfigKey "bootscreen.diskinfo" "${USER_CONFIG_FILE}")"
70-
HWIDINFO="$(readConfigKey "bootscreen.hwidinfo" "${USER_CONFIG_FILE}")"
7167
GOVERNOR="$(readConfigKey "governor" "${USER_CONFIG_FILE}")"
7268
USBMOUNT="$(readConfigKey "usbmount" "${USER_CONFIG_FILE}")"
7369
HDDSORT="$(readConfigKey "hddsort" "${USER_CONFIG_FILE}")"
74-
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
7570
ARC_PATCH="$(readConfigKey "arc.patch" "${USER_CONFIG_FILE}")"
7671
SN="$(readConfigKey "sn" "${USER_CONFIG_FILE}")"
7772
if [ -z "${SN}" ] || [ "${#SN}" -ne 13 ]; then
@@ -96,12 +91,8 @@ DT="$(readConfigKey "platforms.${PLATFORM}.dt" "${P_FILE}")"
9691
EMMCBOOT="$(readConfigKey "emmcboot" "${USER_CONFIG_FILE}")"
9792
MODBLACKLIST="$(readConfigKey "modblacklist" "${USER_CONFIG_FILE}")"
9893

99-
if [ -f "${PART1_PATH}/GRUB_VER" ]; then
100-
SYS_MODEL="$(_get_conf_kv "${PART1_PATH}/GRUB_VER" "MODEL")"
101-
[ -n "${SYS_MODEL}" ] && [ "${MODEL}" != "${SYS_MODEL}" ] && BUILDDONE="false" || true
102-
fi
103-
10494
# Build Sanity Check
95+
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
10596
if [ "${BUILDDONE}" = "false" ]; then
10697
echo "Build not completed!"
10798
echo "Please run the loader build script again!"
@@ -112,9 +103,17 @@ if [ "${BUILDDONE}" = "false" ]; then
112103
fi
113104

114105
# Show Loader Info
106+
DSMINFO="$(readConfigKey "bootscreen.dsminfo" "${USER_CONFIG_FILE}")"
107+
SYSTEMINFO="$(readConfigKey "bootscreen.systeminfo" "${USER_CONFIG_FILE}")"
108+
DISKINFO="$(readConfigKey "bootscreen.diskinfo" "${USER_CONFIG_FILE}")"
109+
HWIDINFO="$(readConfigKey "bootscreen.hwidinfo" "${USER_CONFIG_FILE}")"
110+
if [ -f "${PART1_PATH}/GRUB_VER" ]; then
111+
SYS_MODEL="$(_get_conf_kv "${PART1_PATH}/GRUB_VER" "MODEL")"
112+
fi
115113
if [ "${DSMINFO}" = "true" ]; then
116114
echo -e "\033[1;34mDSM\033[0m"
117115
echo -e "Model: \033[1;37m${MODEL}\033[0m"
116+
echo -e "System: \033[1;37m${SYS_MODEL}\033[0m"
118117
echo -e "Platform: \033[1;37m${PLATFORM}\033[0m"
119118
echo -e "Version: \033[1;37m${PRODUCTVER} (${BUILDNUM}$([ ${SMALLNUM:-0} -ne 0 ] && echo "u${SMALLNUM}"))\033[0m"
120119
echo -e "Kernel: \033[1;37m${KVER} (${KERNEL})\033[0m"
@@ -313,7 +312,7 @@ else
313312
fi
314313

315314
# Executes DSM kernel via KEXEC
316-
kexec -l "${MOD_ZIMAGE_FILE}" --initrd "${MOD_RDGZ_FILE}" --command-line="${CMDLINE_LINE} kexecboot" >"${LOG_FILE}" 2>&1 || die "Failed to load DSM Kernel!"
315+
kexec -l "${MOD_ZIMAGE_FILE}" --initrd "${MOD_RDGZ_FILE}" --command-line="${CMDLINE_LINE}" >"${LOG_FILE}" 2>&1 || die "Failed to load DSM Kernel!"
317316

318317
for T in $(busybox w 2>/dev/null | grep -v 'TTY' | awk '{print $2}'); do
319318
if [ -w "/dev/${T}" ]; then

0 commit comments

Comments
 (0)