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
Hi,
I have an idea of using something like checkinstall/sandbox to
automate src_install phase without making patch for it.
Here it is:
we do "make install" in chrooted env.
There is nothing in chrooted env, so it won't work. The
idea is to make chrooted env as same as the real env. We preload a lib
to monitor file access before chrooting. The lib is much like
sandbox/installwatch. When it encounters a file access, it will make a
link from the original file to DESTDIR so that programs running inside
chrooted env can see it.

Assume the chroot dir is /var/tmp/portage. Then if there is an access
to "/path/to/blah", then a link /var/tmp/portage/path/to/blah is
created and linked to /path/to/blah. If it's a directory, then
all items in that directory need to be linked. When programs in
chrooted env create a new file, it will be created inside
/var/tmp/portage. Of course when programs access to those files, there is
no need to make links from the outside to.

Hard links are prefered. However, hard links is not possible crossing
partitions. We'll use a trick here: make a symlink from the original
file to the chrooted partition, then make a hardlink from the symlink
to chrooted env.

Another problem is when programs modify/delete a file out of chrooted
env. In this case, it will fail. It should be handled by hand. The lib
should ignore (or make it as it's done. the original files don't
change actually). 

The last problem is that links will not be deleted over time. They may
grow if some programs scan the whole tree such as find. Most
install scripts won't afaik.

Ok, once "make install" is done, we have DESTDIR with all installed
files and some links. Some works are needed to remove links.

Don't know if it's usable, so post it here :) Any suggestions?

PS. I don't mean to replace src_install. It's  for quick, dirty
ebuilds. It's  for guys that want to install/test some programs quickly.
-- 
Bi Cờ Lao

Replies

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