tree: more rewrite

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-06-30 10:31:51 +02:00
parent 9a14abbab6
commit f519c386a1
11 changed files with 37 additions and 19 deletions

View File

@ -76,7 +76,7 @@ function addonSelection() {
function modulesMenu() {
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.[${PRODUCTVER}].kver" "${P_FILE}")"
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")"
# Modify KVER for Epyc7002
if [ "${PLATFORM}" == "epyc7002" ]; then
KVERP="${PRODUCTVER}-${KVER}"
@ -1071,7 +1071,7 @@ function sysinfo() {
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
DT="$(readConfigKey "platforms.${PLATFORM}.dt" "${P_FILE}")"
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.[${PRODUCTVER}].kver" "${P_FILE}")"
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")"
ARCPATCH="$(readConfigKey "arc.patch" "${USER_CONFIG_FILE}")"
ADDONSINFO="$(readConfigEntriesArray "addons" "${USER_CONFIG_FILE}")"
REMAP="$(readConfigKey "arc.remap" "${USER_CONFIG_FILE}")"

View File

@ -290,7 +290,7 @@ function arcVersion() {
fi
done < <(readConfigMap "addons" "${USER_CONFIG_FILE}")
# Reset Modules
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.[${PRODUCTVER}].kver" "${P_FILE}")"
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")"
# Modify KVER for Epyc7002
if [ "${PLATFORM}" == "epyc7002" ]; then
KVERP="${PRODUCTVER}-${KVER}"
@ -522,7 +522,7 @@ function arcSummary() {
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
DT="$(readConfigKey "platforms.${PLATFORM}.dt" "${P_FILE}")"
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.[${PRODUCTVER}].kver" "${P_FILE}")"
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")"
ARCPATCH="$(readConfigKey "arc.patch" "${USER_CONFIG_FILE}")"
ADDONSINFO="$(readConfigEntriesArray "addons" "${USER_CONFIG_FILE}")"
REMAP="$(readConfigKey "arc.remap" "${USER_CONFIG_FILE}")"
@ -1046,7 +1046,7 @@ else
fi
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.[${PRODUCTVER}].kver" "${P_FILE}")"
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")"
if [ -n "${PLATFORM}" ] && [ -n "${KVER}" ]; then
if [ "${PLATFORM}" == "epyc7002" ]; then
KVERP="${PRODUCTVER}-${KVER}"

View File

@ -68,7 +68,7 @@ function bootDSM () {
SN="$(readConfigKey "arc.sn" "${USER_CONFIG_FILE}")"
KERNELPANIC="$(readConfigKey "arc.kernelpanic" "${USER_CONFIG_FILE}")"
DT="$(readConfigKey "platforms.${PLATFORM}.dt" "${P_FILE}")"
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.[${PRODUCTVER}].kver" "${P_FILE}")"
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")"
declare -A CMDLINE
@ -135,12 +135,26 @@ function bootDSM () {
[ "${CMDLINE['modprobe.blacklist']}" != "" ] && CMDLINE['modprobe.blacklist']+=","
CMDLINE['modprobe.blacklist']+="mpt3sas"
fi
if true; then
[ ! "${CMDLINE['modprobe.blacklist']}" = "" ] && CMDLINE['modprobe.blacklist']+=","
CMDLINE['modprobe.blacklist']+="evbug"
fi
if echo "apollolake geminilake" | grep -wq "${PLATFORM}"; then
CMDLINE["intel_iommu"]="igfx_off"
fi
if echo "purley broadwellnkv2" | grep -wq "${PLATFORM}"; then
CMDLINE["SASmodel"]="1"
fi
# Disable x2apic
if echo "apollolake geminilake purley" | grep -wq "${PLATFORM}"; then
if grep -q "^flags.*x2apic.*" /proc/cpuinfo; then
eval $(grep -o "ARC_CMDLINE=.*$" "${USER_GRUB_CONFIG}")
[ -z "${ARC_CMDLINE}" ] && ARC_CMDLINE="bzImage-arc"
echo "${ARC_CMDLINE}" | grep -q 'nox2apic' || sed -i "s|${ARC_CMDLINE}|${ARC_CMDLINE} nox2apic|" "${USER_GRUB_CONFIG}"
fi
else
grep -q ' nox2apic' "${USER_GRUB_CONFIG}" && sed -i "s| nox2apic||" "${USER_GRUB_CONFIG}"
fi
# Cmdline NIC Settings
ETHN=0

View File

@ -250,12 +250,14 @@ function _sort_netif() {
# 1 - device path
function getBus() {
BUS=""
# xen
[ -z "${BUS}" ] && BUS=$(lsblk -dpno KNAME,SUBSYSTEMS 2>/dev/null | grep "${1} " | grep -q "xen" && echo "xen")
# usb/ata(sata/ide)/scsi
[ -z "${BUS}" ] && BUS=$(udevadm info --query property --name "${1}" 2>/dev/null | grep ID_BUS | cut -d= -f2 | sed 's/ata/sata/')
# usb/sata(sata/ide)/nvme
[ -z "${BUS}" ] && BUS=$(lsblk -dpno KNAME,TRAN 2>/dev/null | grep "${1} " | awk '{print $2}') #Spaces are intentional
# usb/scsi(sata/ide)/virtio(scsi/virtio)/mmc/nvme
[ -z "${BUS}" ] && BUS=$(lsblk -dpno KNAME,SUBSYSTEMS 2>/dev/null | grep "${1} " | awk -F':' '{print $(NF-1)}' | sed 's/_host//') #Spaces are intentional
[ -z "${BUS}" ] && BUS=$(lsblk -dpno KNAME,SUBSYSTEMS 2>/dev/null | grep "${1} " | awk '{print $2}' | awk -F':' '{print $(NF-1)}' | sed 's/_host//') # Spaces are intentional
echo "${BUS}"
return 0
}

View File

@ -273,7 +273,7 @@ function updateModules() {
local PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
if [ -n "${PRODUCTVER}" ]; then
local PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
local KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.[${PRODUCTVER}].kver" "${P_FILE}")"
local KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")"
# Modify KVER for Epyc7002
if [ "${PLATFORM}" = "epyc7002" ]; then
KVERP="${PRODUCTVER}-${KVER}"

View File

@ -118,12 +118,12 @@ echo
VID="0x46f4"
PID="0x0001"
BUSLIST="usb sata scsi nvme mmc"
BUSLIST="usb sata scsi nvme mmc xen"
if [ "${BUS}" == "usb" ]; then
VID="0x$(udevadm info --query property --name "${LOADER_DISK}" | grep ID_VENDOR_ID | cut -d= -f2)"
PID="0x$(udevadm info --query property --name "${LOADER_DISK}" | grep ID_MODEL_ID | cut -d= -f2)"
elif ! echo "${BUSLIST}" | grep -wq "${BUS}"; then
die "Loader disk is not USB or SATA/SCSI/NVME/eMMC DoM"
die "Loader disk is not USB or SATA/SCSI/NVME/eMMC/XEN"
fi
# Save variables to user config file

View File

@ -60,7 +60,7 @@ if [ "${PRODUCTVERDSM}" != "${PRODUCTVER}" ]; then
fi
# Read model data
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.[${PRODUCTVER}].kver" "${P_FILE}")"
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")"
# Modify KVER for Epyc7002
if [ "${PLATFORM}" == "epyc7002" ]; then

View File

@ -7,7 +7,7 @@
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.[${PRODUCTVER}].kver" "${P_FILE}")"
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")"
# Adapted from: scripts/Makefile.lib
# Usage: size_append FILE [FILE2] [FILEn]...

View File

@ -16,7 +16,7 @@ if [ "${KERNEL}" == "custom" ]; then
echo -n " - Using customized Kernel"
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.[${PRODUCTVER}].kver" "${P_FILE}")"
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")"
# Modify KVER for Epyc7002
if [ "${PLATFORM}" == "epyc7002" ]; then
KVERP="${PRODUCTVER}-${KVER}"

View File

@ -79,7 +79,7 @@ set menu_color_highlight=white/red
set color_normal=white/black
set ARC_CMDLINE="console=tty2 root=/dev/ram net.ifnames=0"
set ARC_CONFIG_CMDLINE="console=tty2 root=/dev/ram net.ifnames=0 ipv6.disable=1"
# set ARC_CONFIG_CMDLINE="console=tty2 root=/dev/ram net.ifnames=0 ipv6.disable=1"
search --set=root --label "ARC3"
if [ -s /zImage-dsm -a -s /initrd-dsm ]; then
@ -109,7 +109,7 @@ if [ -s /automated ]; then
menuentry 'Arc Automated Build Mode' --id automated {
set_gfxpayload
echo "Loading Arc Kernel..."
linux /bzImage-arc ${ARC_CONFIG_CMDLINE} automated_arc
linux /bzImage-arc ${ARC_CMDLINE} automated_arc
echo "Loading Arc Initramfs..."
initrd /initrd-arc
echo "Booting..."
@ -119,7 +119,7 @@ fi
menuentry 'Arc Config Mode' --id config {
set_gfxpayload
echo "Loading Arc Kernel..."
linux /bzImage-arc ${ARC_CONFIG_CMDLINE} force_arc
linux /bzImage-arc ${ARC_CMDLINE} force_arc
echo "Loading Arc Initramfs..."
initrd /initrd-arc
echo "Booting..."
@ -128,7 +128,7 @@ menuentry 'Arc Config Mode' --id config {
menuentry 'Arc Update Mode' --id update {
set_gfxpayload
echo "Loading Arc Kernel..."
linux /bzImage-arc ${ARC_CONFIG_CMDLINE} update_arc
linux /bzImage-arc ${ARC_CMDLINE} update_arc
echo "Loading Arc Initramfs..."
initrd /initrd-arc
echo "Booting..."
@ -138,7 +138,7 @@ if [ -s /zImage-dsm -a -s /initrd-dsm ]; then
menuentry 'DSM Recovery Mode' --id recovery {
set_gfxpayload
echo "Loading Arc Kernel..."
linux /bzImage-arc ${ARC_CONFIG_CMDLINE} recovery
linux /bzImage-arc ${ARC_CMDLINE} recovery
echo "Loading Arc Initramfs..."
initrd /initrd-arc
echo "Booting..."
@ -146,7 +146,7 @@ if [ -s /zImage-dsm -a -s /initrd-dsm ]; then
menuentry 'DSM Reinstall Mode' --id junior {
set_gfxpayload
echo "Loading Arc Kernel..."
linux /bzImage-arc ${ARC_CONFIG_CMDLINE} force_junior
linux /bzImage-arc ${ARC_CMDLINE} force_junior
echo "Loading Arc Initramfs..."
initrd /initrd-arc
echo "Booting..."

View File

@ -386,6 +386,8 @@ extendedConfigFile = "${VMNAME}.vmxf"
floppy0.present = "FALSE"
ethernet0.addressType = "generated"
ethernet0.virtualDev = "vmxnet3"
ethernet0.connectionType = "nat"
ethernet0.allowguestconnectioncontrol = "true"
ethernet0.present = "TRUE"
sata0.present = "TRUE"
sata0:0.fileName = "${VMNAME}-disk1.vmdk"