Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
orangepi-xunlong
GitHub Repository: orangepi-xunlong/orangepi-build
Path: blob/next/external/config/sources/families/sun60iw2.conf
17901 views
1
source "${BASH_SOURCE%/*}/include/sunxi64_common.inc"
2
3
LINUXFAMILY=sun60iw2
4
5
[[ -z $CPUMIN ]] && CPUMIN=416000
6
[[ -z $CPUMAX ]] && CPUMAX=2002000
7
GOVERNOR=ondemand
8
9
OFFSET=32
10
11
case $BRANCH in
12
13
current)
14
if [[ $GITEE_SERVER == yes ]]; then
15
KERNELSOURCE="https://gitee.com/orangepi-xunlong/orange-pi-5.15-sun60iw2.git"
16
MAINLINE_UBOOT_SOURCE='https://gitee.com/orangepi-xunlong/u-boot-orangepi.git'
17
fi
18
19
OVERLAY_PREFIX='sun60i-t736'
20
[[ "${BOARD}" == "orangepi4pro" ]] && OVERLAY_PREFIX='sun60i-a733'
21
KERNELBRANCH="branch:orange-pi-5.15-sun60iw2"
22
LINUXCONFIG="linux-sun60iw2-current"
23
[[ "${BOARD}" == "orangepi4pro" ]] && LINUXCONFIG="linux-sun60iw2-current-opi4pro"
24
BOOTBRANCH='branch:v2018.05-sun60iw2'
25
KERNELPATCHDIR=${BOARDFAMILY}-${BRANCH}
26
UBOOT_TARGET_MAP=";;dts/${BOARD}-u-boot.dts boot0_sdcard.fex boot0_spinor_a733.fex boot_package.fex boot_package_a733_nvme.fex"
27
UBOOT_COMPILER="arm-linux-gnueabi-"
28
UBOOT_USE_GCC='> 6.0'
29
BOOTENV_FILE='sun60iw2.txt'
30
BOOTSCRIPT='boot-sun60iw2.cmd:boot.cmd'
31
KERNEL_USE_GCC='> 10.0'
32
OFFSET=32
33
ATFSOURCE=""
34
ATF_COMPILE="no"
35
INITRD_ARCH=arm
36
37
;;
38
esac
39
40
family_tweaks_s()
41
{
42
if [[ ${DESKTOP_ENVIRONMENT} == gnome ]]; then
43
run_on_sdcard "DEBIAN_FRONTEND=noninteractive apt-get install -y gnome-screenshot tightvncserver gnome-bluetooth"
44
cp $EXTER/packages/blobs/desktop/desktop-wallpapers/orangepi-default.png ${SDCARD}/usr/share/backgrounds/warty-final-ubuntu.png
45
fi
46
47
if [[ $RELEASE == bookworm && ${DESKTOP_ENVIRONMENT} == gnome ]]; then
48
sed -i "s/user-session.*/user-session=gnome-wayland/" ${SDCARD}/etc/lightdm/lightdm.conf.d/22-orangepi-autologin.conf
49
run_on_sdcard "systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target" > /dev/null 2>&1
50
fi
51
52
[[ $RELEASE == jammy && ${DESKTOP_ENVIRONMENT} == xfce ]] && chroot $SDCARD /bin/bash -c "apt-get -y -qq install ocl-icd-libopencl1" >/dev/null 2>&1
53
54
#if [[ "${BOARD}x" == orangepi4ax ]]; then
55
# nvram=$EXTER/cache/sources/orangepi-firmware-git
56
# [[ -f ${nvram}/nvram_ap6256.txt-$BOARD ]] && cp ${nvram}/nvram_ap6256.txt-${BOARD} ${SDCARD}/lib/firmware/nvram_ap6256.txt
57
#fi
58
59
rsync -a --chown=root:root "${EXTER}"/packages/bsp/overlays_arm64/* ${SDCARD}/
60
61
chroot $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>&1
62
63
if [[ $BUILD_DESKTOP == yes ]]; then
64
65
sed -i "s/auto-profiles = yes/auto-profiles = no/" ${SDCARD}/usr/share/pulseaudio/alsa-mixer/profile-sets/default.conf
66
67
echo "load-module module-alsa-sink device=hw:0,0 sink_name=HDMI-Playback sink_properties=\"device.description='HDMI Audio'\"" >> ${SDCARD}/etc/pulse/default.pa
68
echo "load-module module-alsa-sink device=hw:1,0 sink_name=AudioCodec-Playback sink_properties=\"device.description='Audio Codec'\"" >> ${SDCARD}/etc/pulse/default.pa
69
70
chroot $SDCARD /bin/bash -c "apt-get -y -qq install vlc mpv" >/dev/null 2>&1
71
fi
72
73
if [[ ${BRANCH} == current ]]; then
74
SERIALCON="ttyS0"
75
fi
76
77
rsync -a --chown=root:root "${EXTER}"/packages/bsp/sun60iw2/* ${SDCARD}/
78
rsync -a --chown=root:root $EXTER/cache/sources/sun60iw2_packages/npu/* ${SDCARD}/
79
80
if [[ $RELEASE =~ bullseye && ${SELECTED_CONFIGURATION} == desktop ]]; then
81
local packages_to_install=("xserver" "glmark2" "libcedarc" "gst-omx")
82
chroot $SDCARD /bin/bash -c "apt-get -y -qq install gstreamer1.0-x gstreamer1.0-plugins-bad" >> "${DEST}"/${LOG_SUBPATH}/install.log 2>&1
83
for package in ${packages_to_install[@]}; do
84
rsync -a --chown=root:root $EXTER/cache/sources/sun60iw2_packages/$RELEASE/$package/* ${SDCARD}/
85
done
86
87
#if [[ $RELEASE == jammy ]]; then
88
# chroot $SDCARD /bin/bash -c "apt-get -y -qq install glmark2 glmark2-wayland" >> "${DEST}"/${LOG_SUBPATH}/install.log 2>&1
89
#elif [[ $RELEASE == bookworm ]]; then
90
# chroot $SDCARD /bin/bash -c "apt-get -y -qq install glmark2-x11 glmark2-wayland" >> "${DEST}"/${LOG_SUBPATH}/install.log 2>&1
91
#fi
92
93
fi
94
95
install_wiringop
96
}
97
98
family_tweaks_bsp()
99
{
100
install -m 755 $EXTER/packages/blobs/bt/brcm_patchram_plus/brcm_patchram_plus_${ARCH} $destination/usr/bin/brcm_patchram_plus
101
install -m 755 $EXTER/packages/blobs/bt/hciattach/hciattach_opi_${ARCH} $destination/usr/bin/hciattach_opi
102
}
103
104
uboot_custom_postprocess()
105
{
106
107
if [[ ${BRANCH} =~ legacy|current && $(dpkg --print-architecture) == amd64 ]]; then
108
109
rm dts/*.dts sys_config ${BOARD}-u-boot-${BRANCH}.dtb -r
110
export PATH=${EXTER}/packages/pack-uboot/tools/:$PATH
111
cp ${EXTER}/packages/pack-uboot/${BOARDFAMILY}/bin/* . -r
112
[[ "${BOARD}" == "orangepi4pro" ]] && cp ${EXTER}/packages/pack-uboot/${BOARDFAMILY}/bin/boot0_sdcard_a733.fex ./boot0_sdcard.fex
113
#[[ "${BOARD}" == "orangepi4pro" ]] && cp ${EXTER}/packages/pack-uboot/${BOARDFAMILY}/bin/boot0_sdcard.fex-orangepi4pro-4G ./boot0_sdcard.fex
114
cp sys_config/sys_config.fex sys_config.fex
115
cp u-boot.bin u-boot.fex
116
cp dts/u-boot-${BRANCH}.dts dts/${BOARD}-u-boot.dts
117
118
# make u-boot dtb
119
$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}.dts
120
[[ ! -f ${BOARD}-u-boot.dtb ]] && exit_with_error "dts compilation failed"
121
122
busybox unix2dos sys_config.fex
123
$EXTER/packages/pack-uboot/tools/script sys_config.fex
124
cp ${BOARD}-u-boot.dtb sunxi.fex
125
$EXTER/packages/pack-uboot/tools/update_dtb sunxi.fex 4096
126
127
$EXTER/packages/pack-uboot/tools/update_uboot -no_merge u-boot.fex sys_config.bin
128
update_uboot -no_merge u-boot.bin sys_config.bin
129
130
#pack boot package
131
busybox unix2dos boot_package.cfg
132
$EXTER/packages/pack-uboot/tools/dragonsecboot -pack boot_package.cfg
133
134
if [[ ${MERGE_UBOOT} == yes ]]; then
135
136
display_alert "Merge u-boot" "u-boot-${BOARD}-merged.bin" "info"
137
dd if=/dev/zero of=u-boot-${BOARD}-merged.bin bs=1M count=20
138
dd if=boot0_sdcard.fex of=u-boot-${BOARD}-merged.bin bs=8k seek=1 conv=fsync
139
dd if=boot_package.fex of=u-boot-${BOARD}-merged.bin bs=8k seek=2050 conv=fsync
140
mv u-boot-${BOARD}-merged.bin ${DEB_STORAGE}/u-boot/
141
fi
142
fi
143
}
144
145
write_uboot_platform_mtd()
146
{
147
if [[ -b /dev/mtdblock0 ]]; then
148
flash_erase /dev/mtd0 0 50
149
size=$(stat --format="%s" $1/boot0_spinor_a733.fex)
150
mtd_debug write /dev/mtd0 0 $size $1/boot0_spinor_a733.fex
151
size=$(stat --format="%s" $1/boot_package.fex)
152
mtd_debug write /dev/mtd0 262144 $size $1/boot_package_a733_nvme.fex
153
sync
154
fi
155
}
156
157