update for bpi meson g12b board build

This commit is contained in:
August 2024-03-14 17:31:28 +08:00
parent 7f8f4d6468
commit ee8bea63ca
35 changed files with 187 additions and 147 deletions

View File

@ -13,6 +13,6 @@ BOOTENV_FILE="mesong12b_bpi_uEnv.txt"
BOOTSCRIPT="boot-bpi-cm4io.ini:boot.ini"
OVERLAY_PREFIX="bpi-cm4io"
DEFAULT_OVERLAYS="i2c2 spi0 uart1"
DEFAULT_OVERLAYS="i2c2 spi0 uart2"
MODULES="88x2cs media_clock firmware decoder_common stream_input amvdec_avs amvdec_h264 amvdec_mh264 amvdec_h264mvc amvdec_h265 amvdec_mjpeg amvdec_mmjpeg amvdec_mpeg12 amvdec_mmpeg12 amvdec_mpeg4 amvdec_mmpeg4 amvdec_real amvdec_vc1 amvdec_vp9 amvdec_avs2 encoder vpu galcore iv009_isp_iq iv009_isp_lens iv009_isp_sensor iv009_isp"

View File

@ -1 +1 @@
eos
supported

View File

@ -53,44 +53,62 @@ ROOTPWD="1234"
MAINTAINER="Dangku" # deb signature
MAINTAINERMAIL="dangku@bananapi.com"
PACKAGE_LIST_FAMILY="edid-decode yad"
PACKAGE_LIST_FAMILY_REMOVE="btrfs-progs update-manager"
function uboot_custom_postprocess()
{
:
}
function post_family_tweaks_bsp__mesong12b_bpi_desktop() {
display_alert "$BOARD" "Installing board tweaks bsp" "info"
function custom_apt_repo__mesong12b_bpi_apt_list()
{
:
}
function post_family_tweaks__mesong12b_bpi_desktop() {
display_alert "$BOARD" "Installing customer desktop files" "info"
# customer desktop
if [[ "$BUILD_DESKTOP" = "yes" ]]; then
# install desktop application
mkdir -p "${destination}"/etc/skel
cp -R "${SRC}"/packages/blobs/bpi-meson-g12b/desktop/skel/. "${destination}"/etc/skel
cp -R "${SRC}"/packages/blobs/bpi-meson-g12b/desktop/skel/. "${SDCARD}"/etc/skel
# install application icons
mkdir -p "${destination}"/usr/share/icons/armbian
cp "${SRC}"/packages/blobs/bpi-meson-g12b/desktop/desktop-icons/*.png "${destination}"/usr/share/icons/armbian
cp "${SRC}"/packages/blobs/bpi-meson-g12b/desktop/desktop-icons/*.png "${SDCARD}"/usr/share/icons/armbian
fi
}
function post_family_tweaks__mesong12b_bpi()
function post_family_tweaks__mesong12b_bpi_boot_files()
{
display_alert "$BOARD" "Installing board tweaks" "info"
display_alert "$BOARD" "Installing boot files" "info"
# replace bpi bootlogo
if [[ -f "${SDCARD}/boot/boot.bmp" ]]; then
rm ${SDCARD}/boot/boot.bmp
fi
cp ${SRC}/packages/blobs/bpi-meson-g12b/bsp/boot-logo-24.bmp ${SDCARD}/boot/boot-logo.bmp
[[ -f "${SDCARD}"/boot/boot.bmp ]] && rm "${SDCARD}"/boot/boot.bmp
cp "${SRC}"/packages/blobs/bpi-meson-g12b/bsp/boot-logo-24.bmp "${SDCARD}"/boot/boot-logo.bmp
# uboot env file
cp ${SRC}/packages/blobs/bpi-meson-g12b/bsp/lcd_env.txt ${SDCARD}/boot/lcd_env.txt
# copy common board files
run_host_command_logged rsync -a "${SRC}"/packages/bsp/bpi-meson-g12b/common/* "${SDCARD}"
cp "${SRC}"/packages/blobs/bpi-meson-g12b/bsp/lcd_env.txt "${SDCARD}"/boot/lcd_env.txt
}
# vendor hw deb related board files
if [[ ${RELEASE} == "focal" && ${DESKTOP_ENVIRONMENT} == "gnome" ]]; then
run_host_command_logged rsync -a "${SRC}"/packages/bsp/bpi-meson-g12b/vendor/* "${SDCARD}"
function post_family_tweaks__mesong12b_bpi_rootfs_files()
{
display_alert "$BOARD" "Installing rootfs files" "info"
# copy common board files
run_host_command_logged rsync -a "${SRC}"/packages/bsp/bpi-meson-g12b/* "${SDCARD}"
# xsettings
if [[ ${RELEASE} == "buster" && ${DESKTOP_ENVIRONMENT} == "xfce" ]]; then
cp "${SRC}"/packages/blobs/bpi-meson-g12b/xsettings/${RELEASE}/xsettings.xml "${SDCARD}"/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml
fi
}
function post_family_tweaks__mesong12b_bpi_systemd()
{
display_alert "${BOARD}" "Installing systemd service" "info"
# enable systemd service
[[ -f "${SDCARD}"/lib/systemd/system/hdmi_resolution.service ]] && chroot_sdcard systemctl --no-reload enable hdmi_resolution.service
@ -104,11 +122,19 @@ function post_family_tweaks__mesong12b_bpi()
[[ -f "${SDCARD}"/lib/systemd/system/apt-daily-upgrade.timer ]] && disable_systemd_service_sdcard apt-daily-upgrade.timer
}
function post_family_tweaks__mesong12b_bpi_docker()
{
display_alert "${BOARD}" "Installing docker setup script" "info"
# docker install script
install -m 755 "${SRC}"/packages/blobs/bpi-meson-g12b/docker/${RELEASE}/docker_install.sh "${SDCARD}"/usr/local/bin
}
function post_family_config__mesong12b_bpi_imagedebs(){
display_alert "${BOARD}" "Adding packages to image" "info"
# install packages to image
add_packages_to_image edid-decode yad firefox
#add_packages_to_image xxx
# aml hw debs related debs
if [[ ${RELEASE} == "focal" && ${DESKTOP_ENVIRONMENT} == "gnome" ]]; then
@ -116,24 +142,25 @@ function post_family_config__mesong12b_bpi_imagedebs(){
fi
# remove packages from image
# exo-utils
remove_packages btrfs-progs update-manager
if [[ ${RELEASE} == "buster" ]]; then
remove_packages systemd-resolved
fi
}
function pre_customize_image__mesong12b_bpi()
{
display_alert "$BOARD" "Customizing board image" "info"
display_alert "${BOARD}" "Customizing board image" "info"
if [[ ${BUILD_MINIMAL} != "yes" ]]; then
# common prebuilt debs
cp -a ${SRC}/packages/extras-buildpkgs/bananapi/bpi-meson-g12b/common/${RELEASE} ${SDCARD}/tmp/tmp-debs
cp -a "${SRC}"/packages/extras-buildpkgs/bananapi/bpi-meson-g12b/common/${RELEASE} "${SDCARD}"/tmp/tmp-debs
# aml hw debs only support jammy gnome
if [[ ${RELEASE} == "focal" && ${DESKTOP_ENVIRONMENT} == "gnome" ]]; then
cp -a ${SRC}/packages/extras-buildpkgs/bananapi/bpi-meson-g12b/vendor/${RELEASE}/*.deb ${SDCARD}/tmp/tmp-debs/
cp -a "${SRC}"/packages/extras-buildpkgs/bananapi/bpi-meson-g12b/vendor/${RELEASE}/*.deb "${SDCARD}"/tmp/tmp-debs/
fi
chroot $SDCARD /bin/bash -c "dpkg -i --force-bad-version,confdef /tmp/tmp-debs/*.deb"
chroot $SDCARD /bin/bash -c "apt --fix-broken --option Dpkg::Options::="--force-confdef" install -y"
chroot "${SDCARD}" /bin/bash -c "dpkg -i --force-bad-version,confdef /tmp/tmp-debs/*.deb"
chroot "${SDCARD}" /bin/bash -c "apt --fix-broken --option Dpkg::Options::="--force-confdef" install -y"
fi
}

View File

@ -1,12 +1,10 @@
[Desktop Entry]
Version=1.0
Type=Application
Name=HDMI Resolution Setting
Name[zh_CN]=HDMI
Name=Hdmi Resolution
Comment=Configure screen resolution
Comment[zh_CN]=
Exec=/usr/local/bin/hdmi_setup.sh
Icon=/usr/share/icons/armbian/hdmi_resolution.png
Terminal=false
StartupNotify=true
Terminal=true
StartupNotify=false
Categories=GTK;GNOME;Settings;HardwareSettings;

View File

@ -0,0 +1,31 @@
#!/bin/bash
# fix buster docker.service start fail
sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
sudo sed -i 's/#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/g' /etc/sysctl.conf
# uninstall old version
for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do
sudo apt-get remove $pkg;
done
# apt repository
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
# install docker packages
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# verify installation
sudo docker run hello-world

View File

@ -0,0 +1,26 @@
#!/bin/bash
# uninstall old version
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
# apt repository
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
# install Docker packages
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# verify installation
sudo docker run hello-world

View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<channel name="xsettings" version="1.0">
<property name="Net" type="empty">
<property name="ThemeName" type="string" value="Numix"/>
<property name="IconThemeName" type="string" value="Numix"/>
<property name="DoubleClickTime" type="empty"/>
<property name="DoubleClickDistance" type="empty"/>
<property name="DndDragThreshold" type="empty"/>
<property name="CursorBlink" type="empty"/>
<property name="CursorBlinkTime" type="empty"/>
<property name="SoundThemeName" type="empty"/>
<property name="EnableEventSounds" type="empty"/>
<property name="EnableInputFeedbackSounds" type="empty"/>
</property>
<property name="Xft" type="empty">
<property name="DPI" type="int" value="192"/>
<property name="Antialias" type="int" value="1"/>
<property name="Hinting" type="empty"/>
<property name="HintStyle" type="string" value="hintfull"/>
<property name="RGBA" type="empty"/>
</property>
<property name="Gtk" type="empty">
<property name="CanChangeAccels" type="empty"/>
<property name="ColorPalette" type="empty"/>
<property name="FontName" type="empty"/>
<property name="IconSizes" type="empty"/>
<property name="KeyThemeName" type="empty"/>
<property name="ToolbarStyle" type="empty"/>
<property name="ToolbarIconSize" type="empty"/>
<property name="MenuImages" type="empty"/>
<property name="ButtonImages" type="empty"/>
<property name="MenuBarAccel" type="empty"/>
<property name="CursorThemeName" type="empty"/>
<property name="CursorThemeSize" type="empty"/>
</property>
<property name="Xfce" type="empty">
<property name="LastCustomDPI" type="int" value="192"/>
</property>
</channel>

View File

@ -1,85 +0,0 @@
#!/bin/bash
# Only for desktop
if ! which lightdm; then
exit
fi
source /etc/lsb-release
PIPE="/tmp/hdmi_resolution_pipe"
resolutions=()
tempfile=$(mktemp)
# Create a pipe for communication with clients
if [[ ! -p "${PIPE}" ]]; then
mkfifo "${PIPE}"
fi
chmod 777 ${PIPE}
# Established timings supported
if [ "$DISTRIB_CODENAME" == "focal" ]; then
edid-decode < /sys/class/amhdmitx/amhdmitx0/rawedid | grep "E:" > $tempfile
while read line
do
resolutions+=(`echo $line | grep -v i | awk -F ":" '{print $2}' | awk '{print $1}'`)
done < $tempfile
# Standard timings supported
edid-decode < /sys/class/amhdmitx/amhdmitx0/rawedid | grep "S:" > $tempfile
while read line
do
resolutions+=(`echo $line | grep -v i | awk -F ":" '{print $2}' | awk '{print $1}'`)
done < $tempfile
# CEA modes
edid-decode < /sys/class/amhdmitx/amhdmitx0/rawedid | grep "VIC " > $tempfile
while read line
do
resolutions+=(`echo $line | grep -v i | awk '{print $1}'`)
done < $tempfile
elif [ "$DISTRIB_CODENAME" == "jammy" ]; then
edid-decode < /sys/class/amhdmitx/amhdmitx0/rawedid | grep "S:" > $tempfile
while read line
do
resolutions+=(`echo $line | grep -v i | awk -F ":" '{print $3}' | awk '{print $1}'`)
done < $tempfile
fi
##################
resolutions=(`echo ${resolutions[@]} | tr 'A-Z' 'a-z' | sed s/@/p/g`)
echo ${resolutions[@]} | tr ' ' '\n' > $tempfile
resolutions=(`sort -n -k 1 -k 2 -t x $tempfile | uniq | sed -e s/640x480.*/640x480p60hz/g -e s/720x480.*/480p60hz/g -e s/720x576.*/576p60hz/g -e s/1280x720.*/720p60hz/g -e s/1920x1080.*/1080p60hz/g -e s/3840x2160.*/2160p60hz/g | uniq | tr '\n' ' '`)
current_resolution=`cat /sys/class/display/mode`
res=$(yad --entry "${resolutions[@]}" \
--entry-text=$current_resolution \
--entry-label 'Resolution' \
--title 'HDMI Resolution Setting' \
--width=300 \
--height=50 \
--window-icon=/usr/share/icons/armbian/hdmi_resolution.png)
if [ -z "$res" ] || [ "$res" == "$current_resolution" ]; then
exit
fi
zenity --question --text 'Change the resolution will logout your system, please save your files!' \
--title 'Warning' \
--window-icon /usr/share/icons/armbian/warning.png \
--width=350 \
--height=50
if [ $? -ne 0 ]; then
exit
fi
EVENT="change_resolution_$res"
echo $EVENT > $PIPE
exit

View File

@ -1,11 +1,11 @@
#!/bin/bash
# Only for desktop
if ! which lightdm; then
if ! sudo which lightdm; then
exit
fi
source /etc/lsb-release
source /etc/os-release
PIPE="/tmp/hdmi_resolution_pipe"
resolutions=()
@ -16,36 +16,39 @@ if [[ ! -p "${PIPE}" ]]; then
mkfifo "${PIPE}"
fi
chmod 777 ${PIPE}
sudo chmod 777 ${PIPE}
# Established timings supported
if [ "$DISTRIB_CODENAME" == "focal" ]; then
edid-decode < /sys/class/amhdmitx/amhdmitx0/rawedid | grep "E:" > $tempfile
while read line
do
resolutions+=(`echo $line | grep -v i | awk -F ":" '{print $2}' | awk '{print $1}'`)
done < $tempfile
case "${VERSION_CODENAME}" in
"focal"|"buster")
edid-decode < /sys/class/amhdmitx/amhdmitx0/rawedid | grep "E:" > $tempfile
while read line
do
resolutions+=(`echo $line | grep -v i | awk -F ":" '{print $2}' | awk '{print $1}'`)
done < $tempfile
# Standard timings supported
edid-decode < /sys/class/amhdmitx/amhdmitx0/rawedid | grep "S:" > $tempfile
while read line
do
resolutions+=(`echo $line | grep -v i | awk -F ":" '{print $2}' | awk '{print $1}'`)
done < $tempfile
# Standard timings supported
edid-decode < /sys/class/amhdmitx/amhdmitx0/rawedid | grep "S:" > $tempfile
while read line
do
resolutions+=(`echo $line | grep -v i | awk -F ":" '{print $2}' | awk '{print $1}'`)
done < $tempfile
# CEA modes
edid-decode < /sys/class/amhdmitx/amhdmitx0/rawedid | grep " VIC" | grep -v HDMI > $tempfile
while read line
do
resolutions+=(`echo $line | grep -v i | awk '{print $3}'`)
done < $tempfile
elif [ "$DISTRIB_CODENAME" == "jammy" ]; then
edid-decode < /sys/class/amhdmitx/amhdmitx0/rawedid | grep "S:" > $tempfile
while read line
do
resolutions+=(`echo $line | grep -v i | awk -F ":" '{print $3}' | awk '{print $1}'`)
done < $tempfile
fi
# CEA modes
edid-decode < /sys/class/amhdmitx/amhdmitx0/rawedid | grep " VIC" | grep -v HDMI > $tempfile
while read line
do
resolutions+=(`echo $line | grep -v i | awk '{print $3}'`)
done < $tempfile
;;
"jammy")
edid-decode < /sys/class/amhdmitx/amhdmitx0/rawedid | grep "S:" > $tempfile
while read line
do
resolutions+=(`echo $line | grep -v i | awk -F ":" '{print $3}' | awk '{print $1}'`)
done < $tempfile
;;
esac
##################
resolutions=(`echo ${resolutions[@]} | tr 'A-Z' 'a-z' | sed s/@/p/g`)
@ -60,7 +63,7 @@ res=$(yad --entry "${resolutions[@]}" \
--entry-text=$current_resolution \
--entry-label 'Resolution' \
--title 'HDMI Resolution Setting' \
--width=300 \
--width=600 \
--height=50 \
--window-icon=/usr/share/icons/armbian/hdmi_resolution.png)
@ -71,7 +74,7 @@ fi
zenity --question --text 'Change the resolution will logout your system, please save your files!' \
--title 'Warning' \
--window-icon /usr/share/icons/armbian/warning.png \
--width=350 \
--width=600 \
--height=50
if [ $? -ne 0 ]; then

Binary file not shown.