added my Recipes

This commit is contained in:
2024-07-11 14:16:35 +02:00
parent 38bc4f53ac
commit 09b621d929
7118 changed files with 525762 additions and 3 deletions

View File

@@ -0,0 +1,2 @@
SUBSYSTEMS=="graphics_class", KERNEL=="galcore", GROUP="video", MODE="0666"

View File

@@ -0,0 +1 @@
SUBSYSTEMS=="drm", ACTION=="change", RUN+="/usr/bin/pulseaudio_hdmi_switch.sh"

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

View File

@@ -0,0 +1,9 @@
Check GPU
=========
GPU can be deactivated by fuse or not present in some SOC
So in case the GPU is not present, you must configure weston on pix-man by creating this file :
/etc/default/weston with this content :
OPTARGS=--use-pixman

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@@ -0,0 +1,121 @@
#!/bin/sh -
#===============================================================================
#
# FILE: system-generator-check-gpu
#
# DESCRIPTION: The goal are to detect if the gpu are present/loaded or not
# ORGANIZATION: STMicroelectronics
# COPYRIGHT: Copyright (C) 2018, STMicroelectronics - All Rights Reserved
#===============================================================================
check_dt_status() {
gcnano_dir=$(ls /proc/device-tree/soc/ | grep gpu)
if [ -z "$gcnano_dir" ] || [ ! -d /proc/device-tree/soc/$gcnano_dir ];
then
echo "Gcnano in /proc/device-tree/soc/ is not available" > /dev/kmsg
force_no_dtb_gpu="1"
else
if [ ! -f /proc/device-tree/soc/$gcnano_dir/status ]; then
gcnano_status="okay"
else
if $(grep -q "okay" /proc/device-tree/soc/$gcnano_dir/status); then
gcnano_status="okay"
fi
fi
fi
}
check_load_module() {
local _timeout=0
if [ -n "$(cat /proc/modules | grep etnaviv)" ]; then
galcore_module=$(cat /proc/modules | grep ^etnaviv)
return
fi
while [ -z "$(cat /proc/modules | grep galcore)" ]; do
sleep 1
_timeout=$(($_timeout+1))
if [ "$_timeout" -eq "10" ]; then
echo "Time out check load galcore module expired" > /dev/kmsg
break
fi
done
galcore_module=$(cat /proc/modules | grep galcore)
}
check_devices() {
local _timeout=0
if [ -n "$(cat /proc/modules | grep etnaviv)" ]; then
galcore_device=$(cat /proc/modules | grep ^etnaviv)
return
fi
while [ -z "$(ls -l /dev/ | grep galcore)" ]; do
sleep 1
_timeout=$(($_timeout+1))
if [ "$_timeout" -eq "10" ]; then
echo "Time out check galcore device expired" > /dev/kmsg
break
fi
done
galcore_device=$(ls -l /dev/ | grep galcore)
}
check_default_weston_config() {
if [ "$force_no_dtb_gpu" = "1" ];
then
if [ -e /etc/default/weston ] && $(grep -q "Autogenerated" /etc/default/weston);
then
default_weston_status="Autogenerated"
fi
fi
}
#
# Main
#
gcnano_status="disabled"
galcore_module=""
galcore_device=""
default_weston_status=""
force_no_dtb_gpu=0
check_dt_status
check_default_weston_config
if [ "$default_weston_status" = "Autogenerated" ];
then
echo "Weston already configured"
exit 0
fi
check_load_module
check_devices
if [ "$gcnano_status" = "okay" ] && [ -n "$galcore_module" ] && [ -n "$galcore_device" ];
then
#echo "Gcnano is present and activated" > /dev/kmsg
if [ -f /etc/default/weston ] && $(grep -q "Autogenerated" /etc/default/weston) ;
then
sed -i "s/OPTARGS=--use-pixman/#OPTARGS=--use-pixman/g" /etc/default/weston
sed -i "/#Autogenerated/d" /etc/default/weston
fi
if [ ! -f /etc/default/weston ];
then
echo "#Autogenerated" > /etc/default/weston
echo "#OPTARGS=--use-pixman" >> /etc/default/weston
echo "WESTON_USER=weston" >> /etc/default/weston
fi
else
if [ -f /etc/default/weston ] && $(grep -q "Autogenerated" /etc/default/weston) ;
then
echo "Weston already configured on pixman" > /dev/kmsg
else
echo "Configure weston on pixman" > /dev/kmsg
echo "#Autogenerated" > /etc/default/weston
echo "OPTARGS=--use-pixman" >> /etc/default/weston
echo "WESTON_USER=weston" >> /etc/default/weston
fi
fi
dri_device=$(ls -l /dev/ | grep dri)
if [ -z "$dri_device" ];
then
exit 1
fi

View File

@@ -0,0 +1,3 @@
DEFAULT_PULSE_AUDIO_LOCAL_PROFILE=output:analog-stereo
DEFAULT_PULSE_AUDIO_HDMI_PROFILE=output:hdmi-stereo

View File

@@ -0,0 +1,39 @@
#!/bin/sh -
source /etc/default/pulseaudio_profile
PROFILE_LOCAL=$DEFAULT_PULSE_AUDIO_LOCAL_PROFILE
PROFILE_HDMI=$DEFAULT_PULSE_AUDIO_HDMI_PROFILE
HDMI_STATUS=$(cat /sys/class/drm/card0/*HDMI*/status)
if [ "$HDMI_STATUS" = "connected" ]; then
PROFILE=$PROFILE_HDMI
else
PROFILE=$PROFILE_LOCAL
fi
cat > /tmp/pulse_temp_switch.sh <<EOF
#!/bin/sh
cards=\$(pactl list cards | egrep -i 'Card #' | sed 's/Card //g')
index=0
for i in \$cards;
do
card_info=\$(pactl list cards | grep "Card \$i" -A15 | grep "alsa.card_name" | sed 's/ //g'| sed 's/alsa.card_name=\"//g'| sed 's/\"//g' | tr '\t' ' ' | sed 's/^\s*//g')
echo "\$i \$card_info"
# for each card, search alsa.card_name
found=\$(echo \$card_info | grep -n STM32MP | wc -l)
if [ \$found -eq 1 ];
then
echo "pactl set-card-profile \$index $PROFILE"
pactl set-card-profile \$index $PROFILE
break;
fi
index=\$((index+1))
done
EOF
chmod +x /tmp/pulse_temp_switch.sh
if [ "$USER" == "weston" ]; then
script -qc "/tmp/pulse_temp_switch.sh"
else
script -qc "su -l weston -c /tmp/pulse_temp_switch.sh"
fi
rm -f /tmp/pulse_temp_switch.sh

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

View File

@@ -0,0 +1,16 @@
#!/bin/sh
case $1 in
start)
systemctl --user start pulseaudio
/bin/sleep 5
/usr/bin/psplash-drm-quit
;;
stop)
systemctl --user stop weston.service weston.socket
systemctl --user stop pulseaudio
;;
*)
echo "Help: $0 [start|stop]"
;;
esac

Binary file not shown.

After

Width:  |  Height:  |  Size: 961 B

View File

@@ -0,0 +1,12 @@
[Unit]
Description=Check if the gpu are present and set the correct weston configuration
Before=weston-graphical-session.service
[Service]
ExecStart=-/sbin/check-gpu
Type=oneshot
RemainAfterExit=yes
TimeoutSec=0
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,55 @@
[Unit]
Description=Weston graphical session
# Make sure we are started after logins are permitted.
Requires=systemd-user-sessions.service
After=systemd-user-sessions.service
# if you want you can make it part of the graphical session
#Before=graphical.target
# not necessary but just in case
#ConditionPathExists=/dev/tty7
# D-Bus is necessary for contacting logind. Logind is required.
Wants=dbus.socket
After=dbus.socket
[Service]
Type=simple
Environment=XDG_SESSION_TYPE=wayland
ExecStartPre=/usr/bin/systemd-graphical-weston-session.sh start
ExecStart=/bin/systemctl --wait --user start weston.service
ExecStop=/usr/bin/systemd-graphical-weston-session.sh stop
RemainAfterExit=yes
# The user to run the session as. Pick one!
User=weston
Group=weston
# Make sure the working directory is the users home directory
WorkingDirectory=/home/weston
# Set up a full user session for the user, required by Weston.
PAMName=weston-autologin
# A virtual terminal is needed.
TTYPath=/dev/tty7
TTYReset=yes
TTYVHangup=yes
TTYVTDisallocate=yes
# Fail to start if not controlling the tty.
StandardInput=tty-fail
# Defaults to journal, in case it doesn't adjust it accordingly
#StandardOutput=journal
StandardError=journal
# Log this user with utmp, letting it show up with commands 'w' and 'who'.
UtmpIdentifier=tty7
UtmpMode=user
[Install]
Alias=display-manager.service
WantedBy=multi-user.target

View File

@@ -0,0 +1,73 @@
# This is a system unit for launching Weston with auto-login as the
# user configured here.
#
# Weston must be built with systemd support, and your weston.ini must load
# the plugin systemd-notify.so.
[Unit]
Description=Weston, a Wayland compositor, as a system service
Documentation=man:weston(1) man:weston.ini(5)
Documentation=http://wayland.freedesktop.org/
# Make sure we are started after logins are permitted.
Requires=systemd-user-sessions.service
After=systemd-user-sessions.service
# D-Bus is necessary for contacting logind. Logind is required.
Wants=dbus.socket
After=dbus.socket
After=psplash-drm-wait.service
After=weston-checkgpu.service
# Since we are part of the graphical session, make sure we are started before
# it is complete.
Before=graphical.target
# Prevent starting on systems without virtual consoles, Weston requires one
# for now.
ConditionPathExists=/dev/tty0
[Service]
# Requires systemd-notify.so Weston plugin.
#Type=notify
EnvironmentFile=-/etc/default/weston
Environment="XDG_RUNTIME_DIR=/home/weston"
Environment="WESTON_USER=weston"
Environment="WL_EGL_GBM_FENCE=0"
#ExecStart=/usr/bin/weston-launch -- --modules=systemd-notify.so --log=/home/weston/weston.log $OPTARGS
ExecStart=/usr/bin/weston-start --modules=systemd-notify.so --log=/home/weston/weston.log $OPTARGS
ExecStop=/usr/bin/killall weston
# Optional watchdog setup
#TimeoutStartSec=60
#WatchdogSec=20
# The user to run Weston as.
User=weston
Group=weston
# Make sure the working directory is the users home directory
WorkingDirectory=/home/weston
# Set up a full user session for the user, required by Weston.
PAMName=weston-autologin
# A virtual terminal is needed.
TTYPath=/dev/tty7
TTYReset=yes
TTYVHangup=yes
TTYVTDisallocate=yes
# Fail to start if not controlling the tty.
StandardInput=tty-fail
StandardOutput=journal
StandardError=journal
# Log this user with utmp, letting it show up with commands 'w' and 'who'.
UtmpIdentifier=tty7
UtmpMode=user
[Install]
# Note: If you only want weston to start on-demand, remove this line with a
# service drop file
Alias=display-manager.service
WantedBy=multi-user.target

View File

@@ -0,0 +1,41 @@
#!/bin/sh
weston_args=$*
if [ -z "$WESTON_USER" ]; then
WESTON_USER=weston
fi
# for associated service: pulseaudio
if [ ! -d "/var/run/pulse" ]; then
su -c "mkdir -p /var/run/pulse"
su -c "chown -R weston.weston /var/run/pulse"
fi
## Module support
start_application_dir=/usr/share/weston-start-at-startup
start_local_application_dir=/usr/local/weston-start-at-startup
systemctl --user restart pulseaudio
if [ "$USER" == "$WESTON_USER" ]; then
# Load and run application at startup
if [ -d "$start_application_dir" ]; then
for m in "$start_application_dir"/*; do
echo "($m)"
(sleep 5 && $m)&
done
fi
if [ -d "$start_local_application_dir" ]; then
for m in "$start_local_application_dir"/*; do
echo "($m)"
(sleep 5 && $m)&
done
fi
fi
if [ -f /home/weston/weston.log ]; then
mv /home/weston/weston.log /home/weston/weston-previous.log
fi
exec /usr/bin/weston $weston_args

View File

@@ -0,0 +1,105 @@
[core]
#modules=cms-colord.so
#xwayland=true
shell=desktop-shell.so
#gbm-format=xrgb2101010
backend=drm-backend.so
idle-time=0
repaint-window=100
require-input=false
[keyboard]
keymap_layout=us
[shell]
background-image=/usr/share/weston/backgrounds/OpenSTLinux_background_1024x600.png
background-color=0xff002244
background-type=scale-crop
clock-format=minutes
panel-color=0x90a1a1a1
panel-position=bottom
locking=false
animation=none
startup-animation=none
close-animation=none
focus-animation=none
binding-modifier=ctrl
#num-workspaces=6
#cursor-theme=whiteglass
#cursor-size=24
[launcher]
icon=/usr/share/weston/icon/utilities-terminal.png
path=/usr/bin/weston-terminal
[launcher]
icon=/usr/share/weston/icon/space.png
path=/bin/true
[launcher]
icon=/usr/share/weston/icon_flower.png
path=/usr/bin/weston-flower
[launcher]
icon=/usr/share/weston/icon/space.png
path=/bin/true
[launcher]
icon=/usr/share/weston/icon/ST13345_Products_light_blue_24x24.png
path=/usr/local/demo/demo_launcher.py
[launcher]
icon=/usr/share/weston/icon/space.png
path=/bin/true
[input-method]
path=/usr/libexec/weston-keyboard
# HDMI connector
# If the hdmi cable is plugged, weston uses the hdmi output (else dsi output).
# Use the command "systemctl restart weston@root" after pluging/unpluging the hdmi cable.
[output]
name=HDMI-A-1
mode=1280x720
# DSI connector
[output]
name=DSI-1
mode=preferred
transform=rotate-90
app-ids=1000
# LTDC connector
[output]
name=DPI-1
mode=preferred
[libinput]
touchscreen_calibrator=true
calibration_helper=/bin/echo
#enable-tap=true
#tap-and-drag=true
#tap-and-drag-lock=true
#disable-while-typing=false
#middle-button-emulation=true
#left-handed=true
#rotation=90
#accel-profile=flat
#accel-speed=.9
#natural-scroll=true
#scroll-method=edge
# For button-triggered scrolling:
#scroll-method=button
#scroll-button=BTN_RIGHT
#[touchpad]
#constant_accel_factor = 50
#min_accel_factor = 0.16
#max_accel_factor = 1.0
[screen-share]
command=/usr/bin/weston --backend=rdp-backend.so --shell=fullscreen-shell.so --no-clients-resize
#start-on-startup=false
#[xwayland]
#path=/usr/bin/Xwayland

View File

@@ -0,0 +1,30 @@
[Unit]
Description=Weston, a Wayland compositor, as a user service
Documentation=man:weston(1) man:weston.ini(5)
Documentation=https://wayland.freedesktop.org/
# Activate using a systemd socket
Requires=weston.socket
After=weston.socket
# Since we are part of the graphical session, make sure we are started before
Before=graphical-session.target
[Service]
Type=notify
TimeoutStartSec=60
WatchdogSec=20
# Defaults to journal
#StandardOutput=journal
StandardError=journal
EnvironmentFile=-/etc/default/weston
Environment="XDG_RUNTIME_DIR=/home/weston"
Environment="WESTON_USER=weston"
Environment="WL_EGL_GBM_FENCE=0"
# add a ~/.config/weston.ini and weston will pick-it up
ExecStart=/usr/bin/weston-start --modules=systemd-notify.so --log=/home/weston/weston.log $OPTARGS
ExecStop=/usr/bin/killall weston
[Install]
WantedBy=graphical-session.target

View File

@@ -0,0 +1,139 @@
#!/bin/sh
# Weston
#uncomment some part of the following line if you like:
# - see the weston log
# LOG_FILE: file on which the log are writed
# - use a software compositor instead of egl compositor
# USE_PIXMAN: populate the variable to use the software compositor on
# weston
# - add some new option to weston application
# ST_WESTON_ADDONS
# - debug weston via openvt
# DEBUG_OPENGL_VIA_OPENVT: file on which the all stdout, sdterr trace
# are stocked
#LOG_FILE=/tmp/weston.log
#USE_PIXMAN=1
#ST_WESTON_ADDONS
#DEBUG_OPENGL_VIA_OPENVT=/tmp/opengl.log
mkdir -p $XDG_RUNTIME_DIR
chmod 0700 $XDG_RUNTIME_DIR
# psplash management
case "$1" in
start)
PSPLASH_PID=`pgrep psplash`
if [ ! -z $PSPLASH_PID ]; then
echo -n "Stop psplash: "
/usr/bin/psplash-write QUIT
#kill -9 $PSPLASH_PID
echo "done."
fi
PSPLASH_PID=`pgrep psplash-drm`
if [ ! -z $PSPLASH_PID ]; then
echo -n "Stop psplash: "
echo QUIT > /tmp/splash_fifo
#kill -9 $PSPLASH_PID
echo "done."
fi
;;
*)
;;
esac
#log file managment on weston CMD line
CMD_LINE_WESTON=""
if [ -z $LOG_FILE ];
then
CMD_LINE_WESTON=" "
else
if [ -f $LOG_FILE ]; then
rm $LOG_FILE
fi
CMD_LINE_WESTON="--log=$LOG_FILE"
fi
if [ -z "$ST_WESTON_IDLE_TIME" ];
then
ST_WESTON_IDLE_TIME=648000
fi
#compositor managment on CMD line
if [ -z $USE_PIXMAN ];
then
echo "";
else
CMD_LINE_WESTON="$CMD_LINE_WESTON --use-pixman"
fi
#Addons paramaters
if [ -n $ST_WESTON_ADDONS ];
then
CMD_LINE_WESTON="$CMD_LINE_WESTON $ST_WESTON_ADDONS"
fi
# See how we were called.
case "$1" in
start)
if [ ! -z $LOG_FILE ];
then
echo "[SERVICE] start.........." >> $LOG_FILE
fi
echo "Starting Weston"
if [ -n "$DEBUG_OPENGL_VIA_OPENVT" ];
then
echo "[DEBUG] use script /tmp/launch_basic_weston.sh"
echo "[DEBUG] output saved on file $DEBUG_OPENGL_VIA_OPENVT"
#generate a wrapper script to launch weston
cat > /tmp/launch_basic_weston.sh << EOF
/usr/bin/weston $CMD_LINE_WESTON 2>&1 > $DEBUG_OPENGL_VIA_OPENVT
EOF
chmod +x /tmp/launch_basic_weston.sh
openvt -s -w -- /tmp/launch_basic_weston.sh
else
echo "/usr/bin/weston $CMD_LINE_WESTON"
openvt -s -w -- /usr/bin/weston $CMD_LINE_WESTON
# weston --tty=1 $CMD_LINE_WESTON
fi
;;
stop)
echo "Stopping Weston"
if [ ! -z $LOG_FILE ];
then
echo "[SERVICE] stop.........." >> $LOG_FILE
fi
pid_weston=`pidof weston`
kill -9 $pid_weston
;;
status)
if pidof weston >/dev/null
then
echo "Weston: running"
echo "CMDLINE of weston:"
echo " /usr/bin/weston $CMD_LINE_WESTON"
else
echo "Weston: not running"
exit 3
fi
exit 0
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage: weston.sh {start|stop|status|restart}"
exit 1
;;
esac
exit 0

View File

@@ -0,0 +1,7 @@
[Unit]
Description=Weston, a Wayland compositor
Documentation=man:weston(1) man:weston.ini(5)
Documentation=https://wayland.freedesktop.org/
[Socket]
ListenStream=%t/wayland-0

View File

@@ -0,0 +1,13 @@
export XDG_RUNTIME_DIR=/run/user/`id -u weston`
export ELM_ENGINE=wayland_shm
export ECORE_EVAS_ENGINE=wayland_shm
export ECORE_EVAS_ENGINE=wayland_shm
export GDK_BACKEND=wayland
export PULSE_RUNTIME_PATH=/run/user/`id -u weston`
export USE_PLAYBIN3=1
export WAYLAND_DISPLAY=wayland-0
if [ -e $XDG_RUNTIME_DIR/wayland-1 ]; then
export WAYLAND_DISPLAY=wayland-1
fi