Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 302570 - sys-apps/cross-helper-1.15.3.ebuild (new ebuild)
Summary: sys-apps/cross-helper-1.15.3.ebuild (new ebuild)
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High enhancement
Assignee: Embedded Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-28 06:19 UTC by Peter Levine
Modified: 2011-12-03 23:16 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
cross-helper-1.15.3.ebuild (cross-helper-1.15.3.ebuild,2.76 KB, text/plain)
2010-01-28 06:22 UTC, Peter Levine
Details
cross-helper-portagecompat.patch (cross-helper-portagecompat.patch,19.18 KB, patch)
2010-01-28 06:24 UTC, Peter Levine
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Levine 2010-01-28 06:19:28 UTC
cross-helper is a patched, minimal busybox build containing modules for native manipulation of a cross-compiled system.  It currently contains modules for groupadd, useradd, deluser, delgroup, and passwd.  Given that the maintainers of shadow-utils are not interested in native support of a cross-compiled system (from what I've heard on it's IRC channel), that the current implementation of groupadd and useradd in portage (eutils.eclass) checks and/or manipulates files in /etc, not ${ROOT}/etc, and that gentoo is an invaluable resource for cross-compilation, this build would solve a lot of headaches.

The useradd and groupadd modules have been altered to accept parameters similar to shadow (and passed by enewuser & enewgroup).
eg.     cross-helper useradd -g foo -G bar,baz -c "Added by portage" -s /sbin/nologin user

It fails unless ROOT is an environment variable (and not /) and acts on files relative to ROOT.
eg. /usr/armv4tl-softfloat-linux-gnueabi/etc/shadow if ROOT="/usr/armv4tl-softfloat-linux-gnueabi"

It's functionality is supported in portage with a minimal patch to eutils.eclass (which I'll post as another bug and reference here).

NB: I extensively tested and debugged it on my own system but I'm new to c so if anyone wants to alter it, feel free.  I'm open to suggestions.
Comment 1 Peter Levine 2010-01-28 06:22:31 UTC
Created attachment 217691 [details]
cross-helper-1.15.3.ebuild

sys-apps/cross-helper/cross-helper-1.15.3.ebuild
Comment 2 Peter Levine 2010-01-28 06:24:09 UTC
Created attachment 217692 [details, diff]
cross-helper-portagecompat.patch

sys-apps/cross-helper/files/cross-helper-portagecompat.patch
Comment 3 Peter Levine 2010-01-28 06:54:29 UTC
related patch for eutils.eclass at bug# 302572
Comment 4 Wormo (RETIRED) gentoo-dev 2010-01-29 07:56:08 UTC
This looks pretty cool to me, assigning to embedded team to see if they want to take this on.
Comment 5 Peter Stuge 2010-02-09 07:30:58 UTC
(In reply to comment #0)
> Given that the maintainers of shadow-utils are not interested in native
> support of a cross-compiled system (from what I've heard on it's IRC
> channel)

In the gentoo-embedded email thread it was discussed to add a parameter to the utilities in question that would call chroot() very early in the program. This solution was discussed with shadow maintainers also on IRC and the response was very good - a patch to implement this would be welcomed by them.

I thought I'd work on creating that whenever I found some time.. ;)
Comment 6 SpanKY gentoo-dev 2010-02-09 17:21:22 UTC
yes, that is the way to go -- add a chroot flag (-R or something) to all the shadow utilities.  we're not going to hack random packages (like busybox) to add random logic (like chroot) in this way.