summaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-17 09:23:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-17 09:23:10 +0000
commit971da7763ab953b9fb517a9652f715103d7245fc (patch)
tree33049c6d7af7ebf64d65f7bdffaa832469b60a79 /functions
parentAdding upstream version 1.0.134. (diff)
downloaddebootstrap-upstream/1.0.135.tar.xz
debootstrap-upstream/1.0.135.zip
Adding upstream version 1.0.135.upstream/1.0.135
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'functions')
-rw-r--r--functions22
1 files changed, 10 insertions, 12 deletions
diff --git a/functions b/functions
index 00c82fa..3c81524 100644
--- a/functions
+++ b/functions
@@ -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"