Gentoo Archives: gentoo-dev

From: pclouds <pclouds@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] automate "make install" stuff
Date: Wed, 16 Jun 2004 20:35:02
Message-Id: 20040616203809.GA9846@pclouds.net
1 Hi,
2 I have an idea of using something like checkinstall/sandbox to
3 automate src_install phase without making patch for it.
4 Here it is:
5 we do "make install" in chrooted env.
6 There is nothing in chrooted env, so it won't work. The
7 idea is to make chrooted env as same as the real env. We preload a lib
8 to monitor file access before chrooting. The lib is much like
9 sandbox/installwatch. When it encounters a file access, it will make a
10 link from the original file to DESTDIR so that programs running inside
11 chrooted env can see it.
12
13 Assume the chroot dir is /var/tmp/portage. Then if there is an access
14 to "/path/to/blah", then a link /var/tmp/portage/path/to/blah is
15 created and linked to /path/to/blah. If it's a directory, then
16 all items in that directory need to be linked. When programs in
17 chrooted env create a new file, it will be created inside
18 /var/tmp/portage. Of course when programs access to those files, there is
19 no need to make links from the outside to.
20
21 Hard links are prefered. However, hard links is not possible crossing
22 partitions. We'll use a trick here: make a symlink from the original
23 file to the chrooted partition, then make a hardlink from the symlink
24 to chrooted env.
25
26 Another problem is when programs modify/delete a file out of chrooted
27 env. In this case, it will fail. It should be handled by hand. The lib
28 should ignore (or make it as it's done. the original files don't
29 change actually).
30
31 The last problem is that links will not be deleted over time. They may
32 grow if some programs scan the whole tree such as find. Most
33 install scripts won't afaik.
34
35 Ok, once "make install" is done, we have DESTDIR with all installed
36 files and some links. Some works are needed to remove links.
37
38 Don't know if it's usable, so post it here :) Any suggestions?
39
40 PS. I don't mean to replace src_install. It's for quick, dirty
41 ebuilds. It's for guys that want to install/test some programs quickly.
42 --
43 Bi Cờ Lao

Replies

Subject Author
Re: [gentoo-dev] automate "make install" stuff Marius Mauch <genone@g.o>