Skip to content

Commit 513dd1c

Browse files
author
jfliu
committed
grub read dtb name from smbios oem string
1 parent 40fe40f commit 513dd1c

File tree

4 files changed

+14
-61
lines changed

4 files changed

+14
-61
lines changed

10_linux

+3-23
Original file line numberDiff line numberDiff line change
@@ -186,29 +186,9 @@ EOF
186186
fi
187187
if test -e /sys/firmware/devicetree/base/name; then
188188
sed "s/^/$submenu_indentation/" << EOF
189-
smbios -t 1 -s 5 --set=productname
190-
if [ "\$productname" == "ROCK 5 Model B" ];then
191-
devicetree ${rel_dirname}/dtb/rockchip/rk3588-rock-5b.dtb
192-
elif [ "\$productname" == "ROCK 5 Model A" ];then
193-
devicetree ${rel_dirname}/dtb/rockchip/rk3588s-rock-5a.dtb
194-
elif [ "\$productname" == "Indiedroid Nova" ];then
195-
devicetree ${rel_dirname}/dtb/rockchip/rk3588s-9tripod-linux.dtb
196-
elif [ "\$productname" == "NanoPC T6" ];then
197-
devicetree ${rel_dirname}/dtb/rockchip/rk3588-nanopc-t6.dtb
198-
elif [ "\$productname" == "NanoPi R6S" ];then
199-
devicetree ${rel_dirname}/dtb/rockchip/rk3588s-nanopi-r6s.dtb
200-
elif [ "\$productname" == "Edge2" ];then
201-
devicetree ${rel_dirname}/dtb/rockchip/rk3588s-khadas-edge2.dtb
202-
elif [ "\$productname" == "R58 Mini" ];then
203-
devicetree ${rel_dirname}/dtb/rockchip/rk3588-blueberry-minipc-linux.dtb
204-
elif [ "\$productname" == "R58X" ];then
205-
devicetree ${rel_dirname}/dtb/rockchip/rk3588-blueberry-edge-v10-linux.dtb
206-
elif [ "\$productname" == "Orange Pi 5" ];then
207-
devicetree ${rel_dirname}/dtb/rockchip/rk3588s-orangepi-5.dtb
208-
elif [ "\$productname" == "Orange Pi 5 Plus" ];then
209-
devicetree ${rel_dirname}/dtb/rockchip/rk3588-orangepi-5-plus.dtb
210-
elif [ "\$productname" == "H88K" ];then
211-
devicetree ${rel_dirname}/dtb/rockchip/rk3588-hinlink-h88k.dtb
189+
smbios -t 11 -s 4 --set=devicetreename
190+
if [ -f "${rel_dirname}/dtb/rockchip/\$devicetreename" ];then
191+
devicetree ${rel_dirname}/dtb/rockchip/\$devicetreename
212192
fi
213193
EOF
214194
fi

grub-dtb.patch

+5-34
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,15 @@
11
diff --git a/scripts/build/binary_grub_cfg b/scripts/build/binary_grub_cfg
2-
index c41a4fba4..f7c91b6f7 100755
2+
index c41a4fba4..9d7fd0bdc 100755
33
--- a/scripts/build/binary_grub_cfg
44
+++ b/scripts/build/binary_grub_cfg
5-
@@ -54,6 +54,30 @@ Grub_live_menu_entry() {
5+
@@ -54,6 +54,10 @@ Grub_live_menu_entry() {
66

77
cat >> "${LIVE_ENTRIES_TMP}" <<END
88
menuentry "${LABEL}"${HOTKEY} {
9-
+ smbios -t 1 -s 5 --set=productname
10-
+ if [ "\$productname" == "ROCK 5 Model B" ];then
11-
+ devicetree $(dirname $KERNEL)/dtb/rockchip/rk3588-rock-5b.dtb
12-
+ elif [ "\$productname" == "ROCK 5 Model A" ];then
13-
+ devicetree $(dirname $KERNEL)/dtb/rockchip/rk3588s-rock-5a.dtb
14-
+ elif [ "\$productname" == "Indiedroid Nova" ];then
15-
+ devicetree $(dirname $KERNEL)/dtb/rockchip/rk3588s-9tripod-linux.dtb
16-
+ elif [ "\$productname" == "NanoPC T6" ];then
17-
+ devicetree $(dirname $KERNEL)/dtb/rockchip/rk3588-nanopc-t6.dtb
18-
+ elif [ "\$productname" == "NanoPi R6S" ];then
19-
+ devicetree $(dirname $KERNEL)/dtb/rockchip/rk3588s-nanopi-r6s.dtb
20-
+ elif [ "\$productname" == "Edge2" ];then
21-
+ devicetree $(dirname $KERNEL)/dtb/rockchip/rk3588s-khadas-edge2.dtb
22-
+ elif [ "\$productname" == "R58 Mini" ];then
23-
+ devicetree $(dirname $KERNEL)/dtb/rockchip/rk3588-blueberry-minipc-linux.dtb
24-
+ elif [ "\$productname" == "R58X" ];then
25-
+ devicetree $(dirname $KERNEL)/dtb/rockchip/rk3588-blueberry-edge-v10-linux.dtb
26-
+ elif [ "\$productname" == "Orange Pi 5" ];then
27-
+ devicetree $(dirname $KERNEL)/dtb/rockchip/rk3588s-orangepi-5.dtb
28-
+ elif [ "\$productname" == "Orange Pi 5 Plus" ];then
29-
+ devicetree $(dirname $KERNEL)/dtb/rockchip/rk3588-orangepi-5-plus.dtb
30-
+ elif [ "\$productname" == "H88K" ];then
31-
+ devicetree $(dirname $KERNEL)/dtb/rockchip/rk3588-hinlink-h88k.dtb
9+
+ smbios -t 11 -s 4 --set=devicetreename
10+
+ if [ -f "\$devicetreename" ];then
11+
+ devicetree $(dirname $KERNEL)/dtb/rockchip/\$devicetreename
3212
+ fi
3313
linux $KERNEL $APPEND
3414
initrd $INITRD
3515
}
36-
@@ -114,7 +138,7 @@ fi
37-
38-
# Default entries
39-
DEFAULT_FLAVOUR="$(echo ${LB_LINUX_FLAVOURS} | awk '{ print $1 }')"
40-
-DEFAULT_KERNEL="$(basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR})"
41-
+DEFAULT_KERNEL="$(basename chroot/boot/vmlinuz-*)"
42-
DEFAULT_INITRD="initrd.img-$(echo ${DEFAULT_KERNEL} | sed -e 's|vmlinuz-||')"
43-
44-
KERNEL_LIVE="/${INITFS}/${DEFAULT_KERNEL}"

lb-config-bookworm.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ LB_IMAGE_NAME="debian-bookworm-live" lb config \
2525
--mirror-binary-security "http://security.debian.org/debian-security/" \
2626
--mirror-debian-installer "http://ftp.debian.org/debian/"
2727

28-
echo "deb https://beta.armbian.com bookworm main bookworm-utils bookworm-desktop" > config/archives/live.list.chroot
29-
echo "deb https://beta.armbian.com bookworm main bookworm-utils bookworm-desktop" > config/archives/live.list.binary
28+
echo "deb https://apt.armbian.com bookworm main bookworm-utils bookworm-desktop" > config/archives/live.list.chroot
29+
echo "deb https://apt.armbian.com bookworm main bookworm-utils bookworm-desktop" > config/archives/live.list.binary
3030
echo "deb https://download.opensuse.org/repositories/home:/amazingfate:/panfork-mesa/Debian_12/ ./" >> config/archives/live.list.chroot
3131
echo "deb https://download.opensuse.org/repositories/home:/amazingfate:/panfork-mesa/Debian_12/ ./" >> config/archives/live.list.binary
3232

lb-config-jammy.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@ LB_IMAGE_NAME="ubuntu-jammy-live" lb config \
2525
--mirror-binary-security "http://ports.ubuntu.com" \
2626
--mirror-debian-installer "http://ports.ubuntu.com"
2727

28-
echo "deb https://beta.armbian.com jammy main jammy-utils jammy-desktop" > config/archives/live.list.chroot
28+
echo "deb https://apt.armbian.com jammy main jammy-utils jammy-desktop" > config/archives/live.list.chroot
2929
echo "deb https://ppa.launchpadcontent.net/liujianfeng1994/panfork-mesa/ubuntu/ jammy main" >> config/archives/live.list.chroot
3030
echo "deb https://ppa.launchpadcontent.net/liujianfeng1994/rockchip-multimedia/ubuntu/ jammy main" >> config/archives/live.list.chroot
31-
echo "deb https://beta.armbian.com jammy main jammy-utils jammy-desktop" > config/archives/live.list.binary
31+
echo "deb https://apt.armbian.com jammy main jammy-utils jammy-desktop" > config/archives/live.list.binary
32+
echo "deb https://ppa.launchpadcontent.net/liujianfeng1994/panfork-mesa/ubuntu/ jammy main" >> config/archives/live.list.binary
33+
echo "deb https://ppa.launchpadcontent.net/liujianfeng1994/rockchip-multimedia/ubuntu/ jammy main" >> config/archives/live.list.binary
3234

3335
wget https://raw.githubusercontent.com/armbian/build/main/config/armbian.key
3436
gpg --dearmor < armbian.key > armbian.gpg

0 commit comments

Comments
 (0)