Path: blob/next/external/config/sources/families/sun60iw2.conf
21660 views
source "${BASH_SOURCE%/*}/include/sunxi64_common.inc"12LINUXFAMILY=sun60iw234[[ -z $CPUMIN ]] && CPUMIN=4160005[[ -z $CPUMAX ]] && CPUMAX=20020006GOVERNOR=ondemand78OFFSET=32910case $BRANCH in1112current)13if [[ $GITEE_SERVER == yes ]]; then14KERNELSOURCE="https://gitee.com/orangepi-xunlong/orange-pi-5.15-sun60iw2.git"15MAINLINE_UBOOT_SOURCE='https://gitee.com/orangepi-xunlong/u-boot-orangepi.git'16fi1718OVERLAY_PREFIX='sun60i-t736'19KERNELBRANCH="branch:orange-pi-5.15-sun60iw2"20LINUXCONFIG="linux-sun60iw2-current"2122if [[ "${BOARD}" =~ "orangepi4pro"|"orangepizero3w" ]]; then23OVERLAY_PREFIX='sun60i-a733'24LINUXCONFIG="linux-sun60iw2-current-a733"25fi2627BOOTBRANCH='branch:v2018.05-sun60iw2'28KERNELPATCHDIR=${BOARDFAMILY}-${BRANCH}29UBOOT_TARGET_MAP=";;dts/${BOARD}-u-boot.dts boot0_sdcard.fex boot0_spinor_a733.fex boot_package.fex boot_package_a733_nvme.fex"30UBOOT_COMPILER="arm-linux-gnueabi-"31UBOOT_USE_GCC='> 6.0'32BOOTENV_FILE='sun60iw2.txt'33BOOTSCRIPT='boot-sun60iw2.cmd:boot.cmd'34KERNEL_USE_GCC='> 10.0'35OFFSET=3236ATFSOURCE=""37ATF_COMPILE="no"38INITRD_ARCH=arm3940;;41esac4243family_tweaks_s()44{45if [[ ${DESKTOP_ENVIRONMENT} == gnome ]]; then46run_on_sdcard "DEBIAN_FRONTEND=noninteractive apt-get install -y gnome-screenshot tightvncserver gnome-bluetooth"47cp $EXTER/packages/blobs/desktop/desktop-wallpapers/orangepi-default.png ${SDCARD}/usr/share/backgrounds/warty-final-ubuntu.png48fi4950if [[ $RELEASE == bookworm && ${DESKTOP_ENVIRONMENT} == gnome ]]; then51sed -i "s/user-session.*/user-session=gnome-wayland/" ${SDCARD}/etc/lightdm/lightdm.conf.d/22-orangepi-autologin.conf52run_on_sdcard "systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target" > /dev/null 2>&153fi5455[[ $RELEASE == jammy && ${DESKTOP_ENVIRONMENT} == xfce ]] && chroot $SDCARD /bin/bash -c "apt-get -y -qq install ocl-icd-libopencl1" >/dev/null 2>&15657#if [[ "${BOARD}x" == orangepi4ax ]]; then58# nvram=$EXTER/cache/sources/orangepi-firmware-git59# [[ -f ${nvram}/nvram_ap6256.txt-$BOARD ]] && cp ${nvram}/nvram_ap6256.txt-${BOARD} ${SDCARD}/lib/firmware/nvram_ap6256.txt60#fi6162rsync -a --chown=root:root "${EXTER}"/packages/bsp/overlays_arm64/* ${SDCARD}/6364chroot $SDCARD /bin/bash -c "apt-get -y -qq install libopencv-dev mtd-utils rfkill bluetooth bluez bluez-tools ir-keytable tree lirc v4l-utils dnsmasq" >/dev/null 2>&16566if [[ $BUILD_DESKTOP == yes ]]; then6768sed -i "s/auto-profiles = yes/auto-profiles = no/" ${SDCARD}/usr/share/pulseaudio/alsa-mixer/profile-sets/default.conf6970echo "load-module module-alsa-sink device=hw:0,0 sink_name=HDMI-Playback sink_properties=\"device.description='HDMI Audio'\"" >> ${SDCARD}/etc/pulse/default.pa71echo "load-module module-alsa-sink device=hw:1,0 sink_name=AudioCodec-Playback sink_properties=\"device.description='Audio Codec'\"" >> ${SDCARD}/etc/pulse/default.pa7273chroot $SDCARD /bin/bash -c "apt-get -y -qq install vlc mpv" >/dev/null 2>&174fi7576if [[ ${BRANCH} == current ]]; then77SERIALCON="ttyS0"78fi7980rsync -a --chown=root:root "${EXTER}"/packages/bsp/sun60iw2/* ${SDCARD}/81rsync -a --chown=root:root $EXTER/cache/sources/sun60iw2_packages/npu/* ${SDCARD}/8283if [[ $RELEASE =~ bullseye && ${SELECTED_CONFIGURATION} == desktop ]]; then84local packages_to_install=("xserver" "glmark2" "libcedarc" "gst-omx")85chroot $SDCARD /bin/bash -c "apt-get -y -qq install gstreamer1.0-x gstreamer1.0-plugins-bad" >> "${DEST}"/${LOG_SUBPATH}/install.log 2>&186for package in ${packages_to_install[@]}; do87rsync -a --chown=root:root $EXTER/cache/sources/sun60iw2_packages/bullseye/$package/* ${SDCARD}/88done8990#if [[ $RELEASE == jammy ]]; then91# chroot $SDCARD /bin/bash -c "apt-get -y -qq install glmark2 glmark2-wayland" >> "${DEST}"/${LOG_SUBPATH}/install.log 2>&192#elif [[ $RELEASE == bookworm ]]; then93# chroot $SDCARD /bin/bash -c "apt-get -y -qq install glmark2-x11 glmark2-wayland" >> "${DEST}"/${LOG_SUBPATH}/install.log 2>&194#fi9596fi9798install_wiringop99}100101family_tweaks_bsp()102{103install -m 755 $EXTER/packages/blobs/bt/brcm_patchram_plus/brcm_patchram_plus_${ARCH} $destination/usr/bin/brcm_patchram_plus104install -m 755 $EXTER/packages/blobs/bt/hciattach/hciattach_opi_${ARCH} $destination/usr/bin/hciattach_opi105}106107uboot_custom_postprocess()108{109110if [[ ${BRANCH} =~ legacy|current && $(dpkg --print-architecture) == amd64 ]]; then111112local BIN_PATH="${EXTER}/packages/pack-uboot/${BOARDFAMILY}/bin"113rm dts/*.dts sys_config ${BOARD}-u-boot-${BRANCH}.dtb -r114export PATH=${EXTER}/packages/pack-uboot/tools/:$PATH115cp ${EXTER}/packages/pack-uboot/${BOARDFAMILY}/bin/* . -r116cp "${BIN_PATH}/boot0_sdcard_${BOARD}.fex" ./boot0_sdcard.fex 2>/dev/null || cp "${BIN_PATH}/boot0_sdcard_a733.fex" ./boot0_sdcard.fex117118cp sys_config/sys_config.fex sys_config.fex119cp u-boot.bin u-boot.fex120cp dts/u-boot-${BRANCH}.dts dts/${BOARD}-u-boot.dts121122# make u-boot dtb123$EXTER/packages/pack-uboot/tools/dtc -p 2048 -W no-unit_address_vs_reg -@ -O dtb -o ${BOARD}-u-boot.dtb -b 0 dts/u-boot-${BRANCH}.dts124[[ ! -f ${BOARD}-u-boot.dtb ]] && exit_with_error "dts compilation failed"125126busybox unix2dos sys_config.fex127$EXTER/packages/pack-uboot/tools/script sys_config.fex128cp ${BOARD}-u-boot.dtb sunxi.fex129$EXTER/packages/pack-uboot/tools/update_dtb sunxi.fex 4096130131$EXTER/packages/pack-uboot/tools/update_uboot -no_merge u-boot.fex sys_config.bin132update_uboot -no_merge u-boot.bin sys_config.bin133134#pack boot package135busybox unix2dos boot_package.cfg136$EXTER/packages/pack-uboot/tools/dragonsecboot -pack boot_package.cfg137138if [[ ${MERGE_UBOOT} == yes ]]; then139140display_alert "Merge u-boot" "u-boot-${BOARD}-merged.bin" "info"141dd if=/dev/zero of=u-boot-${BOARD}-merged.bin bs=1M count=20142dd if=boot0_sdcard.fex of=u-boot-${BOARD}-merged.bin bs=8k seek=1 conv=fsync143dd if=boot_package.fex of=u-boot-${BOARD}-merged.bin bs=8k seek=2050 conv=fsync144mv u-boot-${BOARD}-merged.bin ${DEB_STORAGE}/u-boot/145fi146fi147}148149write_uboot_platform_mtd()150{151if [[ -b /dev/mtdblock0 ]]; then152flash_erase /dev/mtd0 0 50153size=$(stat --format="%s" $1/boot0_spinor_a733.fex)154mtd_debug write /dev/mtd0 0 $size $1/boot0_spinor_a733.fex155size=$(stat --format="%s" $1/boot_package.fex)156mtd_debug write /dev/mtd0 262144 $size $1/boot_package_a733_nvme.fex157sync158fi159}160161162