From 839e0d4ebb2dc474912ab651be83132d9eeea97a Mon Sep 17 00:00:00 2001 From: Francisco Gil Date: Fri, 14 Feb 2025 10:06:06 +0100 Subject: [PATCH] meta-digi: update home path to "/root" in our recipes Due to a change in systemd the default home directory is now "/root". Modify our recipes to match with this change. Signed-off-by: Francisco Gil --- meta-digi-arm/conf/machine/include/digi-defaults.inc | 5 +++++ .../recipes-graphics/wayland/weston-init.bbappend | 6 +++--- .../wayland/weston-init/weston-launch.service | 4 ++-- ...3-semantic-segmentation-adapt-sample-for-root-user.patch | 6 +++--- meta-digi-dey/recipes-digi/cccs/cccs_git.bb | 2 +- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/meta-digi-arm/conf/machine/include/digi-defaults.inc b/meta-digi-arm/conf/machine/include/digi-defaults.inc index dfbbd8926..9bcbdcaae 100644 --- a/meta-digi-arm/conf/machine/include/digi-defaults.inc +++ b/meta-digi-arm/conf/machine/include/digi-defaults.inc @@ -110,3 +110,8 @@ CCCS_PKGS ?= "cccs-gs-demo dey-examples-cccs" # Default 1k-bloks seek in boot partition. BOOTLOADER_SEEK_BOOTPART ?= "0" + +# Default all platforms to use /root as the home root folder. +# This is otherwise forced by systemd because of hard-coded paths +# in systemd source code. +ROOT_HOME ?= "/root" \ No newline at end of file diff --git a/meta-digi-arm/dynamic-layers/stm-st-stm32mp/recipes-graphics/wayland/weston-init.bbappend b/meta-digi-arm/dynamic-layers/stm-st-stm32mp/recipes-graphics/wayland/weston-init.bbappend index ec5918c65..66d559b92 100644 --- a/meta-digi-arm/dynamic-layers/stm-st-stm32mp/recipes-graphics/wayland/weston-init.bbappend +++ b/meta-digi-arm/dynamic-layers/stm-st-stm32mp/recipes-graphics/wayland/weston-init.bbappend @@ -25,7 +25,7 @@ FILES:${PN} += " ${datadir}/weston \ ${sysconfdir}/etc/default \ ${sysconfdir}/etc/profile.d \ ${sysconfdir}/xdg/weston/weston.ini \ - /home/root \ + ${ROOT_HOME} \ ${systemd_user_unitdir} \ ${systemd_system_unitdir} \ " @@ -78,8 +78,8 @@ do_install() { echo "WESTON_USER=root" > ${D}${sysconfdir}/default/weston # check GPU - install -d ${D}/home/root/ - install -m 644 ${WORKDIR}/README-CHECK-GPU ${D}/home/root/ + install -d ${D}${ROOT_HOME} + install -m 644 ${WORKDIR}/README-CHECK-GPU ${D}${ROOT_HOME} if ! test -f ${D}${base_sbindir}/check-gpu; then install -d ${D}${base_sbindir} echo '#!/bin/sh' > ${WORKDIR}/check-gpu.empty diff --git a/meta-digi-arm/dynamic-layers/stm-st-stm32mp/recipes-graphics/wayland/weston-init/weston-launch.service b/meta-digi-arm/dynamic-layers/stm-st-stm32mp/recipes-graphics/wayland/weston-init/weston-launch.service index 2133a8c19..6bf0df480 100644 --- a/meta-digi-arm/dynamic-layers/stm-st-stm32mp/recipes-graphics/wayland/weston-init/weston-launch.service +++ b/meta-digi-arm/dynamic-layers/stm-st-stm32mp/recipes-graphics/wayland/weston-init/weston-launch.service @@ -30,7 +30,7 @@ ConditionPathExists=/dev/tty0 # Requires systemd-notify.so Weston plugin. #Type=notify EnvironmentFile=-/etc/default/weston -Environment="XDG_RUNTIME_DIR=/home/root" +Environment="XDG_RUNTIME_DIR=%h" Environment="WESTON_USER=root" Environment="WL_EGL_GBM_FENCE=0" #ExecStart=/usr/bin/weston-launch -- --modules=systemd-notify.so --log=/tmp/weston.log $OPTARGS @@ -46,7 +46,7 @@ User=root Group=root # Make sure the working directory is the users home directory -WorkingDirectory=/home/root +WorkingDirectory=%h # Set up a full user session for the user, required by Weston. PAMName=weston-autologin diff --git a/meta-digi-dey/dynamic-layers/x-linux-ai/recipes-samples/semantic-segmentation/files/patches/0003-semantic-segmentation-adapt-sample-for-root-user.patch b/meta-digi-dey/dynamic-layers/x-linux-ai/recipes-samples/semantic-segmentation/files/patches/0003-semantic-segmentation-adapt-sample-for-root-user.patch index 7a372b7a5..667984b98 100644 --- a/meta-digi-dey/dynamic-layers/x-linux-ai/recipes-samples/semantic-segmentation/files/patches/0003-semantic-segmentation-adapt-sample-for-root-user.patch +++ b/meta-digi-dey/dynamic-layers/x-linux-ai/recipes-samples/semantic-segmentation/files/patches/0003-semantic-segmentation-adapt-sample-for-root-user.patch @@ -16,11 +16,11 @@ index 35b8bea..68d554b 100644 img = img.resize(size) img_alpha = img.copy() - img_alpha.save("/home/weston/bitmap.png","PNG") -+ img_alpha.save("/home/root/bitmap.png","PNG") ++ img_alpha.save(os.path.join(os.path.expanduser("~"), "bitmap.png"), "PNG") #load the bitmap to display it as overlay - pixbuf = GdkPixbuf.Pixbuf.new_from_file('/home/weston/bitmap.png') -+ pixbuf = GdkPixbuf.Pixbuf.new_from_file('/home/root/bitmap.png') ++ pixbuf = GdkPixbuf.Pixbuf.new_from_file(os.path.join(os.path.expanduser("~"), "bitmap.png")) img = Gdk.cairo_set_source_pixbuf(cr, pixbuf.copy(),int(offset), int(vertical_offset)) cr.paint() if (self.app.enable_camera_preview == False): @@ -29,7 +29,7 @@ index 35b8bea..68d554b 100644 #remove bitmap.png file before closing app file = 'bitmap.png' - location = "/home/weston" -+ location = "/home/root" ++ location = os.path.expanduser("~") path = os.path.join(location,file) os.remove(path) print("gtk main finished") diff --git a/meta-digi-dey/recipes-digi/cccs/cccs_git.bb b/meta-digi-dey/recipes-digi/cccs/cccs_git.bb index 90ff757f7..461eda8d7 100644 --- a/meta-digi-dey/recipes-digi/cccs/cccs_git.bb +++ b/meta-digi-dey/recipes-digi/cccs/cccs_git.bb @@ -91,7 +91,7 @@ do_install:append:ccimx6ul() { pkg_postinst_ontarget:${PN}-daemon() { # If dualboot is enabled, change the CCCSD download path and set on the fly to yes on the first boot if [ "$(fw_printenv -n dualboot 2>/dev/null)" = "yes" ]; then - sed -i "/firmware_download_path = \/mnt\/update/c\firmware_download_path = \/home\/root" /etc/cccs.conf + sed -i "/firmware_download_path = \/mnt\/update/c\firmware_download_path = %h" /etc/cccs.conf sed -i "/on_the_fly = false/c\on_the_fly = true" /etc/cccs.conf fi }