All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: SIMON BABY <simonkbaby@gmail.com>, yocto@lists.yoctoproject.org
Subject: Re: [yocto] error when try to use sudo command in recipe
Date: Sun, 05 Feb 2023 09:54:17 +0000	[thread overview]
Message-ID: <efae481688d50d97920bc1e8471427a75bc9d6fd.camel@linuxfoundation.org> (raw)
In-Reply-To: <32073.1675570518496655471@lists.yoctoproject.org>

On Sat, 2023-02-04 at 20:15 -0800, SIMON BABY wrote:
> Hi Richard,
> Thank you for the reply.
>  I was trying to add the
> layer https://github.com/savoirfairelinux/meta-embedded-containers in
> my yocto build. Below recipe uses sudo commands. 
> 
> https://github.com/savoirfairelinux/meta-embedded-containers/blob/b131baa90291c159d3a725b8d66786c85964556c/recipes-support/container-image/container-image.bb
> 
> while building it fails at sudo command and getting the error below.
> 
> sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit
> set

I don't see anything in there which runs that task under
fakeroot/pseudo. Are you building this within some kind of container
and/or under something like kas? The error suggests that sudo has been
restricted somehow but I don't think it is bitbake doing it.

I'd point out that do_pull_image task has at least three problems I
spotted at a quick glance:

a) It will kill *any* dockerd process on the system so it can't run in
parallel with any other build

b) The "sleep 5" tells you it is likely to suffer races

c) Using sudo within recipes is considered a bad practise and will
require setup of the right privlegdes to work properly

Cheers,

Richard






  parent reply	other threads:[~2023-02-05  9:54 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-03 22:08 error when try to use sudo command in recipe SIMON BABY
2023-02-04 11:09 ` [yocto] " Richard Purdie
2023-02-05  4:15   ` SIMON BABY
2023-02-05  7:38     ` [yocto] " Alexander Kanavin
2023-02-05 16:23       ` SIMON BABY
2023-02-05 16:43         ` [yocto] " Alexander Kanavin
2023-02-05  9:54     ` Richard Purdie [this message]
2023-02-05 16:44       ` SIMON BABY
2023-02-05 17:08         ` [yocto] " Richard Purdie
2023-02-06  0:00           ` SIMON BABY
2023-02-06  0:13             ` [yocto] " Richard Purdie
2023-02-06  0:31               ` SIMON BABY
2023-02-06  1:05                 ` SIMON BABY
2023-02-06  4:08                   ` SIMON BABY
2023-04-03  7:24               ` adrian.dudau
2023-04-03 14:57                 ` [yocto] " Khem Raj
2023-04-03 15:42                   ` Adrian Dudau
2023-04-03 15:59                     ` Bruce Ashfield
2023-04-04  7:59                       ` Adrian Dudau
2023-04-04 10:02                         ` Chen, Qi
     [not found]                         ` <1752B31EC9C28A4E.3578@lists.yoctoproject.org>
2023-04-05 16:17                           ` Chen, Qi
2023-04-13  7:08                             ` Adrian Dudau
2023-02-09 18:45             ` SIMON BABY
2023-02-09 18:54               ` Alexander Kanavin
2023-02-10  7:46               ` adrian.freihofer
2023-02-10 21:09                 ` SIMON BABY

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=efae481688d50d97920bc1e8471427a75bc9d6fd.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=simonkbaby@gmail.com \
    --cc=yocto@lists.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.