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