Cix: Support Orange Pi 6 Plus
This commit is contained in:
parent
ff9e781d2c
commit
ff7af3be0c
|
|
@ -12,6 +12,7 @@
|
||||||
|
|
||||||
*.bak
|
*.bak
|
||||||
*.swp
|
*.swp
|
||||||
|
*.img
|
||||||
*.tar.gz
|
*.tar.gz
|
||||||
*.patch
|
*.patch
|
||||||
|
|
||||||
|
|
@ -48,6 +49,7 @@ external/cache/sources/t527_packages
|
||||||
external/cache/sources/rk-rootfs-build*
|
external/cache/sources/rk-rootfs-build*
|
||||||
external/cache/sources/orangepi-firmware*
|
external/cache/sources/orangepi-firmware*
|
||||||
external/cache/sources/wiringOP
|
external/cache/sources/wiringOP
|
||||||
|
external/cache/sources/component_cix*
|
||||||
external/cache/sources/wiringOP-Python
|
external/cache/sources/wiringOP-Python
|
||||||
external/cache/sources/rk3399_gst_xserver_libs
|
external/cache/sources/rk3399_gst_xserver_libs
|
||||||
external/cache/sources/ascend-driver
|
external/cache/sources/ascend-driver
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
# Cix P1 SoC
|
||||||
|
BOARD_NAME="Orange Pi 6 Plus"
|
||||||
|
BOARDFAMILY="cix"
|
||||||
|
KERNEL_TARGET="current"
|
||||||
|
IMAGE_PARTITION_TABLE="gpt"
|
||||||
|
DISTRIB_TYPE_CURRENT="bookworm"
|
||||||
|
MODULES_CURRENT="armcb_isp_v4l2 btusb"
|
||||||
|
PLYMOUTH="no"
|
||||||
|
BUILD_MINIMAL="no"
|
||||||
|
REVISION="1.0.0"
|
||||||
|
|
@ -1,59 +1,111 @@
|
||||||
anacron
|
anacron
|
||||||
apt-xapian-index
|
apt-xapian-index
|
||||||
at-spi2-core
|
at-spi2-core
|
||||||
|
bluetooth
|
||||||
|
cifs-utils
|
||||||
|
cheese
|
||||||
|
clpeak
|
||||||
colord
|
colord
|
||||||
|
command-not-found
|
||||||
cups
|
cups
|
||||||
dbus-x11
|
dbus-x11
|
||||||
dmz-cursor-theme
|
|
||||||
dconf-cli
|
dconf-cli
|
||||||
|
dhcpcd
|
||||||
|
dhcpcd-base
|
||||||
|
dmz-cursor-theme
|
||||||
eject
|
eject
|
||||||
foomatic-db-compressed-ppds
|
fcitx5
|
||||||
|
fcitx5-config-qt
|
||||||
|
fcitx5-chinese-addons
|
||||||
|
fcitx5-rime
|
||||||
fonts-noto-cjk
|
fonts-noto-cjk
|
||||||
fonts-ubuntu
|
fonts-ubuntu
|
||||||
fonts-ubuntu-console
|
fonts-ubuntu-console
|
||||||
|
fonts-wqy-zenhei
|
||||||
|
foomatic-db-compressed-ppds
|
||||||
gdebi
|
gdebi
|
||||||
|
gnome-bluetooth
|
||||||
gnome-calculator
|
gnome-calculator
|
||||||
gnome-control-center
|
gnome-control-center
|
||||||
gnome-disk-utility
|
|
||||||
gnome-desktop3-data
|
gnome-desktop3-data
|
||||||
|
gnome-disk-utility
|
||||||
gnome-keyring
|
gnome-keyring
|
||||||
gnome-menus
|
gnome-menus
|
||||||
gnome-screenshot
|
gnome-screenshot
|
||||||
gnome-disk-utility
|
|
||||||
gnome-system-monitor
|
|
||||||
gnome-terminal
|
|
||||||
gnome-session
|
gnome-session
|
||||||
gnome-shell
|
gnome-shell
|
||||||
|
gnome-system-monitor
|
||||||
|
gnome-terminal
|
||||||
|
gparted
|
||||||
|
grub2-common
|
||||||
|
grub-efi-arm64
|
||||||
|
gstreamer1.0-alsa
|
||||||
|
gstreamer1.0-libav
|
||||||
gstreamer1.0-packagekit
|
gstreamer1.0-packagekit
|
||||||
gstreamer1.0-plugins-base-apps
|
gstreamer1.0-plugins-base-apps
|
||||||
gstreamer1.0-pulseaudio
|
|
||||||
inputattach
|
inputattach
|
||||||
|
keyutils
|
||||||
|
kmscube
|
||||||
|
libegl1-mesa-dev
|
||||||
|
libfdk-aac2
|
||||||
|
libfdk-aac-dev
|
||||||
|
libffi-dev
|
||||||
|
libgles2-mesa-dev
|
||||||
|
libnet1
|
||||||
|
libnfsidmap1
|
||||||
libnotify-bin
|
libnotify-bin
|
||||||
|
libpcap0.8
|
||||||
|
libpkgconf3
|
||||||
libpulsedsp
|
libpulsedsp
|
||||||
|
libpython3-dev
|
||||||
|
libqt6opengl6
|
||||||
|
libv4l2rds0
|
||||||
|
libvulkan-dev
|
||||||
|
libwayland-dev
|
||||||
lm-sensors
|
lm-sensors
|
||||||
|
locales
|
||||||
|
mesa-utils
|
||||||
nautilus
|
nautilus
|
||||||
|
netwox
|
||||||
|
nfs-common
|
||||||
pavucontrol
|
pavucontrol
|
||||||
|
pipewalker
|
||||||
|
pkgconf
|
||||||
|
pkgconf-bin
|
||||||
|
pkg-config
|
||||||
profile-sync-daemon
|
profile-sync-daemon
|
||||||
pulseaudio
|
python3.11-venv
|
||||||
pulseaudio-module-bluetooth
|
python3-pip
|
||||||
|
rpcbind
|
||||||
software-properties-gtk
|
software-properties-gtk
|
||||||
synaptic
|
synaptic
|
||||||
system-config-printer
|
system-config-printer
|
||||||
|
task-gnome-desktop
|
||||||
terminator
|
terminator
|
||||||
tracker
|
tracker
|
||||||
tracker-extract
|
tracker-extract
|
||||||
tracker-miner-fs
|
tracker-miner-fs
|
||||||
|
tree
|
||||||
|
udhcpc
|
||||||
|
unrar
|
||||||
upower
|
upower
|
||||||
|
v4l-utils
|
||||||
|
vsftpd
|
||||||
|
vulkan-tools
|
||||||
x11-apps
|
x11-apps
|
||||||
x11-session-utils
|
x11-session-utils
|
||||||
x11-utils
|
x11-utils
|
||||||
x11-xserver-utils
|
x11-xserver-utils
|
||||||
xarchiver
|
xarchiver
|
||||||
|
xbitmaps
|
||||||
xdg-user-dirs
|
xdg-user-dirs
|
||||||
xdg-user-dirs-gtk
|
xdg-user-dirs-gtk
|
||||||
|
xfce4-screenshooter
|
||||||
xfonts-base
|
xfonts-base
|
||||||
|
xfonts-intl-chinese
|
||||||
|
xfonts-wqy
|
||||||
xserver-xorg
|
xserver-xorg
|
||||||
|
xserver-xorg-input-mouse
|
||||||
|
xterm
|
||||||
xwayland
|
xwayland
|
||||||
zenity
|
zenity
|
||||||
lightdm
|
|
||||||
lightdm-settings
|
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
gdm3
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
# overwrite stock lightdm greeter configuration
|
## overwrite stock lightdm greeter configuration
|
||||||
if [ -d /etc/orangepi/lightdm ]; then cp -R /etc/orangepi/lightdm /etc/; fi
|
#if [ -d /etc/orangepi/lightdm ]; then cp -R /etc/orangepi/lightdm /etc/; fi
|
||||||
if [ -f /etc/lightdm/slick-greeter.conf ]; then sed -i 's/orangepi-lightdm\/orangepi-default.png/warty-final-ubuntu.png/g' /etc/lightdm/slick-greeter.conf; fi
|
#if [ -f /etc/lightdm/slick-greeter.conf ]; then sed -i 's/orangepi-lightdm\/orangepi-default.png/warty-final-ubuntu.png/g' /etc/lightdm/slick-greeter.conf; fi
|
||||||
|
#
|
||||||
|
#if [ -f /etc/lightdm/lightdm.conf.d/11-orangepi.conf ]; then sed -i "s/user-session.*/user-session=gnome-wayland/" /etc/lightdm/lightdm.conf.d/11-orangepi.conf; fi
|
||||||
|
#
|
||||||
|
## Disable Pulseaudio timer scheduling which does not work with sndhdmi driver
|
||||||
|
#if [ -f /etc/pulse/default.pa ]; then sed "s/load-module module-udev-detect$/& tsched=0/g" -i /etc/pulse/default.pa; fi
|
||||||
|
|
||||||
if [ -f /etc/lightdm/lightdm.conf.d/11-orangepi.conf ]; then sed -i "s/user-session.*/user-session=gnome-wayland/" /etc/lightdm/lightdm.conf.d/11-orangepi.conf; fi
|
# set wallpapper to orangepi
|
||||||
|
|
||||||
# Disable Pulseaudio timer scheduling which does not work with sndhdmi driver
|
|
||||||
if [ -f /etc/pulse/default.pa ]; then sed "s/load-module module-udev-detect$/& tsched=0/g" -i /etc/pulse/default.pa; fi
|
|
||||||
|
|
||||||
# set wallpapper to armbian
|
|
||||||
keys=/etc/dconf/db/local.d/00-bg
|
keys=/etc/dconf/db/local.d/00-bg
|
||||||
profile=/etc/dconf/profile/user
|
profile=/etc/dconf/profile/user
|
||||||
|
|
||||||
|
|
@ -17,16 +17,26 @@ install -Dv /dev/null $profile
|
||||||
# set default shortcuts
|
# set default shortcuts
|
||||||
echo "
|
echo "
|
||||||
[org/gnome/shell]
|
[org/gnome/shell]
|
||||||
favorite-apps = ['terminator.desktop', 'org.gnome.Nautilus.desktop', 'google-chrome.desktop', 'thunderbird.desktop', 'code.desktop', 'Zoom.desktop']
|
favorite-apps = ['org.gnome.Nautilus.desktop', 'org.gnome.Terminal.desktop', 'chromium.desktop', 'org.gnome.Totem.desktop', 'gparted.desktop', 'org.gnome.Settings.desktop']
|
||||||
|
|
||||||
|
[org/gnome/settings-daemon/plugins/power]
|
||||||
|
sleep-inactive-ac-timeout='0'
|
||||||
|
sleep-inactive-ac-type='nothing'
|
||||||
|
sleep-inactive-battery-timeout='0'
|
||||||
|
sleep-inactive-battery-type='nothing'
|
||||||
|
power-button-action='interactive'
|
||||||
|
|
||||||
|
[org/gnome/desktop/session]
|
||||||
|
idle-delay=uint32 0
|
||||||
|
|
||||||
[org/gnome/desktop/background]
|
[org/gnome/desktop/background]
|
||||||
picture-uri='file:///usr/share/backgrounds/warty-final-ubuntu.png'
|
picture-uri='file:///usr/share/backgrounds/orangepi/orangepi-default.png'
|
||||||
picture-options='zoom'
|
picture-options='zoom'
|
||||||
primary-color='#456789'
|
primary-color='#456789'
|
||||||
secondary-color='#FFFFFF'
|
secondary-color='#FFFFFF'
|
||||||
|
|
||||||
[org/gnome/desktop/screensaver]
|
[org/gnome/desktop/screensaver]
|
||||||
picture-uri='file:///usr/share/backgrounds/warty-final-ubuntu.png'
|
picture-uri='file:///usr/share/backgrounds/orangepi/orangepi-default.png'
|
||||||
picture-options='zoom'
|
picture-options='zoom'
|
||||||
primary-color='#456789'
|
primary-color='#456789'
|
||||||
secondary-color='#FFFFFF'" >> $keys
|
secondary-color='#FFFFFF'" >> $keys
|
||||||
|
|
|
||||||
|
|
@ -1,164 +1,164 @@
|
||||||
# install lightdm greeter
|
# install lightdm greeter
|
||||||
cp -R "${EXTER}"/packages/blobs/desktop/lightdm "${destination}"/etc/orangepi
|
#cp -R "${EXTER}"/packages/blobs/desktop/lightdm "${destination}"/etc/orangepi
|
||||||
|
|
||||||
# install default desktop settings
|
# install default desktop settings
|
||||||
mkdir -p "${destination}"/etc/skel
|
#mkdir -p "${destination}"/etc/skel
|
||||||
cp -R "${EXTER}"/packages/blobs/desktop/skel/. "${destination}"/etc/skel
|
#cp -R "${EXTER}"/packages/blobs/desktop/skel/. "${destination}"/etc/skel
|
||||||
|
|
||||||
#install cinnamon desktop bar icons
|
#install cinnamon desktop bar icons
|
||||||
mkdir -p "${destination}"/usr/share/icons/orangepi
|
#mkdir -p "${destination}"/usr/share/icons/orangepi
|
||||||
cp "${EXTER}"/packages/blobs/desktop/desktop-icons/*.png "${destination}"/usr/share/icons/orangepi
|
#cp "${EXTER}"/packages/blobs/desktop/desktop-icons/*.png "${destination}"/usr/share/icons/orangepi
|
||||||
|
|
||||||
# install wallpapers
|
# install wallpapers
|
||||||
mkdir -p "${destination}"/usr/share/backgrounds/orangepi/
|
#mkdir -p "${destination}"/usr/share/backgrounds/orangepi/
|
||||||
cp "${EXTER}"/packages/blobs/desktop/desktop-wallpapers/*.png "${destination}"/usr/share/backgrounds/orangepi
|
#cp "${EXTER}"/packages/blobs/desktop/desktop-wallpapers/*.png "${destination}"/usr/share/backgrounds/orangepi
|
||||||
|
|
||||||
# install wallpapers
|
# install wallpapers
|
||||||
mkdir -p "${destination}"/usr/share/backgrounds/orangepi-lightdm/
|
#mkdir -p "${destination}"/usr/share/backgrounds/orangepi-lightdm/
|
||||||
cp "${EXTER}"/packages/blobs/desktop/lightdm-wallpapers/*.png "${destination}"/usr/share/backgrounds/orangepi-lightdm
|
#cp "${EXTER}"/packages/blobs/desktop/lightdm-wallpapers/*.png "${destination}"/usr/share/backgrounds/orangepi-lightdm
|
||||||
|
|
||||||
# install logo for login screen
|
# install logo for login screen
|
||||||
mkdir -p "${destination}"/usr/share/pixmaps/orangepi
|
mkdir -p "${destination}"/usr/share/pixmaps/orangepi
|
||||||
cp "${EXTER}"/packages/blobs/desktop/icons/orangepi.png "${destination}"/usr/share/pixmaps/orangepi
|
cp "${EXTER}"/packages/blobs/desktop/icons/orangepi.png "${destination}"/usr/share/pixmaps/orangepi
|
||||||
|
|
||||||
#generate wallpaper list for background changer
|
#generate wallpaper list for background changer
|
||||||
mkdir -p "${destination}"/usr/share/gnome-background-properties
|
#mkdir -p "${destination}"/usr/share/gnome-background-properties
|
||||||
cat <<EOF > "${destination}"/usr/share/gnome-background-properties/orangepi.xml
|
#cat <<EOF > "${destination}"/usr/share/gnome-background-properties/orangepi.xml
|
||||||
<?xml version="1.0"?>
|
#<?xml version="1.0"?>
|
||||||
<!DOCTYPE wallpapers SYSTEM "gnome-wp-list.dtd">
|
#<!DOCTYPE wallpapers SYSTEM "gnome-wp-list.dtd">
|
||||||
<wallpapers>
|
#<wallpapers>
|
||||||
<wallpaper deleted="false">
|
# <wallpaper deleted="false">
|
||||||
<name>OrangePi black-pyscho</name>
|
# <name>OrangePi black-pyscho</name>
|
||||||
<filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
# <filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
||||||
<options>zoom</options>
|
# <options>zoom</options>
|
||||||
<pcolor>#ffffff</pcolor>
|
# <pcolor>#ffffff</pcolor>
|
||||||
<scolor>#000000</scolor>
|
# <scolor>#000000</scolor>
|
||||||
</wallpaper>
|
# </wallpaper>
|
||||||
<wallpaper deleted="false">
|
# <wallpaper deleted="false">
|
||||||
<name>OrangePi bluie-circle</name>
|
# <name>OrangePi bluie-circle</name>
|
||||||
<filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
# <filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
||||||
<options>zoom</options>
|
# <options>zoom</options>
|
||||||
<pcolor>#ffffff</pcolor>
|
# <pcolor>#ffffff</pcolor>
|
||||||
<scolor>#000000</scolor>
|
# <scolor>#000000</scolor>
|
||||||
</wallpaper>
|
# </wallpaper>
|
||||||
<wallpaper deleted="false">
|
# <wallpaper deleted="false">
|
||||||
<name>OrangePi blue-monday</name>
|
# <name>OrangePi blue-monday</name>
|
||||||
<filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
# <filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
||||||
<options>zoom</options>
|
# <options>zoom</options>
|
||||||
<pcolor>#ffffff</pcolor>
|
# <pcolor>#ffffff</pcolor>
|
||||||
<scolor>#000000</scolor>
|
# <scolor>#000000</scolor>
|
||||||
</wallpaper>
|
# </wallpaper>
|
||||||
<wallpaper deleted="false">
|
# <wallpaper deleted="false">
|
||||||
<name>OrangePi blue-penguin</name>
|
# <name>OrangePi blue-penguin</name>
|
||||||
<filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
# <filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
||||||
<options>zoom</options>
|
# <options>zoom</options>
|
||||||
<pcolor>#ffffff</pcolor>
|
# <pcolor>#ffffff</pcolor>
|
||||||
<scolor>#000000</scolor>
|
# <scolor>#000000</scolor>
|
||||||
</wallpaper>
|
# </wallpaper>
|
||||||
<wallpaper deleted="false">
|
# <wallpaper deleted="false">
|
||||||
<name>OrangePi gray-resultado</name>
|
# <name>OrangePi gray-resultado</name>
|
||||||
<filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
# <filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
||||||
<options>zoom</options>
|
# <options>zoom</options>
|
||||||
<pcolor>#ffffff</pcolor>
|
# <pcolor>#ffffff</pcolor>
|
||||||
<scolor>#000000</scolor>
|
# <scolor>#000000</scolor>
|
||||||
</wallpaper>
|
# </wallpaper>
|
||||||
<wallpaper deleted="false">
|
# <wallpaper deleted="false">
|
||||||
<name>OrangePi green-penguin</name>
|
# <name>OrangePi green-penguin</name>
|
||||||
<filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
# <filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
||||||
<options>zoom</options>
|
# <options>zoom</options>
|
||||||
<pcolor>#ffffff</pcolor>
|
# <pcolor>#ffffff</pcolor>
|
||||||
<scolor>#000000</scolor>
|
# <scolor>#000000</scolor>
|
||||||
</wallpaper>
|
# </wallpaper>
|
||||||
<wallpaper deleted="false">
|
# <wallpaper deleted="false">
|
||||||
<name>OrangePi green-retro</name>
|
# <name>OrangePi green-retro</name>
|
||||||
<filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
# <filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
||||||
<options>zoom</options>
|
# <options>zoom</options>
|
||||||
<pcolor>#ffffff</pcolor>
|
# <pcolor>#ffffff</pcolor>
|
||||||
<scolor>#000000</scolor>
|
# <scolor>#000000</scolor>
|
||||||
</wallpaper>
|
# </wallpaper>
|
||||||
<wallpaper deleted="false">
|
# <wallpaper deleted="false">
|
||||||
<name>OrangePi green-wall-penguin</name>
|
# <name>OrangePi green-wall-penguin</name>
|
||||||
<filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
# <filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
||||||
<options>zoom</options>
|
# <options>zoom</options>
|
||||||
<pcolor>#ffffff</pcolor>
|
# <pcolor>#ffffff</pcolor>
|
||||||
<scolor>#000000</scolor>
|
# <scolor>#000000</scolor>
|
||||||
</wallpaper>
|
# </wallpaper>
|
||||||
<wallpaper deleted="false">
|
# <wallpaper deleted="false">
|
||||||
<name>OrangePi 4k-neglated</name>
|
# <name>OrangePi 4k-neglated</name>
|
||||||
<filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
# <filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
||||||
<options>zoom</options>
|
# <options>zoom</options>
|
||||||
<pcolor>#ffffff</pcolor>
|
# <pcolor>#ffffff</pcolor>
|
||||||
<scolor>#000000</scolor>
|
# <scolor>#000000</scolor>
|
||||||
</wallpaper>
|
# </wallpaper>
|
||||||
<wallpaper deleted="false">
|
# <wallpaper deleted="false">
|
||||||
<name>OrangePi neon-gray-penguin</name>
|
# <name>OrangePi neon-gray-penguin</name>
|
||||||
<filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
# <filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
||||||
<options>zoom</options>
|
# <options>zoom</options>
|
||||||
<pcolor>#ffffff</pcolor>
|
# <pcolor>#ffffff</pcolor>
|
||||||
<scolor>#000000</scolor>
|
# <scolor>#000000</scolor>
|
||||||
</wallpaper>
|
# </wallpaper>
|
||||||
<wallpaper deleted="false">
|
# <wallpaper deleted="false">
|
||||||
<name>OrangePi plastic-love</name>
|
# <name>OrangePi plastic-love</name>
|
||||||
<filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
# <filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
||||||
<options>zoom</options>
|
# <options>zoom</options>
|
||||||
<pcolor>#ffffff</pcolor>
|
# <pcolor>#ffffff</pcolor>
|
||||||
<scolor>#000000</scolor>
|
# <scolor>#000000</scolor>
|
||||||
</wallpaper>
|
# </wallpaper>
|
||||||
<wallpaper deleted="false">
|
# <wallpaper deleted="false">
|
||||||
<name>OrangePi purple-penguine</name>
|
# <name>OrangePi purple-penguine</name>
|
||||||
<filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
# <filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
||||||
<options>zoom</options>
|
# <options>zoom</options>
|
||||||
<pcolor>#ffffff</pcolor>
|
# <pcolor>#ffffff</pcolor>
|
||||||
<scolor>#000000</scolor>
|
# <scolor>#000000</scolor>
|
||||||
</wallpaper>
|
# </wallpaper>
|
||||||
<wallpaper deleted="false">
|
# <wallpaper deleted="false">
|
||||||
<name>OrangePi purplepunk-resultado</name>
|
# <name>OrangePi purplepunk-resultado</name>
|
||||||
<filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
# <filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
||||||
<options>zoom</options>
|
# <options>zoom</options>
|
||||||
<pcolor>#ffffff</pcolor>
|
# <pcolor>#ffffff</pcolor>
|
||||||
<scolor>#000000</scolor>
|
# <scolor>#000000</scolor>
|
||||||
</wallpaper>
|
# </wallpaper>
|
||||||
<wallpaper deleted="false">
|
# <wallpaper deleted="false">
|
||||||
<name>OrangePi red-penguin-dark</name>
|
# <name>OrangePi red-penguin-dark</name>
|
||||||
<filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
# <filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
||||||
<options>zoom</options>
|
# <options>zoom</options>
|
||||||
<pcolor>#ffffff</pcolor>
|
# <pcolor>#ffffff</pcolor>
|
||||||
<scolor>#000000</scolor>
|
# <scolor>#000000</scolor>
|
||||||
</wallpaper>
|
# </wallpaper>
|
||||||
<wallpaper deleted="false">
|
# <wallpaper deleted="false">
|
||||||
<name>OrangePi red-penguin</name>
|
# <name>OrangePi red-penguin</name>
|
||||||
<filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
# <filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
||||||
<options>zoom</options>
|
# <options>zoom</options>
|
||||||
<pcolor>#ffffff</pcolor>
|
# <pcolor>#ffffff</pcolor>
|
||||||
<scolor>#000000</scolor>
|
# <scolor>#000000</scolor>
|
||||||
</wallpaper>
|
# </wallpaper>
|
||||||
<wallpaper deleted="false">
|
# <wallpaper deleted="false">
|
||||||
<name>OrangePi light</name>
|
# <name>OrangePi light</name>
|
||||||
<filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
# <filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
||||||
<options>zoom</options>
|
# <options>zoom</options>
|
||||||
<pcolor>#ffffff</pcolor>
|
# <pcolor>#ffffff</pcolor>
|
||||||
<scolor>#000000</scolor>
|
# <scolor>#000000</scolor>
|
||||||
</wallpaper>
|
# </wallpaper>
|
||||||
<wallpaper deleted="false">
|
# <wallpaper deleted="false">
|
||||||
<name>OrangePi dark</name>
|
# <name>OrangePi dark</name>
|
||||||
<filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
# <filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
||||||
<options>zoom</options>
|
# <options>zoom</options>
|
||||||
<pcolor>#ffffff</pcolor>
|
# <pcolor>#ffffff</pcolor>
|
||||||
<scolor>#000000</scolor>
|
# <scolor>#000000</scolor>
|
||||||
</wallpaper>
|
# </wallpaper>
|
||||||
<wallpaper deleted="false">
|
# <wallpaper deleted="false">
|
||||||
<name>OrangePi uc</name>
|
# <name>OrangePi uc</name>
|
||||||
<filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
# <filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
||||||
<options>zoom</options>
|
# <options>zoom</options>
|
||||||
<pcolor>#ffffff</pcolor>
|
# <pcolor>#ffffff</pcolor>
|
||||||
<scolor>#000000</scolor>
|
# <scolor>#000000</scolor>
|
||||||
</wallpaper>
|
# </wallpaper>
|
||||||
<wallpaper deleted="false">
|
# <wallpaper deleted="false">
|
||||||
<name>OrangePi clear</name>
|
# <name>OrangePi clear</name>
|
||||||
<filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
# <filename>/usr/share/backgrounds/orangepi/orangepi-default.png</filename>
|
||||||
<options>zoom</options>
|
# <options>zoom</options>
|
||||||
<pcolor>#ffffff</pcolor>
|
# <pcolor>#ffffff</pcolor>
|
||||||
<scolor>#000000</scolor>
|
# <scolor>#000000</scolor>
|
||||||
</wallpaper>
|
# </wallpaper>
|
||||||
</wallpapers>
|
#</wallpapers>
|
||||||
EOF
|
#EOF
|
||||||
|
|
|
||||||
|
|
@ -56,3 +56,4 @@ xfonts-base
|
||||||
xserver-xorg
|
xserver-xorg
|
||||||
xwayland
|
xwayland
|
||||||
zenity
|
zenity
|
||||||
|
tree
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -14,6 +14,7 @@ ARCH=arm64
|
||||||
KERNEL_IMAGE_TYPE=Image
|
KERNEL_IMAGE_TYPE=Image
|
||||||
CAN_BUILD_STRETCH=yes
|
CAN_BUILD_STRETCH=yes
|
||||||
GIT_SERVER="https://github.com/orangepi-xunlong"
|
GIT_SERVER="https://github.com/orangepi-xunlong"
|
||||||
|
[[ -z $GITEE_SERVER ]] && GITEE_SERVER=no
|
||||||
|
|
||||||
[[ -z $INITRD_ARCH ]] && INITRD_ARCH=arm64
|
[[ -z $INITRD_ARCH ]] && INITRD_ARCH=arm64
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,485 @@
|
||||||
|
ARCH="arm64"
|
||||||
|
|
||||||
|
LINUXFAMILY="cix"
|
||||||
|
BOOTCONFIG="none"
|
||||||
|
ATF_COMPILE="no"
|
||||||
|
EXTERNAL_NEW="none"
|
||||||
|
|
||||||
|
SERIALCON="ttyAMA2"
|
||||||
|
KERNEL_COMPILER='aarch64-none-linux-gnu-'
|
||||||
|
|
||||||
|
case $BRANCH in
|
||||||
|
|
||||||
|
current)
|
||||||
|
if [[ $GITEE_SERVER == yes ]]; then
|
||||||
|
KERNELSOURCE="https://gitee.com/orangepi-xunlong/orange-pi-6.1-cix.git"
|
||||||
|
fi
|
||||||
|
KERNELBRANCH='branch:orange-pi-6.1-cix'
|
||||||
|
KERNELPATCHDIR='cix-current'
|
||||||
|
LINUXCONFIG="linux-cix-p1-current"
|
||||||
|
KERNEL_USE_GCC='> 12.0'
|
||||||
|
;;
|
||||||
|
|
||||||
|
next)
|
||||||
|
KERNELBRANCH='branch:orange-pi-6.6-cix'
|
||||||
|
KERNELPATCHDIR='cix-next'
|
||||||
|
LINUXCONFIG="linux-cix-p1-next"
|
||||||
|
KERNEL_USE_GCC='> 12.0'
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
family_tweaks_bsp() {
|
||||||
|
:
|
||||||
|
}
|
||||||
|
|
||||||
|
function build_cix_prideb() {
|
||||||
|
local PATH_OUT_PRIVATE_DEB_PACKAGES=${EXTER}/cache/sources/component_cix-${BRANCH}/cix_proprietary/cix_proprietary-debs
|
||||||
|
local amvx_module=${EXTER}/cache/sources/component_cix-${BRANCH}/cix_opensource/vpu/vpu_driver/bin/aarch64-none-linux-gnu/amvx.ko
|
||||||
|
local linux_version=$(modinfo ${amvx_module} | awk -F': ' '/vermagic/{split($2,a," "); print a[1]}')
|
||||||
|
|
||||||
|
#npu-noe-umd
|
||||||
|
pkg_Name="cix-noe-umd"
|
||||||
|
create_cix_deb "$pkg_Name"
|
||||||
|
|
||||||
|
#isp-umd
|
||||||
|
pkg_Name="cix-isp-umd"
|
||||||
|
create_cix_deb "$pkg_Name"
|
||||||
|
|
||||||
|
#gpu
|
||||||
|
pkg_Name="cix-gpu-umd"
|
||||||
|
if [[ ! -e $PATH_OUT_PRIVATE_DEB_PACKAGES/cix-gpu-umd/etc/systemd/system ]]; then
|
||||||
|
mkdir -p $PATH_OUT_PRIVATE_DEB_PACKAGES/cix-gpu-umd/etc/systemd/system
|
||||||
|
fi
|
||||||
|
if [[ ! -e $PATH_OUT_PRIVATE_DEB_PACKAGES/cix-gpu-umd/usr/bin ]]; then
|
||||||
|
mkdir -p $PATH_OUT_PRIVATE_DEB_PACKAGES/cix-gpu-umd/usr/bin
|
||||||
|
fi
|
||||||
|
cat > $PATH_OUT_PRIVATE_DEB_PACKAGES/cix-gpu-umd/etc/systemd/system/load-modules.service <<- EOF
|
||||||
|
[Unit]
|
||||||
|
Description=Load custom kernel modules
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/usr/bin/load-modules.sh
|
||||||
|
RemainAfterExit=yes
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=sysinit.target
|
||||||
|
EOF
|
||||||
|
cat > $PATH_OUT_PRIVATE_DEB_PACKAGES/cix-gpu-umd/usr/bin/load-modules.sh <<- EOF
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
insmod /lib/modules/$linux_version/extra/protected_memory_allocator.ko
|
||||||
|
insmod /lib/modules/$linux_version/extra/memory_group_manager.ko
|
||||||
|
insmod /lib/modules/$linux_version/extra/mali_kbase.ko
|
||||||
|
#insmod /lib/modules/$linux_version/extra/rtl_btusb.ko
|
||||||
|
#insmod /lib/modules/$linux_version/extra/rtl_wlan.ko
|
||||||
|
insmod /lib/modules/$linux_version/extra/aipu.ko
|
||||||
|
insmod /lib/modules/$linux_version/extra/amvx.ko
|
||||||
|
insmod /lib/modules/$linux_version/kernel/drivers/hid/uhid.ko
|
||||||
|
|
||||||
|
#insmod /lib/modules/$linux_version/kernel/net/netfilter/x_tables.ko
|
||||||
|
#insmod /lib/modules/$linux_version/kernel/net/ipv4/netfilter/ip_tables.ko
|
||||||
|
#insmod /lib/modules/$linux_version/kernel/net/ipv4/netfilter/iptable_nat.ko
|
||||||
|
#insmod /lib/modules/$linux_version/kernel/net/ipv4/netfilter/nf_defrag_ipv4.ko
|
||||||
|
#insmod /lib/modules/$linux_version/kernel/net/ipv6/netfilter/nf_defrag_ipv6.ko
|
||||||
|
#insmod /lib/modules/$linux_version/kernel/lib/libcrc32c.ko
|
||||||
|
#insmod /lib/modules/$linux_version/kernel/net/netfilter/nf_conntrack.ko
|
||||||
|
#insmod /lib/modules/$linux_version/kernel/net/netfilter/nf_nat.ko
|
||||||
|
#insmod /lib/modules/$linux_version/kernel/net/netfilter/xt_MASQUERADE.ko
|
||||||
|
|
||||||
|
ln -s /dev/dma_heap/reserved /dev/dma_heap/linux,cma
|
||||||
|
|
||||||
|
if [[ ! -e /etc/machine-id ]]; then
|
||||||
|
dbus-uuidgen > /etc/machine-id
|
||||||
|
ln -sf /etc/machine-id /var/lib/dbus/machine-id
|
||||||
|
fi
|
||||||
|
|
||||||
|
EOF
|
||||||
|
cat >> $PATH_OUT_PRIVATE_DEB_PACKAGES/cix-gpu-umd/usr/bin/load-modules.sh <<- 'EOF'
|
||||||
|
video_devices=($(ls /dev/video* 2>/dev/null | sort -V))
|
||||||
|
|
||||||
|
if [ ${#video_devices[@]} -eq 1 ]; then
|
||||||
|
ln -s "${video_devices[0]}" /dev/video-cixdec0
|
||||||
|
elif [ ${#video_devices[@]} -eq 0 ]; then
|
||||||
|
echo "Not found /dev/video*"
|
||||||
|
else
|
||||||
|
max_device="${video_devices[-2]}"
|
||||||
|
ln -s "$max_device" /dev/video-cixdec0
|
||||||
|
fi
|
||||||
|
EOF
|
||||||
|
sudo chmod a+x $PATH_OUT_PRIVATE_DEB_PACKAGES/cix-gpu-umd/usr/bin/load-modules.sh
|
||||||
|
if [[ ! -e $PATH_OUT_PRIVATE_DEB_PACKAGES/cix-gpu-umd/DEBIAN ]]; then
|
||||||
|
mkdir -p $PATH_OUT_PRIVATE_DEB_PACKAGES/cix-gpu-umd/DEBIAN
|
||||||
|
fi
|
||||||
|
cat > $PATH_OUT_PRIVATE_DEB_PACKAGES/cix-gpu-umd/DEBIAN/postinst <<- EOF
|
||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Enable the service to start on boot
|
||||||
|
systemctl enable load-modules.service || true
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
EOF
|
||||||
|
cat > $PATH_OUT_PRIVATE_DEB_PACKAGES/cix-gpu-umd/DEBIAN/triggers <<- EOF
|
||||||
|
activate-noawait ldconfig
|
||||||
|
EOF
|
||||||
|
cat > $PATH_OUT_PRIVATE_DEB_PACKAGES/cix-gpu-umd/DEBIAN/shlibs <<- EOF
|
||||||
|
libgbm 1 cix-gpu-umd (>= 1.0.0-1)
|
||||||
|
EOF
|
||||||
|
sudo chmod a+x $PATH_OUT_PRIVATE_DEB_PACKAGES/cix-gpu-umd/DEBIAN/postinst
|
||||||
|
rm -rf $PATH_OUT_PRIVATE_DEB_PACKAGES/cix-gpu-umd/usr/share/cix
|
||||||
|
create_cix_deb "$pkg_Name"
|
||||||
|
|
||||||
|
#dsp
|
||||||
|
pkg_Name="cix-audio-dsp"
|
||||||
|
create_cix_deb "$pkg_Name"
|
||||||
|
}
|
||||||
|
|
||||||
|
function create_cix_deb() {
|
||||||
|
local pkg_Name="$1"
|
||||||
|
local PATH_CHANGELOGS=${EXTER}/cache/sources/component_cix-${BRANCH}/changelogs
|
||||||
|
local PRIVATE_DEB_PACKAGES=("cix-dpu-ddk" "cix-npu-umd" "cix-isp-umd" "cix-gpu-umd" "cix-audio-dsp" "cix-hdcp2" "cix-noe-umd")
|
||||||
|
local CIX_DEB_VERSION="0.01-1"
|
||||||
|
|
||||||
|
display_alert "Building cix deb" "${pkg_Name}" "info"
|
||||||
|
CHANGELOG="$PATH_CHANGELOGS/changelog.${pkg_Name}"
|
||||||
|
if [[ ! -f "$CHANGELOG" ]]; then
|
||||||
|
exit_with_error "changelog not found" "${CHANGELOG}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
VERSION=$(grep -m 1 -oP '^\S+\s+\(\K[^)]+(?=\))' "$CHANGELOG")
|
||||||
|
if [[ ! -n "$VERSION" ]]; then
|
||||||
|
display_alert "get Version failed from: ${CHANGELOG}, will use default version" "1.0.0" "info"
|
||||||
|
sleep 10
|
||||||
|
VERSION="1.0.0"
|
||||||
|
fi
|
||||||
|
|
||||||
|
local pkg_Ver=$VERSION
|
||||||
|
local pkg_private=false
|
||||||
|
|
||||||
|
for str in "${PRIVATE_DEB_PACKAGES[@]}"; do
|
||||||
|
if [[ "$str" == "$pkg_Name" ]]; then
|
||||||
|
rm -rf ${PATH_OUT_DEB_PACKAGES}/$pkg_Name
|
||||||
|
cp -r ${PATH_OUT_PRIVATE_DEB_PACKAGES}/${pkg_Name} ${PATH_OUT_DEB_PACKAGES}/$pkg_Name
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
local build_deb_dir="${PATH_OUT_DEB_PACKAGES}/${pkg_Name}"
|
||||||
|
|
||||||
|
case "$pkg_Name" in
|
||||||
|
("cix-mesa")
|
||||||
|
CONTROL_CONTENT="Package: ${pkg_Name}
|
||||||
|
Version: ${pkg_Ver}
|
||||||
|
Architecture: arm64
|
||||||
|
Maintainer: Cix OS team
|
||||||
|
Depends: libc6 (>= 2.34)
|
||||||
|
Provides: libgl1-mesa-dri, libgl1, libglapi-mesa, libgl-dev
|
||||||
|
Replaces: libgl1-mesa-dri, libgl1, libglapi-mesa, libgl-dev
|
||||||
|
Section: utils
|
||||||
|
Priority: optional
|
||||||
|
Description: $pkg_Name package"
|
||||||
|
;;
|
||||||
|
("cix-xserver")
|
||||||
|
CONTROL_CONTENT="Package: ${pkg_Name}
|
||||||
|
Version: ${pkg_Ver}
|
||||||
|
Architecture: arm64
|
||||||
|
Maintainer: Cix OS team
|
||||||
|
Depends: libc6 (>= 2.34)
|
||||||
|
Provides: xwayland
|
||||||
|
Replaces: xwayland
|
||||||
|
Section: utils
|
||||||
|
Priority: optional
|
||||||
|
Description: $pkg_Name package"
|
||||||
|
;;
|
||||||
|
("cix-gpu-umd")
|
||||||
|
CONTROL_CONTENT="Package: ${pkg_Name}
|
||||||
|
Version: ${pkg_Ver}
|
||||||
|
Architecture: arm64
|
||||||
|
Maintainer: Cix OS team
|
||||||
|
Depends: libc6 (>= 2.34)
|
||||||
|
Provides: libwayland-dev, libwayland-egl1, libgles2, ocl-icd-libopencl1, libgbm1, libegl-dev, libgles1, libegl1, libgles1, libgles-dev, ocl-icd-opencl-dev, libgbm-dev
|
||||||
|
Replaces: libwayland-dev, libwayland-egl1, libgles2, ocl-icd-libopencl1, libgbm1, libegl-dev, libgles1, libegl1, libgles1, libgles-dev, ocl-icd-opencl-dev, libgbm-dev
|
||||||
|
Section: utils
|
||||||
|
Priority: optional
|
||||||
|
Description: $pkg_Name package"
|
||||||
|
;;
|
||||||
|
("cix-gstreamer")
|
||||||
|
CONTROL_CONTENT="Package: ${pkg_Name}
|
||||||
|
Version: ${pkg_Ver}
|
||||||
|
Architecture: arm64
|
||||||
|
Maintainer: Cix OS team
|
||||||
|
Depends: libc6 (>= 2.34), libglib2.0-0, libglib2.0-bin, libx11-6, libgdk-pixbuf-2.0-0, zlib1g, libasound2, libogg0, libopus0, libxext6, libxi6, libxfixes3, libxdamage1, libxml2, libnettle8, libcairo2, libjpeg62-turbo, libpng16-16, libsoup-3.0-0, libva-drm2, libva-glx2, libva-wayland2, libva-x11-2, libva2, libdrm2, libdrm-radeon1, libdrm-nouveau2, libdrm-amdgpu1, libdrm-freedreno1, libdrm-tegra0, libdrm-etnaviv1, libvulkan1, libxcb1, libxkbcommon0, libwayland-client0, libwayland-server0, libwayland-cursor0, libwayland-egl1, libwayland-bin, libnice10, libwebp7, libwebpmux3, libwebpdemux2, libjson-glib-1.0-0, libpango-1.0-0, libpangocairo-1.0-0, libpangoft2-1.0-0, libpangoxft-1.0-0
|
||||||
|
Section: utils
|
||||||
|
Priority: optional
|
||||||
|
Description: $pkg_Name package"
|
||||||
|
;;
|
||||||
|
("cix-npu-onnxruntime")
|
||||||
|
CONTROL_CONTENT="Package: ${pkg_Name}
|
||||||
|
Version: ${pkg_Ver}
|
||||||
|
Architecture: arm64
|
||||||
|
Maintainer: Cix OS team
|
||||||
|
Depends: python3-pip
|
||||||
|
Section: utils
|
||||||
|
Priority: optional
|
||||||
|
Description: $pkg_Name package"
|
||||||
|
;;
|
||||||
|
(*)
|
||||||
|
CONTROL_CONTENT="Package: ${pkg_Name}
|
||||||
|
Version: ${pkg_Ver}
|
||||||
|
Architecture: arm64
|
||||||
|
Maintainer: Cix OS team
|
||||||
|
Depends: libc6 (>= 2.34)
|
||||||
|
Section: utils
|
||||||
|
Priority: optional
|
||||||
|
Description: $pkg_Name package"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [[ -e $build_deb_dir/usr/share/doc/$pkg_Name ]]; then
|
||||||
|
if [[ -e $build_deb_dir/usr/share/doc/$pkg_Name/changelog.Debian.gz ]]; then
|
||||||
|
rm -rf $build_deb_dir/usr/share/doc/$pkg_Name/changelog.Debian.gz
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
mkdir -p $build_deb_dir/usr/share/doc/$pkg_Name
|
||||||
|
fi
|
||||||
|
|
||||||
|
cp $CHANGELOG $build_deb_dir/usr/share/doc/$pkg_Name/changelog.Debian
|
||||||
|
gzip $build_deb_dir/usr/share/doc/$pkg_Name/changelog.Debian
|
||||||
|
|
||||||
|
if [[ -e $PATH_OUT_PRIVATE_DEB_PACKAGES/copyright/$pkg_Name ]]; then
|
||||||
|
mkdir -p $build_deb_dir/usr/share/doc/$pkg_Name
|
||||||
|
cp $PATH_OUT_PRIVATE_DEB_PACKAGES/copyright/$pkg_Name/copyright $build_deb_dir/usr/share/doc/$pkg_Name
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -e "$build_deb_dir" ]]; then
|
||||||
|
if [[ ! -e "$build_deb_dir/DEBIAN/control" ]]; then
|
||||||
|
mkdir -p "$build_deb_dir/DEBIAN"
|
||||||
|
echo "${CONTROL_CONTENT}" > "$build_deb_dir/DEBIAN/control"
|
||||||
|
else
|
||||||
|
sed -i "s/^Version: .*/Version: $pkg_Ver/" "$build_deb_dir/DEBIAN/control"
|
||||||
|
fi
|
||||||
|
|
||||||
|
chmod -R 755 "$build_deb_dir"
|
||||||
|
chmod -R g-s "$build_deb_dir"
|
||||||
|
rm -f ${PATH_OUT_DEB_PACKAGES}/${pkg_Name}_*.deb
|
||||||
|
dpkg-deb -b --root-owner-group "$build_deb_dir" "${PATH_OUT_DEB_PACKAGES}/${pkg_Name}_${pkg_Ver}_arm64.deb" > /dev/null
|
||||||
|
rm -rf ${PATH_OUT_DEB_PACKAGES}/${pkg_Name}
|
||||||
|
else
|
||||||
|
display_alert "deb path does not exist" "${build_deb_dir}" "info"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
family_tweaks_kernel () {
|
||||||
|
|
||||||
|
cix_open_src=${EXTER}/cache/sources/component_cix-${BRANCH}/cix_opensource
|
||||||
|
PATH_OUT_PRIVATE_DEB_PACKAGES=${EXTER}/cache/sources/component_cix-${BRANCH}/cix_proprietary/cix_proprietary-debs
|
||||||
|
PATH_OUT_DEB_PACKAGES=${DEB_STORAGE}/cix_debs-${BRANCH}
|
||||||
|
|
||||||
|
export ARCH=arm64
|
||||||
|
export KDIR=${SRC}/kernel/${KERNELBRANCH#branch:}
|
||||||
|
export CROSS_COMPILE=${toolchain}/${KERNEL_COMPILER}
|
||||||
|
|
||||||
|
[[ -d ${PATH_OUT_DEB_PACKAGES} ]] && rm -r ${PATH_OUT_DEB_PACKAGES}
|
||||||
|
mkdir -p ${PATH_OUT_DEB_PACKAGES}
|
||||||
|
|
||||||
|
cd ${cix_open_src}/vpu/vpu_driver/
|
||||||
|
bash ./clean.sh > /dev/null
|
||||||
|
scons $CTHREADS target=linux > /dev/null
|
||||||
|
# build deb package
|
||||||
|
pkg_Name="cix-vpu-driver"
|
||||||
|
linux_version=$(strings ${LINUXSOURCEDIR}/arch/arm64/boot/Image | grep "Linux version" | cut -d' ' -f3 | head -1)
|
||||||
|
build_deb_dir=${PATH_OUT_DEB_PACKAGES}/${pkg_Name}
|
||||||
|
rm -rf ${build_deb_dir}
|
||||||
|
install_dir=${build_deb_dir}/usr/share/cix/bin
|
||||||
|
install_dir_kernel_modules=${build_deb_dir}/lib/modules/${linux_version}/extra
|
||||||
|
install_dir_include=${build_deb_dir}/usr/share/cix/include
|
||||||
|
install_dir_firmware="${build_deb_dir}/lib/firmware"
|
||||||
|
mkdir -p ${install_dir}
|
||||||
|
mkdir -p ${install_dir_kernel_modules}
|
||||||
|
mkdir -p ${install_dir_include}
|
||||||
|
mkdir -p ${install_dir_firmware}
|
||||||
|
if [ -f bin/aarch64-none-linux-gnu/amvx.ko ]; then
|
||||||
|
cp bin/aarch64-none-linux-gnu/amvx.ko ${install_dir_kernel_modules}
|
||||||
|
cp include/aarch64-none-linux-gnu/mvx-v4l2-controls.h ${install_dir_include}
|
||||||
|
if [[ -d "${PATH_OUT_PRIVATE_DEB_PACKAGES}/cix-vpu-umd/usr/lib/firmware" ]]; then
|
||||||
|
cp -fp ${PATH_OUT_PRIVATE_DEB_PACKAGES}/cix-vpu-umd/usr/lib/firmware/* ${install_dir_firmware}/
|
||||||
|
fi
|
||||||
|
create_cix_deb "${pkg_Name}"
|
||||||
|
else
|
||||||
|
exit_with_error "vpu: amvx.ko module not exist"
|
||||||
|
fi
|
||||||
|
# finish build deb package
|
||||||
|
cd - > /dev/null
|
||||||
|
|
||||||
|
export COMPASS_DRV_BTENVAR_ARCH=${ARCH}
|
||||||
|
export COMPASS_DRV_BTENVAR_KMD_DIR=driver
|
||||||
|
export COMPASS_DRV_BTENVAR_KMD_VERSION=5.8.0
|
||||||
|
export COMPASS_DRV_BTENVAR_KPATH=${KDIR}
|
||||||
|
export BUILD_AIPU_VERSION_KMD=BUILD_ZHOUYI_V3
|
||||||
|
export BUILD_TARGET_PLATFORM_KMD=BUILD_PLATFORM_SKY1
|
||||||
|
export BUILD_NPU_DEVFREQ=y
|
||||||
|
cd ${cix_open_src}/npu/npu_driver
|
||||||
|
cp -f ${COMPASS_DRV_BTENVAR_KMD_DIR}/armchina-npu/include/armchina_aipu.h ${KDIR}/include/uapi/misc
|
||||||
|
make $CTHREADS -C ${COMPASS_DRV_BTENVAR_KMD_DIR} ARCH=${COMPASS_DRV_BTENVAR_ARCH} CROSS_COMPILE=${CROSS_COMPILE} clean > /dev/null
|
||||||
|
make $CTHREADS -C ${COMPASS_DRV_BTENVAR_KMD_DIR} ARCH=${COMPASS_DRV_BTENVAR_ARCH} CROSS_COMPILE=${CROSS_COMPILE} > /dev/null
|
||||||
|
pkg_Name="cix-npu-driver"
|
||||||
|
if [ -f ${COMPASS_DRV_BTENVAR_KMD_DIR}/aipu.ko ]; then
|
||||||
|
# build deb package
|
||||||
|
build_deb_dir=${PATH_OUT_DEB_PACKAGES}/${pkg_Name}
|
||||||
|
rm -rf ${build_deb_dir}
|
||||||
|
install_dir=${build_deb_dir}/lib/modules/${linux_version}/extra
|
||||||
|
mkdir -p ${install_dir}
|
||||||
|
cp ${COMPASS_DRV_BTENVAR_KMD_DIR}/aipu.ko ${install_dir}
|
||||||
|
create_cix_deb "${pkg_Name}"
|
||||||
|
rm -f $PATH_LINUX/include/uapi/misc/armchina_aipu.h
|
||||||
|
# finish build deb package
|
||||||
|
else
|
||||||
|
exit_with_error "npu: aipu.ko module not exist"
|
||||||
|
fi
|
||||||
|
cd - > /dev/null
|
||||||
|
|
||||||
|
export CONFIG_MALI_BASE_MODULES=y
|
||||||
|
export CONFIG_MALI_MEMORY_GROUP_MANAGER=y
|
||||||
|
export CONFIG_MALI_PROTECTED_MEMORY_ALLOCATOR=y
|
||||||
|
export CONFIG_MALI_PLATFORM_NAME="sky1"
|
||||||
|
export CONFIG_MALI_CSF_SUPPORT=y
|
||||||
|
export CONFIG_MALI_CIX_POWER_MODEL=y
|
||||||
|
cd ${cix_open_src}/gpu
|
||||||
|
bash clean.sh > /dev/null
|
||||||
|
gpu_driver_dir=${cix_open_src}/gpu/gpu_kernel/drivers
|
||||||
|
if [[ "${DOCKER_MODE}" == "docker" ]]; then
|
||||||
|
ARCH=arm64 make KCFLAGS="-D__ANDROID_COMMON_KERNEL__ -DUSING_DOCKER_MODE" $CTHREADS -C ${gpu_driver_dir}/base/arm/ > /dev/null
|
||||||
|
ARCH=arm64 make KCFLAGS="-D__ANDROID_COMMON_KERNEL__ -DUSING_DOCKER_MODE" $CTHREADS -C ${gpu_driver_dir}/gpu/arm/ > /dev/null
|
||||||
|
else
|
||||||
|
ARCH=arm64 make $CTHREADS -C ${gpu_driver_dir}/base/arm/ > /dev/null
|
||||||
|
ARCH=arm64 make $CTHREADS -C ${gpu_driver_dir}/gpu/arm/ > /dev/null
|
||||||
|
fi
|
||||||
|
# build deb package
|
||||||
|
pkg_Name="cix-gpu-driver"
|
||||||
|
build_deb_dir=${PATH_OUT_DEB_PACKAGES}/${pkg_Name}
|
||||||
|
rm -rf ${build_deb_dir}
|
||||||
|
install_dir=${build_deb_dir}/lib/modules/${linux_version}/extra
|
||||||
|
mkdir -p ${install_dir}
|
||||||
|
if [ -f ${gpu_driver_dir}/gpu/arm/midgard/mali_kbase.ko ]; then
|
||||||
|
cp ${gpu_driver_dir}/base/arm/memory_group_manager/memory_group_manager.ko ${install_dir}
|
||||||
|
cp ${gpu_driver_dir}/base/arm/protected_memory_allocator/protected_memory_allocator.ko ${install_dir}
|
||||||
|
cp ${gpu_driver_dir}/gpu/arm/midgard/mali_kbase.ko ${install_dir}
|
||||||
|
create_cix_deb "${pkg_Name}"
|
||||||
|
else
|
||||||
|
exit_with_error "gpu: amxv.ko module not exist"
|
||||||
|
fi
|
||||||
|
# finish build deb package
|
||||||
|
cd - > /dev/null
|
||||||
|
|
||||||
|
local DRV_DIR=${cix_open_src}/isp/isp_driver
|
||||||
|
MODULE=armcb_isp_v4l2
|
||||||
|
cd "${DRV_DIR}"
|
||||||
|
make ARCH=${ARCH} CROSS_COMPILE=${CROSS_COMPILE} $CTHREADS PATH_ROOT=${KDIR} clean > /dev/null
|
||||||
|
make ARCH=${ARCH} CROSS_COMPILE=${CROSS_COMPILE} $CTHREADS PATH_ROOT=${KDIR} build > /dev/null
|
||||||
|
if [ -f ${DRV_DIR}/${MODULE}.ko ]; then
|
||||||
|
# build deb package
|
||||||
|
pkg_Name="cix-isp-driver-v4l2"
|
||||||
|
build_deb_dir=${PATH_OUT_DEB_PACKAGES}/${pkg_Name}
|
||||||
|
rm -rf ${build_deb_dir}
|
||||||
|
install_dir=${build_deb_dir}/lib/modules/${linux_version}/extra
|
||||||
|
mkdir -p ${install_dir}
|
||||||
|
cp ${DRV_DIR}/${MODULE}.ko ${install_dir}
|
||||||
|
create_cix_deb "${pkg_Name}"
|
||||||
|
else
|
||||||
|
exit_with_error "${MODULE}.ko module not exist"
|
||||||
|
fi
|
||||||
|
cd - > /dev/null
|
||||||
|
|
||||||
|
build_cix_prideb
|
||||||
|
|
||||||
|
mkdir -p ${SRC}/output/cix/ > /dev/null 2>&1
|
||||||
|
cp ${KDIR}/arch/arm64/boot/Image ${SRC}/output/cix/
|
||||||
|
cp ${KDIR}/arch/arm64/boot/dts/cix/sky1-*dtb ${SRC}/output/cix/
|
||||||
|
rm ${SRC}/output/debs/linux-dtb*
|
||||||
|
}
|
||||||
|
|
||||||
|
install_cix_debs() {
|
||||||
|
|
||||||
|
[[ $BUILD_DESKTOP != yes ]] && return
|
||||||
|
[[ ${RELEASE} == noble ]] && return
|
||||||
|
|
||||||
|
display_alert "Installing" "Cix debs" "info"
|
||||||
|
|
||||||
|
local POOL_PATH=${EXTER}/cache/sources/component_cix-${BRANCH}/cix_proprietary/cix_proprietary-debs
|
||||||
|
local DEB_PATH=${SDCARD}/root/debs
|
||||||
|
|
||||||
|
mkdir -p ${DEB_PATH}
|
||||||
|
cp -fp $POOL_PATH/pool/main/*/*/*.deb ${DEB_PATH}/
|
||||||
|
cp -fp $POOL_PATH/pool/main/*/*.deb ${DEB_PATH}/
|
||||||
|
cp ${EXTER}/cache/sources/component_cix-${BRANCH}/debs/*.deb ${DEB_PATH}/
|
||||||
|
|
||||||
|
run_on_sdcard "apt-get -y --allow-downgrades install /root/debs/*.deb"
|
||||||
|
run_on_sdcard "systemctl mask swap.target"
|
||||||
|
run_on_sdcard "systemctl enable cix_resume.service"
|
||||||
|
run_on_sdcard "systemctl enable cix_resume_prepare.service"
|
||||||
|
rm ${DEB_PATH} -rf
|
||||||
|
|
||||||
|
dpkg_install_deb_chroot "${EXTER}/cache/sources/component_cix-${BRANCH}/debs_manual/cix-gnome-core-1.43_arm64.deb"
|
||||||
|
dpkg_install_deb_chroot "${EXTER}/cache/sources/component_cix-${BRANCH}/debs_manual/yolox-demo-v4l2_2.0.0_arm64.deb"
|
||||||
|
#dpkg_install_deb_chroot "${EXTER}/cache/sources/component_cix-${BRANCH}/debs_manual/systemd_252.26-1~deb12u2_arm64.deb"
|
||||||
|
run_on_sdcard "EBIAN_FRONTEND=noninteractive apt-get -yqq install pulseaudio"
|
||||||
|
run_on_sdcard "EBIAN_FRONTEND=noninteractive apt-get -yqq remove wireplumber"
|
||||||
|
run_on_sdcard "EBIAN_FRONTEND=noninteractive apt-get -yqq remove pipewire-pulse"
|
||||||
|
|
||||||
|
rm $SDCARD/root/*.deb >/dev/null 2>&1
|
||||||
|
}
|
||||||
|
|
||||||
|
family_tweaks() {
|
||||||
|
|
||||||
|
install_balenaEtcher
|
||||||
|
#install_wiringop
|
||||||
|
|
||||||
|
if [[ -L "${SDCARD}/usr/lib/policykit-1/polkit-agent-helper-1" ]]; then
|
||||||
|
chmod 5755 ${SDCARD}/usr/lib/policykit-1/polkit-agent-helper-1
|
||||||
|
fi
|
||||||
|
|
||||||
|
cp ${DEB_STORAGE}/cix_debs-${BRANCH} ${SDCARD}/root/ -rf
|
||||||
|
run_on_sdcard "apt-get -y --allow-downgrades install /root/cix_debs-${BRANCH}/*.deb"
|
||||||
|
|
||||||
|
amvx_module=${EXTER}/cache/sources/component_cix-${BRANCH}/cix_opensource/vpu/vpu_driver/bin/aarch64-none-linux-gnu/amvx.ko
|
||||||
|
linux_version=$(modinfo ${amvx_module} | awk -F': ' '/vermagic/{split($2,a," "); print a[1]}')
|
||||||
|
|
||||||
|
run_on_sdcard "depmod -a $linux_version/"
|
||||||
|
rm -rf ${SDCARD}/root/cix_debs-${BRANCH}
|
||||||
|
rm -rf ${SDCARD}/usr/local/test.mp4
|
||||||
|
|
||||||
|
touch ${SDCARD}/root/.Xauthority
|
||||||
|
|
||||||
|
mv ${SDCARD}/usr/share/cix/bin/spidev_test ${SDCARD}/usr/bin/ >/dev/null 2>&1
|
||||||
|
rm ${SDCARD}/usr/share/cix/bin/isp_app >/dev/null 2>&1
|
||||||
|
|
||||||
|
sed -i 's/^ENABLED=true$/ENABLED=false/' ${SDCARD}/etc/default/orangepi-zram-config
|
||||||
|
|
||||||
|
run_on_sdcard "systemctl --no-reload enable getty@tty1.service >/dev/null 2>&1"
|
||||||
|
run_on_sdcard "systemctl --no-reload enable isp-daemon.service >/dev/null 2>&1"
|
||||||
|
if [[ ${RELEASE} == bookworm ]]; then
|
||||||
|
run_on_sdcard "systemctl mask ssh.socket" >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
|
||||||
|
rsync -a --chown=root:root "${EXTER}"/packages/bsp/overlays_cix/* ${SDCARD}/
|
||||||
|
}
|
||||||
|
|
||||||
|
install_balenaEtcher(){
|
||||||
|
|
||||||
|
if [[ $BUILD_DESKTOP == yes && $install_balena_etcher == yes ]]; then
|
||||||
|
|
||||||
|
[[ ${RELEASE} == noble ]] && return
|
||||||
|
|
||||||
|
balena_etcher_deb=balena-etcher-electron_1.7.9+5945ab1f_arm64.deb
|
||||||
|
balena_etcher_url="https://github.com/Itai-Nelken/BalenaEtcher-arm/releases/download/v1.7.9/${balena_etcher_deb}"
|
||||||
|
balena_etcher=${EXTER}/cache/debs/arm64/${balena_etcher_deb}
|
||||||
|
|
||||||
|
if [[ ! -f ${balena_etcher} ]]; then
|
||||||
|
wget -P ${EXTER}/cache/debs/arm64 ${balena_etcher_url}
|
||||||
|
fi
|
||||||
|
|
||||||
|
install_deb_chroot ${balena_etcher}
|
||||||
|
rm $SDCARD/root/*.deb >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
@ -23,6 +23,7 @@ INSTALL_KSRC="no"
|
||||||
IGNORE_UPDATES=""
|
IGNORE_UPDATES=""
|
||||||
COMPRESS_OUTPUTIMAGE="no"
|
COMPRESS_OUTPUTIMAGE="no"
|
||||||
NO_APT_CACHER="yes"
|
NO_APT_CACHER="yes"
|
||||||
|
GITEE_SERVER="no"
|
||||||
|
|
||||||
#install_balena_etcher="yes"
|
#install_balena_etcher="yes"
|
||||||
#install_zfs="yes"
|
#install_zfs="yes"
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
db962c19a1737d10bcf14e18a8bc66e4 arm-gnu-toolchain-12.3.rel1-x86_64-aarch64-none-linux-gnu.tar.xz
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
db962c19a1737d10bcf14e18a8bc66e4
|
||||||
|
|
@ -138,7 +138,8 @@ function get_ip_addresses() {
|
||||||
if [[ $intf =~ $HIDE_IP_PATTERN ]]; then
|
if [[ $intf =~ $HIDE_IP_PATTERN ]]; then
|
||||||
continue
|
continue
|
||||||
else
|
else
|
||||||
local tmp=$(ip -4 addr show dev $intf | grep -v "$intf:avahi" | awk '/inet/ {print $2}' | cut -d'/' -f1)
|
local tmp=$(ip -4 addr show dev $intf | grep -v "$intf:avahi" | awk '/inet/ {print $2}' | cut -d'/' -f1 | head -n 1)
|
||||||
|
|
||||||
# add both name and IP - can be informative but becomes ugly with long persistent/predictable device names
|
# add both name and IP - can be informative but becomes ugly with long persistent/predictable device names
|
||||||
#[[ -n $tmp ]] && ips+=("$intf: $tmp")
|
#[[ -n $tmp ]] && ips+=("$intf: $tmp")
|
||||||
# add IP only
|
# add IP only
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ do_expand_partition()
|
||||||
|
|
||||||
# trim any btrfs subvolume identifier given in square brackets (e.g. /dev/mapper/orangepi-root[/@])
|
# trim any btrfs subvolume identifier given in square brackets (e.g. /dev/mapper/orangepi-root[/@])
|
||||||
local rootsource=$(findmnt -n -o SOURCE / | sed 's~\[.*\]~~') # i.e. /dev/mmcblk0p1 or /dev/mapper/orangepi-root
|
local rootsource=$(findmnt -n -o SOURCE / | sed 's~\[.*\]~~') # i.e. /dev/mmcblk0p1 or /dev/mapper/orangepi-root
|
||||||
|
old_partuuid=$(sudo blkid ${rootsource} -s PARTUUID -o value)
|
||||||
|
|
||||||
# check for device type
|
# check for device type
|
||||||
local roottype=$(lsblk -n -o TYPE $rootsource) # crypt, part or disk
|
local roottype=$(lsblk -n -o TYPE $rootsource) # crypt, part or disk
|
||||||
|
|
@ -160,6 +161,17 @@ do_expand_partition()
|
||||||
btrfs filesystem resize max / >> ${Log} 2>&1
|
btrfs filesystem resize max / >> ${Log} 2>&1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
if [[ ${BOARD} == orangepi6plus ]]; then
|
||||||
|
new_partuuid=$(sudo blkid ${rootsource} -s PARTUUID -o value)
|
||||||
|
if [[ ${rootdevice} == *sd* ]]; then
|
||||||
|
mount ${rootdevicepath}1 /mnt/
|
||||||
|
else
|
||||||
|
mount ${rootdevicepath}p1 /mnt/
|
||||||
|
fi
|
||||||
|
sed -i "s/root=PARTUUID=${old_partuuid}/root=PARTUUID=${new_partuuid}/g" /mnt/GRUB/GRUB.CFG
|
||||||
|
umount /mnt/
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
do_resize_crypt()
|
do_resize_crypt()
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,422 @@
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
EXITCODE=0
|
||||||
|
|
||||||
|
# bits of this were adapted from lxc-checkconfig
|
||||||
|
# see also https://github.com/lxc/lxc/blob/lxc-1.0.2/src/lxc/lxc-checkconfig.in
|
||||||
|
|
||||||
|
possibleConfigs="
|
||||||
|
/proc/config.gz
|
||||||
|
/boot/config-$(uname -r)
|
||||||
|
/usr/src/linux-$(uname -r)/.config
|
||||||
|
/usr/src/linux/.config
|
||||||
|
"
|
||||||
|
|
||||||
|
if [ $# -gt 0 ]; then
|
||||||
|
CONFIG="$1"
|
||||||
|
else
|
||||||
|
: "${CONFIG:=/proc/config.gz}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! command -v zgrep > /dev/null 2>&1; then
|
||||||
|
zgrep() {
|
||||||
|
zcat "$2" | grep "$1"
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
|
useColor=true
|
||||||
|
if [ "$NO_COLOR" = "1" ] || [ ! -t 1 ]; then
|
||||||
|
useColor=false
|
||||||
|
fi
|
||||||
|
kernelVersion="$(uname -r)"
|
||||||
|
kernelMajor="${kernelVersion%%.*}"
|
||||||
|
kernelMinor="${kernelVersion#$kernelMajor.}"
|
||||||
|
kernelMinor="${kernelMinor%%.*}"
|
||||||
|
|
||||||
|
is_set() {
|
||||||
|
zgrep "CONFIG_$1=[y|m]" "$CONFIG" > /dev/null
|
||||||
|
}
|
||||||
|
is_set_in_kernel() {
|
||||||
|
zgrep "CONFIG_$1=y" "$CONFIG" > /dev/null
|
||||||
|
}
|
||||||
|
is_set_as_module() {
|
||||||
|
zgrep "CONFIG_$1=m" "$CONFIG" > /dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
color() {
|
||||||
|
# if stdout is not a terminal, then don't do color codes.
|
||||||
|
if [ "$useColor" = "false" ]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
codes=
|
||||||
|
if [ "$1" = 'bold' ]; then
|
||||||
|
codes='1'
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
if [ "$#" -gt 0 ]; then
|
||||||
|
code=
|
||||||
|
case "$1" in
|
||||||
|
# see https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
|
||||||
|
black) code=30 ;;
|
||||||
|
red) code=31 ;;
|
||||||
|
green) code=32 ;;
|
||||||
|
yellow) code=33 ;;
|
||||||
|
blue) code=34 ;;
|
||||||
|
magenta) code=35 ;;
|
||||||
|
cyan) code=36 ;;
|
||||||
|
white) code=37 ;;
|
||||||
|
esac
|
||||||
|
if [ "$code" ]; then
|
||||||
|
codes="${codes:+$codes;}$code"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
printf '\033[%sm' "$codes"
|
||||||
|
}
|
||||||
|
wrap_color() {
|
||||||
|
text="$1"
|
||||||
|
shift
|
||||||
|
color "$@"
|
||||||
|
printf '%s' "$text"
|
||||||
|
color reset
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
wrap_good() {
|
||||||
|
echo "$(wrap_color "$1" white): $(wrap_color "$2" green)"
|
||||||
|
}
|
||||||
|
wrap_bad() {
|
||||||
|
echo "$(wrap_color "$1" bold): $(wrap_color "$2" bold red)"
|
||||||
|
}
|
||||||
|
wrap_warning() {
|
||||||
|
wrap_color >&2 "$*" red
|
||||||
|
}
|
||||||
|
|
||||||
|
check_flag() {
|
||||||
|
if is_set_in_kernel "$1"; then
|
||||||
|
wrap_good "CONFIG_$1" 'enabled'
|
||||||
|
elif is_set_as_module "$1"; then
|
||||||
|
wrap_good "CONFIG_$1" 'enabled (as module)'
|
||||||
|
else
|
||||||
|
wrap_bad "CONFIG_$1" 'missing'
|
||||||
|
EXITCODE=1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
check_flags() {
|
||||||
|
for flag in "$@"; do
|
||||||
|
printf -- '- '
|
||||||
|
check_flag "$flag"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
check_command() {
|
||||||
|
if command -v "$1" > /dev/null 2>&1; then
|
||||||
|
wrap_good "$1 command" 'available'
|
||||||
|
else
|
||||||
|
wrap_bad "$1 command" 'missing'
|
||||||
|
EXITCODE=1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
check_device() {
|
||||||
|
if [ -c "$1" ]; then
|
||||||
|
wrap_good "$1" 'present'
|
||||||
|
else
|
||||||
|
wrap_bad "$1" 'missing'
|
||||||
|
EXITCODE=1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
check_sysctl() {
|
||||||
|
val=$(sysctl -n $1)
|
||||||
|
want=$2
|
||||||
|
if [ "$val" = "$want" ]; then
|
||||||
|
wrap_good "sysctl $1" "enabled"
|
||||||
|
else
|
||||||
|
wrap_bad "sysctl $1" "disabled"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ ! -e "$CONFIG" ]; then
|
||||||
|
wrap_warning "warning: $CONFIG does not exist, searching other paths for kernel config ..."
|
||||||
|
for tryConfig in $possibleConfigs; do
|
||||||
|
if [ -e "$tryConfig" ]; then
|
||||||
|
CONFIG="$tryConfig"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [ ! -e "$CONFIG" ]; then
|
||||||
|
wrap_warning "error: cannot find kernel config"
|
||||||
|
wrap_warning " try running this script again, specifying the kernel config:"
|
||||||
|
wrap_warning " CONFIG=/path/to/kernel/.config $0 or $0 /path/to/kernel/.config"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
wrap_color "info: reading kernel config from $CONFIG ..." white
|
||||||
|
echo
|
||||||
|
|
||||||
|
echo 'Generally Necessary:'
|
||||||
|
|
||||||
|
printf -- '- '
|
||||||
|
if [ "$(stat -f -c %t /sys/fs/cgroup 2> /dev/null)" = '63677270' ]; then
|
||||||
|
wrap_good 'cgroup hierarchy' 'cgroupv2'
|
||||||
|
cgroupv2ControllerFile='/sys/fs/cgroup/cgroup.controllers'
|
||||||
|
if [ -f "$cgroupv2ControllerFile" ]; then
|
||||||
|
echo ' Controllers:'
|
||||||
|
for controller in cpu cpuset io memory pids; do
|
||||||
|
if grep -qE '(^| )'"$controller"'($| )' "$cgroupv2ControllerFile"; then
|
||||||
|
echo " - $(wrap_good "$controller" 'available')"
|
||||||
|
else
|
||||||
|
echo " - $(wrap_bad "$controller" 'missing')"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
else
|
||||||
|
wrap_bad "$cgroupv2ControllerFile" 'nonexistent??'
|
||||||
|
fi
|
||||||
|
# TODO find an efficient way to check if cgroup.freeze exists in subdir
|
||||||
|
else
|
||||||
|
cgroupSubsystemDir="$(sed -rne '/^[^ ]+ ([^ ]+) cgroup ([^ ]*,)?(cpu|cpuacct|cpuset|devices|freezer|memory)[, ].*$/ { s//\1/p; q }' /proc/mounts)"
|
||||||
|
cgroupDir="$(dirname "$cgroupSubsystemDir")"
|
||||||
|
if [ -d "$cgroupDir/cpu" ] || [ -d "$cgroupDir/cpuacct" ] || [ -d "$cgroupDir/cpuset" ] || [ -d "$cgroupDir/devices" ] || [ -d "$cgroupDir/freezer" ] || [ -d "$cgroupDir/memory" ]; then
|
||||||
|
echo "$(wrap_good 'cgroup hierarchy' 'properly mounted') [$cgroupDir]"
|
||||||
|
else
|
||||||
|
if [ "$cgroupSubsystemDir" ]; then
|
||||||
|
echo "$(wrap_bad 'cgroup hierarchy' 'single mountpoint!') [$cgroupSubsystemDir]"
|
||||||
|
else
|
||||||
|
wrap_bad 'cgroup hierarchy' 'nonexistent??'
|
||||||
|
fi
|
||||||
|
EXITCODE=1
|
||||||
|
echo " $(wrap_color '(see https://github.com/tianon/cgroupfs-mount)' yellow)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$(cat /sys/module/apparmor/parameters/enabled 2> /dev/null)" = 'Y' ]; then
|
||||||
|
printf -- '- '
|
||||||
|
if command -v apparmor_parser > /dev/null 2>&1; then
|
||||||
|
wrap_good 'apparmor' 'enabled and tools installed'
|
||||||
|
else
|
||||||
|
wrap_bad 'apparmor' 'enabled, but apparmor_parser missing'
|
||||||
|
printf ' '
|
||||||
|
if command -v apt-get > /dev/null 2>&1; then
|
||||||
|
wrap_color '(use "apt-get install apparmor" to fix this)'
|
||||||
|
elif command -v yum > /dev/null 2>&1; then
|
||||||
|
wrap_color '(your best bet is "yum install apparmor-parser")'
|
||||||
|
else
|
||||||
|
wrap_color '(look for an "apparmor" package for your distribution)'
|
||||||
|
fi
|
||||||
|
EXITCODE=1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
check_flags \
|
||||||
|
NAMESPACES NET_NS PID_NS IPC_NS UTS_NS \
|
||||||
|
CGROUPS CGROUP_CPUACCT CGROUP_DEVICE CGROUP_FREEZER CGROUP_SCHED CPUSETS MEMCG \
|
||||||
|
KEYS \
|
||||||
|
VETH BRIDGE BRIDGE_NETFILTER \
|
||||||
|
IP_NF_FILTER IP_NF_MANGLE IP_NF_TARGET_MASQUERADE \
|
||||||
|
IP6_NF_FILTER IP6_NF_MANGLE IP6_NF_TARGET_MASQUERADE \
|
||||||
|
NETFILTER_XT_MATCH_ADDRTYPE \
|
||||||
|
NETFILTER_XT_MATCH_CONNTRACK \
|
||||||
|
NETFILTER_XT_MATCH_IPVS \
|
||||||
|
NETFILTER_XT_MARK \
|
||||||
|
IP_NF_RAW IP_NF_NAT NF_NAT \
|
||||||
|
IP6_NF_RAW IP6_NF_NAT NF_NAT \
|
||||||
|
POSIX_MQUEUE
|
||||||
|
# (POSIX_MQUEUE is required for bind-mounting /dev/mqueue into containers)
|
||||||
|
|
||||||
|
if [ "$kernelMajor" -lt 4 ] || ([ "$kernelMajor" -eq 4 ] && [ "$kernelMinor" -lt 8 ]); then
|
||||||
|
check_flags DEVPTS_MULTIPLE_INSTANCES
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$kernelMajor" -lt 5 ] || [ "$kernelMajor" -eq 5 -a "$kernelMinor" -le 1 ]; then
|
||||||
|
check_flags NF_NAT_IPV4
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$kernelMajor" -lt 5 ] || [ "$kernelMajor" -eq 5 -a "$kernelMinor" -le 2 ]; then
|
||||||
|
check_flags NF_NAT_NEEDED
|
||||||
|
fi
|
||||||
|
# check availability of BPF_CGROUP_DEVICE support
|
||||||
|
if [ "$kernelMajor" -ge 5 ] || ([ "$kernelMajor" -eq 4 ] && [ "$kernelMinor" -ge 15 ]); then
|
||||||
|
check_flags CGROUP_BPF
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo
|
||||||
|
|
||||||
|
echo 'Optional Features:'
|
||||||
|
{
|
||||||
|
check_flags USER_NS
|
||||||
|
}
|
||||||
|
{
|
||||||
|
check_flags SECCOMP
|
||||||
|
check_flags SECCOMP_FILTER
|
||||||
|
}
|
||||||
|
{
|
||||||
|
check_flags CGROUP_PIDS
|
||||||
|
}
|
||||||
|
{
|
||||||
|
# Kernel v5.8+ removes MEMCG_SWAP_ENABLED and deprecates MEMCG_SWAP.
|
||||||
|
if [ "$kernelMajor" -lt 5 ] || [ "$kernelMajor" -eq 5 -a "$kernelMinor" -lt 8 ]; then
|
||||||
|
CODE=${EXITCODE}
|
||||||
|
check_flags MEMCG_SWAP MEMCG_SWAP_ENABLED
|
||||||
|
# FIXME this check is cgroupv1-specific
|
||||||
|
if [ -e /sys/fs/cgroup/memory/memory.memsw.limit_in_bytes ]; then
|
||||||
|
echo " $(wrap_color '(cgroup swap accounting is currently enabled)' bold black)"
|
||||||
|
EXITCODE=${CODE}
|
||||||
|
elif is_set MEMCG_SWAP && ! is_set MEMCG_SWAP_ENABLED; then
|
||||||
|
echo " $(wrap_color '(cgroup swap accounting is currently not enabled, you can enable it by setting boot option "swapaccount=1")' bold black)"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# Kernel v5.8+ enables swap accounting by default.
|
||||||
|
echo " $(wrap_color '(cgroup swap accounting is currently enabled)' bold black)"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
{
|
||||||
|
if is_set LEGACY_VSYSCALL_NATIVE; then
|
||||||
|
printf -- '- '
|
||||||
|
wrap_bad "CONFIG_LEGACY_VSYSCALL_NATIVE" 'enabled'
|
||||||
|
echo " $(wrap_color '(dangerous, provides an ASLR-bypassing target with usable ROP gadgets.)' bold black)"
|
||||||
|
elif is_set LEGACY_VSYSCALL_EMULATE; then
|
||||||
|
printf -- '- '
|
||||||
|
wrap_good "CONFIG_LEGACY_VSYSCALL_EMULATE" 'enabled'
|
||||||
|
elif is_set LEGACY_VSYSCALL_NONE; then
|
||||||
|
printf -- '- '
|
||||||
|
wrap_bad "CONFIG_LEGACY_VSYSCALL_NONE" 'enabled'
|
||||||
|
echo " $(wrap_color '(containers using eglibc <= 2.13 will not work. Switch to' bold black)"
|
||||||
|
echo " $(wrap_color ' "CONFIG_VSYSCALL_[NATIVE|EMULATE]" or use "vsyscall=[native|emulate]"' bold black)"
|
||||||
|
echo " $(wrap_color ' on kernel command line. Note that this will disable ASLR for the,' bold black)"
|
||||||
|
echo " $(wrap_color ' VDSO which may assist in exploiting security vulnerabilities.)' bold black)"
|
||||||
|
# else Older kernels (prior to 3dc33bd30f3e, released in v4.40-rc1) do
|
||||||
|
# not have these LEGACY_VSYSCALL options and are effectively
|
||||||
|
# LEGACY_VSYSCALL_EMULATE. Even older kernels are presumably
|
||||||
|
# effectively LEGACY_VSYSCALL_NATIVE.
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ "$kernelMajor" -lt 4 ] || ([ "$kernelMajor" -eq 4 ] && [ "$kernelMinor" -le 5 ]); then
|
||||||
|
check_flags MEMCG_KMEM
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$kernelMajor" -lt 3 ] || ([ "$kernelMajor" -eq 3 ] && [ "$kernelMinor" -le 18 ]); then
|
||||||
|
check_flags RESOURCE_COUNTERS
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$kernelMajor" -lt 3 ] || ([ "$kernelMajor" -eq 3 ] && [ "$kernelMinor" -le 13 ]); then
|
||||||
|
netprio=NETPRIO_CGROUP
|
||||||
|
else
|
||||||
|
netprio=CGROUP_NET_PRIO
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$kernelMajor" -lt 5 ]; then
|
||||||
|
check_flags IOSCHED_CFQ CFQ_GROUP_IOSCHED
|
||||||
|
fi
|
||||||
|
|
||||||
|
check_flags \
|
||||||
|
BLK_CGROUP BLK_DEV_THROTTLING \
|
||||||
|
CGROUP_PERF \
|
||||||
|
CGROUP_HUGETLB \
|
||||||
|
NET_CLS_CGROUP $netprio \
|
||||||
|
CFS_BANDWIDTH FAIR_GROUP_SCHED \
|
||||||
|
IP_NF_TARGET_REDIRECT \
|
||||||
|
IP_SCTP \
|
||||||
|
IP_VS \
|
||||||
|
IP_VS_NFCT \
|
||||||
|
IP_VS_PROTO_TCP \
|
||||||
|
IP_VS_PROTO_UDP \
|
||||||
|
IP_VS_RR \
|
||||||
|
SECURITY_SELINUX \
|
||||||
|
SECURITY_APPARMOR
|
||||||
|
|
||||||
|
check_flags \
|
||||||
|
NFT_CT \
|
||||||
|
NFT_FIB_IPV4 \
|
||||||
|
NFT_FIB_IPV6 \
|
||||||
|
NFT_FIB \
|
||||||
|
NFT_MASQ \
|
||||||
|
NFT_NAT \
|
||||||
|
NF_TABLES
|
||||||
|
|
||||||
|
if ! is_set EXT4_USE_FOR_EXT2; then
|
||||||
|
check_flags EXT3_FS EXT3_FS_XATTR EXT3_FS_POSIX_ACL EXT3_FS_SECURITY
|
||||||
|
if ! is_set EXT3_FS || ! is_set EXT3_FS_XATTR || ! is_set EXT3_FS_POSIX_ACL || ! is_set EXT3_FS_SECURITY; then
|
||||||
|
echo " $(wrap_color '(enable these ext3 configs if you are using ext3 as backing filesystem)' bold black)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
check_flags EXT4_FS EXT4_FS_POSIX_ACL EXT4_FS_SECURITY
|
||||||
|
if ! is_set EXT4_FS || ! is_set EXT4_FS_POSIX_ACL || ! is_set EXT4_FS_SECURITY; then
|
||||||
|
if is_set EXT4_USE_FOR_EXT2; then
|
||||||
|
echo " $(wrap_color 'enable these ext4 configs if you are using ext3 or ext4 as backing filesystem' bold black)"
|
||||||
|
else
|
||||||
|
echo " $(wrap_color 'enable these ext4 configs if you are using ext4 as backing filesystem' bold black)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo '- Network Drivers:'
|
||||||
|
echo " - \"$(wrap_color 'bridge' blue)\":"
|
||||||
|
check_sysctl net.ipv4.ip_forward 1 | sed 's/^/ - /'
|
||||||
|
check_sysctl net.ipv6.conf.all.forwarding 1 | sed 's/^/ - /'
|
||||||
|
check_sysctl net.ipv6.conf.default.forwarding 1 | sed 's/^/ - /'
|
||||||
|
echo " - \"$(wrap_color 'overlay' blue)\":"
|
||||||
|
check_flags VXLAN BRIDGE_VLAN_FILTERING | sed 's/^/ /'
|
||||||
|
echo ' Optional (for encrypted networks):'
|
||||||
|
check_flags CRYPTO CRYPTO_AEAD CRYPTO_GCM CRYPTO_SEQIV CRYPTO_GHASH \
|
||||||
|
XFRM XFRM_USER XFRM_ALGO INET_ESP NETFILTER_XT_MATCH_BPF | sed 's/^/ /'
|
||||||
|
if [ "$kernelMajor" -lt 5 ] || [ "$kernelMajor" -eq 5 -a "$kernelMinor" -le 3 ]; then
|
||||||
|
check_flags INET_XFRM_MODE_TRANSPORT | sed 's/^/ /'
|
||||||
|
fi
|
||||||
|
echo " - \"$(wrap_color 'ipvlan' blue)\":"
|
||||||
|
check_flags IPVLAN | sed 's/^/ /'
|
||||||
|
echo " - \"$(wrap_color 'macvlan' blue)\":"
|
||||||
|
check_flags MACVLAN DUMMY | sed 's/^/ /'
|
||||||
|
echo " - \"$(wrap_color 'ftp,tftp client in container' blue)\":"
|
||||||
|
check_flags NF_NAT_FTP NF_CONNTRACK_FTP NF_NAT_TFTP NF_CONNTRACK_TFTP | sed 's/^/ /'
|
||||||
|
|
||||||
|
# only fail if no storage drivers available
|
||||||
|
CODE=${EXITCODE}
|
||||||
|
EXITCODE=0
|
||||||
|
STORAGE=1
|
||||||
|
|
||||||
|
echo '- Storage Drivers:'
|
||||||
|
echo " - \"$(wrap_color 'btrfs' blue)\":"
|
||||||
|
check_flags BTRFS_FS | sed 's/^/ /'
|
||||||
|
check_flags BTRFS_FS_POSIX_ACL | sed 's/^/ /'
|
||||||
|
[ "$EXITCODE" = 0 ] && STORAGE=0
|
||||||
|
EXITCODE=0
|
||||||
|
|
||||||
|
echo " - \"$(wrap_color 'overlay' blue)\":"
|
||||||
|
check_flags OVERLAY_FS | sed 's/^/ /'
|
||||||
|
[ "$EXITCODE" = 0 ] && STORAGE=0
|
||||||
|
EXITCODE=0
|
||||||
|
|
||||||
|
echo " - \"$(wrap_color 'zfs' blue)\":"
|
||||||
|
printf ' - '
|
||||||
|
check_device /dev/zfs
|
||||||
|
printf ' - '
|
||||||
|
check_command zfs
|
||||||
|
printf ' - '
|
||||||
|
check_command zpool
|
||||||
|
[ "$EXITCODE" = 0 ] && STORAGE=0
|
||||||
|
EXITCODE=0
|
||||||
|
|
||||||
|
EXITCODE=$CODE
|
||||||
|
[ "$STORAGE" = 1 ] && EXITCODE=1
|
||||||
|
|
||||||
|
echo
|
||||||
|
|
||||||
|
check_limit_over() {
|
||||||
|
if [ "$(cat "$1")" -le "$2" ]; then
|
||||||
|
wrap_bad "- $1" "$(cat "$1")"
|
||||||
|
wrap_color " This should be set to at least $2, for example set: sysctl -w kernel/keys/root_maxkeys=1000000" bold black
|
||||||
|
EXITCODE=1
|
||||||
|
else
|
||||||
|
wrap_good "- $1" "$(cat "$1")"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
echo 'Limits:'
|
||||||
|
check_limit_over /proc/sys/kernel/keys/root_maxkeys 10000
|
||||||
|
echo
|
||||||
|
|
||||||
|
exit $EXITCODE
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
# GDM configuration storage
|
||||||
|
#
|
||||||
|
# See /usr/share/gdm/gdm.schemas for a list of available options.
|
||||||
|
|
||||||
|
[daemon]
|
||||||
|
# Uncomment the line below to force the login screen to use Xorg
|
||||||
|
XorgEnable=false
|
||||||
|
#WaylandEnable=true
|
||||||
|
|
||||||
|
# Enabling automatic login
|
||||||
|
AutomaticLoginEnable = true
|
||||||
|
AutomaticLogin = orangepi
|
||||||
|
|
||||||
|
# Enabling timed login
|
||||||
|
# TimedLoginEnable = true
|
||||||
|
# TimedLogin = user1
|
||||||
|
# TimedLoginDelay = 10
|
||||||
|
|
||||||
|
[security]
|
||||||
|
|
||||||
|
[xdmcp]
|
||||||
|
|
||||||
|
[chooser]
|
||||||
|
|
||||||
|
[debug]
|
||||||
|
# Uncomment the line below to turn on debugging
|
||||||
|
# More verbose logs
|
||||||
|
# Additionally lets the X server dump core if it crashes
|
||||||
|
#Enable=true
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
blacklist r8125
|
||||||
|
blacklist pgdrv
|
||||||
|
blacklist rtk_btusb
|
||||||
|
blacklist amdgpu
|
||||||
|
blacklist armcb_isp
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
export KWIN_COMPOSE=O2ES
|
||||||
|
export QT_OPENGL=es2
|
||||||
|
export GDK_GL=gles
|
||||||
|
export GST_GL_API=gles2
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Copyright (c) Authors: https://www.armbian.com/authors
|
||||||
|
#
|
||||||
|
# This file is licensed under the terms of the GNU General Public
|
||||||
|
# License version 2. This program is licensed "as is" without any
|
||||||
|
# warranty of any kind, whether express or implied.
|
||||||
|
|
||||||
|
# DO NOT EDIT THIS FILE but add config options to /etc/default/orangepi-motd
|
||||||
|
# any changes will be lost on board support package update
|
||||||
|
|
||||||
|
THIS_SCRIPT="config"
|
||||||
|
MOTD_DISABLE=""
|
||||||
|
|
||||||
|
[[ -f /etc/default/orangepi-motd ]] && . /etc/default/orangepi-motd
|
||||||
|
|
||||||
|
for f in $MOTD_DISABLE; do
|
||||||
|
[[ $f == $THIS_SCRIPT ]] && exit 0
|
||||||
|
done
|
||||||
|
|
||||||
|
#if [[ $(( $RANDOM % 2 )) == 0 ]]; then
|
||||||
|
# if [[ -f /usr/sbin/orangepi-config ]]; then
|
||||||
|
# echo -e "[\e[31m General system configuration (beta)\e[0m: \e[1morangepi-config\e[0m ]\n"
|
||||||
|
# else
|
||||||
|
# echo -e "[\e[31m Menu-driven system configuration (beta)\e[0m: \e[1msudo dpkg -i orangepi-config.deb\e[0m ]\n"
|
||||||
|
# fi
|
||||||
|
#fi
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
||||||
Binary file not shown.
|
|
@ -0,0 +1,32 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 检查至少提供一个 GPIO 引脚
|
||||||
|
if [ "$#" -lt 1 ]; then
|
||||||
|
echo "Usage: $0 gpio_number1 [gpio_number2 ... gpio_numberN]"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 导出和设置方向为输出
|
||||||
|
for gpio in "$@"; do
|
||||||
|
if [ ! -e "/sys/class/gpio/gpio${gpio}" ]; then
|
||||||
|
echo "Exporting GPIO $gpio"
|
||||||
|
echo $gpio > /sys/class/gpio/export
|
||||||
|
fi
|
||||||
|
echo "Setting GPIO $gpio direction to out"
|
||||||
|
echo "out" > /sys/class/gpio/gpio${gpio}/direction
|
||||||
|
done
|
||||||
|
|
||||||
|
# 闪烁逻辑
|
||||||
|
while true; do
|
||||||
|
# 设置 GPIO 高电平
|
||||||
|
for gpio in "$@"; do
|
||||||
|
echo 1 > /sys/class/gpio/gpio${gpio}/value
|
||||||
|
done
|
||||||
|
sleep 1 # 调整为所需的闪烁时间间隔
|
||||||
|
|
||||||
|
# 设置 GPIO 低电平
|
||||||
|
for gpio in "$@"; do
|
||||||
|
echo 0 > /sys/class/gpio/gpio${gpio}/value
|
||||||
|
done
|
||||||
|
sleep 1 # 调整为所需的闪烁时间间隔
|
||||||
|
done
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
gst-launch-1.0 v4l2src device=/dev/video1 ! videoconvert ! autovideosink
|
||||||
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
gst-launch-1.0 v4l2src device=/dev/video3 ! videoconvert ! autovideosink
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
blink_gpio.sh 65 64 106 32 33 108 17 14 18 57 37 40 41 66 69 114 115 34 109 35 36 15 16 56 38 39 70 71
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
#gst-launch-1.0 v4l2src device=/dev/video1 ! videoconvert ! autovideosink &
|
||||||
|
gst-launch-1.0 v4l2src device=/dev/video1 ! videoconvert ! autovideosink \
|
||||||
|
v4l2src device=/dev/video3 ! videoconvert ! autovideosink
|
||||||
|
|
||||||
|
#gst-launch-1.0 v4l2src device=/dev/video3 ! videoconvert ! autovideosink &
|
||||||
|
|
||||||
BIN
external/packages/bsp/overlays_cix/usr/bin/gpu_utilization_clock_tracing
vendored
Executable file
BIN
external/packages/bsp/overlays_cix/usr/bin/gpu_utilization_clock_tracing
vendored
Executable file
Binary file not shown.
|
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
wget -O install.sh \
|
||||||
|
http://download.bt.cn/install/install-ubuntu_6.0.sh && sudo bash install.sh
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
release=$(lsb_release -cs)
|
||||||
|
|
||||||
|
sudo apt update
|
||||||
|
if [[ $release =~ focal|bionic|buster ]]; then
|
||||||
|
sudo apt-get -y install qt5-default qttools5-dev-tools qtbase5-doc-html qt5-assistant qt5-doc
|
||||||
|
elif [[ $release =~ bullseye|bookworm|jammy ]]; then
|
||||||
|
sudo apt-get -y install qttools5-dev-tools qtbase5-doc-html qt5-assistant qt5-doc qt5-qmake qt5-qmake-bin
|
||||||
|
else
|
||||||
|
echo "Unsupported system!"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
sudo apt-get -y install qtcreator qmlscene gdb qtdeclarative5-dev qtbase5-examples cmake
|
||||||
|
|
||||||
|
if [[ $release =~ bookworm ]]; then
|
||||||
|
sudo apt-get -y install qt6-wayland qtwayland5
|
||||||
|
sudo apt-get -y install libegl1-mesa-dev libgles2-mesa-dev
|
||||||
|
fi
|
||||||
|
|
||||||
|
sudo chown orangepi:orangepi /usr/lib/aarch64-linux-gnu/qt5/examples -R
|
||||||
|
|
||||||
|
qmake -v
|
||||||
Binary file not shown.
|
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
sudo rm /etc/ssh/ssh_host_*
|
||||||
|
sudo dpkg-reconfigure openssh-server
|
||||||
Binary file not shown.
|
|
@ -0,0 +1,84 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# USB Gadget 配置脚本
|
||||||
|
# 功能:将设备配置为 USB NCM (网络控制模型) 设备
|
||||||
|
|
||||||
|
set -e # 遇到任何错误立即退出
|
||||||
|
|
||||||
|
GADGET_DIR="/sys/kernel/config/usb_gadget/g1"
|
||||||
|
|
||||||
|
echo "正在设置 USB NCM Gadget..."
|
||||||
|
|
||||||
|
# 检查是否以 root 权限运行
|
||||||
|
if [ "$EUID" -ne 0 ]; then
|
||||||
|
echo "错误:请使用 sudo 或以 root 用户运行此脚本"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 检查 configfs 是否已挂载
|
||||||
|
if ! mountpoint -q /sys/kernel/config; then
|
||||||
|
echo "挂载 configfs..."
|
||||||
|
mount -t configfs none /sys/kernel/config || {
|
||||||
|
echo "错误:无法挂载 configfs"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 清理现有配置(如果存在)
|
||||||
|
if [ -d "$GADGET_DIR" ]; then
|
||||||
|
echo "清理现有 gadget 配置..."
|
||||||
|
echo "" > "$GADGET_DIR/UDC" 2>/dev/null || true
|
||||||
|
rm -f "$GADGET_DIR/configs/c.1/ncm.usb0"
|
||||||
|
rmdir "$GADGET_DIR/configs/c.1/strings/0x409" 2>/dev/null || true
|
||||||
|
rmdir "$GADGET_DIR/configs/c.1" 2>/dev/null || true
|
||||||
|
rmdir "$GADGET_DIR/functions/ncm.usb0" 2>/dev/null || true
|
||||||
|
rmdir "$GADGET_DIR/strings/0x409" 2>/dev/null || true
|
||||||
|
rmdir "$GADGET_DIR" 2>/dev/null || true
|
||||||
|
sleep 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 创建 gadget 目录
|
||||||
|
echo "创建 gadget 目录..."
|
||||||
|
mkdir "$GADGET_DIR"
|
||||||
|
|
||||||
|
# 设置 USB 设备描述符
|
||||||
|
echo "设置设备描述符..."
|
||||||
|
echo 0x35b1 > "$GADGET_DIR/idVendor"
|
||||||
|
echo 0x0009 > "$GADGET_DIR/idProduct"
|
||||||
|
echo 0x0200 > "$GADGET_DIR/bcdDevice"
|
||||||
|
echo 0x0210 > "$GADGET_DIR/bcdUSB"
|
||||||
|
echo "super-speed-plus" > "$GADGET_DIR/max_speed"
|
||||||
|
|
||||||
|
# 设置字符串描述符
|
||||||
|
echo "设置字符串描述符..."
|
||||||
|
mkdir -m 0770 "$GADGET_DIR/strings/0x409"
|
||||||
|
echo "0123456789ABCDEF" > "$GADGET_DIR/strings/0x409/serialnumber"
|
||||||
|
echo "cix" > "$GADGET_DIR/strings/0x409/manufacturer"
|
||||||
|
echo "USB ncm Device" > "$GADGET_DIR/strings/0x409/product"
|
||||||
|
|
||||||
|
# 创建配置
|
||||||
|
echo "创建配置..."
|
||||||
|
mkdir -m 0770 "$GADGET_DIR/configs/c.1"
|
||||||
|
mkdir -m 0770 "$GADGET_DIR/configs/c.1/strings/0x409"
|
||||||
|
echo "ncm" > "$GADGET_DIR/configs/c.1/strings/0x409/configuration"
|
||||||
|
|
||||||
|
# 创建 NCM 功能
|
||||||
|
echo "创建 NCM 功能..."
|
||||||
|
mkdir "$GADGET_DIR/functions/ncm.usb0"
|
||||||
|
|
||||||
|
# 将功能链接到配置
|
||||||
|
echo "链接功能到配置..."
|
||||||
|
ln -s "$GADGET_DIR/functions/ncm.usb0" "$GADGET_DIR/configs/c.1/"
|
||||||
|
|
||||||
|
# 启用 gadget
|
||||||
|
echo "启用 USB 设备控制器..."
|
||||||
|
UDC_DEVICE=$(ls /sys/class/udc/ | head -n1)
|
||||||
|
if [ -n "$UDC_DEVICE" ]; then
|
||||||
|
echo "$UDC_DEVICE" > "$GADGET_DIR/UDC"
|
||||||
|
echo "已启用 UDC: $UDC_DEVICE"
|
||||||
|
else
|
||||||
|
echo "警告:未找到可用的 UDC 设备"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "USB NCM Gadget 配置完成!"
|
||||||
|
echo "设备现在应该被识别为 USB 网络设备"
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo "Video Device and Name Correspondence:"
|
||||||
|
echo "====================================="
|
||||||
|
for dev in /dev/video*; do
|
||||||
|
dev_name=$(basename $dev)
|
||||||
|
if [ -f "/sys/class/video4linux/${dev_name}/name" ]; then
|
||||||
|
name=$(cat "/sys/class/video4linux/${dev_name}/name")
|
||||||
|
echo "$dev : $name"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo 3 | sudo tee /sys/kernel/debug/amvx/log/group/perf/enable > /dev/null
|
||||||
|
|
||||||
|
echo "开始监控VPU使用率(只显示大于0的情况)..."
|
||||||
|
echo "按 Ctrl+C 停止监控"
|
||||||
|
|
||||||
|
while true
|
||||||
|
do
|
||||||
|
# 读取VPU使用率
|
||||||
|
utilization=$(sudo cat /sys/kernel/debug/amvx/log/group/perf/utilization | awk '{print $3}' | tr -d '%')
|
||||||
|
|
||||||
|
# 只有当使用率大于0时才输出
|
||||||
|
if (( $(echo "$utilization > 0" | bc -l) )); then
|
||||||
|
# 获取当前时间
|
||||||
|
current_time=$(date '+%H:%M:%S')
|
||||||
|
|
||||||
|
# 读取实时FPS信息
|
||||||
|
fps_info=$(sudo cat /sys/kernel/debug/amvx/log/group/perf/realtime_fps)
|
||||||
|
|
||||||
|
# 输出信息
|
||||||
|
echo "VPU Utilization: ${utilization}%"
|
||||||
|
if [ -n "$fps_info" ] && [ "$fps_info" != "null" ]; then
|
||||||
|
echo "$current_time $fps_info"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
15
external/packages/bsp/overlays_cix/usr/lib/systemd/system/isp-daemon.service
vendored
Executable file
15
external/packages/bsp/overlays_cix/usr/lib/systemd/system/isp-daemon.service
vendored
Executable file
|
|
@ -0,0 +1,15 @@
|
||||||
|
[Unit]
|
||||||
|
Description=ISP Daemon
|
||||||
|
After=network.target load-isp-modules.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
Environment=LD_LIBRARY_PATH="/usr/share/cix/lib"
|
||||||
|
ExecStart=/usr/bin/isp_app -s 0 &
|
||||||
|
Restart=always
|
||||||
|
RestartSec=1
|
||||||
|
StartLimitInterval=10
|
||||||
|
StartLimitBurst=5
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
BIN
external/packages/bsp/overlays_cix/usr/share/backgrounds/orangepi/orangepi-default.png
vendored
Executable file
BIN
external/packages/bsp/overlays_cix/usr/share/backgrounds/orangepi/orangepi-default.png
vendored
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 MiB |
|
|
@ -0,0 +1,79 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <termios.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
|
int main(int argc, char *argv[]) {
|
||||||
|
if (argc < 2) {
|
||||||
|
printf("Usage: %s <serialport>\n", argv[0]);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
char *portname = argv[1];
|
||||||
|
|
||||||
|
// 打开串口
|
||||||
|
int fd = open(portname, O_RDWR | O_NOCTTY | O_SYNC);
|
||||||
|
if (fd < 0) {
|
||||||
|
printf("Error opening %s: %s\n", portname, strerror(errno));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 配置串口
|
||||||
|
struct termios tty;
|
||||||
|
memset(&tty, 0, sizeof tty);
|
||||||
|
if (tcgetattr(fd, &tty) != 0) {
|
||||||
|
printf("Error from tcgetattr: %s\n", strerror(errno));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
cfsetospeed(&tty, B115200); // 设置波特率为 115200
|
||||||
|
cfsetispeed(&tty, B115200);
|
||||||
|
|
||||||
|
tty.c_cflag = (tty.c_cflag & ~CSIZE) | CS8; // 8-bit chars
|
||||||
|
tty.c_iflag &= ~IGNBRK; // 禁用break处理
|
||||||
|
tty.c_lflag = 0; // 不使用规范模式
|
||||||
|
tty.c_oflag = 0; // 不执行输出处理
|
||||||
|
tty.c_cc[VMIN] = 0; // 读取不需要字符
|
||||||
|
tty.c_cc[VTIME] = 5; // 0.5秒超时
|
||||||
|
|
||||||
|
tty.c_iflag &= ~(IXON | IXOFF | IXANY); // 关闭流控制
|
||||||
|
tty.c_cflag |= (CLOCAL | CREAD); // 忽略调制解调器状态线,开启接收
|
||||||
|
tty.c_cflag &= ~(PARENB | PARODD); // 关闭奇偶校验
|
||||||
|
tty.c_cflag &= ~CSTOPB; // 无停止位
|
||||||
|
tty.c_cflag &= ~CRTSCTS; // 禁用硬件流控制
|
||||||
|
|
||||||
|
if (tcsetattr(fd, TCSANOW, &tty) != 0) {
|
||||||
|
printf("Error from tcsetattr: %s\n", strerror(errno));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 向串口写数据
|
||||||
|
char *msg = "Hello, Serial Port!\n";
|
||||||
|
int wlen = write(fd, msg, strlen(msg));
|
||||||
|
if (wlen != strlen(msg)) {
|
||||||
|
printf("Error from write: %d, %d\n", wlen, errno);
|
||||||
|
}
|
||||||
|
tcdrain(fd); // 等待传输完成
|
||||||
|
printf("W: %s", msg);
|
||||||
|
|
||||||
|
// 从串口读数据
|
||||||
|
unsigned char buf[100];
|
||||||
|
int total_read = 0;
|
||||||
|
int rdlen;
|
||||||
|
while ((rdlen = read(fd, buf + total_read, sizeof(buf) - 1 - total_read)) > 0) {
|
||||||
|
total_read += rdlen;
|
||||||
|
if (total_read >= sizeof(buf) - 1 || buf[total_read - 1] == '\n') {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (total_read > 0) {
|
||||||
|
buf[total_read] = 0; // 确保字符串正确终止
|
||||||
|
printf("R: %s", buf);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 关闭串口 - 这部分代码将不会被执行,因为循环是无限的
|
||||||
|
close(fd);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,196 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Copyright 2024 Cix Technology Group Co., Ltd.
|
||||||
|
# All Rights Reserved.
|
||||||
|
#
|
||||||
|
# The following programs are the sole property of Cix Technology Group Co., Ltd.,
|
||||||
|
# and contain its proprietary and confidential information.
|
||||||
|
#
|
||||||
|
|
||||||
|
function replace_line_if_exist() {
|
||||||
|
local src=$1
|
||||||
|
local dst=$2
|
||||||
|
local file=$3
|
||||||
|
|
||||||
|
if [[ -e "$file" ]]; then
|
||||||
|
set +E
|
||||||
|
local res=`grep -n "${src}" "${file}"`
|
||||||
|
#echo "res:$res"
|
||||||
|
if [[ ${#res} -gt 0 ]]; then
|
||||||
|
line=`echo "${res}" | cut -d ":" -f 1`
|
||||||
|
fi
|
||||||
|
set -E
|
||||||
|
#echo "line: $line"
|
||||||
|
if [[ $line -gt 0 ]]; then
|
||||||
|
sed -i "${line}c${dst}" "${file}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function create_cix_rootfs()
|
||||||
|
{
|
||||||
|
display_alert "Preparing" "cix rootfs" "info"
|
||||||
|
|
||||||
|
local PATH_OUT=${SRC}/output/cix
|
||||||
|
local ROOT_FREE_SIZE=4096000
|
||||||
|
rootfs_ext4=${PATH_OUT}/images/rootfs.ext4
|
||||||
|
|
||||||
|
rm -rf ${PATH_OUT} > /dev/null 2>&1
|
||||||
|
mkdir -p ${PATH_OUT}/images > /dev/null 2>&1
|
||||||
|
|
||||||
|
mount --bind --make-private $SDCARD $MOUNT/
|
||||||
|
|
||||||
|
local debianSize=`sudo du ${MOUNT} -d 0 -k | sudo awk -F ' ' '{print $1}'`
|
||||||
|
debianSize=`expr $debianSize \* 13 / 10`
|
||||||
|
if [[ ${debianSize} -lt 1024 ]]; then
|
||||||
|
totalsize='10240'
|
||||||
|
elif [[ ${debianSize} -lt 10240 ]]; then
|
||||||
|
totalsize=`expr $debianSize \* 50 / 10`
|
||||||
|
elif [[ ${debianSize} -lt 102400 ]]; then
|
||||||
|
totalsize=`expr $debianSize \* 25 / 10`
|
||||||
|
elif [[ ${debianSize} -lt 1024000 ]]; then
|
||||||
|
totalsize=`expr $debianSize \* 20 / 10`
|
||||||
|
else
|
||||||
|
totalsize=`expr $debianSize + ${ROOT_FREE_SIZE:-4096000}`
|
||||||
|
fi
|
||||||
|
|
||||||
|
local count=`expr $totalsize / 4`
|
||||||
|
root_uuid=$(uuidgen)
|
||||||
|
boot_uuid=$(uuidgen | tr -d '-' | cut -c1-8 | tr 'a-f' 'A-F')
|
||||||
|
formatted_boot_uuid="${boot_uuid:0:4}-${boot_uuid:4:4}"
|
||||||
|
cat <<-END > ${SDCARD}/etc/fstab
|
||||||
|
# /etc/fstab: static file system information.
|
||||||
|
#
|
||||||
|
# Use 'blkid' to print the universally unique identifier for a device; this may
|
||||||
|
# be used with UUID= as a more robust way to name devices that works even if
|
||||||
|
# disks are added and removed. See fstab(5).
|
||||||
|
#
|
||||||
|
# <file system> <mount point> <type> <options> <dump> <pass>
|
||||||
|
|
||||||
|
END
|
||||||
|
#echo "UUID=${formatted_boot_uuid} /boot vfat defaults,umask=0077 0 2" >> $MOUNT/etc/fstab
|
||||||
|
#echo "UUID=$root_uuid / ext4 errors=remount-ro 0 1" >> $MOUNT/etc/fstab
|
||||||
|
|
||||||
|
dd if=/dev/zero of="${rootfs_ext4}" bs=4k count=$count > /dev/null 2>&1
|
||||||
|
#mkfs.ext4 -U ${uuid} -F -i 4096 "${rootfs_ext4}" -d "${MOUNT}" > /dev/null 2>&1
|
||||||
|
mkfs.ext4 -F -i 4096 "${rootfs_ext4}" -d "${MOUNT}" > /dev/null 2>&1
|
||||||
|
fsck.ext4 -pvfD "${rootfs_ext4}" > /dev/null 2>&1
|
||||||
|
|
||||||
|
umount $MOUNT
|
||||||
|
rm -rf $MOUNT
|
||||||
|
}
|
||||||
|
|
||||||
|
function create_cix_image()
|
||||||
|
{
|
||||||
|
display_alert "Creating" "cix image" "info"
|
||||||
|
|
||||||
|
local PATH_OUT=${SRC}/output/cix
|
||||||
|
local gpt_btp=${PATH_OUT}/images/partition.bpt
|
||||||
|
local SCRIPT_DIR=${EXTER}/cache/sources/component_cix-${BRANCH}
|
||||||
|
|
||||||
|
if [[ $SELECTED_CONFIGURATION == "cli_standard" ]]; then
|
||||||
|
IMAGE_TYPE=server
|
||||||
|
elif [[ $SELECTED_CONFIGURATION == "cli_minimal" ]]; then
|
||||||
|
IMAGE_TYPE=minimal
|
||||||
|
else
|
||||||
|
IMAGE_TYPE=desktop
|
||||||
|
fi
|
||||||
|
version="${BOARD^}_${REVISION}_${DISTRIBUTION,}_${RELEASE}_${IMAGE_TYPE}"${DESKTOP_ENVIRONMENT:+_$DESKTOP_ENVIRONMENT}"_linux$(grab_version "$LINUXSOURCEDIR")"
|
||||||
|
mkdir -p ${SRC}/output/images/${version}
|
||||||
|
local cix_image_name="${SRC}/output/images/${version}/${version}.img"
|
||||||
|
|
||||||
|
cp -f "${SCRIPT_DIR}/debian/fb/partition.bpt" "${gpt_btp}" || {
|
||||||
|
display_alert "Failed to copy BPT template" "${gpt_btp}" "err"
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
local boot_start=$(expr $(sed -n '6p' ${gpt_btp} | awk '{print $2}') / 1024 / 1024)
|
||||||
|
local boot_size=$(expr $(sed -n '11p' ${gpt_btp} | awk -F '"' '{print $4}' | awk '{print $1}'))
|
||||||
|
|
||||||
|
if [[ ! -f "${rootfs_ext4}" ]]; then
|
||||||
|
display_alert "Rootfs missing" "${rootfs_ext4}" "err"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
local rootfs_ext4="${PATH_OUT}/images/rootfs.ext4"
|
||||||
|
local root_size=`du -s -b ${rootfs_ext4} | awk '{print $1}'`
|
||||||
|
root_size=`expr $root_size / 1024 / 1024 + 10`
|
||||||
|
local total_size=`expr $root_size + $boot_size + $boot_start + 1`
|
||||||
|
local root_start=`expr $boot_size + $boot_start`
|
||||||
|
local boot_end=$root_start
|
||||||
|
local root_end=$total_size
|
||||||
|
|
||||||
|
#echo "total size: ${total_size}M"
|
||||||
|
#echo "boot: ${boot_start}, ${boot_end}M"
|
||||||
|
#echo "rootfs: ${root_start}, ${root_end}M"
|
||||||
|
|
||||||
|
replace_line_if_exist "\"disk_size\":" "\ \ \ \ \ \ \ \ \"disk_size\": \"${total_size} MiB\"," "${gpt_btp}"
|
||||||
|
sudo "${SCRIPT_DIR}/debian/fb/bpttool" make_table --input "${gpt_btp}" --output_gpt "${PATH_OUT}/images/partition-table.img" --output_json "${PATH_OUT}/partition-table.json"
|
||||||
|
sudo chown ${USER}:${USER} "${PATH_OUT}/images/partition-table.img"
|
||||||
|
|
||||||
|
boot_size=$(expr $boot_size \* 1024 \* 1024)
|
||||||
|
#echo "boot_start: ${boot_start}Mib, boot_size: ${boot_size} bytes"
|
||||||
|
|
||||||
|
cp "${SCRIPT_DIR}/debian/grub-post-silicon.cfg" "${PATH_OUT}/images/grub.cfg"
|
||||||
|
local root_device_guid=$("${SCRIPT_DIR}/debian/cix_tool" --flash-tool -d "${PATH_OUT}/images/partition-table.img" | grep "PARTITION1, guid:" | awk -F ":" '{print $2}')
|
||||||
|
sed -i "s:root=/dev/nvme0n1p2:root=PARTUUID=${root_device_guid}:g" "${PATH_OUT}/images/grub.cfg"
|
||||||
|
sed -i "s:root=/dev/sda2:root=PARTUUID=${root_device_guid}:g" "${PATH_OUT}/images/grub.cfg"
|
||||||
|
|
||||||
|
local dtb_args=()
|
||||||
|
while IFS= read -r -d $'\0' dtb; do
|
||||||
|
dtb_args+=("${dtb}" "/$(basename "${dtb}")")
|
||||||
|
done < <(find "${LINUXSOURCEDIR}/arch/arm64/boot/dts/cix/" -maxdepth 1 -name "*.dtb" -print0)
|
||||||
|
|
||||||
|
sed -i '3cset default="0"' "${PATH_OUT}/images/grub.cfg"
|
||||||
|
"${SCRIPT_DIR}/tools/mk-part-fat" \
|
||||||
|
-o "${PATH_OUT}/images/boot.img" \
|
||||||
|
-s "${boot_size}" \
|
||||||
|
-l "ESP" \
|
||||||
|
"${SCRIPT_DIR}/grub.efi" "/EFI/BOOT/BOOTAA64.EFI" \
|
||||||
|
"${PATH_OUT}/images/grub.cfg" "/grub/grub.cfg" \
|
||||||
|
"${LINUXSOURCEDIR}/arch/arm64/boot/Image" "/Image" \
|
||||||
|
"${SCRIPT_DIR}/cix_binary/device/images/rootfs.cpio.gz" "/rootfs.cpio.gz" \
|
||||||
|
"${dtb_args[@]}" > /dev/null 2>&1
|
||||||
|
|
||||||
|
fatlabel -i "${PATH_OUT}/images/boot.img" "0x${boot_uuid}"
|
||||||
|
|
||||||
|
dd if=/dev/zero of="${cix_image_name}" bs=1M count=$total_size > /dev/null 2>&1
|
||||||
|
parted -s "${cix_image_name}" mklabel gpt > /dev/null 2>&1
|
||||||
|
|
||||||
|
dd if="${PATH_OUT}/images/partition-table.img" of="${cix_image_name}" conv=notrunc,fsync bs=1M seek=0 > /dev/null 2>&1
|
||||||
|
|
||||||
|
local boot_offset=`"${SCRIPT_DIR}/debian/cix_tool" --flash-tool -d "${PATH_OUT}/images/partition-table.img" -p boot | awk '{print $1}'`
|
||||||
|
boot_offset=`expr $boot_offset \* 512 / 1024 / 1024`
|
||||||
|
#echo "boot offset: $boot_offset M bytes"
|
||||||
|
dd if="${PATH_OUT}/images/boot.img" of="${cix_image_name}" conv=notrunc,fsync bs=1M seek=$boot_offset > /dev/null 2>&1
|
||||||
|
|
||||||
|
local rootfs_offset=`"${SCRIPT_DIR}/debian/cix_tool" --flash-tool -d "${PATH_OUT}/images/partition-table.img" -p root | awk '{print $1}'`
|
||||||
|
rootfs_offset=`expr $rootfs_offset \* 512 / 1024 / 1024`
|
||||||
|
#echo "root offset: $rootfs_offset M bytes"
|
||||||
|
dd if="${rootfs_ext4}" of="${cix_image_name}" conv=notrunc,fsync bs=1M seek=$rootfs_offset > /dev/null 2>&1
|
||||||
|
|
||||||
|
if [[ $COMPRESS_OUTPUTIMAGE == "" || $COMPRESS_OUTPUTIMAGE == no ]]; then
|
||||||
|
COMPRESS_OUTPUTIMAGE="sha,img"
|
||||||
|
elif [[ $COMPRESS_OUTPUTIMAGE == yes ]]; then
|
||||||
|
COMPRESS_OUTPUTIMAGE="sha,xz"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $COMPRESS_OUTPUTIMAGE == *xz* ]]; then
|
||||||
|
display_alert "Compressing" "${cix_image_name}.xz" "info"
|
||||||
|
# compressing consumes a lot of memory we don't have. Waiting for previous packing job to finish helps to run a lot more builds in parallel
|
||||||
|
available_cpu=$(grep -c 'processor' /proc/cpuinfo)
|
||||||
|
[[ ${available_cpu} -gt 8 ]] && available_cpu=8 # using more cpu cores for compressing is pointless
|
||||||
|
available_mem=$(LC_ALL=c free | grep Mem | awk '{print $4/$2 * 100.0}' | awk '{print int($1)}') # in percentage
|
||||||
|
|
||||||
|
pixz -7 -p ${available_cpu} -f $(expr ${available_cpu} + 2) < $cix_image_name > ${cix_image_name}.xz
|
||||||
|
compression_type=".xz"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $COMPRESS_OUTPUTIMAGE == *sha* ]]; then
|
||||||
|
cd ${SRC}/output/images/${version}/
|
||||||
|
display_alert "SHA256 calculating" "${version}.img${compression_type}" "info"
|
||||||
|
sha256sum -b ${version}.img${compression_type} > ${version}.img${compression_type}.sha
|
||||||
|
fi
|
||||||
|
|
||||||
|
display_alert "Done building" "$cix_image_name" "info"
|
||||||
|
}
|
||||||
|
|
@ -542,6 +542,8 @@ CUSTOM_KERNEL_CONFIG
|
||||||
|
|
||||||
rsync --remove-source-files -rq ./*.deb "${DEB_STORAGE}/" || exit_with_error "Failed moving kernel DEBs"
|
rsync --remove-source-files -rq ./*.deb "${DEB_STORAGE}/" || exit_with_error "Failed moving kernel DEBs"
|
||||||
|
|
||||||
|
[[ $(type -t family_tweaks_kernel) == function ]] && family_tweaks_kernel
|
||||||
|
|
||||||
# store git hash to the file and create a change log
|
# store git hash to the file and create a change log
|
||||||
#HASHTARGET="${EXTER}/cache/hash"$([[ ${BETA} == yes ]] && echo "-beta")"/linux-image-${BRANCH}-${LINUXFAMILY}"
|
#HASHTARGET="${EXTER}/cache/hash"$([[ ${BETA} == yes ]] && echo "-beta")"/linux-image-${BRANCH}-${LINUXFAMILY}"
|
||||||
#OLDHASHTARGET=$(head -1 "${HASHTARGET}.githash" 2>/dev/null)
|
#OLDHASHTARGET=$(head -1 "${HASHTARGET}.githash" 2>/dev/null)
|
||||||
|
|
@ -592,7 +594,12 @@ compile_firmware()
|
||||||
plugin_dir="orangepi-firmware${FULL}"
|
plugin_dir="orangepi-firmware${FULL}"
|
||||||
mkdir -p "${firmwaretempdir}/${plugin_dir}/lib/firmware"
|
mkdir -p "${firmwaretempdir}/${plugin_dir}/lib/firmware"
|
||||||
|
|
||||||
|
if [[ $GITEE_SERVER == yes ]]; then
|
||||||
|
[[ $IGNORE_UPDATES != yes ]] && fetch_from_repo "https://gitee.com/orangepi-xunlong/firmware" "${EXTER}/cache/sources/orangepi-firmware-git" "branch:master"
|
||||||
|
else
|
||||||
[[ $IGNORE_UPDATES != yes ]] && fetch_from_repo "https://github.com/orangepi-xunlong/firmware" "${EXTER}/cache/sources/orangepi-firmware-git" "branch:master"
|
[[ $IGNORE_UPDATES != yes ]] && fetch_from_repo "https://github.com/orangepi-xunlong/firmware" "${EXTER}/cache/sources/orangepi-firmware-git" "branch:master"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -n $FULL ]]; then
|
if [[ -n $FULL ]]; then
|
||||||
[[ $IGNORE_UPDATES != yes ]] && fetch_from_repo "$MAINLINE_FIRMWARE_SOURCE" "${EXTER}/cache/sources/linux-firmware-git" "branch:master"
|
[[ $IGNORE_UPDATES != yes ]] && fetch_from_repo "$MAINLINE_FIRMWARE_SOURCE" "${EXTER}/cache/sources/linux-firmware-git" "branch:master"
|
||||||
# cp : create hardlinks
|
# cp : create hardlinks
|
||||||
|
|
@ -645,8 +652,13 @@ compile_orangepi-zsh()
|
||||||
orangepi_zsh_dir=orangepi-zsh_${REVISION}_all
|
orangepi_zsh_dir=orangepi-zsh_${REVISION}_all
|
||||||
display_alert "Building deb" "orangepi-zsh" "info"
|
display_alert "Building deb" "orangepi-zsh" "info"
|
||||||
|
|
||||||
|
if [[ $GITEE_SERVER == yes ]]; then
|
||||||
|
[[ $IGNORE_UPDATES != yes ]] && fetch_from_repo "https://gitee.com/orangepi-xunlong/oh-my-zsh" "${EXTER}/cache/sources/oh-my-zsh" "branch:master"
|
||||||
|
[[ $IGNORE_UPDATES != yes ]] && fetch_from_repo "https://gitee.com/orangepi-xunlong/evalcache" "${EXTER}/cache/sources/evalcache" "branch:master"
|
||||||
|
else
|
||||||
[[ $IGNORE_UPDATES != yes ]] && fetch_from_repo "https://github.com/robbyrussell/oh-my-zsh" "${EXTER}/cache/sources/oh-my-zsh" "branch:master"
|
[[ $IGNORE_UPDATES != yes ]] && fetch_from_repo "https://github.com/robbyrussell/oh-my-zsh" "${EXTER}/cache/sources/oh-my-zsh" "branch:master"
|
||||||
[[ $IGNORE_UPDATES != yes ]] && fetch_from_repo "https://github.com/mroth/evalcache" "${EXTER}/cache/sources/evalcache" "branch:master"
|
[[ $IGNORE_UPDATES != yes ]] && fetch_from_repo "https://github.com/mroth/evalcache" "${EXTER}/cache/sources/evalcache" "branch:master"
|
||||||
|
fi
|
||||||
|
|
||||||
mkdir -p "${tmp_dir}/${orangepi_zsh_dir}"/{DEBIAN,etc/skel/,etc/oh-my-zsh/,/etc/skel/.oh-my-zsh/cache}
|
mkdir -p "${tmp_dir}/${orangepi_zsh_dir}"/{DEBIAN,etc/skel/,etc/oh-my-zsh/,/etc/skel/.oh-my-zsh/cache}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -259,8 +259,12 @@ if [[ $BUILD_DESKTOP == "yes" && -z $DESKTOP_ENVIRONMENT ]]; then
|
||||||
for desktop_env_dir in "${DESKTOP_CONFIGS_DIR}/"*; do
|
for desktop_env_dir in "${DESKTOP_CONFIGS_DIR}/"*; do
|
||||||
local desktop_env_name=$(basename ${desktop_env_dir})
|
local desktop_env_name=$(basename ${desktop_env_dir})
|
||||||
local expert_infos=""
|
local expert_infos=""
|
||||||
|
if [[ $BOARDFAMILY == "cix" && $desktop_env_name == xfce ]]; then
|
||||||
|
:
|
||||||
|
else
|
||||||
[[ "${EXPERT}" == "yes" ]] && expert_infos="[$(cat "${desktop_env_dir}/support" 2> /dev/null)]"
|
[[ "${EXPERT}" == "yes" ]] && expert_infos="[$(cat "${desktop_env_dir}/support" 2> /dev/null)]"
|
||||||
desktop_element_supported "${desktop_env_dir}" "${ARCH}" && options+=("${desktop_env_name}" "${desktop_env_name^} desktop environment ${expert_infos}")
|
desktop_element_supported "${desktop_env_dir}" "${ARCH}" && options+=("${desktop_env_name}" "${desktop_env_name^} desktop environment ${expert_infos}")
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -89,10 +89,15 @@ PRE_INSTALL_DISTRIBUTION_SPECIFIC
|
||||||
FEL_ROOTFS=$SDCARD/
|
FEL_ROOTFS=$SDCARD/
|
||||||
display_alert "Starting FEL boot" "$BOARD" "info"
|
display_alert "Starting FEL boot" "$BOARD" "info"
|
||||||
source $SRC/scripts/fel-load.sh
|
source $SRC/scripts/fel-load.sh
|
||||||
|
else
|
||||||
|
if [[ $BOARDFAMILY == "cix" ]]; then
|
||||||
|
create_cix_rootfs
|
||||||
|
create_cix_image
|
||||||
else
|
else
|
||||||
prepare_partitions
|
prepare_partitions
|
||||||
create_image
|
create_image
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# stage: unmount tmpfs
|
# stage: unmount tmpfs
|
||||||
umount $SDCARD 2>&1
|
umount $SDCARD 2>&1
|
||||||
|
|
@ -215,7 +220,7 @@ create_rootfs_cache()
|
||||||
cd $SDCARD # this will prevent error sh: 0: getcwd() failed
|
cd $SDCARD # this will prevent error sh: 0: getcwd() failed
|
||||||
|
|
||||||
eval 'debootstrap --variant=minbase --include=${DEBOOTSTRAP_LIST// /,} ${PACKAGE_LIST_EXCLUDE:+ --exclude=${PACKAGE_LIST_EXCLUDE// /,}} \
|
eval 'debootstrap --variant=minbase --include=${DEBOOTSTRAP_LIST// /,} ${PACKAGE_LIST_EXCLUDE:+ --exclude=${PACKAGE_LIST_EXCLUDE// /,}} \
|
||||||
--arch=$ARCH --components=${DEBOOTSTRAP_COMPONENTS} $DEBOOTSTRAP_OPTION --foreign ${release_version} $SDCARD/ ${apt_mirror}' \
|
--no-check-gpg --arch=$ARCH --components=${DEBOOTSTRAP_COMPONENTS} $DEBOOTSTRAP_OPTION --foreign ${release_version} $SDCARD/ ${apt_mirror}' \
|
||||||
${PROGRESS_LOG_TO_FILE:+' | tee -a $DEST/${LOG_SUBPATH}/debootstrap.log'} \
|
${PROGRESS_LOG_TO_FILE:+' | tee -a $DEST/${LOG_SUBPATH}/debootstrap.log'} \
|
||||||
${OUTPUT_DIALOG:+' | dialog --backtitle "$backtitle" --progressbox "Debootstrap (stage 1/2)..." $TTY_Y $TTY_X'} \
|
${OUTPUT_DIALOG:+' | dialog --backtitle "$backtitle" --progressbox "Debootstrap (stage 1/2)..." $TTY_Y $TTY_X'} \
|
||||||
${OUTPUT_VERYSILENT:+' >/dev/null 2>/dev/null'} ';EVALPIPE=(${PIPESTATUS[@]})'
|
${OUTPUT_VERYSILENT:+' >/dev/null 2>/dev/null'} ';EVALPIPE=(${PIPESTATUS[@]})'
|
||||||
|
|
@ -347,6 +352,7 @@ create_rootfs_cache()
|
||||||
|
|
||||||
install_docker
|
install_docker
|
||||||
[[ ${BOARDFAMILY} == "starfive2" ]] && jh7110_install_libs
|
[[ ${BOARDFAMILY} == "starfive2" ]] && jh7110_install_libs
|
||||||
|
[[ ${BOARDFAMILY} == "cix" ]] && install_cix_debs
|
||||||
|
|
||||||
# Remove packages from packages.uninstall
|
# Remove packages from packages.uninstall
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -460,9 +460,6 @@ POST_INSTALL_KERNEL_DEBS
|
||||||
[[ -f "${SDCARD}"/usr/bin/gnome-session ]] && sed -i "s/user-session.*/user-session=ubuntu-wayland/" ${SDCARD}/etc/lightdm/lightdm.conf.d/22-orangepi-autologin.conf > /dev/null 2>&1
|
[[ -f "${SDCARD}"/usr/bin/gnome-session ]] && sed -i "s/user-session.*/user-session=ubuntu-wayland/" ${SDCARD}/etc/lightdm/lightdm.conf.d/22-orangepi-autologin.conf > /dev/null 2>&1
|
||||||
[[ -f "${SDCARD}"/usr/bin/startplasma-x11 ]] && sed -i "s/user-session.*/user-session=plasma-x11/" ${SDCARD}/etc/lightdm/lightdm.conf.d/22-orangepi-autologin.conf
|
[[ -f "${SDCARD}"/usr/bin/startplasma-x11 ]] && sed -i "s/user-session.*/user-session=plasma-x11/" ${SDCARD}/etc/lightdm/lightdm.conf.d/22-orangepi-autologin.conf
|
||||||
|
|
||||||
# execute $LINUXFAMILY-specific tweaks
|
|
||||||
[[ $(type -t family_tweaks) == function ]] && family_tweaks
|
|
||||||
|
|
||||||
call_extension_method "post_family_tweaks" << 'FAMILY_TWEAKS'
|
call_extension_method "post_family_tweaks" << 'FAMILY_TWEAKS'
|
||||||
*customize the tweaks made by $LINUXFAMILY-specific family_tweaks*
|
*customize the tweaks made by $LINUXFAMILY-specific family_tweaks*
|
||||||
It is run after packages are installed in the rootfs, but before enabling additional services.
|
It is run after packages are installed in the rootfs, but before enabling additional services.
|
||||||
|
|
@ -636,6 +633,8 @@ FAMILY_TWEAKS
|
||||||
# disable MOTD for first boot - we want as clean 1st run as possible
|
# disable MOTD for first boot - we want as clean 1st run as possible
|
||||||
chmod -x "${SDCARD}"/etc/update-motd.d/*
|
chmod -x "${SDCARD}"/etc/update-motd.d/*
|
||||||
|
|
||||||
|
# execute $LINUXFAMILY-specific tweaks
|
||||||
|
[[ $(type -t family_tweaks) == function ]] && family_tweaks
|
||||||
}
|
}
|
||||||
|
|
||||||
install_rclocal()
|
install_rclocal()
|
||||||
|
|
|
||||||
|
|
@ -1425,7 +1425,8 @@ prepare_host()
|
||||||
nfs-kernel-server ntpdate p7zip-full parted patchutils pigz pixz \
|
nfs-kernel-server ntpdate p7zip-full parted patchutils pigz pixz \
|
||||||
pkg-config pv python3-dev python3-distutils qemu-user-static rsync swig \
|
pkg-config pv python3-dev python3-distutils qemu-user-static rsync swig \
|
||||||
systemd-container u-boot-tools udev unzip uuid-dev wget whiptail zip \
|
systemd-container u-boot-tools udev unzip uuid-dev wget whiptail zip \
|
||||||
zlib1g-dev gcc-riscv64-linux-gnu"
|
zlib1g-dev gcc-riscv64-linux-gnu uuid-runtime fatattr git-lfs scons \
|
||||||
|
mtools"
|
||||||
|
|
||||||
if [[ $(dpkg --print-architecture) == amd64 ]]; then
|
if [[ $(dpkg --print-architecture) == amd64 ]]; then
|
||||||
|
|
||||||
|
|
@ -1559,6 +1560,13 @@ prepare_host()
|
||||||
display_alert "Checking for external GCC compilers" "" "info"
|
display_alert "Checking for external GCC compilers" "" "info"
|
||||||
# download external Linaro compiler and missing special dependencies since they are needed for certain sources
|
# download external Linaro compiler and missing special dependencies since they are needed for certain sources
|
||||||
|
|
||||||
|
case ${BOARDFAMILY} in
|
||||||
|
cix)
|
||||||
|
local toolchains=(
|
||||||
|
"arm-gnu-toolchain-12.3.rel1-x86_64-aarch64-none-linux-gnu.tar.xz"
|
||||||
|
)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
local toolchains=(
|
local toolchains=(
|
||||||
"ky-toolchain-linux-glibc-x86_64-v1.0.1.tar.xz"
|
"ky-toolchain-linux-glibc-x86_64-v1.0.1.tar.xz"
|
||||||
"gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz"
|
"gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz"
|
||||||
|
|
@ -1574,6 +1582,8 @@ prepare_host()
|
||||||
"gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf.tar.xz"
|
"gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf.tar.xz"
|
||||||
"gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu.tar.xz"
|
"gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu.tar.xz"
|
||||||
)
|
)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
USE_TORRENT_STATUS=${USE_TORRENT}
|
USE_TORRENT_STATUS=${USE_TORRENT}
|
||||||
USE_TORRENT="no"
|
USE_TORRENT="no"
|
||||||
|
|
@ -1655,6 +1665,11 @@ function webseed ()
|
||||||
https://mirrors.bfsu.edu.cn/armbian-releases/
|
https://mirrors.bfsu.edu.cn/armbian-releases/
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
if [[ ${filename} == *ky* ]] || [[ ${filename} == *arm-gnu-toolchain* ]]; then
|
||||||
|
WEBSEED=(
|
||||||
|
http://www.iplaystore.cn/upload/
|
||||||
|
)
|
||||||
|
fi
|
||||||
for toolchain in ${WEBSEED[@]}; do
|
for toolchain in ${WEBSEED[@]}; do
|
||||||
text="${text} ${toolchain}${1}"
|
text="${text} ${toolchain}${1}"
|
||||||
done
|
done
|
||||||
|
|
@ -1681,13 +1696,12 @@ download_and_verify()
|
||||||
local server=${ARMBIAN_MIRROR}
|
local server=${ARMBIAN_MIRROR}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -f ${localdir}/${dirname}/.download-complete ]]; then
|
if [[ ${filename} == *ky* ]] || [[ ${filename} == *arm-gnu-toolchain* ]]; then
|
||||||
return
|
server="http://www.iplaystore.cn/upload/"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ${filename} == *ky* ]]; then
|
if [[ -f ${localdir}/${dirname}/.download-complete ]]; then
|
||||||
server="http://www.iplaystore.cn/"
|
return
|
||||||
remotedir=""
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# switch to china mirror if US timeouts
|
# switch to china mirror if US timeouts
|
||||||
|
|
@ -1695,15 +1709,20 @@ download_and_verify()
|
||||||
if [[ $? -ne 7 && $? -ne 22 && $? -ne 0 ]]; then
|
if [[ $? -ne 7 && $? -ne 22 && $? -ne 0 ]]; then
|
||||||
display_alert "Timeout from $server" "retrying" "info"
|
display_alert "Timeout from $server" "retrying" "info"
|
||||||
server="https://mirrors.tuna.tsinghua.edu.cn/armbian-releases/"
|
server="https://mirrors.tuna.tsinghua.edu.cn/armbian-releases/"
|
||||||
|
if [[ ${filename} == *ky* ]] || [[ ${filename} == *arm-gnu-toolchain* ]]; then
|
||||||
|
server="http://www.iplaystore.cn/upload/"
|
||||||
|
fi
|
||||||
|
|
||||||
# switch to another china mirror if tuna timeouts
|
# switch to another china mirror if tuna timeouts
|
||||||
timeout 10 curl --head --fail --silent ${server}${remotedir}/${filename} 2>&1 >/dev/null
|
timeout 10 curl --head --fail --silent ${server}${remotedir}/${filename} 2>&1 >/dev/null
|
||||||
if [[ $? -ne 7 && $? -ne 22 && $? -ne 0 ]]; then
|
if [[ $? -ne 7 && $? -ne 22 && $? -ne 0 ]]; then
|
||||||
display_alert "Timeout from $server" "retrying" "info"
|
display_alert "Timeout from $server" "retrying" "info"
|
||||||
server="https://mirrors.bfsu.edu.cn/armbian-releases/"
|
server="https://mirrors.bfsu.edu.cn/armbian-releases/"
|
||||||
|
if [[ ${filename} == *ky* ]] || [[ ${filename} == *arm-gnu-toolchain* ]]; then
|
||||||
|
server="http://www.iplaystore.cn/upload/"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# check if file exists on remote server before running aria2 downloader
|
# check if file exists on remote server before running aria2 downloader
|
||||||
[[ ! `timeout 10 curl --head --fail --silent ${server}${remotedir}/${filename}` ]] && return
|
[[ ! `timeout 10 curl --head --fail --silent ${server}${remotedir}/${filename}` ]] && return
|
||||||
|
|
@ -1925,9 +1944,9 @@ install_docker() {
|
||||||
esac
|
esac
|
||||||
|
|
||||||
#if [[ ${SELECTED_CONFIGURATION} == desktop ]]; then
|
#if [[ ${SELECTED_CONFIGURATION} == desktop ]]; then
|
||||||
mirror_url=https://repo.huaweicloud.com
|
# mirror_url=https://repo.huaweicloud.com
|
||||||
#else
|
#else
|
||||||
# mirror_url=https://mirrors.aliyun.com
|
mirror_url=https://mirrors.aliyun.com
|
||||||
#fi
|
#fi
|
||||||
|
|
||||||
chroot "${SDCARD}" /bin/bash -c "curl -fsSL ${mirror_url}/docker-ce/linux/${distributor_id}/gpg | apt-key add -"
|
chroot "${SDCARD}" /bin/bash -c "curl -fsSL ${mirror_url}/docker-ce/linux/${distributor_id}/gpg | apt-key add -"
|
||||||
|
|
|
||||||
109
scripts/main.sh
109
scripts/main.sh
|
|
@ -84,6 +84,8 @@ source "${SRC}"/scripts/general.sh # general functions
|
||||||
source "${SRC}"/scripts/chroot-buildpackages.sh # chroot packages building
|
source "${SRC}"/scripts/chroot-buildpackages.sh # chroot packages building
|
||||||
# shellcheck source=pack.sh
|
# shellcheck source=pack.sh
|
||||||
source "${SRC}"/scripts/pack-uboot.sh
|
source "${SRC}"/scripts/pack-uboot.sh
|
||||||
|
# shellcheck source=build-cix-image.sh
|
||||||
|
source "${SRC}"/scripts/build-cix-image.sh
|
||||||
|
|
||||||
|
|
||||||
# set log path
|
# set log path
|
||||||
|
|
@ -159,48 +161,6 @@ fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# if BUILD_OPT, KERNEL_CONFIGURE, BOARD, BRANCH or RELEASE are not set, display selection menu
|
|
||||||
if [[ -z $BUILD_OPT ]]; then
|
|
||||||
|
|
||||||
options+=("u-boot" "U-boot package")
|
|
||||||
options+=("kernel" "Kernel package")
|
|
||||||
options+=("rootfs" "Rootfs and all deb packages")
|
|
||||||
options+=("image" "Full OS image for flashing")
|
|
||||||
|
|
||||||
menustr="Compile image | rootfs | kernel | u-boot"
|
|
||||||
BUILD_OPT=$(whiptail --title "${titlestr}" --backtitle "${backtitle}" --notags \
|
|
||||||
--menu "${menustr}" "${TTY_Y}" "${TTY_X}" $((TTY_Y - 8)) \
|
|
||||||
--cancel-button Exit --ok-button Select "${options[@]}" \
|
|
||||||
3>&1 1>&2 2>&3)
|
|
||||||
|
|
||||||
unset options
|
|
||||||
[[ -z $BUILD_OPT ]] && exit_with_error "No option selected"
|
|
||||||
[[ $BUILD_OPT == rootfs ]] && ROOT_FS_CREATE_ONLY="yes"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if [[ ${BUILD_OPT} =~ kernel|image ]]; then
|
|
||||||
|
|
||||||
if [[ -z $KERNEL_CONFIGURE ]]; then
|
|
||||||
|
|
||||||
options+=("no" "Do not change the kernel configuration")
|
|
||||||
options+=("yes" "Show a kernel configuration menu before compilation")
|
|
||||||
|
|
||||||
menustr="Select the kernel configuration."
|
|
||||||
KERNEL_CONFIGURE=$(whiptail --title "${titlestr}" --backtitle "$backtitle" --notags \
|
|
||||||
--menu "${menustr}" $TTY_Y $TTY_X $((TTY_Y - 8)) \
|
|
||||||
--cancel-button Exit --ok-button Select "${options[@]}" \
|
|
||||||
3>&1 1>&2 2>&3)
|
|
||||||
|
|
||||||
unset options
|
|
||||||
[[ -z $KERNEL_CONFIGURE ]] && exit_with_error "No option selected"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if [[ -z $BOARD ]]; then
|
if [[ -z $BOARD ]]; then
|
||||||
|
|
||||||
|
|
@ -246,6 +206,7 @@ if [[ -z $BOARD ]]; then
|
||||||
options+=("orangepi5plus" "Rockchip RK3588 octa core 4-32GB RAM 2.5GBE USB3 USB-C WiFi/BT NVMe eMMC")
|
options+=("orangepi5plus" "Rockchip RK3588 octa core 4-32GB RAM 2.5GBE USB3 USB-C WiFi/BT NVMe eMMC")
|
||||||
options+=("orangepicm4" "Rockchip RK3566 quad core 2-8GB RAM GBE eMMC USB3 NvMe WiFi/BT")
|
options+=("orangepicm4" "Rockchip RK3566 quad core 2-8GB RAM GBE eMMC USB3 NvMe WiFi/BT")
|
||||||
options+=("orangepi3b" "Rockchip RK3566 quad core 2-8GB RAM GBE eMMC USB3 NvMe WiFi/BT")
|
options+=("orangepi3b" "Rockchip RK3566 quad core 2-8GB RAM GBE eMMC USB3 NvMe WiFi/BT")
|
||||||
|
options+=("orangepi6plus" "Cix P1 12-core 16-64GB RAM 5GBE USB3 USB-C WiFi/BT NVMe")
|
||||||
options+=("orangepirv" "Starfive JH7110 quad core 2-8GB RAM GBE USB3 NvMe WiFi/BT")
|
options+=("orangepirv" "Starfive JH7110 quad core 2-8GB RAM GBE USB3 NvMe WiFi/BT")
|
||||||
options+=("orangepirv2" "Ky X1 octa core 2-8GB RAM GBE USB3 WiFi/BT NVMe eMMC")
|
options+=("orangepirv2" "Ky X1 octa core 2-8GB RAM GBE USB3 WiFi/BT NVMe eMMC")
|
||||||
#options+=("orangepir2s" "Ky X1 octa core 2-8GB RAM 2.5GBE USB3 eMMC")
|
#options+=("orangepir2s" "Ky X1 octa core 2-8GB RAM 2.5GBE USB3 eMMC")
|
||||||
|
|
@ -269,6 +230,55 @@ LINUXFAMILY="${BOARDFAMILY}"
|
||||||
|
|
||||||
[[ -z $KERNEL_TARGET ]] && exit_with_error "Board configuration does not define valid kernel config"
|
[[ -z $KERNEL_TARGET ]] && exit_with_error "Board configuration does not define valid kernel config"
|
||||||
|
|
||||||
|
# if BUILD_OPT, KERNEL_CONFIGURE, BOARD, BRANCH or RELEASE are not set, display selection menu
|
||||||
|
if [[ -z $BUILD_OPT ]]; then
|
||||||
|
|
||||||
|
if [[ $BOARDFAMILY != "cix" ]]; then
|
||||||
|
options+=("u-boot" "U-boot package")
|
||||||
|
fi
|
||||||
|
options+=("kernel" "Kernel package")
|
||||||
|
options+=("rootfs" "Rootfs and all deb packages")
|
||||||
|
options+=("image" "Full OS image for flashing")
|
||||||
|
|
||||||
|
if [[ $BOARDFAMILY != "cix" ]]; then
|
||||||
|
menustr="Compile image | rootfs | kernel | u-boot"
|
||||||
|
else
|
||||||
|
menustr="Compile image | rootfs | kernel"
|
||||||
|
fi
|
||||||
|
BUILD_OPT=$(whiptail --title "${titlestr}" --backtitle "${backtitle}" --notags \
|
||||||
|
--menu "${menustr}" "${TTY_Y}" "${TTY_X}" $((TTY_Y - 8)) \
|
||||||
|
--cancel-button Exit --ok-button Select "${options[@]}" \
|
||||||
|
3>&1 1>&2 2>&3)
|
||||||
|
|
||||||
|
unset options
|
||||||
|
[[ -z $BUILD_OPT ]] && exit_with_error "No option selected"
|
||||||
|
[[ $BUILD_OPT == rootfs ]] && ROOT_FS_CREATE_ONLY="yes"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if [[ ${BUILD_OPT} =~ kernel|image ]]; then
|
||||||
|
|
||||||
|
if [[ -z $KERNEL_CONFIGURE ]]; then
|
||||||
|
|
||||||
|
options+=("no" "Do not change the kernel configuration")
|
||||||
|
options+=("yes" "Show a kernel configuration menu before compilation")
|
||||||
|
|
||||||
|
menustr="Select the kernel configuration."
|
||||||
|
KERNEL_CONFIGURE=$(whiptail --title "${titlestr}" --backtitle "$backtitle" --notags \
|
||||||
|
--menu "${menustr}" $TTY_Y $TTY_X $((TTY_Y - 8)) \
|
||||||
|
--cancel-button Exit --ok-button Select "${options[@]}" \
|
||||||
|
3>&1 1>&2 2>&3)
|
||||||
|
|
||||||
|
unset options
|
||||||
|
[[ -z $KERNEL_CONFIGURE ]] && exit_with_error "No option selected"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if [[ -z $BRANCH ]]; then
|
if [[ -z $BRANCH ]]; then
|
||||||
|
|
||||||
options=()
|
options=()
|
||||||
|
|
@ -438,7 +448,18 @@ if [[ ${IGNORE_UPDATES} != yes ]]; then
|
||||||
|
|
||||||
display_alert "Downloading sources" "" "info"
|
display_alert "Downloading sources" "" "info"
|
||||||
|
|
||||||
|
if [[ $BOARDFAMILY != "cix" ]]; then
|
||||||
|
|
||||||
[[ $BUILD_OPT =~ u-boot|image ]] && fetch_from_repo "$BOOTSOURCE" "$BOOTDIR" "$BOOTBRANCH" "yes"
|
[[ $BUILD_OPT =~ u-boot|image ]] && fetch_from_repo "$BOOTSOURCE" "$BOOTDIR" "$BOOTBRANCH" "yes"
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $BOARDFAMILY == "cix" ]]; then
|
||||||
|
|
||||||
|
fetch_from_repo "https://github.com/orangepi-xunlong/component_cix-$BRANCH.git" "${EXTER}/cache/sources/component_cix-$BRANCH" "branch:main"
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
[[ $BUILD_OPT =~ kernel|image ]] && fetch_from_repo "$KERNELSOURCE" "$KERNELDIR" "$KERNELBRANCH" "yes"
|
[[ $BUILD_OPT =~ kernel|image ]] && fetch_from_repo "$KERNELSOURCE" "$KERNELDIR" "$KERNELBRANCH" "yes"
|
||||||
|
|
||||||
if [[ -n ${ATFSOURCE} ]]; then
|
if [[ -n ${ATFSOURCE} ]]; then
|
||||||
|
|
@ -520,6 +541,7 @@ done
|
||||||
# Compile u-boot if packed .deb does not exist or use the one from Orange Pi
|
# Compile u-boot if packed .deb does not exist or use the one from Orange Pi
|
||||||
if [[ $BUILD_OPT == u-boot || $BUILD_OPT == image ]]; then
|
if [[ $BUILD_OPT == u-boot || $BUILD_OPT == image ]]; then
|
||||||
|
|
||||||
|
if [[ $BOARDFAMILY != "cix" ]]; then
|
||||||
if [[ ! -f "${DEB_STORAGE}"/u-boot/${CHOSEN_UBOOT}_${REVISION}_${ARCH}.deb ]]; then
|
if [[ ! -f "${DEB_STORAGE}"/u-boot/${CHOSEN_UBOOT}_${REVISION}_${ARCH}.deb ]]; then
|
||||||
|
|
||||||
[[ -n "${ATFSOURCE}" && "${REPOSITORY_INSTALL}" != *u-boot* ]] && compile_atf
|
[[ -n "${ATFSOURCE}" && "${REPOSITORY_INSTALL}" != *u-boot* ]] && compile_atf
|
||||||
|
|
@ -533,6 +555,7 @@ if [[ $BUILD_OPT == u-boot || $BUILD_OPT == image ]]; then
|
||||||
display_alert "Target directory" "${DEB_STORAGE}/u-boot" "info"
|
display_alert "Target directory" "${DEB_STORAGE}/u-boot" "info"
|
||||||
display_alert "File name" "${CHOSEN_UBOOT}_${REVISION}_${ARCH}.deb" "info"
|
display_alert "File name" "${CHOSEN_UBOOT}_${REVISION}_${ARCH}.deb" "info"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Compile kernel if packed .deb does not exist or use the one from Orange Pi
|
# Compile kernel if packed .deb does not exist or use the one from Orange Pi
|
||||||
|
|
@ -567,7 +590,7 @@ if [[ $BUILD_OPT == rootfs || $BUILD_OPT == image ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Compile plymouth-theme-orangepi if packed .deb does not exist or use the one from repository
|
# Compile plymouth-theme-orangepi if packed .deb does not exist or use the one from repository
|
||||||
if [[ ! -f ${DEB_STORAGE}/plymouth-theme-orangepi_${REVISION}_all.deb ]]; then
|
if [[ ! -f ${DEB_STORAGE}/plymouth-theme-orangepi_${REVISION}_all.deb && $PLYMOUTH == yes ]]; then
|
||||||
|
|
||||||
[[ "${REPOSITORY_INSTALL}" != *plymouth-theme-orangepi* ]] && compile_plymouth-theme-orangepi
|
[[ "${REPOSITORY_INSTALL}" != *plymouth-theme-orangepi* ]] && compile_plymouth-theme-orangepi
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue