Gentoo Archives: gentoo-embedded

From: Joakim Tjernlund <joakim.tjernlund@×××××××××.se>
To: gentoo-embedded@l.g.o
Subject: Re: [gentoo-embedded] cross building into custom SYSROOT with non root user ?
Date: Tue, 22 Oct 2013 18:45:37
Message-Id: OF7EE0304F.8FF209A8-ONC1257C0C.0066ECFA-C1257C0C.00670BB7@transmode.se
In Reply to: Re: [gentoo-embedded] cross building into custom SYSROOT with non root user ? by Joakim Tjernlund
1 Joakim Tjernlund <joakim.tjernlund@×××××××××.se> wrote on 2013/10/22
2 20:37:52:
3
4 > From: Joakim Tjernlund <joakim.tjernlund@×××××××××.se>
5 > To: gentoo-embedded@l.g.o,
6 > Date: 2013/10/22 20:38
7 > Subject: Re: [gentoo-embedded] cross building into custom SYSROOT with
8 non root user ?
9 >
10 > Peter Stuge <peter@×××××.se> wrote on 2013/10/22 04:35:52:
11 > >
12 > > Joakim Tjernlund wrote:
13 > > > I am trying to get this old dream to fly again:
14 > > > Building a root fs in my own sysroot (other that /usr/CHOST ) as a
15 > normal user
16 > >
17 > > Yay, that would be very nice.
18 > >
19 > >
20 > > > I could not even build glibc:
21 > > > > SYSROOT=/usr/local/src/X-5000/root
22 > > > PKGDIR=/usr/local/src/X-5000/overlay/packages
23 > > > DISTDIR=/usr/local/src/X-5000/overlay/distfiles
24 > > > ROOT=/usr/local/src/X-5000/root emerge-x86_64-tm-linux-gnu -a
25 --nodeps
26 >
27 > > > sys-libs/glibc
28 > > > ....
29 > > > /usr/bin/install: cannot change ownership of
30 > > >
31 >
32 '/usr/x86_64-tm-linux-gnu/tmp/portage/sys-libs/glibc-2.17/image//usr/lib/misc/glibc/pt_chown':
33
34 > Operation not permitted
35 > >
36 > > pt_chown is a bit of a special case and it does come with an --enable
37 > > switch in configure. Did you try using --disable-pt_chown ? I guess
38 > > the program isn't really needed in an embedded system and besides
39 > > "It is not built by default because systems using the Linux kernel
40 > > are commonly built with the `devpts' filesystem enabled and mounted
41 > > at `/dev/pts', which manages pseudo-terminal ownership automatically."
42 > >
43 > > glibc.git/login/Makefile hardcodes the -m 4755 parameter to install.
44 > > I can imagine that a few system packages would take such liberties,
45 > > but hopefully it isn't strictly neccessary if we can specify
46 > > carefully what we actually want to build.
47 > >
48 > >
49 > > > I got fakeroot installed but seems like emerge ignores that somehow.
50 > > > Is this just a futile dream still?
51 > >
52 > > Dunno - since you have the setup maybe you can try disabling pt_chown
53 > > and see how far that takes you? I'm very interested in your results.
54 >
55 > FEATURES=fakeroot seems broken (or some profile data is missing)
56 > However I got a bit further, doing just:
57 > ./sysroot-ebuild /usr/portage/sys-apps/busybox/busybox-1.21.1.ebuild
58 > --debug install
59 > fails too until one add
60 > PORTAGE_INST_UID=$(id -u)
61 > PORTAGE_INST_GID=$(id -g)
62 > somehow these are unset doing cross builds so install thinks it should
63 > change owner to root.
64 > Add this to cross-emerge? How about adding an explicit cross-ebuild too?
65 >
66 > BTW, cat sysroot-ebuild:
67 > : ${CROSS_CMD:=ebuild}
68 > CHOST=x86_64-tm-linux-gnu
69 > PORTAGE_INST_UID=$(id -u)
70 > PORTAGE_INST_GID=$(id -g)
71 > export PORTAGE_INST_UID PORTAGE_INST_GID
72 > #SYSROOT=/usr/local/src/X-5000/root
73 > #PORTAGE_CONFIGROOT=/usr/local/src/X-5000/configroot
74 > #export SYSROOT PORTAGE_CONFIGROOT
75 >
76 > export CROSS_CMD CHOST
77 > cross-emerge "$@"
78 >
79 > Jocke
80
81 See also bug:
82 https://bugs.gentoo.org/show_bug.cgi?id=489016
83 hopefully someone can solve the fakeroot problem too