Gentoo Archives: gentoo-dev

From: Stefan Jones <cretin@g.o>
To: gentoo-core <gentoo-core@g.o>, gentoo-dev <gentoo-dev@g.o>
Subject: [gentoo-dev] Prelink, unpriv user compile and fakeroot
Date: Wed, 20 Nov 2002 21:11:11
Message-Id: 1037826628.18993.46.camel@localhost
1 Hi all,
2
3 When I started using prelink and portage some apps started to segfault
4 in the portage compile/install environment. This was traced to the
5 LD_PRELOAD environmental variable. Prelinked apps don't like being
6 LD_PRELOADed.
7
8 Most of / all these problems are due to buggy / nonstandard compile
9 methods and glibc bugs with preloading and prelink (one glibc bug has
10 already been fixed)
11
12 As a work around to the above problems and a permanent fix to sandbox
13 problems I started working on jrray's fakeroot portage patch ( look at
14 http://cvs.gentoo.org/~jrray )
15
16 What was needed was for compiles to be done by a normal unprivileged
17 user ( like nobody, or the new portage user ) without ANY sandbox or
18 other library being preloaded. This fixes most compile time problems
19 with things like emacs. This is also supported by all package I know as
20 it is the normal manual install method most people use.
21
22 This safe as the user has no write permissions to most of the file
23 system. Also the functions of sandbox are not needed during compile as
24 during this stage nothing needs to be installed properly.
25
26 Then the install stage can be done as root with libsandbox as normal as
27 during this stage no tricky library manipulations are being done so
28 LD_PRELOAD will not interfere.
29
30 The attached patch only uses sandbox, but can be easily hacked to use
31 fakeroot instead/as well. The patch is a radical hack of jrray's
32 version.
33
34 It can also be found at
35
36 http://cvs.gentoo.org/~cretin/portage-prelink+fakeroot.patch
37
38 Install:
39 Install prelink if you want to prelink, you can use the patch without
40 prelink to get the unpriv user compile feature.
41
42 Then apply patch:
43 This a patch against the portage-2.0.44.tar.bz2 tarball found in
44 /usr/portage so add to the portage ebuild
45 cd ${S} ; bzip2 -dc /path/to/portage-prelink+fakeroot.patch | patch -p1
46 || die
47
48 Next add a "portage" group and a user called "portage" with home dir at
49 /home/portage. Finally add prelink to FEATURES in make.conf if you want
50 prelink.
51
52 Now watch the breakages ....
53 (only joking, it works fine for me )
54
55 Is software ever finished?
56
57 --
58 Stefan Jones <cretin@g.o>
59 Gentoo Linux

Attachments

File name MIME type
portage-prelink+fakeroot.patch text/x-patch