Skip to content
This repository
Browse code

Merge pull request #55 from daniel-pittman/feature/master/better-fake…

…root-safety-checks

Inform users and abort when we can't unpack the ISO image
  • Loading branch information...
commit 2d84e612e1f6e112f028d4b466afabe5931fd426 2 parents 76df43b + 9bd0f1c
Daniel Pittman authored February 07, 2013
10  iso-build-files/build_initial_directories.sh
... ...
@@ -1,4 +1,4 @@
1  
-#!/bin/sh
  1
+#!/bin/bash
2 2
 . ./mk-build-lib.sh
3 3
 
4 4
 if ! test -f Core-current.iso; then
@@ -23,11 +23,17 @@ mkdir original-iso-files
23 23
 # get a copy of the files from the original ISO
24 24
 if exists 7z; then
25 25
     7z -o"original-iso-files" x Core-current.iso
26  
-else
  26
+elif test x"${FAKEROOTKEY}" = x""; then
27 27
     test -d /tmp/cdrom || mkdir -p /tmp/cdrom
28 28
     mount Core-current.iso /tmp/cdrom -o loop
29 29
     cp -a /tmp/cdrom/boot original-iso-files/
30 30
     umount /tmp/cdrom
  31
+else
  32
+    echo "It looks like you are running with fakeroot, but you don't"
  33
+    echo "have the 7z command (p7zip or p7zip-full) available.  This"
  34
+    echo "means we can't unpack the ISO image; either install that tool"
  35
+    echo "or run this as real root instead."
  36
+    exit 1
31 37
 fi
32 38
 
33 39
 # extract the boot/core.gz file from that directory

0 notes on commit 2d84e61

Please sign in to comment.
Something went wrong with that request. Please try again.