Openembedded Devel Discussions
 help / color / mirror / Atom feed
From: Michael Smith <msmith@cbnco.com>
To: openembedded-devel@lists.openembedded.org
Subject: Re: Create dir with 700 permissions from recipe
Date: Tue, 18 Aug 2009 10:33:12 -0400	[thread overview]
Message-ID: <4A8ABBA8.8030504@cbnco.com> (raw)
In-Reply-To: <6978a1740908180652y36467f0evcfc467153cf9ac64@mail.gmail.com>

s hakkesteegt wrote:

> For a recipe I want to use locally to enable public key authentication on my
> images, I'm trying to create the .ssh dir with 700 permissions. But this
> doesn't seem to work. It ends up in the rootfs and in the ipk with 775
> permissions, although in the work dir it has the correct 700 permissions.

Hi Siebren,

Try adding something like this to your recipe:

python populate_packages_append () {
         # Non-empty directory permissions don't get preserved by the
         # normal populate process.
         def dirperm_hack(d):
                 pkgdest = bb.data.getVar('PKGDEST', d, 1)
                 pn = bb.data.getVar('PN', d, 1)
                 os.chmod(os.path.join(pkgdest, pn, '/home/root/.ssh'), 
0700)

         dirperm_hack(d)
}

I made a failed attempt at fixing this in package_deb.bbclass, but it 
caused other problems; in the end I figured it was easier to work around 
it in the one recipe where I needed a non-empty directory with 0700 perms.

Mike



      parent reply	other threads:[~2009-08-18 14:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-18 13:52 Create dir with 700 permissions from recipe s hakkesteegt
2009-08-18 14:12 ` Graeme Gregory
2009-08-18 14:40   ` Phil Blundell
2009-08-19  8:55   ` s hakkesteegt
2009-08-19 12:00     ` Michael Smith
2009-08-18 14:17 ` Koen Kooi
2009-08-19  6:58   ` s hakkesteegt
2009-08-19 12:19     ` marcin
2009-08-20  3:40       ` Denys Dmytriyenko
2009-08-18 14:33 ` Michael Smith [this message]

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=4A8ABBA8.8030504@cbnco.com \
    --to=msmith@cbnco.com \
    --cc=openembedded-devel@lists.openembedded.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox