Skip to content

Commit

Permalink
Borrow <KERNEL_BRANCH> to replace <must_kernel_6xy>
Browse files Browse the repository at this point in the history
  • Loading branch information
ophub committed Feb 5, 2023
1 parent acee19b commit d009450
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
15 changes: 9 additions & 6 deletions build-armbian/armbian-files/common-files/etc/model_database.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
# Copyright (C) 2021- https://github.com/ophub/amlogic-s9xxx-armbian
#
# 1.ID 2.MODEL 3.SOC 4.FDTFILE 5.UBOOT_OVERLOAD 6.MAINLINE_UBOOT 7.BOOTLOADER_IMG 8.KERNEL_BRANCH 9.PLATFORM 10.FAMILY 11.BOARD 12.BUILD
# {8.KERNEL_BRANCH} is the directory name of https://github.com/ophub/kernel/tree/main/pub. Rockchip-rk3588 devices must use the kernel of the [ rk3588 ]
# [ 8.KERNEL_BRANCH ] is the directory name of https://github.com/ophub/kernel/tree/main/pub/
# [ rk3588 ] : used for rockchip-rk3588 series devices
# [ 6.x.y ] : stable/6.x.y used for rockchip-rk3399/rk3568 series devices
# [ stable ] : used for all devices
# When building the Armbian firmware, find [ the first ] configuration information with the [ same BOARD name ] and [ BUILD as yes ]
# In [ armbian-install ], only the list of [ the same FAMILY ] is displayed by default
# Description: https://github.com/ophub/amlogic-s9xxx-armbian/blob/main/build-armbian/documents/amlogic_model_database.md
Expand Down Expand Up @@ -149,17 +152,17 @@ r102 :H88K :rk3588 :rk3588-hinlink-h88k.dtb
#-------+----------------------------+---------+---------------------------------------+-----------------------------+------------------------------------+--------------------------------+----------------+-----------+--------------+----------------+-------
# 1.ID 2.MODEL 3.SOC 4.FDTFILE 5.UBOOT_OVERLOAD 6.MAINLINE_UBOOT 7.BOOTLOADER_IMG 8.KERNEL_BRANCH 9.PLATFORM 10.FAMILY 11.BOARD 12.BUILD
#-------+----------------------------+---------+---------------------------------------+-----------------------------+------------------------------------+--------------------------------+----------------+-----------+--------------+----------------+-------
r201 :R66S :rk3568 :rk3568-fastrhino-r66s.dtb :NA :u-boot.itb :idbloader.img :stable :rockchip :rk3568 :r66s :yes
r202 :R68S :rk3568 :rk3568-fastrhino-r68s.dtb :NA :NA :bootloader.bin :stable :rockchip :rk3568 :r68s :yes
r203 :H66K :rk3568 :rk3568-opc-h66k.dtb :NA :NA :bootloader.bin :stable :rockchip :rk3568 :h66k :yes
r204 :H68K :rk3568 :rk3568-opc-h68k.dtb :NA :NA :bootloader.bin :stable :rockchip :rk3568 :h68k :yes
r201 :R66S :rk3568 :rk3568-fastrhino-r66s.dtb :NA :u-boot.itb :idbloader.img :6.x.y :rockchip :rk3568 :r66s :yes
r202 :R68S :rk3568 :rk3568-fastrhino-r68s.dtb :NA :NA :bootloader.bin :6.x.y :rockchip :rk3568 :r68s :yes
r203 :H66K :rk3568 :rk3568-opc-h66k.dtb :NA :NA :bootloader.bin :6.x.y :rockchip :rk3568 :h66k :yes
r204 :H68K :rk3568 :rk3568-opc-h68k.dtb :NA :NA :bootloader.bin :6.x.y :rockchip :rk3568 :h68k :yes


# Rockchip Rockchip-rk3399 Family
#-------+----------------------------+---------+---------------------------------------+-----------------------------+------------------------------------+--------------------------------+----------------+-----------+--------------+----------------+-------
# 1.ID 2.MODEL 3.SOC 4.FDTFILE 5.UBOOT_OVERLOAD 6.MAINLINE_UBOOT 7.BOOTLOADER_IMG 8.KERNEL_BRANCH 9.PLATFORM 10.FAMILY 11.BOARD 12.BUILD
#-------+----------------------------+---------+---------------------------------------+-----------------------------+------------------------------------+--------------------------------+----------------+-----------+--------------+----------------+-------
r301 :EAIDK-610 :rk3399 :rk3399-eaidk-610.dtb :NA :u-boot.itb :idbloader.img :stable :rockchip :rk3399 :eaidk-610 :yes
r301 :EAIDK-610 :rk3399 :rk3399-eaidk-610.dtb :NA :u-boot.itb :idbloader.img :6.x.y :rockchip :rk3399 :eaidk-610 :yes


# Rockchip Rockchip-rk3328 Family
Expand Down
10 changes: 6 additions & 4 deletions build-armbian/armbian-files/common-files/usr/sbin/armbian-update
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,13 @@ init_var() {
[[ "${SOC,,}" == "rk3588" ]] && KERNEL_BRANCH="rk3588" || KERNEL_BRANCH="stable"
echo "KERNEL_BRANCH='${KERNEL_BRANCH}'" >>${ophub_release_file}
}
# Rockchip rk3588 series, such as Rock5b only support rk3588/5.10.y kernel
# Rockchip rk3588 series, such as rock5b only support rk3588/5.10.y kernel
[[ "${SOC,,}" == "rk3588" && "${KERNEL_BRANCH}" != "rk3588" ]] && {
echo -e "${WARNING} Kernel [ ${KERNEL_BRANCH} ] is not available for this device, it has been automatically adjusted to [ rk3588 ]."
KERNEL_BRANCH="rk3588"
}
# Adjust kernel directory [ 6.x.y ] to [ stable ]
[[ "${KERNEL_BRANCH}" == "6.x.y" ]] && KERNEL_BRANCH="stable"

# Display settings results
echo -e "${INFO} Set the kernel name: [ ${inputs_kernel} ]"
Expand Down Expand Up @@ -342,9 +344,9 @@ check_kernel() {
cd ${kernel_path}
echo -e "${STEPS} Start checking the kernel..."

# Rockchip rk3568 series, such as FastRhino R66S/R68S only support 6.x.y kernel
[[ "${SOC,,}" == "rk3568" && "${inputs_kernel:0:2}" != "6." ]] && error_msg "Kernel [ ${inputs_kernel} ] is not available for this device."
# Rockchip rk3588 series, such as Rock5b only support rk3588/5.10.y kernel
# Rockchip rk3568/rk3399 series, such as r66s/r68s/h66k/h68k/eaidk-610 only support 6.x.y kernel
[[ "${SOC,,}" == "rk3568" || "${SOC,,}" == "rk3399" ]] && [[ "${inputs_kernel:0:2}" != "6." ]] && error_msg "Kernel [ ${inputs_kernel} ] is not available for this device."
# Rockchip rk3588 series, such as rock5b only support rk3588/5.10.y kernel
[[ "${SOC,,}" == "rk3588" && "${inputs_kernel:0:5}" != "5.10." ]] && error_msg "Kernel [ ${inputs_kernel} ] is not available for this device."

# Determine custom kernel filename
Expand Down
4 changes: 1 addition & 3 deletions rebuild
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ auto_kernel="true"
# Get the list of devices built by default
# 1.ID 2.MODEL 3.SOC 4.FDTFILE 5.UBOOT_OVERLOAD 6.MAINLINE_UBOOT 7.BOOTLOADER_IMG 8.KERNEL_BRANCH 9.PLATFORM 10.FAMILY 11.BOARD 12.BUILD
build_armbian=($(cat ${model_conf} | sed -e 's/NA//g' -e 's/NULL//g' -e 's/[ ][ ]*//g' | grep -E "^[^#].*:yes$" | awk -F':' '{print $11}' | sort | uniq | xargs))
# Set the list of devices that must use the stable/6.x.y kernel
must_kernel_6xy=("r66s" "r68s" "h66k" "h68k" "eaidk-610")
# Set the list of devices that must use the /boot/extlinux/extlinux.conf file
must_extlinux=("s905x-t95" "s912-t95z-plus" "s905lb-r3300l")

Expand Down Expand Up @@ -865,7 +863,7 @@ loop_rebuild() {
kernel="${k}"

# Identify devices that must use the 6.x.y kernel
[[ -n "$(echo "${must_kernel_6xy[@]}" | grep -w "${board}")" && "${kernel:0:1}" -ne "6" ]] && {
[[ "${KERNEL_BRANCH}" == "6.x.y" && "${kernel:0:2}" != "6." ]] && {
echo -e "(${j}.${i}) ${TIPS} The ${board} device cannot use ${kd}/${kernel} kernel, skip."
let i++
continue
Expand Down

0 comments on commit d009450

Please sign in to comment.