CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
orangepi-xunlong

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: orangepi-xunlong/orangepi-build
Path: blob/next/external/config/sources/families/ky.conf
Views: 3960
1
ARCH="riscv64"
2
3
LINUXCONFIG="linux-ky-${BRANCH}"
4
LINUXFAMILY="ky"
5
6
SERIALCON="ttyS0"
7
BOOTSCRIPT='boot-ky.cmd:boot.cmd'
8
BOOTENV_FILE='ky.txt'
9
KERNEL_COMPILER='riscv64-unknown-linux-gnu-'
10
UBOOT_COMPILER='riscv64-unknown-linux-gnu-'
11
OVERLAY_PREFIX='x1'
12
OFFSET=30
13
14
case "${BRANCH}" in
15
16
current)
17
BOOTBRANCH='branch:v2022.10-ky'
18
19
KERNELBRANCH="branch:orange-pi-6.6-ky"
20
KERNELPATCHDIR="ky-${BRANCH}"
21
UBOOT_TARGET_MAP=";;bootinfo_sd.bin bootinfo_emmc.bin bootinfo_spinor.bin FSBL.bin u-boot-env-default.bin u-boot-opensbi.itb"
22
;;
23
24
esac
25
26
27
uboot_custom_postprocess()
28
{
29
:
30
}
31
32
write_uboot_platform()
33
{
34
if [[ -b "${2}boot0" ]]; then
35
echo 0 > /sys/block/${2##*/}boot0/force_ro
36
dd if=${1}/bootinfo_emmc.bin of=${2}boot0 >/dev/null 2>&1 && sync
37
dd if=${1}/FSBL.bin of=${2}boot0 seek=512 bs=1 >/dev/null 2>&1 && sync
38
echo 1 > /sys/block/${2##*/}boot0/force_ro
39
fi
40
41
dd if=$1/bootinfo_sd.bin of=$2 seek=0 conv=notrunc status=none >/dev/null 2>&1
42
dd if=$1/FSBL.bin of=$2 seek=256 conv=notrunc status=none >/dev/null 2>&1
43
dd if=$1/u-boot-env-default.bin of=$2 seek=768 conv=notrunc status=none >/dev/null 2>&1
44
dd if=$1/u-boot-opensbi.itb of=$2 seek=1664 conv=notrunc status=none >/dev/null 2>&1
45
}
46
47
write_uboot_platform_mtd()
48
{
49
if [[ -b /dev/mtdblock0 ]]; then
50
dd if=$1/bootinfo_spinor.bin of=/dev/mtdblock0 >/dev/null 2>&1 && sync
51
dd if=$1/FSBL.bin of=/dev/mtdblock2 seek=0 bs=1 >/dev/null 2>&1 && sync
52
dd if=$1/u-boot-env-default.bin of=/dev/mtdblock3 seek=0 bs=1 >/dev/null 2>&1 && sync
53
dd if=$1/u-boot-opensbi.itb of=/dev/mtdblock5 seek=0 bs=1K >/dev/null 2>&1 && sync
54
fi
55
}
56
57
family_tweaks()
58
{
59
rsync -a --chown=root:root "${EXTER}"/packages/bsp/ky/* ${SDCARD}/
60
61
run_on_sdcard "DEBIAN_FRONTEND=noninteractive apt-get install -y gdisk dnsmasq util-linux-extra smartmontools can-utils v4l-utils cmake python3-pip"
62
if [[ ${DESKTOP_ENVIRONMENT} == gnome ]]; then
63
run_on_sdcard "DEBIAN_FRONTEND=noninteractive apt-get install -y gnome-screenshot tightvncserver gnome-bluetooth"
64
sed -i 's/# *AutomaticLoginEnable = true/AutomaticLoginEnable = true/' ${SDCARD}/etc/gdm3/custom.conf
65
sed -i 's/# *AutomaticLogin = user1/AutomaticLogin = orangepi/' ${SDCARD}/etc/gdm3/custom.conf
66
echo -e "\n[Install]\nWantedBy=multi-user.target" >> ${SDCARD}/lib/systemd/system/gdm3.service
67
#cp $EXTER/packages/blobs/desktop/desktop-wallpapers/orangepi-default.png ${SDCARD}/usr/share/backgrounds/warty-final-ubuntu.png
68
fi
69
70
if [[ $RELEASE == noble && ${SELECTED_CONFIGURATION} == desktop ]]; then
71
local packages_to_install
72
packages_to_install_common=("ddk" "camera" "mpp")
73
packages_to_install=("mesa" "glmark2" "gst" "ffmpeg" "mpv")
74
packages_to_install+=("libv4l" "chromium" "npu" "docker" "adbd" "gnome")
75
76
run_on_sdcard "DEBIAN_FRONTEND=noninteractive apt-get install -y vlc fonts-liberation libu2f-udev xdg-utils"
77
78
for package in ${packages_to_install_common[@]}; do
79
dpkg_install_debs_chroot $EXTER/cache/sources/ky_packages/common/$package
80
done
81
82
for package in ${packages_to_install[@]}; do
83
dpkg_install_debs_chroot $EXTER/cache/sources/ky_packages/$RELEASE/$package
84
done
85
86
rm $SDCARD/root/*.deb >/dev/null 2>&1
87
fi
88
89
if [[ $BUILD_DESKTOP == yes ]]; then
90
sed -i "s/auto-profiles = yes/auto-profiles = no/" ${SDCARD}/usr/share/pulseaudio/alsa-mixer/profile-sets/default.conf
91
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
92
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
93
echo "set-default-sink HDMI-Playback" >> ${SDCARD}/etc/pulse/default.pa
94
fi
95
96
if [[ "${BOARD}x" == orangepirv2x ]]; then
97
nvram=$EXTER/cache/sources/orangepi-firmware-git
98
[[ -f ${nvram}/nvram_ap6256.txt-$BOARD ]] && cp ${nvram}/nvram_ap6256.txt-${BOARD} ${SDCARD}/lib/firmware/nvram_ap6256.txt
99
fi
100
101
chroot "${SDCARD}" /bin/bash -c "sudo usermod -aG docker ${OPI_USERNAME}"
102
install_wiringop
103
}
104
105