summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xmkinitcpio7
1 files changed, 7 insertions, 0 deletions
diff --git a/mkinitcpio b/mkinitcpio
index 5fec347..5bed94e 100755
--- a/mkinitcpio
+++ b/mkinitcpio
@@ -323,6 +323,13 @@ fi
if [[ -z $GENIMG ]]; then
msg "Starting dry run: %s" "$KERNELVERSION"
else
+ # check for permissions. if the image doesn't already exist,
+ # then check the directory
+ if [[ ( -e $GENIMG && ! -w $GENIMG ) ||
+ ( ! -d ${GENIMG%/*} || ! -w ${GENIMG%/*} ) ]]; then
+ die 'Unable to write to %s' "$GENIMG"
+ fi
+
COMPRESSION=${optcompress:-$COMPRESSION}
if ! type -P "$COMPRESSION" >/dev/null; then
die "Unable to locate compression method: %s" "$COMPRESSION"