diff options
Diffstat (limited to 'functions')
-rw-r--r-- | functions | 22 |
1 files changed, 10 insertions, 12 deletions
@@ -217,9 +217,9 @@ keyring () { if [ -e "$1" ]; then KEYRING="$1" elif [ -z "$DISABLE_KEYRING" ]; then - if [ -n "$DEF_HTTPS_MIRROR" ] && [ -z "$USER_MIRROR" ] && [ -z "$FORCE_KEYRING" ]; then - info KEYRING "Keyring file not available at %s; switching to https mirror %s" "$1" "$DEF_HTTPS_MIRROR" - USER_MIRROR="$DEF_HTTPS_MIRROR" + if [ -z "$USER_MIRROR" ] && [ -z "$FORCE_KEYRING" ]; then + info KEYRING "Keyring file not available at %s; switching to https mirror %s" "$1" "https://${DEF_MIRROR#http://}" + USER_MIRROR="https://${DEF_MIRROR#http://}" else warning KEYRING "Cannot check Release signature; keyring file not available %s" "$1" if [ -n "$FORCE_KEYRING" ]; then @@ -1306,7 +1306,8 @@ setup_devices () { touch "$TARGET/dev/console" ;; *) - if ! setup_devices_simple; then + if ! setup_devices_simple || + ! sh -c ': >"$1"' -- "$TARGET/dev/null" 2>/dev/null; then setup_devices_bind fi ;; @@ -1673,7 +1674,7 @@ while (read STDIN, $x, 1) { }' "$@" elif [ "$1" = "GETDEPS" ]; then local pkgdest="$2"; shift; shift -LC_ALL=C grep "$gropt" '^$|^Package:|^Depends:|^Pre-Depends:' $pkgdest | perl -e ' +LC_ALL=C grep "$gropt" '^$|^Package:|^Depends:|^Pre-Depends:' "${pkgdest}" | perl -e ' %seen = map { $_ => 1 } @ARGV; while (<STDIN>) { if (/^Package: (.*)$/) { @@ -1836,13 +1837,10 @@ check_sane_mount () { lxc|lxc-libvirt|mmdebstrap-unshare) ;; *) - if mknod "$1/test-dev-null" c 1 3 2>/dev/null; then - if ! echo test > "$1/test-dev-null"; then - rm -f "$1/test-dev-null" - return 1 - fi - else - # mknod failed. Try if bind-mounting works + if ! mknod "$1/test-dev-null" c 1 3 2>/dev/null || + ! echo test > "$1/test-dev-null"; then + # mknod failed (e.g. user namespace) or writing failed + # (e.g. nodev). Try if bind-mounting works touch "$1/test-dev-null" if ! mount -o bind /dev/null "$1/test-dev-null"; then rm -f "$1/test-dev-null" |