All of lore.kernel.org
 help / color / mirror / Atom feed
From: Graeme Gregory <dp@xora.org.uk>
To: openembedded-devel@lists.openembedded.org
Subject: Re: Create dir with 700 permissions from recipe
Date: Tue, 18 Aug 2009 15:12:20 +0100	[thread overview]
Message-ID: <4A8AB6C4.8040805@xora.org.uk> (raw)
In-Reply-To: <6978a1740908180652y36467f0evcfc467153cf9ac64@mail.gmail.com>

s hakkesteegt wrote:
> Hi,
>
> 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.
> This is the recipe I created:
>
>
> SRC_URI=" \
>                     file://authorized_keys \
>        "
>
> FILES_${PN}=" /home/root/.ssh \
>                        /home/root/.ssh/authorized_keys \
>            "
>
> do_install(){
>        install -m 0700 -d ${D}/home/root/.ssh
>        install -m 0600 ${WORKDIR}/authorized_keys
> ${D}/home/root/.ssh/authorized_keys
> }
>
>
> On irc was suggested to use postinst script. So I tried to add the next at
> the end of the recipe.:
>
>
> pkg_postinst_${PN}-chmodsshdir () {
>         chmod 700 /home/root/.ssh
> }
>
>   
You above recipe doesnt create a package called.

${PN}-chmodsshdir

you also need to add something like

if test "x$D" != "x"; then
    exit
fi

to the beginning of the postinst to stop it running during image creation.

Graeme




  reply	other threads:[~2009-08-18 14:29 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 [this message]
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

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=4A8AB6C4.8040805@xora.org.uk \
    --to=dp@xora.org.uk \
    --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 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.