aboutsummaryrefslogtreecommitdiff
path: root/scripts/rootfs.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/rootfs.sh')
-rwxr-xr-xscripts/rootfs.sh17
1 files changed, 12 insertions, 5 deletions
diff --git a/scripts/rootfs.sh b/scripts/rootfs.sh
index 955aef9..ae0fa95 100755
--- a/scripts/rootfs.sh
+++ b/scripts/rootfs.sh
@@ -122,7 +122,12 @@ rootfs_uninstall() {
echo ""
echo "==> uninstalling packages ..."
if [[ ${#PKGS_REMOVED} > 0 ]]; then
- pacman -r "$ROOTFS" -Rdd --noconfirm ${PKGS_REMOVED}
+ pacman -r "$ROOTFS" -Rs --noconfirm ${PKGS_REMOVED}
+ fi
+
+ echo ">>> force removing packages ..."
+ if [[ ${#PKGS_REMOVED_FORCE} > 0 ]]; then
+ pacman -r "$ROOTFS" -Rs --noconfirm ${PKGS_REMOVED_FORCE}
fi
}
@@ -192,9 +197,11 @@ rootfs_to_docker() {
##
rootfs_clean() {
echo ""
- echo "==> unmounting and cleaning previous rootfs ..."
+ echo "==> unmounting and cleaning previous rootfs '$ROOTFS'"
- sudo umount -R $ROOTFS
- rm -f ${ROOTFS}/*
- rmdir ${ROOTFS}
+ if [ -d ${ROOTFS} ]; then
+ sudo umount -R $ROOTFS &>/dev/null
+ rm -f ${ROOTFS}/* &>/dev/null
+ rmdir ${ROOTFS} &>/dev/null
+ fi
}