[oe] Create dir with 700 permissions from recipe
Michael Smith
msmith at cbnco.com
Tue Aug 18 14:33:12 UTC 2009
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
More information about the Openembedded-devel
mailing list