Skip to content

Commit 730e756

Browse files
committed
Add s905w kernel usage restrictions
1 parent e2bd3ed commit 730e756

File tree

3 files changed

+42
-19
lines changed

3 files changed

+42
-19
lines changed

build-armbian/armbian-files/common-files/etc/model_database.conf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@
2929
101 :Phicomm-N1 :s905d :meson-gxl-s905d-phicomm-n1.dtb :u-boot-n1.bin :NA :u-boot-2015-phicomm-n1.bin :stable :amlogic :meson-gxl :uEnv.txt :s905d :yes
3030
102 :Phicomm-N1(DMA-thresh) :s905d :meson-gxl-s905d-phicomm-n1-thresh.dtb :u-boot-n1.bin :NA :u-boot-2015-phicomm-n1.bin :stable :amlogic :meson-gxl :uEnv.txt :s905d :no
3131
103 :HG680P :s905x :meson-gxl-s905x-p212.dtb :u-boot-p212.bin :NA :NA :stable :amlogic :meson-gxl :uEnv.txt :s905x :yes
32-
104 :TX3-Mini :s905w :meson-gxl-s905w-tx3-mini.dtb :u-boot-s905x-s912.bin :NA :NA :stable :amlogic :meson-gxl :uEnv.txt :s905w :yes
32+
104 :TX3-Mini :s905w :meson-gxl-s905w-tx3-mini.dtb :NA :NA :NA :5.15.y :amlogic :meson-gxl :uEnv.txt :s905w :yes
3333
105 :MECOOL-KI-Pro :s905d :meson-gxl-s905d-mecool-ki-pro.dtb :u-boot-p201.bin :NA :NA :stable :amlogic :meson-gxl :uEnv.txt :s905d-ki :yes
3434
#-------+----------------------------+---------+---------------------------------------+-----------------------------+------------------------------------+--------------------------------+----------------+-----------+--------------+----------------+----------------+-------
3535
106 :T95 :s905x :meson-gxl-s905x-p212.dtb :u-boot-s905x-s912.bin :NA :NA :stable :amlogic :meson-gxl :extlinux.conf :s905x-t95 :no
3636
107 :B860H :s905x :meson-gxl-s905x-b860h.dtb :u-boot-p212.bin :NA :NA :stable :amlogic :meson-gxl :uEnv.txt :s905x :no
3737
108 :TBee :s905x :meson-gxl-s905x-tbee.dtb :u-boot-p212.bin :NA :NA :stable :amlogic :meson-gxl :uEnv.txt :s905x :no
38-
109 :W95 :s905w :meson-gxl-s905w-p281.dtb :u-boot-s905x-s912.bin :NA :NA :stable :amlogic :meson-gxl :uEnv.txt :s905w :no
39-
110 :X96-Mini :s905w :meson-gxl-s905w-x96-mini.dtb :u-boot-s905x-s912.bin :NA :NA :stable :amlogic :meson-gxl :uEnv.txt :s905x :no
38+
109 :W95 :s905w :meson-gxl-s905w-p281.dtb :NA :NA :NA :5.15.y :amlogic :meson-gxl :uEnv.txt :s905w :no
39+
110 :X96-Mini :s905w :meson-gxl-s905w-x96-mini.dtb :NA :NA :NA :5.15.y :amlogic :meson-gxl :uEnv.txt :s905w :no
4040
#-------+----------------------------+---------+---------------------------------------+-----------------------------+------------------------------------+--------------------------------+----------------+-----------+--------------+----------------+----------------+-------
4141
111 :TX9 :s905x :meson-gxl-s905x-tx9.dtb :u-boot-s905x-s912.bin :NA :NA :stable :amlogic :meson-gxl :uEnv.txt :s905x :no
4242
112 :M302A/M304A :s905l3b :meson-gxl-s905l3b-m302a.dtb :u-boot-s905x-s912.bin :NA :NA :stable :amlogic :meson-gxl :uEnv.txt :s905l3b :no
@@ -47,7 +47,7 @@
4747
116 :CM311-1/HG680-LC :s905l3 :meson-gxl-s905l2-x7-5g.dtb :u-boot-p212.bin :NA :NA :stable :amlogic :meson-gxl :uEnv.txt :s905l3 :no
4848
117 :E900V22E :s905l3b :meson-gxl-s905l3b-e900v22e.dtb :u-boot-s905x-s912.bin :NA :NA :stable :amlogic :meson-gxl :uEnv.txt :s905l3b :no
4949
118 :BesTV-R3300L :s905l-b :meson-gxl-s905x-p212.dtb :u-boot-r3300l.bin :r3300l-u-boot.bin.sd.bin :NA :stable :amlogic :meson-gxl :extlinux.conf :s905lb-r3300l :yes
50-
119 :X96W/FunTV :s905w :meson-gxl-s905w-x96w.dtb :u-boot-s905x-s912.bin :NA :NA :stable :amlogic :meson-gxl :uEnv.txt :s905w :no
50+
119 :X96W/FunTV :s905w :meson-gxl-s905w-x96w.dtb :NA :NA :NA :5.15.y :amlogic :meson-gxl :uEnv.txt :s905w :no
5151

5252

5353
# Amlogic GXM Family

build-armbian/armbian-files/common-files/usr/sbin/armbian-update

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -165,24 +165,34 @@ init_var() {
165165

166166
# Automatically complete old version ophub_release_file
167167
[[ -z "${KERNEL_BRANCH}" ]] && {
168-
[[ "${SOC,,}" == "rk3588" ]] && KERNEL_BRANCH="rk3588" || KERNEL_BRANCH="stable"
168+
if [[ "${SOC,,}" == "rk3588" ]]; then
169+
KERNEL_BRANCH="rk3588"
170+
elif [[ "${SOC,,}" == "s905w" ]]; then
171+
KERNEL_BRANCH="5.15.y"
172+
elif [[ "${SOC,,}" == "rk3568" || "${SOC,,}" == "rk3399" ]]; then
173+
KERNEL_BRANCH="6.1.y"
174+
else
175+
KERNEL_BRANCH="stable"
176+
fi
169177
echo "KERNEL_BRANCH='${KERNEL_BRANCH}'" >>${ophub_release_file}
170178
}
171-
# Rockchip rk3588 series, such as rock5b only support rk3588/5.10.y kernel
172-
[[ "${SOC,,}" == "rk3588" && "${KERNEL_BRANCH}" != "rk3588" ]] && {
173-
echo -e "${WARNING} Kernel [ ${KERNEL_BRANCH} ] is not available for this device, it has been automatically adjusted to [ rk3588 ]."
174-
KERNEL_BRANCH="rk3588"
175-
}
176-
# Adjust kernel directory [ 6.x.y ] to [ stable ]
177-
[[ "${KERNEL_BRANCH}" == "6.x.y" ]] && KERNEL_BRANCH="stable"
179+
180+
# Set kernel download directory [ 5.15.y/6.x.y ] to [ stable ]
181+
if [[ "${KERNEL_BRANCH}" == "rk3588" ]]; then
182+
kernel_down="rk3588"
183+
elif [[ "${KERNEL_BRANCH}" == "dev" ]]; then
184+
kernel_down="dev"
185+
else
186+
kernel_down="stable"
187+
fi
178188

179189
# Display settings results
190+
echo -e "${INFO} Set the kernel download directory: [ ${kernel_repo}/${kernel_down} ]"
180191
echo -e "${INFO} Set the kernel name: [ ${inputs_kernel} ]"
181-
echo -e "${INFO} Set the kernel directory: [ ${KERNEL_BRANCH} ]"
182192

183193
# Convert kernel library address to svn format
184194
[[ "${kernel_repo}" == http* && -n "$(echo "${kernel_repo}" | grep "tree/main")" ]] && kernel_repo="${kernel_repo//tree\/main/trunk}"
185-
kernel_repo="${kernel_repo}/${KERNEL_BRANCH}"
195+
kernel_repo="${kernel_repo}/${kernel_down}"
186196

187197
# Convert kernel library address to API format
188198
kernel_api="${kernel_repo#*com\/}"
@@ -344,10 +354,16 @@ check_kernel() {
344354
cd ${kernel_path}
345355
echo -e "${STEPS} Start checking the kernel..."
346356

347-
# Rockchip rk3568/rk3399 series, such as r66s/r68s/h66k/h68k/eaidk-610 only support 6.x.y kernel
348-
[[ "${SOC,,}" == "rk3568" || "${SOC,,}" == "rk3399" ]] && [[ "${inputs_kernel:0:2}" != "6." ]] && error_msg "Kernel [ ${inputs_kernel} ] is not available for this device."
349-
# Rockchip rk3588 series, such as rock5b only support rk3588/5.10.y kernel
350-
[[ "${SOC,,}" == "rk3588" && "${inputs_kernel:0:5}" != "5.10." ]] && error_msg "Kernel [ ${inputs_kernel} ] is not available for this device."
357+
if [[ "${SOC,,}" == "s905w" ]] && [[ "${inputs_kernel:0:5}" != "5.15." && "${inputs_kernel:0:4}" != "5.4." ]]; then
358+
# Rockchip rk3568/rk3399 series, such as r66s/r68s/h66k/h68k/eaidk-610 only support 5.4.y/5.15.y kernel
359+
error_msg "Kernel [ ${inputs_kernel} ] is not available for this device."
360+
elif [[ "${SOC,,}" == "rk3568" || "${SOC,,}" == "rk3399" ]] && [[ "${inputs_kernel:0:2}" != "6." ]]; then
361+
# Rockchip rk3568/rk3399 series, such as r66s/r68s/h66k/h68k/eaidk-610 only support 6.x.y kernel
362+
error_msg "Kernel [ ${inputs_kernel} ] is not available for this device."
363+
elif [[ "${SOC,,}" == "rk3588" && "${inputs_kernel:0:5}" != "5.10." ]]; then
364+
# Rockchip rk3588 series, such as rock5b only support rk3588/5.10.y kernel
365+
error_msg "Kernel [ ${inputs_kernel} ] is not available for this device."
366+
fi
351367

352368
# Determine custom kernel filename
353369
kernel_boot="$(ls boot-${inputs_kernel}-*.tar.gz 2>/dev/null | head -n 1)"
@@ -489,7 +505,6 @@ update_kernel() {
489505

490506
# Update release file
491507
sed -i "s|^KERNEL_VERSION=.*|KERNEL_VERSION='${KERNEL_VERSION}'|g" ${ophub_release_file}
492-
sed -i "s|^KERNEL_BRANCH=.*|KERNEL_BRANCH='${KERNEL_BRANCH}'|g" ${ophub_release_file}
493508
[[ "${auto_mainline_uboot}" == "yes" ]] && sed -i "s|^MLUBOOT_STATUS=.*|MLUBOOT_STATUS='yes'|g" ${ophub_release_file}
494509

495510
# Delete kernel tmpfiles

rebuild

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -864,6 +864,7 @@ loop_rebuild() {
864864
j="1"
865865
for b in ${build_armbian[*]}; do
866866
{
867+
# Set specific configuration for building Armbian system
867868
board="${b}"
868869
confirm_version
869870

@@ -887,7 +888,14 @@ loop_rebuild() {
887888
let i++
888889
continue
889890
}
891+
# Identify devices that must use the 5.4.y/5.15.y kernel
892+
[[ "${KERNEL_BRANCH}" == "5.15.y" ]] && [[ "${kernel:0:5}" != "5.15." && "${kernel:0:4}" != "5.4." ]] && {
893+
echo -e "(${j}.${i}) ${TIPS} The ${board} device cannot use ${kd}/${kernel} kernel, skip."
894+
let i++
895+
continue
896+
}
890897

898+
# Check disk space size
891899
echo -ne "(${j}.${i}) Start building Armbian [ ${board} - ${kd}/${kernel} ]. "
892900
now_remaining_space="$(df -Tk ${current_path} | grep '/dev/' | awk '{print $5}' | echo $(($(xargs) / 1024 / 1024)))"
893901
if [[ "${now_remaining_space}" -le "6" ]]; then

0 commit comments

Comments
 (0)