diff options
author | Colin Watson <cjwatson@debian.org> | 2007-10-19 13:45:48 (GMT) |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2007-10-19 13:45:48 (GMT) |
commit | f8ba662779476396f7bf58e213c5995a8f104266 (patch) | |
tree | 3026eb3f3533fdf66ff5c30fe5607aff5580ee77 /functions | |
parent | c702ea3582aecfe6d164092bfbebdd0a08226b8e (diff) | |
download | debootstrap-f8ba662779476396f7bf58e213c5995a8f104266.zip debootstrap-f8ba662779476396f7bf58e213c5995a8f104266.tar.gz debootstrap-f8ba662779476396f7bf58e213c5995a8f104266.tar.bz2 |
* Emit an error if we cannot create working devices or executables on the
target (based on work by Bastian Kleineidam; closes: #233798).
r49822
Diffstat (limited to 'functions')
-rw-r--r-- | functions | 31 |
1 files changed, 31 insertions, 0 deletions
@@ -989,6 +989,37 @@ resolve_deps () { ################################################################### helpers +# Return zero if it is possible to create devices and execute programs in +# this directory. (Both may be forbidden by mount options, e.g. nodev and +# noexec respectively.) +check_sane_mount () { + case "$ARCH" in + kfreebsd-*|hurd-*) + ;; + *) + mknod "$1/test-dev-null" c 1 3 || return 1 + if ! echo test > "$1/test-dev-null"; then + rm -f "$1/test-dev-null" + return 1 + fi + rm -f "$1/test-dev-null" + ;; + esac + + cat > "$1/test-exec" <<EOF +#! /bin/sh +: +EOF + chmod +x "$1/test-exec" + if ! "$1/test-exec"; then + rm -f "$1/test-exec" + return 1 + fi + rm -f "$1/test-exec" + + return 0 +} + read_gpg_status () { badsig= unkkey= |