Skip to content

Commit

Permalink
TST: Helper to build a chroot
Browse files Browse the repository at this point in the history
  • Loading branch information
mih committed May 19, 2018
1 parent 96b0b45 commit 0d90b94
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tools/mk_minimal_chroot.sh
@@ -0,0 +1,17 @@
#!/bin/bash
#
# bootstrap a tiny chroot (26MB compressed)
#
# run with sudo

set -e -u

chrootdir=$(mktemp -d)
echo "Working in $chrootdir"
debootstrap --variant=minbase --no-check-gpg stretch "$chrootdir"
find "$chrootdir"/var/cache/apt/archives -type f -delete
find "$chrootdir"/var/lib/apt/lists/ -type f -delete
rm -rf "$chrootdir"/usr/share/doc/*
rm -rf "$chrootdir"/usr/share/man
tar --show-transformed-names --transform=s,^.*$(basename $chrootdir),minichroot, -cvjf minichroot.tar.xz "$chrootdir"
echo "chroot tarball at minichroot.tar.xz"

0 comments on commit 0d90b94

Please sign in to comment.