BTS

Issue805

Title grml-debootstrap, make removing apt cache chroot-script operations configurable
Priority wish Status resolved
Superseder Nosy List mika, suntong
Assigned To mika Topics

Created on 2010-01-27.15:40:56 by suntong, last changed 2010-02-23.00:16:13 by mika.

Files
File name Uploaded Type Edit Remove
unnamed suntong, 2010-01-27.19:34:39 text/html
Messages
msg2915 (view) Author: mika Date: 2010-02-23.00:16:07
We believe that your issue has been closed by the upload of
Version 0.34 of grml-debootstrap from Michael Prokop <mika@grml.org>.
The explanation is attached below

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Mon, 22 Feb 2010 23:46:13 +0100
Source: grml-debootstrap
Binary: grml-debootstrap
Architecture: source all
Version: 0.34
Distribution: unstable
Urgency: low
Maintainer: Michael Prokop <mika@grml.org>
Changed-By: Michael Prokop <mika@grml.org>
Description: 
 grml-debootstrap - wrapper around debootstrap for installing plain Debian via grml
Changes: 
 grml-debootstrap (0.34) unstable; urgency=low
 .
   * Move the apt cache removal function to a later point of execution
     so custom scripts still have access to the Debian packages.
   * Display executed debootstrap cmdline when running it.
   * Slightly improve checks for grub-install/update-grub and do
     no set full path to the binaries.
   * Revert "Updated grml-debootstrap parameter handling" which
     breaks the way grml-debootstrap used to work. Instead:
   * Introduce option --nopackages to skip installation of packages
     defined in /etc/debootstrap/packages.
   * Support config variable RM_APTCACHE to allow disabling removal
     of apt-cache. Thanks for the idea and initial patch, Tong Sun.
     [Closes: issue805]
Checksums-Sha1: 
 0c5b35e5b1da78212314fbfc5f78d08d6e3ddc29 984 grml-debootstrap_0.34.dsc
 ca585e3e1755ef447247444c9aeab9f883dfb316 137835 grml-debootstrap_0.34.tar.gz
 c9cf977294af7714d0dad9a4e75fe5afae9b708f 112630 grml-debootstrap_0.34_all.deb
Checksums-Sha256: 
 049705c2e9aadc53314edac179b766e84ca813d399416679cf1cd1cdbf82aa88 984 grml-debootstrap_0.34.dsc
 51061b8c15702c82e624178c63c963f7cf983caf35c1e4e1a5c0f29a498e7721 137835 grml-debootstrap_0.34.tar.gz
 7103c515007ea95418a5005352dae6e59f36d1e40802bbfe666d57e35997cd8c 112630 grml-debootstrap_0.34_all.deb
Files: 
 bb6bb250bebf47575216d300bc57e501 984 grml optional grml-debootstrap_0.34.dsc
 3ce9ed8470f5ceb4958f58117ee379ca 137835 grml optional grml-debootstrap_0.34.tar.gz
 5a9c53d47dc18379ddddda9688f2257a 112630 grml optional grml-debootstrap_0.34_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iD8DBQFLgxsh2N9T+zficugRAhD5AJ9VrVuGTfywKTjqNJSCDJKs64YS2gCeMaNw
2b59Uku9LOqgRmq5EcSHAPU=
=oPmK
-----END PGP SIGNATURE-----
msg2913 (view) Author: mika Date: 2010-02-22.23:05:19
Implemented (though slighty adjusted) in git.
msg2874 (view) Author: mika Date: 2010-01-27.22:08:31
* Tong Sun wrote in grml's BTS on 20100127 / 20:34:

> > Do really reuse those debs?

> yes, I actually bind mount my host apt archive into chroot, so I'd rather
> leave them along. I know I can use apt repo cache, but currently the
> one-line bind mount serves me well and save me from setting up a local apt
> repo cache.

Good point, thanks - I'll take care of it.

regards,
-mika-
msg2870 (view) Author: suntong Date: 2010-01-27.19:34:39
On Wed, Jan 27, 2010 at 11:58 AM, Michael Prokop <bts@bts.grml.org> wrote:

>
> > It normally takes me several iterations to use grml-debootstrap, and I
> prefer to
> > leave apt cache as-is most of the time.
>
> Do really reuse those debs?
>

yes, I actually bind mount my host apt archive into chroot, so I'd rather
leave them along. I know I can use apt repo cache, but currently the
one-line bind mount serves me well and save me from setting up a local apt
repo cache.
msg2869 (view) Author: suntong1 Date: 2010-01-27.19:29:27
fixed
---
 chroot-script    |    4 +++-
 config           |    3 +++
 grml-debootstrap |    1 +
 3 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/chroot-script b/chroot-script
index d1bdb95..9b56024 100755
--- a/chroot-script
+++ b/chroot-script
@@ -131,7 +131,9 @@ EOF
 
 # remove now useless apt cache {{{
 remove_apt_cache() {
-  apt-get clean
+  apt-get autoremove
+  apt-get autoclean
+  [ "$RM_DEBS" = 'yes' ] && apt-get clean
 }
 # }}}
 
diff --git a/config b/config
index a0cdb11..ee4238e 100644
--- a/config
+++ b/config
@@ -163,6 +163,9 @@ TIMEZONE='Europe/Vienna'
 # generate initrd via update-initramfs?
 INITRD='yes'
 
+# specify RM_DEBS='yes' to wipe out apt cache in chroot after grml-debootstrap
+RM_DEBS=
+
 # this file contains information that has been caught during
 # installation and will be displayed at the end of the installation
 INSTALL_NOTES='/etc/debootstrap/install_notes'
diff --git a/grml-debootstrap b/grml-debootstrap
index 7edc29b..b97261d 100755
--- a/grml-debootstrap
+++ b/grml-debootstrap
@@ -791,6 +791,7 @@ preparechroot() {
   [ -n "$ROOTPASSWORD" ]  && echo "ROOTPASSWORD=$ROOTPASSWORD" >> $CHROOT_VARIABLES
   [ -n "$TARGET" ]        && echo "TARGET=$TARGET"             >> $CHROOT_VARIABLES
   [ -n "$TARGET_UUID" ]   && echo "TARGET_UUID=$TARGET_UUID"   >> $CHROOT_VARIABLES
+  [ -n "$RM_DEBS" ]	  && echo "RM_DEBS=$RM_DEBS"   >> $CHROOT_VARIABLES
 
   cp $VERBOSE $CONFFILES/chroot-script $MNTPOINT/bin/chroot-script
   chmod 755 $MNTPOINT/bin/chroot-script
-- 
1.6.5
msg2867 (view) Author: mika Date: 2010-01-27.16:58:54
* Tong Sun wrote in grml's BTS on 20100127 / 16:41:

> Need to make the newly introduced removing apt cache operations in chroot-script
> configurable.

> It normally takes me several iterations to use grml-debootstrap, and I prefer to
> leave apt cache as-is most of the time.

Do really reuse those debs?

regards,
-mika-
msg2864 (view) Author: suntong Date: 2010-01-27.15:40:56
Need to make the newly introduced removing apt cache operations in chroot-script
configurable.

It normally takes me several iterations to use grml-debootstrap, and I prefer to
leave apt cache as-is most of the time.
History
Date User Action Args
2010-02-23 00:16:13mikasetstatus: fixed-in-git -> resolved
nosy: mika, suntong
messages: + msg2915
2010-02-22 23:05:29mikasetassignedto: mika
nosy: + mika
2010-02-22 23:05:21mikasetpriority: bug -> wish
status: chatting -> fixed-in-git
messages: + msg2913
2010-01-27 22:08:34mikasetmessages: + msg2874
2010-01-27 19:34:41suntongsetfiles: + unnamed
messages: + msg2870
2010-01-27 19:29:28suntong1setmessages: + msg2869
2010-01-27 16:58:56mikasetstatus: unread -> chatting
messages: + msg2867
2010-01-27 15:40:56suntongcreate