All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Petr Kubizňák" <kubiznak.petr@gmail.com>
To: yocto@yoctoproject.org
Subject: Changing file group from an image recipe
Date: Fri, 26 Feb 2016 18:56:35 +0100	[thread overview]
Message-ID: <CAD+X0UQFHqgJTi-A3aOC7dD_Lb6n6Yz9aen6yA4OdBVHvxpCYw@mail.gmail.com> (raw)

[-- 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 --]

                 reply	other threads:[~2016-02-26 17:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAD+X0UQFHqgJTi-A3aOC7dD_Lb6n6Yz9aen6yA4OdBVHvxpCYw@mail.gmail.com \
    --to=kubiznak.petr@gmail.com \
    --cc=yocto@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.