opiaimax: install npu driver

This commit is contained in:
leeboby 2024-08-16 09:29:48 +08:00
parent b7fb0db0ac
commit 6968742411
5 changed files with 33 additions and 8 deletions

1
.gitignore vendored
View File

@ -49,5 +49,6 @@ external/cache/sources/orangepi-firmware*
external/cache/sources/wiringOP
external/cache/sources/wiringOP-Python
external/cache/sources/rk3399_gst_xserver_libs
external/cache/sources/ascend-driver
external/cache/sources/arm-trusted-firmware-sunxi-mainline
external/cache/debs/arm64/balena-etcher-electron_1.7.9+5945ab1f_arm64.deb

View File

@ -11,6 +11,5 @@ BOOT_SUPPORT_SPI="yes"
SKIP_BOOTSPLASH="yes" # Skip boot splash patch, conflicts with CONFIG_VT=yes
DISTRIB_TYPE_LEGACY="bullseye bookworm bionic focal jammy"
DISTRIB_TYPE_CURRENT="bullseye bookworm focal jammy"
INSTALL_HEADERS="yes"
BOOTFS_TYPE="fat"
REVISION="1.0.0"

View File

@ -144,6 +144,7 @@ family_tweaks_s() {
chroot $SDCARD /bin/bash -c "apt-get -y -qq install usb-modeswitch tree dnsmasq v4l-utils swig python3-dev python3-setuptools bluez libncurses-dev" >> "${DEST}"/${LOG_SUBPATH}/install.log 2>&1
[[ ${BOARD} =~ orangepiaimax ]] && install_310b-npu-driver
install_wiringop
install_balenaEtcher
@ -181,6 +182,7 @@ family_tweaks_s() {
fi
# Realtek 8811CU/8821CU usb modeswitch support
if [[ -f ${SDCARD}/lib/udev/rules.d/40-usb_modeswitch.rules ]]; then
cp ${SDCARD}/lib/udev/rules.d/40-usb_modeswitch.rules ${SDCARD}/etc/udev/rules.d/40-usb_modeswitch.rules
sed '/LABEL="modeswitch_rules_end"/d' -i ${SDCARD}/etc/udev/rules.d/40-usb_modeswitch.rules
cat >> ${SDCARD}/etc/udev/rules.d/40-usb_modeswitch.rules <<-EOF
@ -188,4 +190,5 @@ family_tweaks_s() {
ATTR{idVendor}=="0bda", ATTR{idProduct}=="1a2b", RUN+="/usr/sbin/usb_modeswitch -K -v 0bda -p 1a2b"
LABEL="modeswitch_rules_end"
EOF
fi
}

View File

@ -1885,6 +1885,22 @@ install_wiringop()
rm $SDCARD/root/*.deb >/dev/null 2>&1
}
install_310b-npu-driver()
{
local driver_path="$EXTER/cache/sources/ascend-driver"
local driver_name="Ascend-hdk-310b-npu-driver_23.0.5_linux-aarch64-opiaimax.run"
local driver=${driver_path}/${driver_name}
if [[ -f "${driver}" ]]; then
display_alert "Installing" "$driver_name" "info"
cp "${driver}" "${SDCARD}/opt/"
chmod +x "${SDCARD}/opt/Ascend-hdk-310b-npu-driver_23.0.5_linux-aarch64-opiaimax.run"
chroot "${SDCARD}" /bin/bash -c "/opt/${driver_name} --chroot --full --install-username=orangepi --install-usergroup=orangepi --install-for-all"
fi
}
install_docker() {
[[ $install_docker != yes ]] && return

View File

@ -449,6 +449,12 @@ if [[ ${IGNORE_UPDATES} != yes ]]; then
fi
if [[ ${BOARD} =~ orangepiaimax ]]; then
[[ $BUILD_OPT =~ image ]] && fetch_from_repo "https://github.com/orangepi-xunlong/ascend-driver.git" "${EXTER}/cache/sources/ascend-driver" "branch:main"
fi
if [[ ${BOARD} =~ orangepi4|orangepi4-lts|orangepi800 && $RELEASE =~ focal|buster|bullseye|bookworm ]]; then
[[ ${BUILD_OPT} == image ]] && fetch_from_repo "https://github.com/orangepi-xunlong/rk-rootfs-build.git" "${EXTER}/cache/sources/rk-rootfs-build-${RELEASE}" "branch:rk-rootfs-build-${RELEASE}"