Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/boards/radxa-nio-12l.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ BOARD_MAINTAINER="HeyMeco"
KERNEL_TARGET="collabora"
KERNEL_TEST_TARGET="collabora"
BOOT_FDT_FILE="mediatek/mt8395-radxa-nio-12l.dtb"
enable_extension "grub-with-dtb"
SERIALCON="ttyS0:921600"
HAS_VIDEO_OUTPUT="yes"

# Post-config function for vendor branch
Expand Down
5 changes: 5 additions & 0 deletions config/bootenv/genio.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
verbosity=1
bootlogo=false
console=both


117 changes: 117 additions & 0 deletions config/bootscripts/boot-genio.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# DO NOT EDIT THIS FILE
#
# Please edit /boot/armbianEnv.txt to set supported parameters
#

setenv overlay_error "false"
# default values
setenv rootdev "LABEL=armbi_root"
setenv verbosity "1"
setenv console "both"
setenv bootlogo "false"
setenv rootfstype "ext4"
setenv docker_optimizations "on"
setenv earlycon "off"

# Set load address for temporary file loading (armbianEnv.txt, overlays, etc)
# Using address that doesn't conflict with kernel (0x45000000), ramdisk (0x49000000), or fdt (0x44000000)
Comment thread
HeyMeco marked this conversation as resolved.
Outdated
setenv load_addr "0x43000000"

test -n "${distro_bootpart}" || distro_bootpart=1

echo "Boot script loaded from ${devtype} ${devnum}:${distro_bootpart}"

# get PARTUUID of first partition on SD/eMMC/UFS the boot script was loaded from
echo "Detecting PARTUUID for ${devtype} device ${devnum}:${distro_bootpart}..."
if test "${devtype}" = "mmc"; then part uuid mmc ${devnum}:${distro_bootpart} partuuid; fi
Comment thread
HeyMeco marked this conversation as resolved.
Outdated
if test "${devtype}" = "scsi"; then part uuid scsi ${devnum}:${distro_bootpart} partuuid; fi

# Use PARTUUID if available (more reliable), otherwise fall back to rootdev label
if test -n "${partuuid}"; then
echo "PARTUUID detected: ${partuuid}"
setenv rootdev "PARTUUID=${partuuid}"
echo "Set default rootdev=${rootdev}"
Comment thread
HeyMeco marked this conversation as resolved.
Outdated
else
echo "PARTUUID not available, keeping fallback rootdev=${rootdev}"
fi

# Load armbianEnv.txt if it exists - using direct load instead of test -e for better compatibility
# This happens AFTER PARTUUID detection so user can override rootdev if needed
echo "Attempting to load ${prefix}armbianEnv.txt from ${devtype} ${devnum}:${distro_bootpart} to ${load_addr}..."
if load ${devtype} ${devnum}:${distro_bootpart} ${load_addr} ${prefix}armbianEnv.txt; then
echo "Successfully loaded armbianEnv.txt (${filesize} bytes)"
if env import -t ${load_addr} ${filesize}; then
echo "Successfully imported environment from armbianEnv.txt"
else
echo "Warning: Failed to import environment from armbianEnv.txt"
fi
else
echo "armbianEnv.txt not found or failed to load - using default environment"
fi

echo "Final rootdev: ${rootdev}"

if test "${logo}" = "disabled"; then setenv logo "logo.nologo"; fi
Comment thread
HeyMeco marked this conversation as resolved.
Outdated

if test "${console}" = "display" || test "${console}" = "both"; then setenv consoleargs "console=tty1"; fi
if test "${console}" = "serial" || test "${console}" = "both"; then setenv consoleargs "console=ttyS0,921600 ${consoleargs}"; fi
if test "${earlycon}" = "on"; then setenv consoleargs "earlycon ${consoleargs}"; fi
if test "${bootlogo}" = "true"; then
setenv consoleargs "splash plymouth.ignore-serial-consoles ${consoleargs}"
else
setenv consoleargs "splash=verbose ${consoleargs}"
fi

setenv bootargs "root=${rootdev} rootwait rootfstype=${rootfstype} ${consoleargs} consoleblank=0 loglevel=${verbosity} ubootpart=${partuuid} usb-storage.quirks=${usbstoragequirks} ${extraargs} ${extraboardargs}"

if test "${docker_optimizations}" = "on"; then setenv bootargs "${bootargs} cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory"; fi

echo "Final bootargs: ${bootargs}"

echo "Loading kernel image to ${kernel_addr_r}..."
load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} ${prefix}Image
echo "Loading initramfs to ${ramdisk_addr_r}..."
load ${devtype} ${devnum}:${distro_bootpart} ${ramdisk_addr_r} ${prefix}uInitrd
echo "Loading device tree ${fdtfile} to ${fdt_addr_r}..."
load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}dtb/${fdtfile}
fdt addr ${fdt_addr_r}
fdt resize 65536
for overlay_file in ${overlays}; do
if load ${devtype} ${devnum}:${distro_bootpart} ${load_addr} ${prefix}dtb/mediatek/overlay/${overlay_prefix}-${overlay_file}.dtbo; then
echo "Applying kernel provided DT overlay ${overlay_prefix}-${overlay_file}.dtbo"
fdt apply ${load_addr} || setenv overlay_error "true"
elif load ${devtype} ${devnum}:${distro_bootpart} ${load_addr} ${prefix}dtb/mediatek/overlay/${overlay_file}.dtbo; then
echo "Applying kernel provided DT overlay ${overlay_file}.dtbo"
fdt apply ${load_addr} || setenv overlay_error "true"
fi
done
for overlay_file in ${user_overlays}; do
if load ${devtype} ${devnum}:${distro_bootpart} ${load_addr} ${prefix}overlay-user/${overlay_file}.dtbo; then
echo "Applying user provided DT overlay ${overlay_file}.dtbo"
fdt apply ${load_addr} || setenv overlay_error "true"
fi
done
if test "${overlay_error}" = "true"; then
echo "Error applying DT overlays, restoring original DT"
load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}dtb/${fdtfile}
else
if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}dtb/mediatek/overlay/${overlay_prefix}-fixup.scr; then
load ${devtype} ${devnum}:${distro_bootpart} ${load_addr} ${prefix}dtb/mediatek/overlay/${overlay_prefix}-fixup.scr
echo "Applying kernel provided DT fixup script (${overlay_prefix}-fixup.scr)"
source ${load_addr}
fi
if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}fixup.scr; then
load ${devtype} ${devnum}:${distro_bootpart} ${load_addr} ${prefix}fixup.scr
echo "Applying user provided fixup script (fixup.scr)"
source ${load_addr}
fi
fi

Comment thread
HeyMeco marked this conversation as resolved.
echo "Trying 'kaslrseed' command... Info: 'Unknown command' can be safely ignored since 'kaslrseed' does not apply to all boards."
kaslrseed # @TODO: This gives an error (Unknown command ' kaslrseed ' - try 'help') on many devices since CONFIG_CMD_KASLRSEED is not enabled

echo "Booting kernel from ${kernel_addr_r} with initramfs at ${ramdisk_addr_r} and DTB at ${fdt_addr_r}..."
booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}

# Recompile with:
# mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr
10 changes: 7 additions & 3 deletions config/sources/families/genio.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@ declare -g ARCH=arm64
declare -g GOVERNOR=performance
declare -g INSTALL_ARMBIAN_FIRMWARE=no

# GRUB and UEFI configuration
declare -g BOOTCONFIG="none" # Skip U-Boot completely
# U-Boot bootscript configuration
declare -g BOOTCONFIG="none" # Skip U-Boot compilation
declare -g BOOTSCRIPT="boot-genio.cmd:boot.cmd" # Use custom boot script for Genio (compatible with U-Boot without itest/setexpr/bootz)
Comment thread
HeyMeco marked this conversation as resolved.
declare -g BOOTENV_FILE="genio.txt" # Boot environment template for armbianEnv.txt

# GRUB and UEFI configuration (legacy, may be removed)
Comment thread
HeyMeco marked this conversation as resolved.
Outdated
declare -g UEFI_GRUB_TERMINAL="gfxterm" # Use graphics terminal for GRUB
declare -g UEFI_GRUB_TIMEOUT=3 # GRUB menu timeout
declare -g SERIALCON="ttyS0" # Serial console for GRUB | TODO: Figure out if we can get Grub via HDMI too
declare -g BOARD_FIRMWARE_INSTALL="-full" # Install full firmware for UEFI support

# GRUB configuration with DTB support
declare -g GRUB_CMDLINE_LINUX_DEFAULT="console=ttyS0,921600 root=LABEL=armbi_root rootwait rootfstype=ext4 efi=noruntime"
declare -g GRUB_CMDLINE_LINUX_DEFAULT="console=tty1 console=ttyS0,921600 root=LABEL=armbi_root rootwait rootfstype=ext4 efi=noruntime"
Comment thread
HeyMeco marked this conversation as resolved.
Outdated

# Kernel configuration
case $BRANCH in
Expand Down