cleanup apt cache before packing initramfs

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
Steven Armstrong 2014-02-03 15:29:48 +01:00
parent 5f79efb201
commit ca47ea0038

View file

@ -253,6 +253,12 @@ cp -L "$src" "$real_dst"
config = cdist.config.Config(local, remote)
config.run()
def cleanup(self):
# Remove cruft from chroot
for action in 'autoclean clean autoremove'.split():
cmd = [ 'chroot', self.target_dir, '/usr/bin/apt-get', action]
subprocess.check_call(cmd)
@classmethod
def commandline(cls, args):
self = cls(target_dir=args.target_dir[0],
@ -270,6 +276,9 @@ cp -L "$src" "$real_dst"
if args.config:
self.config()
# Cleanup chroot
self.cleanup()
# Output pxe files
if args.pxe_boot_dir:
self.create_pxe(args.pxe_boot_dir)