aboutsummaryrefslogtreecommitdiff
path: root/scripts/rootfs.sh
diff options
context:
space:
mode:
authorMhd Sulhan <ms@kilabit.info>2015-11-28 16:59:44 +0700
committerMhd Sulhan <ms@kilabit.info>2015-11-28 16:59:44 +0700
commit1e9c24d3f47fbf4b22241bebfc11de9c9c615f02 (patch)
treeecc732688e91e63b09db8dd04ec057b8decc7af8 /scripts/rootfs.sh
parentbb392b3bf7ce2085c2cec10d575ab623452017c7 (diff)
downloadarch-docker-1e9c24d3f47fbf4b22241bebfc11de9c9c615f02.tar.xz
Remove packages only after bootstraping is finished.
* arch-base: remove unneeded packages.
Diffstat (limited to 'scripts/rootfs.sh')
-rwxr-xr-xscripts/rootfs.sh20
1 files changed, 14 insertions, 6 deletions
diff --git a/scripts/rootfs.sh b/scripts/rootfs.sh
index 000beda..a30ea18 100755
--- a/scripts/rootfs.sh
+++ b/scripts/rootfs.sh
@@ -84,7 +84,19 @@ rootfs_bootstrap() {
chmod +x ${RUN_BOOTSTRAP}
## run the bootstrap script.
- arch-chroot "$ROOTFS" /bin/sh -c "/`basename ${RUN_BOOTSTRAP}`"
+ ${SCRIPTD}/arch-chroot.sh "$ROOTFS" /bin/sh -c "/`basename ${RUN_BOOTSTRAP}`"
+ wait
+}
+
+rootfs_uninstall() {
+ echo "==> uninstalling packages ..."
+ pacman -r "$ROOTFS" -Rdd --noconfirm ${PKGS_REMOVED}
+}
+
+rootfs_clean_pacman() {
+ echo "==> remove pacman db and local ..."
+ rm -rf "${ROOTFS}/var/lib/pacman/sync/*"
+ rm -rf "${ROOTFS}/var/lib/pacman/local/*"
}
##
@@ -102,6 +114,7 @@ rootfs_main() {
rootfs_install
rootfs_copy
rootfs_bootstrap
+ rootfs_uninstall
}
rootfs_backup() {
@@ -121,11 +134,6 @@ rootfs_backup() {
## Convert rootfs to docker image.
##
rootfs_to_docker() {
- if [[ $# < 2 ]]; then
- echo "args: rootfs_to_docker [image-name] [options]"
- exit 1
- fi
-
rootfs_backup
sudo tar --numeric-owner --xattrs --acls -C "$ROOTFS" -c . |