From daa23c88e6542ba15bd1ad41ac15c5b113b63a56 Mon Sep 17 00:00:00 2001 From: DanyLE Date: Wed, 5 Mar 2025 14:27:12 +0100 Subject: [PATCH] refactor + use gtk4-layer-shell 1.1.0 --- conf/layer.conf | 8 +-- .../u-boot/files/0003-correct-version.patch | 13 ++++ recipes-bsp/u-boot/u-boot-xunlong.bb | 10 +-- recipes-core/base-files/base-files_%.bbappend | 3 + recipes-core/images/base-image.inc | 50 ++++++++++++++ recipes-core/images/core-image-base.bbappend | 28 +++++++- .../images/core-image-minimal.bbappend | 65 +------------------ recipes-diya/diya-overlay/diya-overlay.bb | 2 +- recipes-diya/diya-overlay/files/confd | 10 ++- recipes-diya/diya-overlay/files/expandfs.sh | 19 ++---- recipes-gnome/gtk+/gtk4_%.bbappend | 1 + recipes-graphics/mesa/mesa-gl_%.bbappend | 1 + recipes-graphics/mesa/mesa_%.bbappend | 5 ++ .../gtk4-layer-shell_git.bbappend | 4 ++ recipes-wlroots/labwc/files/autostart | 14 ++-- ...{labwc_%.bbappend_bak => labwc_%.bbappend} | 1 + 16 files changed, 138 insertions(+), 96 deletions(-) create mode 100644 recipes-bsp/u-boot/files/0003-correct-version.patch create mode 100644 recipes-core/images/base-image.inc mode change 120000 => 100644 recipes-core/images/core-image-base.bbappend create mode 100644 recipes-gnome/gtk+/gtk4_%.bbappend create mode 100644 recipes-graphics/mesa/mesa-gl_%.bbappend create mode 100644 recipes-graphics/mesa/mesa_%.bbappend create mode 100644 recipes-gtk/gtk-layer-shell/gtk4-layer-shell_git.bbappend rename recipes-wlroots/labwc/{labwc_%.bbappend_bak => labwc_%.bbappend} (97%) diff --git a/conf/layer.conf b/conf/layer.conf index 9db75bf..01507f1 100644 --- a/conf/layer.conf +++ b/conf/layer.conf @@ -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" \ No newline at end of file +LICENSE_FLAGS_ACCEPTED = "synaptics-killswitch commercial" \ No newline at end of file diff --git a/recipes-bsp/u-boot/files/0003-correct-version.patch b/recipes-bsp/u-boot/files/0003-correct-version.patch new file mode 100644 index 0000000..4737a3b --- /dev/null +++ b/recipes-bsp/u-boot/files/0003-correct-version.patch @@ -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)/.." \ diff --git a/recipes-bsp/u-boot/u-boot-xunlong.bb b/recipes-bsp/u-boot/u-boot-xunlong.bb index b38315e..248068e 100644 --- a/recipes-bsp/u-boot/u-boot-xunlong.bb +++ b/recipes-bsp/u-boot/u-boot-xunlong.bb @@ -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" diff --git a/recipes-core/base-files/base-files_%.bbappend b/recipes-core/base-files/base-files_%.bbappend index 78cc593..380859d 100644 --- a/recipes-core/base-files/base-files_%.bbappend +++ b/recipes-core/base-files/base-files_%.bbappend @@ -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" diff --git a/recipes-core/images/base-image.inc b/recipes-core/images/base-image.inc new file mode 100644 index 0000000..dbfb73b --- /dev/null +++ b/recipes-core/images/base-image.inc @@ -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/* +} \ No newline at end of file diff --git a/recipes-core/images/core-image-base.bbappend b/recipes-core/images/core-image-base.bbappend deleted file mode 120000 index 65e0d4a..0000000 --- a/recipes-core/images/core-image-base.bbappend +++ /dev/null @@ -1 +0,0 @@ -core-image-minimal.bbappend \ No newline at end of file diff --git a/recipes-core/images/core-image-base.bbappend b/recipes-core/images/core-image-base.bbappend new file mode 100644 index 0000000..66190dc --- /dev/null +++ b/recipes-core/images/core-image-base.bbappend @@ -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 \ No newline at end of file diff --git a/recipes-core/images/core-image-minimal.bbappend b/recipes-core/images/core-image-minimal.bbappend index ba3f09c..28bc2d6 100644 --- a/recipes-core/images/core-image-minimal.bbappend +++ b/recipes-core/images/core-image-minimal.bbappend @@ -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 \ No newline at end of file +DISTRO_FEATURES:remove = " wayland gobject-introspection-data " +require base-image.inc diff --git a/recipes-diya/diya-overlay/diya-overlay.bb b/recipes-diya/diya-overlay/diya-overlay.bb index 2d431a8..5ec8448 100644 --- a/recipes-diya/diya-overlay/diya-overlay.bb +++ b/recipes-diya/diya-overlay/diya-overlay.bb @@ -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 diff --git a/recipes-diya/diya-overlay/files/confd b/recipes-diya/diya-overlay/files/confd index b969dd6..08d72f8 100644 --- a/recipes-diya/diya-overlay/files/confd +++ b/recipes-diya/diya-overlay/files/confd @@ -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 diff --git a/recipes-diya/diya-overlay/files/expandfs.sh b/recipes-diya/diya-overlay/files/expandfs.sh index f4ef5df..791a870 100644 --- a/recipes-diya/diya-overlay/files/expandfs.sh +++ b/recipes-diya/diya-overlay/files/expandfs.sh @@ -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 diff --git a/recipes-gnome/gtk+/gtk4_%.bbappend b/recipes-gnome/gtk+/gtk4_%.bbappend new file mode 100644 index 0000000..fb387e6 --- /dev/null +++ b/recipes-gnome/gtk+/gtk4_%.bbappend @@ -0,0 +1 @@ +GTKBASE_RRECOMMENDS:remove = "adwaita-icon-theme-symbolic" diff --git a/recipes-graphics/mesa/mesa-gl_%.bbappend b/recipes-graphics/mesa/mesa-gl_%.bbappend new file mode 100644 index 0000000..6b84baf --- /dev/null +++ b/recipes-graphics/mesa/mesa-gl_%.bbappend @@ -0,0 +1 @@ +PACKAGECONFIG:class-target = "opengl gallium" diff --git a/recipes-graphics/mesa/mesa_%.bbappend b/recipes-graphics/mesa/mesa_%.bbappend new file mode 100644 index 0000000..f2dfc23 --- /dev/null +++ b/recipes-graphics/mesa/mesa_%.bbappend @@ -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" diff --git a/recipes-gtk/gtk-layer-shell/gtk4-layer-shell_git.bbappend b/recipes-gtk/gtk-layer-shell/gtk4-layer-shell_git.bbappend new file mode 100644 index 0000000..860f492 --- /dev/null +++ b/recipes-gtk/gtk-layer-shell/gtk4-layer-shell_git.bbappend @@ -0,0 +1,4 @@ +PV = "1.1.0" +SRCREV = "v1.1.0" + +INSANE_SKIP:${PN}-dev += "dev-elf" \ No newline at end of file diff --git a/recipes-wlroots/labwc/files/autostart b/recipes-wlroots/labwc/files/autostart index d005d5d..5b76448 100644 --- a/recipes-wlroots/labwc/files/autostart +++ b/recipes-wlroots/labwc/files/autostart @@ -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 --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" diff --git a/recipes-wlroots/labwc/labwc_%.bbappend_bak b/recipes-wlroots/labwc/labwc_%.bbappend similarity index 97% rename from recipes-wlroots/labwc/labwc_%.bbappend_bak rename to recipes-wlroots/labwc/labwc_%.bbappend index eb415f4..49eaf49 100644 --- a/recipes-wlroots/labwc/labwc_%.bbappend_bak +++ b/recipes-wlroots/labwc/labwc_%.bbappend @@ -1,6 +1,7 @@ PACKAGECONFIG:remove = " man-pages xwayland " FILESEXTRAPATHS:prepend := "${THISDIR}/files:" +RRECOMMENDS:${PN} = "" SRC_URI += " file://autostart \ file://init \ file://environment \