Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Inform users and abort when we can't unpack the ISO image #55

Merged
merged 1 commit into from

1 participant

@daniel-pittman

When running under fakeroot(1), we would try and loopback mount the ISO image
to unpack it despite knowing that could never work. That was a poor user
experience, and we can absolutely do better than that.

This updates the script to check if we are running under fakeroot and skip the
attempt to use mount in favour of informing the user about what they should do
to successfully build.

This closes issue #54.

Signed-off-by: Daniel Pittman daniel@rimspace.net

@daniel-pittman daniel-pittman Inform users and abort when we can't unpack the ISO image
When running under fakeroot(1), we would try and loopback mount the ISO image
to unpack it despite knowing that could never work. That was a poor user
experience, and we can absolutely do better than that.

This updates the script to check if we are running under fakeroot and skip the
attempt to use mount in favour of informing the user about what they should do
to successfully build.

This closes issue #54.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
9bd0f1c
@daniel-pittman daniel-pittman merged commit 2d84e61 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 15, 2013
  1. @daniel-pittman

    Inform users and abort when we can't unpack the ISO image

    daniel-pittman authored
    When running under fakeroot(1), we would try and loopback mount the ISO image
    to unpack it despite knowing that could never work. That was a poor user
    experience, and we can absolutely do better than that.
    
    This updates the script to check if we are running under fakeroot and skip the
    attempt to use mount in favour of informing the user about what they should do
    to successfully build.
    
    This closes issue #54.
    
    Signed-off-by: Daniel Pittman <daniel@rimspace.net>
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 2 deletions.
  1. +8 −2 iso-build-files/build_initial_directories.sh
View
10 iso-build-files/build_initial_directories.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
. ./mk-build-lib.sh
if ! test -f Core-current.iso; then
@@ -23,11 +23,17 @@ mkdir original-iso-files
# get a copy of the files from the original ISO
if exists 7z; then
7z -o"original-iso-files" x Core-current.iso
-else
+elif test x"${FAKEROOTKEY}" = x""; then
test -d /tmp/cdrom || mkdir -p /tmp/cdrom
mount Core-current.iso /tmp/cdrom -o loop
cp -a /tmp/cdrom/boot original-iso-files/
umount /tmp/cdrom
+else
+ echo "It looks like you are running with fakeroot, but you don't"
+ echo "have the 7z command (p7zip or p7zip-full) available. This"
+ echo "means we can't unpack the ISO image; either install that tool"
+ echo "or run this as real root instead."
+ exit 1
fi
# extract the boot/core.gz file from that directory
Something went wrong with that request. Please try again.