All of lore.kernel.org
 help / color / mirror / Atom feed
* Changing file group from an image recipe
@ 2016-02-26 17:56 Petr Kubizňák
  0 siblings, 0 replies; only message in thread
From: Petr Kubizňák @ 2016-02-26 17:56 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 1402 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1808 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-02-26 17:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-26 17:56 Changing file group from an image recipe Petr Kubizňák

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.