Support Orange Pi 5 Pro

This commit is contained in:
baiywt
2023-11-09 16:23:39 +08:00
parent 3dac8e2b63
commit d3c7234c55
13 changed files with 299 additions and 82 deletions

View File

@@ -244,7 +244,83 @@ dpkg_install_deb_chroot()
}
dpkg_install_debs_chroot()
{
local deb_dir=$1
local unsatisfied_dependencies=()
local package_names=()
local package_dependencies=()
[ ! -d "$deb_dir" ] && return
deb_packages=($(find "${deb_dir}" -type f -name "*.deb"))
find_in_array() {
local target="$1"
local element=""
shift
for element in "$@"; do
[[ "$element" == "$target" ]] && return 0
done
return 1
}
for package in "${deb_packages[@]}"; do
package_names+=($(dpkg-deb -f "$package" Package))
dep_str=$(dpkg-deb -I "${package}" | grep 'Depends' | sed 's/.*: //' | sed 's/ //g' | sed 's/([^)]*)//g')
IFS=',' read -ra dep_array <<< "$dep_str"
if [[ ! ${#dep_array[@]} -eq 0 ]]; then
#dep_array[-1]="${dep_array[-1]} "
for element in "${dep_array[@]}"; do
if [[ $element == *"|"* ]]; then
#dep_array=("${dep_array[@]/$element}")
:
else
if ! find_in_array "$element" "${package_dependencies[@]}"; then
package_dependencies+=("${element}")
fi
fi
done
fi
done
for dependency in "${package_dependencies[@]}"; do
if ! chroot "${SDCARD}" /bin/bash -c "dpkg-query -W --showformat='\${Status}' ${dependency} \
| grep -q 'ok installed'" &>/dev/null; then
all=("${package_names[@]}" "${unsatisfied_dependencies[@]}")
if ! find_in_array "$dependency" "${all[@]}"; then
unsatisfied_dependencies+=("$dependency")
fi
fi
done
if [[ ! -z "${unsatisfied_dependencies[*]}" ]]; then
display_alert "Installing Dependencies" "${unsatisfied_dependencies[*]}"
chroot $SDCARD /bin/bash -c "apt-get -y -qq install ${unsatisfied_dependencies[*]}" >> "${DEST}"/${LOG_SUBPATH}/install.log 2>&1
fi
local names=""
for package in "${deb_packages[@]}"; do
name="/root/"$(basename "${package}")
names+=($name)
[[ ! -f "${SDCARD}${name}" ]] && cp "${package}" "${SDCARD}${name}"
done
if [[ ! -z "${names[*]}" ]]; then
display_alert "Installing" "$(basename $deb_dir)"
# when building in bulk from remote, lets make sure we have up2date index
chroot "${SDCARD}" /bin/bash -c "dpkg -i ${names[*]} " >> "${DEST}"/${LOG_SUBPATH}/install.log 2>&1
[[ $? -ne 0 ]] && exit_with_error "Installation of $(basename $deb_dir) failed" "${BOARD} ${RELEASE} ${BUILD_DESKTOP} ${LINUXFAMILY}"
chroot "${SDCARD}" /bin/bash -c "apt-mark hold ${package_names[*]}" >> "${DEST}"/${LOG_SUBPATH}/install.log 2>&1
fi
}
run_on_sdcard()
{

View File

@@ -239,6 +239,7 @@ if [[ -z $BOARD ]]; then
#options+=("orangepitab" "Rockchip RK3588S octa core 4-16GB RAM USB-C WiFi/BT NVMe")
#options+=("orangepi900" "Rockchip RK3588 octa core 4-16GB RAM 2.5GBE USB3 USB-C WiFi/BT NVMe")
options+=("orangepi5plus" "Rockchip RK3588 octa core 4-32GB RAM 2.5GBE USB3 USB-C WiFi/BT NVMe eMMC")
#options+=("orangepi5pro" "Rockchip RK3588 octa core 4-32GB RAM 2.5GBE USB3 USB-C WiFi/BT NVMe eMMC")
options+=("orangepicm4" "Rockchip RK3566 quad core 2-8GB RAM GBE eMMC USB3 NvMe WiFi/BT")
options+=("orangepi3b" "Rockchip RK3566 quad core 2-8GB RAM GBE eMMC USB3 NvMe WiFi/BT")
#options+=("orangepir1plus" "Rockchip RK3328 quad core 1GB RAM 2xGBE USB2 SPI")
@@ -467,7 +468,7 @@ if [[ ${IGNORE_UPDATES} != yes ]]; then
if [[ ${BOARDFAMILY} == "rockchip-rk3588" && $RELEASE =~ bullseye|bookworm|focal|jammy|raspi ]]; then
[[ ${BUILD_OPT} == image ]] && fetch_from_repo "https://github.com/orangepi-xunlong/rk-rootfs-build.git" "${EXTER}/cache/sources/rk3588_packages_${RELEASE}" "branch:rk3588_packages_${RELEASE}"
[[ ${BUILD_OPT} == image ]] && fetch_from_repo "https://github.com/orangepi-xunlong/rk-rootfs-build.git" "${EXTER}/cache/sources/rk35xx_packages" "branch:rk35xx_packages"
fi