Re: dpkg --root=... not really useful?
Lukas Nellen writes ("dpkg --root=... not really useful?"):
> Trying to find a way to maintain the root file system for a diskless
> client, I tried to use
> dpkg --root=/tftpboot/diskless
> to install the packages I wanted initially installed. (The aim of this
> is to have a root file system for NFS installations...). There are two
> big problems which I encountered trying this:
> 1) dpkg refuses to work without the basic directory structure in
> I had to make a couple of directories and touch some files before
> dpkg was willing to install anything.
Yes, of course. If you say --root it expects to find everything,
including its status area, there. You can say --instroot and it will
look for the status area in the usual place, but then of course you'll
probably get things horribly out of step. What did you expect ?
> 2) It is impossible to run any of the postinst etc. scripts. I got a
> cryptic error message about some missing directory - it seemed to refer
> to /var/lib/dpkg/tmp.ci (but I am not sure about it). Anyway, all
> the postinst scripts which I looked at are coded with absolute paths.
> So an installation into a tree not rooted at / is impossible. I cannot
> recall the guidelines giving any recommendation as to how to code paths
> in the control scripts of a package. Does dpkg pass the information
> about the root of the current installation to the scripts it runs?
It uses chroot() to change the root directory as seen by the scripts
to the directory you specify. Of course if the directory tree there
is nearly empty it won't be able to run the scripts because the shell
&c will not exist or work.
> To me, it seems that right now I have two possibilities to create the
> diskless root I want as a staring point:
> a) Clone my main machine (well, the subset I want) or
> b) unpack the tar of Bruce's base floppies.