refactor + use gtk4-layer-shell 1.1.0

This commit is contained in:
DanyLE 2025-03-05 14:27:12 +01:00
parent bdfbfc9669
commit daa23c88e6
16 changed files with 138 additions and 96 deletions

View File

@ -10,7 +10,7 @@ BBFILE_PATTERN_meta-opi-diya = "^${LAYERDIR}/"
BBFILE_PRIORITY_meta-opi-diya = "11"
LAYERDEPENDS_meta-opi-diya = " core "
LAYERSERIES_COMPAT_meta-opi-diya = "kirkstone"
LAYERSERIES_COMPAT_meta-opi-diya = "scarthgap"
PACKAGE_CLASSES = "package_ipk"
@ -21,8 +21,8 @@ INHERIT += "rm_work"
EXTRA_IMAGE_FEATURES ?= " ssh-server-dropbear read-only-rootfs "
# ssh-server-dropbear
DISTRO_FEATURES:append := " opengl wayland "
DISTRO_FEATURES:remove = " x11 vulkan "
DISTRO_FEATURES:append := " opengl "
DISTRO_FEATURES:remove = " x11 vulkan ptest"
TOOLCHAIN_TARGET_TASK:append = " libgles3-mesa-dev "
# DISTRO_FEATURES:append := " vc4-gfx opengl directfb "
MACHINE ?= "orange-pi-zero2w"
@ -41,4 +41,4 @@ PREFERRED_PROVIDER_u-boot = "u-boot-xunlong"
# extra kernel CMDLINE_RNDIS option
# CMDLINE_RNDIS += " video=DPI-1:480x640,rotate=90 "
# accept license for wifi and bluetooth firmware
LICENSE_FLAGS_ACCEPTED = "synaptics-killswitch"
LICENSE_FLAGS_ACCEPTED = "synaptics-killswitch commercial"

View File

@ -0,0 +1,13 @@
diff --git a/scripts/dtc/pylibfdt/Makefile b/scripts/dtc/pylibfdt/Makefile
index 493995e30..a7579f0c5 100644
--- a/scripts/dtc/pylibfdt/Makefile
+++ b/scripts/dtc/pylibfdt/Makefile
@@ -17,7 +17,7 @@ quiet_cmd_pymod = PYMOD $@
cmd_pymod = unset CROSS_COMPILE; unset CFLAGS; \
CC="$(HOSTCC)" LDSHARED="$(HOSTCC) -shared " \
LDFLAGS="$(HOSTLDFLAGS)" \
- VERSION="u-boot-$(UBOOTVERSION)" \
+ VERSION="$(UBOOTVERSION)" \
CPPFLAGS="$(HOSTCFLAGS) -I$(LIBFDT_srcdir)" OBJDIR=$(obj) \
SOURCES="$(PYLIBFDT_srcs)" \
SWIG_OPTS="-I$(LIBFDT_srcdir) -I$(LIBFDT_srcdir)/.." \

View File

@ -11,22 +11,22 @@ DEPENDS:append = " bc-native dtc-native swig-native python3-native flex-native b
DEPENDS:append = " atf-50i-h616 "
# No patches for other machines yet
# PROVIDES = "virtual/bootloader"
# COMPATIBLE_MACHINE = "orange-pi-zero2w"
PROVIDES += " u-boot virtual/bootloader "
#COMPATIBLE_MACHINE = "orange-pi-zero2w"
# DEFAULT_PREFERENCE_orange-pi-zero2w="1"
COMPATIBLE_MACHINE = "(sun4i|sun5i|sun7i|sun8i|sun50i)"
COMPATIBLE_MACHINE = "(sun4i|sun5i|sun7i|sun8i|sun50i|orange-pi-zero2w)"
DEFAULT_PREFERENCE:sun4i = "1"
DEFAULT_PREFERENCE:sun5i = "1"
DEFAULT_PREFERENCE:sun7i = "1"
DEFAULT_PREFERENCE:sun8i = "1"
DEFAULT_PREFERENCE:sun50i = "1"
DEFAULT_PREFERENCE:orange-pi-zero2w="1"
SRC_URI = " \
git://github.com/orangepi-xunlong/u-boot-orangepi.git;protocol=https;branch=v2021.07-sunxi \
file://boot.cmd \
file://0003-correct-version.patch \
"
PE = "1"

View File

@ -11,6 +11,9 @@ if [ ! -e "$XDG_RUNTIME_DIR" ]; then
mkdir -p "$XDG_RUNTIME_DIR"
fi
export TERM=xterm-256color
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
eval $(dbus-launch --auto-syntax)
fi
EOF
cat << EOF >> "${D}${sysconfdir}/profile"

View File

@ -0,0 +1,50 @@
inherit extrausers
EXTRA_USERS_PARAMS = "usermod -p 2Pe/4xyFxsokE diya; \
usermod -a -G video diya; \
usermod -a -G tty diya; \
usermod -a -G input diya; \
usermod -a -G dialout diya; \
usermod -a -G audio diya; \
usermod -a -G sudo diya; \
"
IMAGE_BOOT_FILES:append = "fs_resize config.txt recovery-${MACHINE}.cpio.gz Image boot.scr ${KERNEL_DEVICETREE} allwinner/overlay/sun50i-h616-fixup.scr "
IMAGE_INSTALL:append = "kernel-modules \
uwe5622-firmware \
e2fsprogs \
libcurl \
libdrm \
libgbm \
libgles2 \
libegl-mesa \
libglapi \
libudev \
libinput \
diya-overlay \
seatd \
libxkbcommon \
xkeyboard-config \
udev \
glew \
mesa \
sudo \
htop \
i2c-tools \
bash \
nano \
wpa-supplicant \
evtest \
rsync \
coreutils \
glmark2 \
"
# TOOLCHAIN_HOST_TASK:append = " libxkbcommon "
IMAGE_PREPROCESS_COMMAND += "image_patch;"
image_patch () {
# delete unused kernel image
rm -rf ${IMAGE_ROOTFS}/boot/*
}

View File

@ -1 +0,0 @@
core-image-minimal.bbappend

View File

@ -0,0 +1,27 @@
DISTRO_FEATURES:append = " wayland "
require base-image.inc
EXTRA_USERS_PARAMS:append = "usermod -a -G avahi diya"
IMAGE_INSTALL:append = "pango \
seatd \
pixman \
cairo \
glib-2.0 \
freetype \
fontconfig \
librsvg librsvg-gtk \
gdk-pixbuf \
gtk4 \
gtk4-layer-shell \
gobject-introspection \
wayland wayland-protocols \
foot swaybg swayidle swaylock tofi wtype \
mc \
gdbserver gdb \
labwc \
wlr-randr \
"
PACKAGE_EXCLUDE = " gtk+ gtk+3 adwaita-icon-theme "
IMAGE_INSTALL:remove = " gtk+ gtk+3 adwaita-icon-theme "
# wlr-randr l3afpad wlopm cairo-egl

View File

@ -1,63 +1,2 @@
inherit extrausers
# usermod -p BJpK8ADNDLsGg root;
EXTRA_USERS_PARAMS = "usermod -p 2Pe/4xyFxsokE diya; \
usermod -a -G video diya; \
usermod -a -G tty diya; \
usermod -a -G input diya; \
usermod -a -G dialout diya; \
usermod -a -G audio diya; \
usermod -a -G avahi diya; \
usermod -a -G sudo diya \
"
IMAGE_BOOT_FILES:append = "fs_resize config.txt recovery-${MACHINE}.cpio.gz Image boot.scr ${KERNEL_DEVICETREE} allwinner/overlay/sun50i-h616-fixup.scr "
IMAGE_INSTALL:append = "kernel-modules \
libcurl \
libdrm \
libgbm \
libgles2 \
libegl-mesa \
libglapi \
libudev \
libinput \
pango \
libxkbcommon \
xkeyboard-config \
diya-overlay \
seatd \
pixman \
cairo \
glib-2.0 \
udev \
glew \
freetype \
fontconfig \
librsvg librsvg-gtk \
gdk-pixbuf \
gtk-layer-shell \
gobject-introspection \
l3afpad \
mesa \
sudo \
htop \
i2c-tools \
bash \
nano \
wpa-supplicant \
evtest \
rsync \
coreutils \
wayland wayland-protocols \
foot swaybg swayidle swaylock wlopm sfwbar tofi wtype \
mc \
gdbserver \
"
IMAGE_PREPROCESS_COMMAND += "image_patch;"
image_patch () {
# delete unused kernel image
rm -rf ${IMAGE_ROOTFS}/boot/*
}
# labwc wlr-randr
DISTRO_FEATURES:remove = " wayland gobject-introspection-data "
require base-image.inc

View File

@ -31,7 +31,7 @@ do_install() {
install -m 0755 ${WORKDIR}/boot-to-recovery ${D}/sbin/boot-to-recovery
install -m 0755 ${WORKDIR}/fs_resize ${DEPLOY_DIR_IMAGE}/
cat << EOF >> ${DEPLOY_DIR_IMAGE}/config.txt
cat << EOF > ${DEPLOY_DIR_IMAGE}/config.txt
recovery=false
recovery_image=recovery-${MACHINE}.cpio.gz
console=both

View File

@ -3,6 +3,10 @@
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DESC="Auto deployment configuration from media"
if [ -z "$DISK" ]; then
DISK="mmcblk1"
fi
case "$1" in
start)
echo -n "Start $DESC: "
@ -19,9 +23,9 @@ case "$1" in
fi
if [ -f "/boot/home_partition_should_be_formated" ]; then
echo "Trying to format the home partition"
umount /dev/mmcblk1p4
yes | mkfs.ext4 /dev/mmcblk1p4
mount /dev/mmcblk1p4 /home
umount /dev/${DISK}p4
yes | mkfs.ext4 /dev/${DISK}p4
mount /dev/${DISK}p4 /home
mkdir -p /home/diya
chown -R diya:diya /home/diya
rm /boot/home_partition_should_be_formated

View File

@ -1,20 +1,15 @@
#! /bin/sh
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
if [ -z "$DISK" ]; then
DISK="mmcblk1"
fi
if [ "$(/usr/bin/id -u)" -ne 0 ]; then
echo "$0 shall be run as root"
exit 1
fi
line=$(
sed -e 's/\s*\([\+0-9a-zA-Z]*\).*/\1/' << EOF | fdisk /dev/mmcblk1 | grep /dev/mmcblk1p4
p
q
EOF
)
echo "Partition: $line"
#start_sector=$(echo "$line" | cut -d' ' -f14)
start_sector=$(echo "$line" | cut -d' ' -f15)
start_sector=$(cat /sys/block/$DISK/${DISK}p4/start)
echo "Start sector is: $start_sector"
if [ -z "$start_sector" ]; then
@ -23,7 +18,7 @@ if [ -z "$start_sector" ]; then
fi
echo "Expanding the partition"
sed -e 's/\s*\([\+0-9a-zA-Z]*\).*/\1/' << EOF | fdisk /dev/mmcblk1p4
sed -e 's/\s*\([\+0-9a-zA-Z]*\).*/\1/' << EOF | fdisk /dev/$DISK
d # delete partition
4 # number 4
n # new partition

View File

@ -0,0 +1 @@
GTKBASE_RRECOMMENDS:remove = "adwaita-icon-theme-symbolic"

View File

@ -0,0 +1 @@
PACKAGECONFIG:class-target = "opengl gallium"

View File

@ -0,0 +1,5 @@
# Enable lima and panfrost Mesa drivers
PACKAGECONFIG:append = " lima panfrost"
# Enable KMS renderonly Mesa support
# See https://cgit.freedesktop.org/mesa/mesa/commit/?id=2b780fe89300199f2334539aa1678e9b68f0434f
GALLIUMDRIVERS:append = ",kmsro"

View File

@ -0,0 +1,4 @@
PV = "1.1.0"
SRCREV = "v1.1.0"
INSANE_SKIP:${PN}-dev += "dev-elf"

View File

@ -3,7 +3,7 @@
# Set background color
swaybg -i /etc/xdg/labwc/wpp.jpg >/dev/null 2>&1 &
wlr-randr --output DPI-1 --transform 90
# wlr-randr --output DPI-1 --transform 90
# Configure output directives such as mode, position, scale and transform.
# Use wlr-randr to get your output names
@ -29,10 +29,10 @@ wlr-randr --output DPI-1 --transform 90
# `wlr-randr --output <whatever> --off` because this re-arranges views
# (since a837fef). Instead use a wlr-output-power-management client such as
# https://git.sr.ht/~leon_plickat/wlopm
swayidle -w timeout 60 'wlopm --off DPI-1' resume 'wlopm --on DPI-1' &
#swayidle -w timeout 60 'wlopm --off DPI-1' resume 'wlopm --on DPI-1' &
SFWBAR_CNF="/etc/xdg/sfwbar/sfwbar.config"
if [ -e "$HOME/.config/sfwbar/sfwbar.config" ]; then
SFWBAR_CNF="$HOME/.config/sfwbar/sfwbar.config"
fi
sfwbar -f "$SFWBAR_CNF"
#SFWBAR_CNF="/etc/xdg/sfwbar/sfwbar.config"
#if [ -e "$HOME/.config/sfwbar/sfwbar.config" ]; then
# SFWBAR_CNF="$HOME/.config/sfwbar/sfwbar.config"
#fi
#sfwbar -f "$SFWBAR_CNF"

View File

@ -1,6 +1,7 @@
PACKAGECONFIG:remove = " man-pages xwayland "
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
RRECOMMENDS:${PN} = ""
SRC_URI += " file://autostart \
file://init \
file://environment \