aboutsummaryrefslogtreecommitdiff
path: root/functions.sh
diff options
context:
space:
mode:
authorJan Wagner <mail@jwagner.eu>2016-03-12 16:07:25 +0100
committerJan Wagner <mail@jwagner.eu>2016-03-12 16:07:25 +0100
commit4aa8ac6985680eb12ba5c82422ecc50e2bb55447 (patch)
treea85e15805b773c5218ccb0a279490c98eec41e81 /functions.sh
parent80185bd93dd9eecb1b41ef8ac9a186aff19ab33e (diff)
downloadrpi2-gen-image-4aa8ac6985680eb12ba5c82422ecc50e2bb55447.tar.gz
rpi2-gen-image-4aa8ac6985680eb12ba5c82422ecc50e2bb55447.tar.bz2
rpi2-gen-image-4aa8ac6985680eb12ba5c82422ecc50e2bb55447.zip
spliting more files, fix-uboot, fix-fbturbo, fix-locale
Diffstat (limited to 'functions.sh')
-rw-r--r--functions.sh17
1 files changed, 16 insertions, 1 deletions
diff --git a/functions.sh b/functions.sh
index e94a42c..f64fb97 100644
--- a/functions.sh
+++ b/functions.sh
@@ -1,11 +1,16 @@
+# This file contains utility functions used by rpi2-gen-image.sh
+
cleanup (){
- # Clean up all temporary mount points
set +x
set +e
+
+ # Identify and kill all processes still using files
echo "killing processes using mount point ..."
fuser -k $R
sleep 3
fuser -9 -k -v $R
+
+ # Clean up all temporary mount points
echo "removing temporary mount points ..."
umount -l $R/proc 2> /dev/null
umount -l $R/sys 2> /dev/null
@@ -21,3 +26,13 @@ chroot_exec() {
# Exec command in chroot
LANG=C LC_ALL=C DEBIAN_FRONTEND=noninteractive chroot $R $*
}
+
+install_readonly() {
+ # Install file with user read-only permissions
+ install -o root -g root -m 644 $*
+}
+
+install_exec() {
+ # Install file with root exec permissions
+ install -o root -g root -m 744 $*
+}