[yocto] Changing file group from an image recipe
Petr Kubizňák
kubiznak.petr at gmail.com
Fri Feb 26 09:56:35 PST 2016
In dizzy, I have a problem with changing a file group from an image recipe.
I create a user admin from an application recipe, say app.bb:
...
inherit pkgconfig cmake update-rc.d useradd
USERADD_PACKAGES = "${PN}"
USERADD_PARAM_${PN} = "admin"
...
Creating the user works fine. Now I need to grant the admin user rights to
reboot the system. I tested I need to change the group ownership of
/sbin/halt.sysvinit and move "/sbin/reboot" from /etc/busybox.links.nosuid
to /etc/busybox.links.suid. So I do the following in the image recipe, say
myimage.bb:
...
inherit core-image
ROOTFS_POSTPROCESS_COMMAND += "set_admin_rights;"
set_admin_rights () {
# admin needs to be able to reboot the system
echo /sbin/reboot >> ${IMAGE_ROOTFS}/${sysconfdir}/busybox.links.suid
sed -i '/\/sbin\/reboot/d'
${IMAGE_ROOTFS}/${sysconfdir}/busybox.links.nosuid
chgrp admin ${IMAGE_ROOTFS}/sbin/halt.sysvinit
}
Anyway, this does not work, and I get the following output during bitbaking:
WARNING: log_check: warning: group admin does not exist - using root
It looks like the myimage.bb recipe does not know about the created admin
user, even though it is known in app.bb and changing some files' group
locally in that recipe works as expected.
Can someone please suggest how to properly change the group, or how to
achieve required functionality more elegantly?
Thanks, Petr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20160226/fb6f7f68/attachment.html>
More information about the yocto
mailing list