Skip to content

Commit

Permalink
weston-init: Add --system for useradd
Browse files Browse the repository at this point in the history
Add --system parameter for useradd to avoid intruducing .bashrc
and .profile under home dir to fix the below error.
 $ bitbake core-image-weston
| DEBUG: Executing python function set_image_size
| DEBUG: 352679.600000 = 271292 * 1.300000
| DEBUG: 455079.600000 = max(352679.600000, 65536)[352679.600000] + 102400
| DEBUG: 455080.000000 = int(455079.600000)
| DEBUG: 455080 = aligned(455080)
| DEBUG: returning 455080
| DEBUG: Python function set_image_size finished
| DEBUG: Executing shell function do_image_tar
| tar: ./home/weston/.bashrc: Unknown file type; file ignored
| tar: ./home/weston/.profile: Unknown file type; file ignored
| tar: Exiting with failure status due to previous errors
| WARNING: /buildarea1/test/yocto/builds/poky-build-weston/tmp/work/qemux86_64-poky-linux/core-image-weston/1.0/temp/run.do_image_tar.1972897:150 exit 1 from '[ $? -eq 1 ]'
| WARNING: Backtrace (BB generated script):
    #1: do_image_tar, /buildarea1/test/yocto/builds/poky-build-weston/tmp/work/qemux86_64-poky-linux/core-image-weston/1.0/temp/run.do_image_tar.1972897, line 150
    #2: main, /buildarea1/test/yocto/builds/poky-build-weston/tmp/work/qemux86_64-poky-linux/core-image-weston/1.0/temp/run.do_image_tar.1972897, line 156
| DEBUG: Python function extend_recipe_sysroot finished
| DEBUG: Executing python function set_image_size
| DEBUG: 352679.600000 = 271292 * 1.300000
| DEBUG: 455079.600000 = max(352679.600000, 65536)[352679.600000] + 102400
| DEBUG: 455080.000000 = int(455079.600000)
| DEBUG: 455080 = aligned(455080)
| DEBUG: returning 455080
| DEBUG: Python function set_image_size finished
| DEBUG: Executing shell function do_image_ext4
| DEBUG: Executing dd if=/dev/zero of=/buildarea1/test/yocto/builds/poky-build-weston/tmp/work/qemux86_64-poky-linux/core-image-weston/1.0/deploy-core-image-weston-image-complete/core-image-weston-qemux86-64.rootfs-20240315032140.ext4 seek=455080 count=0 bs=1024
| 0+0 records in
| 0+0 records out
| 0 bytes copied, 0.00136946 s, 0.0 kB/s
| DEBUG: Actual Rootfs size:  268184    /buildarea1/test/yocto/builds/poky-build-weston/tmp/work/qemux86_64-poky-linux/core-image-weston/1.0/rootfs
| DEBUG: Actual Partition size: 466001920
| DEBUG: Executing mkfs.ext4 -F -i 4096 /buildarea1/test/yocto/builds/poky-build-weston/tmp/work/qemux86_64-poky-linux/core-image-weston/1.0/deploy-core-image-weston-image-complete/core-image-weston-qemux86-64.rootfs-20240315032140.ext4 -d /buildarea1/test/yocto/builds/poky-build-weston/tmp/work/qemux86_64-poky-linux/core-image-weston/1.0/rootfs
| mke2fs 1.47.0 (5-Feb-2023)
| Discarding device blocks: done
| Creating filesystem with 455080 1k blocks and 113792 inodes
| Filesystem UUID: 2031373e-63cd-4711-968b-4023ff7d6a90
| Superblock backups stored on blocks:
|   8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409
|
| Allocating group tables: done
| Writing inode tables: done
| Creating journal (8192 blocks): done
| Copying files into the device: __populate_fs: ignoring entry ".bashrc"
| .bashrc: File not found by ext2_lookup while looking up ".bashrc"
| mkfs.ext4: File not found by ext2_lookup while populating file system
| WARNING: /buildarea1/test/yocto/builds/poky-build-weston/tmp/work/qemux86_64-poky-linux/core-image-weston/1.0/temp/run.do_image_ext4.1972895:178 exit 1 from 'mkfs.$fstype -F $extra_imagecmd /buildarea1/test/yocto/builds/poky-build-weston/tmp/work/qemux86_64-poky-linux/core-image-weston/1.0/deploy-core-image-weston-image-complete/core-image-weston-qemux86-64.rootfs-20240315032140.$fstype -d /buildarea1/test/yocto/builds/poky-build-weston/tmp/work/qemux86_64-poky-linux/core-image-weston/1.0/rootfs'
| WARNING: Backtrace (BB generated script):
|   #1: oe_mkext234fs, /buildarea1/test/yocto/builds/poky-build-weston/tmp/work/qemux86_64-poky-linux/core-image-weston/1.0/temp/run.do_image_ext4.1972895, line 178
|   #2: do_image_ext4, /buildarea1/test/yocto/builds/poky-build-weston/tmp/work/qemux86_64-poky-linux/core-image-weston/1.0/temp/run.do_image_ext4.1972895, line 150
|   #3: main, /buildarea1/test/yocto/builds/poky-build-weston/tmp/work/qemux86_64-poky-linux/core-image-weston/1.0/temp/run.do_image_ext4.1972895, line 215
ERROR: Task (/buildarea1/test/yocto/poky/meta/recipes-graphics/images/core-image-weston.bb:do_image_ext4) failed with exit code '1'

Before the patch:
$ ls -a tmp/work/qemux86_64-poky-linux/core-image-weston/1.0/rootfs/home/weston/
.  ..  .bashrc  .profile

After the patch:
$ ls -a tmp/work/qemux86_64-poky-linux/core-image-weston/1.0/rootfs/home/weston/
.  ..

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
  • Loading branch information
Mingli Yu authored and rpurdie committed Mar 16, 2024
1 parent 4502314 commit ca64708
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion meta/recipes-graphics/wayland/weston-init.bb
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,6 @@ FILES:${PN} += "\
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,render,wayland weston"
USERADD_PARAM:${PN} = "--system --home /home/weston --shell /bin/sh --user-group -G video,input,render,wayland weston"
GROUPADD_PARAM:${PN} = "-r wayland; -r render"

0 comments on commit ca64708

Please sign in to comment.