forked from ungleich-public/cdist
cleanup apt cache before packing initramfs
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
parent
5f79efb201
commit
ca47ea0038
1 changed files with 9 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue