summaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2013-11-23 22:47:13 +0100
committerDave Reisner <dreisner@archlinux.org>2013-11-24 02:57:13 +0100
commitcaf145fd4a6269b747c0f6134868b9b748dd73f3 (patch)
tree028fb7e91de28319126369ced77fdd7309f207e0 /functions
parent1bf318f11d42522973633aa1c837693476c3a9e0 (diff)
downloadmkinitcpio-caf145fd4a6269b747c0f6134868b9b748dd73f3.tar.gz
mkinitcpio-caf145fd4a6269b747c0f6134868b9b748dd73f3.tar.xz
functions: error out when buildroot isn't writeable
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Diffstat (limited to 'functions')
-rw-r--r--functions5
1 files changed, 5 insertions, 0 deletions
diff --git a/functions b/functions
index 81a6072..9a29a17 100644
--- a/functions
+++ b/functions
@@ -635,6 +635,11 @@ initialize_buildroot() {
fi
buildroot=${2:-$workdir/root}
+ if [[ ! -w ${2:-$workdir} ]]; then
+ error 'Unable to write to build root: %s' "$buildroot"
+ return 1
+ fi
+
# base directory structure
install -dm755 "$buildroot"/{new_root,proc,sys,dev,run,tmp,etc,usr/{local,lib,bin}}
ln -s "usr/lib" "$buildroot/lib"