diff options
author | Filip Pytloun <filip@pytloun.cz> | 2016-03-09 11:09:41 +0100 |
---|---|---|
committer | Filip Pytloun <filip@pytloun.cz> | 2016-03-11 09:50:51 +0100 |
commit | ea1f8911cd69216027df5f9d727f47a1b67ef29b (patch) | |
tree | a1f2590c4b1be985b4a276ac291e0dfc9ad78484 /functions.sh | |
parent | 27d947162017091ac25267c7f235c97d5c685dd2 (diff) | |
download | rpi2-gen-image-ea1f8911cd69216027df5f9d727f47a1b67ef29b.tar.gz rpi2-gen-image-ea1f8911cd69216027df5f9d727f47a1b67ef29b.tar.bz2 rpi2-gen-image-ea1f8911cd69216027df5f9d727f47a1b67ef29b.zip |
Refactor: split bootstrap actions and allow custom
Diffstat (limited to 'functions.sh')
-rw-r--r-- | functions.sh | 19 |
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 $* +} |