i an use yocto 4.0.18
my bb files is poky/meta/recipes-graphics/wayland/weston-init.bb
SUMMARY = "Startup script and systemd unit file for the Weston Wayland compositor"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
PACKAGE_ARCH = "${MACHINE_ARCH}"
SRC_URI = "file://init
file://weston.env
file://weston.ini
file://weston.service
file://weston.socket
file://weston-autologin
file://weston-start"
S = "${WORKDIR}"
PACKAGECONFIG ??= ""
PACKAGECONFIG:append:qemuriscv64 = " use-pixman"
PACKAGECONFIG:append:qemuppc64 = " use-pixman"
PACKAGECONFIG[no-idle-timeout] = ",,"
PACKAGECONFIG[use-pixman] = ",,"
DEFAULTBACKEND ??= ""
DEFAULTBACKEND:qemuall ?= "drm"
do_install() {
if [ "${VIRTUAL-RUNTIME_init_manager}" != "systemd" ]; then
install -Dm755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/weston
sed -i 's#ROOTHOME#${ROOT_HOME}#' ${D}/${sysconfdir}/init.d/weston
fi
install -D -p -m0644 ${WORKDIR}/weston.ini ${D}${sysconfdir}/xdg/weston/weston.ini
install -Dm644 ${WORKDIR}/weston.env ${D}${sysconfdir}/default/weston
# Install Weston systemd service and accompanying udev rule
install -D -p -m0644 ${WORKDIR}/weston.service ${D}${systemd_system_unitdir}/weston.service
install -D -p -m0644 ${WORKDIR}/weston.socket ${D}${systemd_system_unitdir}/weston.socket
if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then
install -D -p -m0644 ${WORKDIR}/weston-autologin ${D}${sysconfdir}/pam.d/weston-autologin
fi
sed -i -e s:/etc:${sysconfdir}:g
-e s:/usr/bin:${bindir}:g
-e s:/var:${localstatedir}:g
${D}${systemd_system_unitdir}/weston.service
# Install weston-start script
install -Dm755 ${WORKDIR}/weston-start ${D}${bindir}/weston-start
sed -i 's,@DATADIR@,${datadir},g' ${D}${bindir}/weston-start
sed -i 's,@LOCALSTATEDIR@,${localstatedir},g' ${D}${bindir}/weston-start
if [ -n "${DEFAULTBACKEND}" ]; then
sed -i -e "/^[core]/a backend=${DEFAULTBACKEND}-backend.so" ${D}${sysconfdir}/xdg/weston/weston.ini
fi
if [ "${@bb.utils.contains('PACKAGECONFIG', 'no-idle-timeout', 'yes', 'no', d)}" = "yes" ]; then
sed -i -e "/^[core]/a idle-time=0" ${D}${sysconfdir}/xdg/weston/weston.ini
fi
if [ "${@bb.utils.contains('PACKAGECONFIG', 'use-pixman', 'yes', 'no', d)}" = "yes" ]; then
sed -i -e "/^[core]/a use-pixman=true" ${D}${sysconfdir}/xdg/weston/weston.ini
fi
install -dm 755 -o weston -g weston ${D}/home/weston
}
INHIBIT_UPDATERCD_BBCLASS = "${@oe.utils.conditional('VIRTUAL-RUNTIME_init_manager', 'systemd', '1', '', d)}"
inherit update-rc.d systemd useradd
USERADD_PACKAGES = "${PN}"
# rdepends on weston which depends on virtual/egl
#
require ${THISDIR}/required-distro-features.inc
RDEPENDS:${PN} = "weston kbd"
INITSCRIPT_NAME = "weston"
INITSCRIPT_PARAMS = "start 9 5 2 . stop 20 0 1 6 ."
FILES:${PN} += "
${sysconfdir}/xdg/weston/weston.ini
${systemd_system_unitdir}/weston.service
${systemd_system_unitdir}/weston.socket
${sysconfdir}/default/weston
${sysconfdir}/pam.d/
/home/weston
"
CONFFILES:${PN} += "${sysconfdir}/xdg/weston/weston.ini ${sysconfdir}/default/weston"
SYSTEMD_SERVICE:${PN} = "weston.service weston.socket"
USERADD_PARAM:${PN} = "--home /home/weston --shell /bin/sh --user-group -G video,input weston"
GROUPADD_PARAM:${PN} = "-r wayland;"
but there is no input group,so the error log is :
Running scriptlet: weston-init-1.0-r0.sl1640 441/558
%prein(weston-init-1.0-r0.sl1640): scriptlet start
%prein(weston-init-1.0-r0.sl1640): execv(/bin/sh) pid 3523376
+ set -e
+ OPT=
+ SYSROOT=
+ test x/home/sunqian/sl16x0/sdk/build-sl1640/tmp/work/sl1640-poky-linux/astra-ubuntu/1.0-r0/rootfs '!=' x
+ SYSROOT=/home/sunqian/sl16x0/sdk/build-sl1640/tmp/work/sl1640-poky-linux/astra-ubuntu/1.0-r0/rootfs
+ OPT='--root /home/sunqian/sl16x0/sdk/build-sl1640/tmp/work/sl1640-poky-linux/astra-ubuntu/1.0-r0/rootfs'
+ '[' '!' -e /home/sunqian/sl16x0/sdk/build-sl1640/tmp/work/sl1640-poky-linux/astra-ubuntu/1.0-r0/rootfs/etc/login.defs -a -e /home/sunqian/sl16x0/sdk/build-sl1640/tmp/work/sl1640-poky-linux/astra-ubuntu/1.0-r0/rootfs/etc/login.defs.dpkg-new ']'
+ export PSEUDO_PASSWD=/home/sunqian/sl16x0/sdk/build-sl1640/tmp/work/sl1640-poky-linux/astra-ubuntu/1.0-r0/rootfs
+ PSEUDO_PASSWD=/home/sunqian/sl16x0/sdk/build-sl1640/tmp/work/sl1640-poky-linux/astra-ubuntu/1.0-r0/rootfs
+ test x = x
+ GROUPADD_PARAM='-r wayland;'
+ USERADD_PARAM='--home /home/weston --shell /bin/sh --user-group -G video,input weston'
+ GROUPMEMS_PARAM=
++ tr -d '[:space:]'
++ echo -r 'wayland;'
+ test 'x-rwayland;' '!=' x
+ echo 'Running groupadd commands...'
Running groupadd commands...
++ cut -d ';' -f 1
++ sed -e 's#[ t]*$##'
++ echo '-r wayland;'
+ opts='-r wayland'
++ echo '-r wayland;'
++ cut -d ';' -f 2-
++ sed -e 's#[ t]*$##'
+ remaining=
+ test 'x-r wayland' '!=' x
+ perform_groupadd /home/sunqian/sl16x0/sdk/build-sl1640/tmp/work/sl1640-poky-linux/astra-ubuntu/1.0-r0/rootfs '--root /home/sunqian/sl16x0/sdk/build-sl1640/tmp/work/sl1640-poky-linux/astra-ubuntu/1.0-r0/rootfs -r wayland'
+ local rootdir=/home/sunqian/sl16x0/sdk/build-sl1640/tmp/work/sl1640-poky-linux/astra-ubuntu/1.0-r0/rootfs
+ local 'opts=--root /home/sunqian/sl16x0/sdk/build-sl1640/tmp/work/sl1640-poky-linux/astra-ubuntu/1.0-r0/rootfs -r wayland'
+ bbnote 'weston-init: Performing groupadd with [--root /home/sunqian/sl16x0/sdk/build-sl1640/tmp/work/sl1640-poky-linux/astra-ubuntu/1.0-r0/rootfs -r wayland]'
+ echo 'NOTE: weston-init: Performing groupadd with [--root /home/sunqian/sl16x0/sdk/build-sl1640/tmp/work/sl1640-poky-linux/astra-ubuntu/1.0-r0/rootfs -r wayland]'
NOTE: weston-init: Performing groupadd with [--root /home/sunqian/sl16x0/sdk/build-sl1640/tmp/work/sl1640-poky-linux/astra-ubuntu/1.0-r0/rootfs -r wayland]
++ echo '--root /home/sunqian/sl16x0/sdk/build-sl1640/tmp/work/sl1640-poky-linux/astra-ubuntu/1.0-r0/rootfs -r wayland'
++ awk '{ print $NF }'
+ local groupname=wayland
++ grep '^wayland:' /home/sunqian/sl16x0/sdk/build-sl1640/tmp/work/sl1640-poky-linux/astra-ubuntu/1.0-r0/rootfs/etc/group
++ true
+ local group_exists=
+ test x = x
+ eval flock -x /home/sunqian/sl16x0/sdk/build-sl1640/tmp/work/sl1640-poky-linux/astra-ubuntu/1.0-r0/rootfs/etc -c '"' groupadd '$opts"'
++ flock -x /home/sunqian/sl16x0/sdk/build-sl1640/tmp/work/sl1640-poky-linux/astra-ubuntu/1.0-r0/rootfs/etc -c ' groupadd --root /home/sunqian/sl16x0/sdk/build-sl1640/tmp/work/sl1640-poky-linux/astra-ubuntu/1.0-r0/rootfs -r wayland'
configuration error - unknown item 'SYSLOG_SU_ENAB' (notify administrator)
configuration error - unknown item 'SYSLOG_SG_ENAB' (notify administrator)
++ grep '^wayland:' /home/sunqian/sl16x0/sdk/build-sl1640/tmp/work/sl1640-poky-linux/astra-ubuntu/1.0-r0/rootfs/etc/group
+ group_exists=wayland:x:992:
+ test xwayland:x:992: = x
+ test 'x-r wayland' = x
++ cut -d ';' -f 1
++ echo ''
++ sed -e 's#[ t]*$##'
+ opts=
++ echo ''
++ cut -d ';' -f 2-
++ sed -e 's#[ t]*$##'
+ remaining=
+ test x '!=' x
++ tr -d '[:space:]'
++ echo --home /home/weston --shell /bin/sh --user-group -G video,input weston
+ test x--home/home/weston--shell/bin/sh--user-group-Gvideo,inputweston '!=' x
+ echo 'Running useradd commands...'
Running useradd commands...
++ echo '--home /home/weston --shell /bin/sh --user-group -G video,input weston'
++ cut -d ';' -f 1
++ sed -e 's#[ t]*$##'
+ opts='--home /home/weston --shell /bin/sh --user-group -G video,input weston'
++ cut -d ';' -f 2-
++ echo '--home /home/weston --shell /bin/sh --user-group -G video,input weston'
++ sed -e 's#[ t]*$##'
+ remaining='--home /home/weston --shell /bin/sh --user-group -G video,input weston'
+ test 'x--home /home/weston --shell /bin/sh --user-group -G video,input weston' '!=' x
+ perform_useradd /home/sunqian/sl16x0/sdk/build-sl1640/tmp/work/sl1640-poky-linux/astra-ubuntu/1.0-r0/rootfs '--root /home/sunqian/sl16x0/sdk/build-sl1640/tmp/work/sl1640-poky-linux/astra-ubuntu/1.0-r0/rootfs --home /home/weston --shell /bin/sh --user-group -G video,input weston'
+ local rootdir=/home/sunqian/sl16x0/sdk/build-sl1640/tmp/work/sl1640-poky-linux/astra-ubuntu/1.0-r0/rootfs
+ local 'opts=--root /home/sunqian/sl16x0/sdk/build-sl1640/tmp/work/sl1640-poky-linux/astra-ubuntu/1.0-r0/rootfs --home /home/weston --shell /bin/sh --user-group -G video,input weston'
+ bbnote 'weston-init: Performing useradd with [--root /home/sunqian/sl16x0/sdk/build-sl1640/tmp/work/sl1640-poky-linux/astra-ubuntu/1.0-r0/rootfs --home /home/weston --shell /bin/sh --user-group -G video,input weston]'
+ echo 'NOTE: weston-init: Performing useradd with [--root /home/sunqian/sl16x0/sdk/build-sl1640/tmp/work/sl1640-poky-linux/astra-ubuntu/1.0-r0/rootfs --home /home/weston --shell /bin/sh --user-group -G video,input weston]'
NOTE: weston-init: Performing useradd with [--root /home/sunqian/sl16x0/sdk/build-sl1640/tmp/work/sl1640-poky-linux/astra-ubuntu/1.0-r0/rootfs --home /home/weston --shell /bin/sh --user-group -G video,input weston]
++ echo '--root /home/sunqian/sl16x0/sdk/build-sl1640/tmp/work/sl1640-poky-linux/astra-ubuntu/1.0-r0/rootfs --home /home/weston --shell /bin/sh --user-group -G video,input weston'
++ awk '{ print $NF }'
+ local username=weston
++ grep '^weston:' /home/sunqian/sl16x0/sdk/build-sl1640/tmp/work/sl1640-poky-linux/astra-ubuntu/1.0-r0/rootfs/etc/passwd
++ true
+ local user_exists=
+ test x = x
+ eval flock -x /home/sunqian/sl16x0/sdk/build-sl1640/tmp/work/sl1640-poky-linux/astra-ubuntu/1.0-r0/rootfs/etc -c '"' useradd '$opts"'
++ flock -x /home/sunqian/sl16x0/sdk/build-sl1640/tmp/work/sl1640-poky-linux/astra-ubuntu/1.0-r0/rootfs/etc -c ' useradd --root /home/sunqian/sl16x0/sdk/build-sl1640/tmp/work/sl1640-poky-linux/astra-ubuntu/1.0-r0/rootfs --home /home/weston --shell /bin/sh --user-group -G video,input weston'
configuration error - unknown item 'SYSLOG_SU_ENAB' (notify administrator)
configuration error - unknown item 'SYSLOG_SG_ENAB' (notify administrator)
**useradd: group 'input' does not exist**
+ true
++ grep '^weston:' /home/sunqian/sl16x0/sdk/build-sl1640/tmp/work/sl1640-poky-linux/astra-ubuntu/1.0-r0/rootfs/etc/passwd
++ true
+ user_exists=
+ test x = x
+ bbfatal 'weston-init: useradd command did not succeed.'
+ echo 'ERROR: weston-init: useradd command did not succeed.'
ERROR: weston-init: useradd command did not succeed.
+ exit 1
%prein(weston-init-1.0-r0.sl1640): waitpid(3523376) rc 3523376 status 100
error: %prein(weston-init-1.0-r0.sl1640) scriptlet failed, exit status 1
i tried to GROUPADD_PARAM:${PN} = "-r wayland;-r input;"
used to add groups,but it’s not worked,the build report error;
how to added multiple groups at one bb files?
i just want to create a input group before useradd
New contributor
jason is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.