aboutsummaryrefslogtreecommitdiff
path: root/functions.sh
diff options
context:
space:
mode:
Diffstat (limited to 'functions.sh')
-rw-r--r--functions.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/functions.sh b/functions.sh
new file mode 100644
index 0000000..cc932ee
--- /dev/null
+++ b/functions.sh
@@ -0,0 +1,19 @@
+cleanup (){
+ # Clean up all temporary mount points
+ set +x
+ set +e
+ echo "removing temporary mount points ..."
+ umount -l $R/proc 2> /dev/null
+ umount -l $R/sys 2> /dev/null
+ umount -l $R/dev/pts 2> /dev/null
+ umount "$BUILDDIR/mount/boot/firmware" 2> /dev/null
+ umount "$BUILDDIR/mount" 2> /dev/null
+ losetup -d "$EXT4_LOOP" 2> /dev/null
+ losetup -d "$VFAT_LOOP" 2> /dev/null
+ trap - 0 1 2 3 6
+}
+
+chroot_exec() {
+ # Exec command in chroot
+ LANG=C LC_ALL=C chroot $R $*
+}