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

Replies

Subject Author
Re: [gentoo-embedded] cross building into custom SYSROOT with non root user ? Joakim Tjernlund <joakim.tjernlund@×××××××××.se>