[Grml] grml-debootstrap misc questions

T o n g mlist4suntong at yahoo.com
Wed Sep 3 00:34:59 CEST 2008


On Tue, 02 Sep 2008 23:36:30 +0200, Michael Prokop wrote:

>> - Does debootstrap download packages? If yes, where does it place
>> downloaded packages?
> 
> Yes, they are located in /var/cache/apt/archives of the target
> system.
> 
>> - Since grml-debootstrap also install packages defined in
>> /etc/debootstrap/packages into the chroot system, is it a good idea to
>> bind mount /var/cache/apt/archives into the chroot system as well, so as
>> to save the downloading and cleaning up?
> 
> I'm not sure about that, I've to check this out in reallife usage. :)
> But if you have any patches or implementation details it would be
> great if you could share them with us.

The bind mounting /var/cache/apt/archives is a trick that I've been using
for years. Never cause me any problem. Since the bind mounting apt
configure files are dangerous, thus adding a bind-mount option is not
necessary, I think it is pretty safe to add the following line at the end
of function mount_target() in grml-debootstrap

   mount --bind /var/cache/apt/archives $MNTPOINT/var/cache/apt/archives

then umount it somewhere during clean up. 

Each Debian system would have such /var/cache/apt/archives directory, so I
think it is pretty safe to do so. This will allows us to do
grml-debootstrap over and over without downloading Debian packages more
then once.

In fact, this is what I do before calling grml-debootstrap:

 mount -o bind /path/to/my/customized/debootstrap /etc/debootstrap 

So that I can keep my own customized /etc/debootstrap without worrying it
interfering with grml-debootstrap default settings, and the troubles when
upgrading grml-debootstrap.

>> - furthermore, I think over 99% people would have same apt/sources.list
>> and apt/preferences in host and chroot system. If so, would it be a
>> good idea for the same bind-mount option bind mount
>> /etc/apt/sources.list & /etc/apt/preferences into the chroot system as
>> well?
> 
> No, that's a bit dangerous as a default IMO (because there might be just
> too many problematic situations when booting a grml based on unstable
> and installing a Debian/stable system).
> 
> But you can use /etc/debootstrap/etc/.... to copy files from the source
> to the target system, check out the grml-debootstrap manpage.

Ah, good idea. Then please add '--dereference' whenever 'cp' files from
host into chroot system. I want to symlink them into /etc/debootstrap/etc/
instead of copying them over.

Further, not for this release, please log to bts to add an option to remove
packages. There are packages that I don't need, e.g., nano, tasksel,
tasksel-data, gcc-4.2-base, etc. An option that allows us to remove would
be nice.

Thanks, 

-- 
Tong (remove underscore(s) to reply)
  http://xpt.sourceforge.net/techdocs/
  http://xpt.sourceforge.net/tools/




More information about the Grml mailing list