Skip to content

Commit

Permalink
Add s905w kernel usage restrictions
Browse files Browse the repository at this point in the history
  • Loading branch information
ophub committed Feb 12, 2023
1 parent e2bd3ed commit 730e756
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
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
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
103 :HG680P :s905x :meson-gxl-s905x-p212.dtb :u-boot-p212.bin :NA :NA :stable :amlogic :meson-gxl :uEnv.txt :s905x :yes
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
104 :TX3-Mini :s905w :meson-gxl-s905w-tx3-mini.dtb :NA :NA :NA :5.15.y :amlogic :meson-gxl :uEnv.txt :s905w :yes
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
#-------+----------------------------+---------+---------------------------------------+-----------------------------+------------------------------------+--------------------------------+----------------+-----------+--------------+----------------+----------------+-------
106 :T95 :s905x :meson-gxl-s905x-p212.dtb :u-boot-s905x-s912.bin :NA :NA :stable :amlogic :meson-gxl :extlinux.conf :s905x-t95 :no
107 :B860H :s905x :meson-gxl-s905x-b860h.dtb :u-boot-p212.bin :NA :NA :stable :amlogic :meson-gxl :uEnv.txt :s905x :no
108 :TBee :s905x :meson-gxl-s905x-tbee.dtb :u-boot-p212.bin :NA :NA :stable :amlogic :meson-gxl :uEnv.txt :s905x :no
109 :W95 :s905w :meson-gxl-s905w-p281.dtb :u-boot-s905x-s912.bin :NA :NA :stable :amlogic :meson-gxl :uEnv.txt :s905w :no
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
109 :W95 :s905w :meson-gxl-s905w-p281.dtb :NA :NA :NA :5.15.y :amlogic :meson-gxl :uEnv.txt :s905w :no
110 :X96-Mini :s905w :meson-gxl-s905w-x96-mini.dtb :NA :NA :NA :5.15.y :amlogic :meson-gxl :uEnv.txt :s905w :no
#-------+----------------------------+---------+---------------------------------------+-----------------------------+------------------------------------+--------------------------------+----------------+-----------+--------------+----------------+----------------+-------
111 :TX9 :s905x :meson-gxl-s905x-tx9.dtb :u-boot-s905x-s912.bin :NA :NA :stable :amlogic :meson-gxl :uEnv.txt :s905x :no
112 :M302A/M304A :s905l3b :meson-gxl-s905l3b-m302a.dtb :u-boot-s905x-s912.bin :NA :NA :stable :amlogic :meson-gxl :uEnv.txt :s905l3b :no
Expand All @@ -47,7 +47,7 @@
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
117 :E900V22E :s905l3b :meson-gxl-s905l3b-e900v22e.dtb :u-boot-s905x-s912.bin :NA :NA :stable :amlogic :meson-gxl :uEnv.txt :s905l3b :no
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
119 :X96W/FunTV :s905w :meson-gxl-s905w-x96w.dtb :u-boot-s905x-s912.bin :NA :NA :stable :amlogic :meson-gxl :uEnv.txt :s905w :no
119 :X96W/FunTV :s905w :meson-gxl-s905w-x96w.dtb :NA :NA :NA :5.15.y :amlogic :meson-gxl :uEnv.txt :s905w :no


# Amlogic GXM Family
Expand Down
45 changes: 30 additions & 15 deletions build-armbian/armbian-files/common-files/usr/sbin/armbian-update
Original file line number Diff line number Diff line change
Expand Up @@ -165,24 +165,34 @@ init_var() {

# Automatically complete old version ophub_release_file
[[ -z "${KERNEL_BRANCH}" ]] && {
[[ "${SOC,,}" == "rk3588" ]] && KERNEL_BRANCH="rk3588" || KERNEL_BRANCH="stable"
if [[ "${SOC,,}" == "rk3588" ]]; then
KERNEL_BRANCH="rk3588"
elif [[ "${SOC,,}" == "s905w" ]]; then
KERNEL_BRANCH="5.15.y"
elif [[ "${SOC,,}" == "rk3568" || "${SOC,,}" == "rk3399" ]]; then
KERNEL_BRANCH="6.1.y"
else
KERNEL_BRANCH="stable"
fi
echo "KERNEL_BRANCH='${KERNEL_BRANCH}'" >>${ophub_release_file}
}
# 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"

# Set kernel download directory [ 5.15.y/6.x.y ] to [ stable ]
if [[ "${KERNEL_BRANCH}" == "rk3588" ]]; then
kernel_down="rk3588"
elif [[ "${KERNEL_BRANCH}" == "dev" ]]; then
kernel_down="dev"
else
kernel_down="stable"
fi

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

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

# Convert kernel library address to API format
kernel_api="${kernel_repo#*com\/}"
Expand Down Expand Up @@ -344,10 +354,16 @@ check_kernel() {
cd ${kernel_path}
echo -e "${STEPS} Start checking the 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."
if [[ "${SOC,,}" == "s905w" ]] && [[ "${inputs_kernel:0:5}" != "5.15." && "${inputs_kernel:0:4}" != "5.4." ]]; then
# Rockchip rk3568/rk3399 series, such as r66s/r68s/h66k/h68k/eaidk-610 only support 5.4.y/5.15.y kernel
error_msg "Kernel [ ${inputs_kernel} ] is not available for this device."
elif [[ "${SOC,,}" == "rk3568" || "${SOC,,}" == "rk3399" ]] && [[ "${inputs_kernel:0:2}" != "6." ]]; then
# Rockchip rk3568/rk3399 series, such as r66s/r68s/h66k/h68k/eaidk-610 only support 6.x.y kernel
error_msg "Kernel [ ${inputs_kernel} ] is not available for this device."
elif [[ "${SOC,,}" == "rk3588" && "${inputs_kernel:0:5}" != "5.10." ]]; then
# Rockchip rk3588 series, such as rock5b only support rk3588/5.10.y kernel
error_msg "Kernel [ ${inputs_kernel} ] is not available for this device."
fi

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

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

# Delete kernel tmpfiles
Expand Down
8 changes: 8 additions & 0 deletions rebuild
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,7 @@ loop_rebuild() {
j="1"
for b in ${build_armbian[*]}; do
{
# Set specific configuration for building Armbian system
board="${b}"
confirm_version

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

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

0 comments on commit 730e756

Please sign in to comment.