sun55iw3.conf 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. source "${BASH_SOURCE%/*}/include/sunxi64_common.inc"
  2. LINUXFAMILY=sun55iw3
  3. NAME_KERNEL="uImage"
  4. NAME_INITRD="uInitrd"
  5. SRC_CMDLINE="earlycon=uart8250,mmio32,0x02500000 clk_ignore_unused initcall_debug=0 console=ttyAS0,115200 console=tty0 loglevel=8 cma=64M init=/sbin/init rw no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 splash plymouth.ignore-serial-consoles"
  6. [[ -z $CPUMIN ]] && CPUMIN=480000
  7. [[ -z $CPUMAX ]] && CPUMAX=1512000
  8. GOVERNOR=ondemand
  9. #ASOUND_STATE=asound.state.sun55iw3-${BRANCH}
  10. case $BRANCH in
  11. current)
  12. OVERLAY_PREFIX='sun55i-t527'
  13. KERNELBRANCH="branch:orange-pi-5.15-sun55iw3"
  14. LINUXCONFIG="linux-5.15-sun55iw3-current"
  15. [[ $BOARD =~ orangepi4a ]] && BOOTBRANCH='branch:v2018.05-t527'
  16. KERNELPATCHDIR=${BOARDFAMILY}-${BRANCH}
  17. UBOOT_TARGET_MAP=";;dts/${BOARD}-u-boot.dts boot0_sdcard.fex boot_package.fex"
  18. UBOOT_COMPILER="arm-linux-gnueabi-"
  19. UBOOT_USE_GCC='> 6.0'
  20. BOOTENV_FILE=sun50iw9-default.txt
  21. BOOTSCRIPT='boot-sun50iw9.cmd:boot.cmd'
  22. KERNEL_USE_GCC='> 10.0'
  23. OFFSET=20
  24. ATFSOURCE=""
  25. ATF_COMPILE="no"
  26. INITRD_ARCH=arm
  27. ;;
  28. esac
  29. family_tweaks_s()
  30. {
  31. if [[ ${DESKTOP_ENVIRONMENT} == gnome ]]; then
  32. run_on_sdcard "DEBIAN_FRONTEND=noninteractive apt-get install -y gnome-screenshot tightvncserver gnome-bluetooth"
  33. cp $EXTER/packages/blobs/desktop/desktop-wallpapers/orangepi-default.png ${SDCARD}/usr/share/backgrounds/warty-final-ubuntu.png
  34. fi
  35. if [[ $RELEASE == bookworm && ${DESKTOP_ENVIRONMENT} == gnome ]]; then
  36. sed -i "s/user-session.*/user-session=gnome-wayland/" ${SDCARD}/etc/lightdm/lightdm.conf.d/22-orangepi-autologin.conf
  37. run_on_sdcard "systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target" > /dev/null 2>&1
  38. fi
  39. if [[ "${BOARD}x" == orangepi4ax ]]; then
  40. nvram=$EXTER/cache/sources/orangepi-firmware-git
  41. [[ -f ${nvram}/nvram_ap6256.txt-$BOARD ]] && cp ${nvram}/nvram_ap6256.txt-${BOARD} ${SDCARD}/lib/firmware/nvram_ap6256.txt
  42. fi
  43. rsync -a --chown=root:root "${EXTER}"/packages/bsp/overlays_arm64/* ${SDCARD}/
  44. chroot $SDCARD /bin/bash -c "apt-get -y -qq install rfkill bluetooth bluez bluez-tools ir-keytable tree lirc v4l-utils dnsmasq" >/dev/null 2>&1
  45. if [[ $BUILD_DESKTOP == yes ]]; then
  46. sed -i "s/auto-profiles = yes/auto-profiles = no/" ${SDCARD}/usr/share/pulseaudio/alsa-mixer/profile-sets/default.conf
  47. if [[ $BRANCH =~ legacy ]]; then
  48. echo "load-module module-alsa-sink device=hw:0,0 sink_name=AudioCodec-Playback sink_properties=\"device.description='Audio Codec'\"" >> ${SDCARD}/etc/pulse/default.pa
  49. echo "load-module module-alsa-sink device=hw:1,0 sink_name=HDMI-Playback sink_properties=\"device.description='HDMI Audio'\"" >> ${SDCARD}/etc/pulse/default.pa
  50. elif [[ $BRANCH =~ current|next ]]; then
  51. echo "load-module module-alsa-sink device=hw:0,0 sink_name=AudioCodec-Playback sink_properties=\"device.description='Audio Codec'\"" >> ${SDCARD}/etc/pulse/default.pa
  52. echo "load-module module-alsa-sink device=hw:2,0 sink_name=HDMI-Playback sink_properties=\"device.description='HDMI Audio'\"" >> ${SDCARD}/etc/pulse/default.pa
  53. fi
  54. fi
  55. if [[ ${BRANCH} == current ]]; then
  56. [[ ${SRC_EXTLINUX} != "yes" ]] && sed -i 's/^debug_uart.*/debug_uart=ttyAS0/' "${SDCARD}"/boot/orangepiEnv.txt
  57. SERIALCON="ttyAS0"
  58. fi
  59. rsync -a --chown=root:root "${EXTER}"/packages/bsp/t527/* ${SDCARD}/
  60. if [[ ${SELECTED_CONFIGURATION} == desktop ]]; then
  61. local packages_to_install=("mesa" "libcedarc" "gst-omx")
  62. chroot $SDCARD /bin/bash -c "apt-get -y -qq install gstreamer1.0-x" >> "${DEST}"/${LOG_SUBPATH}/install.log 2>&1
  63. for package in ${packages_to_install[@]}; do
  64. dpkg_install_debs_chroot $EXTER/cache/sources/t527_packages/$RELEASE/$package
  65. done
  66. if [[ $RELEASE == jammy ]]; then
  67. chroot $SDCARD /bin/bash -c "apt-get -y -qq install glmark2 glmark2-wayland" >> "${DEST}"/${LOG_SUBPATH}/install.log 2>&1
  68. elif [[ $RELEASE == bookworm ]]; then
  69. chroot $SDCARD /bin/bash -c "apt-get -y -qq install glmark2-x11 glmark2-wayland" >> "${DEST}"/${LOG_SUBPATH}/install.log 2>&1
  70. fi
  71. fi
  72. install_wiringop
  73. }
  74. family_tweaks_bsp()
  75. {
  76. install -m 755 $EXTER/packages/blobs/bt/brcm_patchram_plus/brcm_patchram_plus_${ARCH} $destination/usr/bin/brcm_patchram_plus
  77. }
  78. uboot_custom_postprocess()
  79. {
  80. if [[ ${BRANCH} =~ legacy|current && $(dpkg --print-architecture) == amd64 ]]; then
  81. rm dts/*.dts sys_config ${BOARD}-u-boot-${BRANCH}.dtb -r
  82. export PATH=${EXTER}/packages/pack-uboot/${BOARDFAMILY}/tools/:$PATH
  83. cp ${EXTER}/packages/pack-uboot/${BOARDFAMILY}/bin/* . -r
  84. cp sys_config/sys_config_${BOARD}.fex sys_config.fex
  85. cp u-boot.bin u-boot.fex
  86. if [[ $KERNELBRANCH == "branch:orange-pi-5.15-sun55iw3" ]]; then
  87. mv monitor.fex-linux5.15 monitor.fex
  88. mv boot_package.cfg-linux5.15 boot_package.cfg
  89. mv boot0_sdcard.fex-linux5.15 boot0_sdcard.fex
  90. fi
  91. cp dts/${BOARD}-u-boot-${BRANCH}.dts dts/${BOARD}-u-boot.dts
  92. # make u-boot dtb
  93. $EXTER/packages/pack-uboot/${BOARDFAMILY}/tools/dtc -p 2048 -W no-unit_address_vs_reg -@ -O dtb -o ${BOARD}-u-boot.dtb -b 0 dts/${BOARD}-u-boot-${BRANCH}.dts
  94. [[ ! -f ${BOARD}-u-boot.dtb ]] && exit_with_error "dts compilation failed"
  95. busybox unix2dos sys_config.fex
  96. $EXTER/packages/pack-uboot/${BOARDFAMILY}/tools/script sys_config.fex
  97. cp ${BOARD}-u-boot.dtb sunxi.fex
  98. $EXTER/packages/pack-uboot/${BOARDFAMILY}/tools/update_dtb sunxi.fex 4096
  99. $EXTER/packages/pack-uboot/${BOARDFAMILY}/tools/update_uboot -no_merge u-boot.fex sys_config.bin
  100. update_uboot -no_merge u-boot.bin sys_config.bin
  101. #pack boot package
  102. busybox unix2dos boot_package.cfg
  103. $EXTER/packages/pack-uboot/${BOARDFAMILY}/tools/dragonsecboot -pack boot_package.cfg
  104. if [[ ${MERGE_UBOOT} == yes ]]; then
  105. display_alert "Merge u-boot" "u-boot-${BOARD}-merged.bin" "info"
  106. dd if=/dev/zero of=u-boot-${BOARD}-merged.bin bs=1M count=20
  107. dd if=boot0_sdcard.fex of=u-boot-${BOARD}-merged.bin bs=8k seek=1 conv=fsync
  108. dd if=boot_package.fex of=u-boot-${BOARD}-merged.bin bs=8k seek=2050 conv=fsync
  109. mv u-boot-${BOARD}-merged.bin ${DEB_STORAGE}/u-boot/
  110. fi
  111. fi
  112. }