Yet another LPM

Ivan Kabaivanov chepati at yahoo.com
Thu Mar 29 11:00:13 PDT 2007


On Thursday 29 March 2007 06:47, Jan Dvořák wrote:
> Hi,
>
> 	one of bullets on Robert's TODO list was:
>  > It'd be nice to catalog new files as each package is installed, with
>  > a find(1) script or something similar, and maybe toss in md5sum too.
>  > So if two packages install the same file we know about it.. so we know
>  > whether /usr/share/man/man1/su.1 is from Coreutils, Util-linux,
>  > Shadow, or something else. It'd also be usefull for tripwire-like
>  > setups, and a foundation for package management (automated or
>  > otherwise).
>
> 	IF it is acceptable, that the main dependencies are UnionFS and FUSE,
> then http://jh.gvn.cz/~jd870911/lpm/ may help. It is somewhat similar to
> Slackware's package management. The script `lpmb' uses tiny FUSE wrapper
> `monofs' to make whole system look like one file system (no need to care
> about /usr not being in place anymore) and then overlays the view
> (real-only) with UnionFS, creates temporary work directory in /tmp
> (after `mount --bind /tmp` for speedup) and chroots into overlay.
>
> 	Once exited chroot successfully, overlay is umounted as well as monofs
> and snapshot is moved into given location (tarball in the example below).
>


Within the context of IPCop I was thinking of doing:
make DESTDIR=/tmp/[package] install for every package, then
find /tmp/[package] > package.list
rm -fr /tmp/[package]
make install

so that we didn't have to run find after installing every package, which the 
more packages were installed, the longer it took.  With the above idea, find 
takes considerably less time.  The overhead comes from having to install 
every package twice, but with the exception of gcc,glibc,perl and maybe a few 
more, that overhead was negligible compared to a full / find.  Some packages 
probably will not understand DESTDIR, but for those a sed would fix it.

Then I got to thinking that it would be nice to have a temporary directory 
bound to /tools so that a single make install will populate both /tools and 
the temp directory in which I can run a find in parallel while the next 
package was installed.  I though unionfs might do something like this, but 
from the few minutes I spent reading its description it didn't seem like what 
I wanted.  Perhaps I was wrong, because I see this discussion here today...

There's always installwatch, but I don't like its log files, plus it looks 
like it doesn't work reliably with static libs/bins.

IvanK.




> 	Idealized example:
>
> ~# lpmb ed-0.2-1.tar.bz2
> /tmp/tmp.X/work# tar xvf /usr/src/ed/ed-0.2.tar.bz2
> /tmp/tmp.X/work# cd ed-0.2
> /tmp/tmp.X/work/ed-0.2# patch -Np1 -i /usr/src/ed/ed-0.2-dirent-1.patch
> /tmp/tmp.X/work/ed-0.2# ./configure --prefix=/usr && make all install
> ^D
>
> ~# ls ed-*
> ed-0.2-1.tar.bz2
>
> ~# lpm -i ed-0.2-1.tar.bz2
> /usr
> /usr/bin
> /usr/bin/ed
> [...]
> Files backed up:
> 	/usr/share/man/man1/ed.1 (1)
>
> ~# lpm -q /usr/share/man/man1/ed.1
> man-pages-2.43-1
> ed-0.2-1
>
> ~# mv /usr/share/man/man1/{.__lpm_1.,}ed.1
>
> ~# lpm --force --remove ed-0.2-1
> /usr/bin/ed
> /usr/bin/red
> ...
> Packages removed...
> ~# ls /usr/share/man/man1/ed.1
> /usr/share/man/man1/ed.1
> ~# lpm -q /usr/share/man/man1/ed.1
> man-pages-2.43-1
>
> 	And so on... Just download newest tarball and try it out.



More information about the hlfs-dev mailing list