summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco d'Itri <md@linux.it>2016-02-18 01:10:50 (GMT)
committerSamuel Thibault <sthibault@debian.org>2016-02-18 01:10:50 (GMT)
commitaaac37bbff19d26ac19790c70ee9f42ec92f019c (patch)
treeb84f490c0bf31c20c5e92a147dd6f1659f0bf5ba
parent745d40d7bb7a7b37885982ac3b06f836131a45d6 (diff)
downloaddebootstrap-aaac37bbff19d26ac19790c70ee9f42ec92f019c.zip
debootstrap-aaac37bbff19d26ac19790c70ee9f42ec92f019c.tar.gz
debootstrap-aaac37bbff19d26ac19790c70ee9f42ec92f019c.tar.bz2
Split setup_devices in setup_devices and setup_dynamic_devices,
(setup_devices now only deals with static device nodes) and move the calls to setup_devices from the beginning of the second stage to the end of the first stage. setup_dynamic_devices mounts the appropriate filesystems which provide dynamic device nodes for the architectures which need one in debootstrap (kfreebsd and hurd). This fixes a bug in --second-stage introduced in 1.0.34 and exposed by the devices-related changes of 1.0.76: the second stage debootstrap runs "dpkg --print-architecture >/dev/null" at the very beginning of the program when /dev is still empty, so it creates an empty regular file in place of /dev/null and this will cause mknod to fail later. (Closes: #813232)
-rw-r--r--debian/changelog19
-rw-r--r--functions23
-rw-r--r--scripts/aequorea4
-rw-r--r--scripts/breezy3
-rw-r--r--scripts/dapper3
-rw-r--r--scripts/edgy4
-rw-r--r--scripts/feisty4
-rw-r--r--scripts/gutsy4
-rw-r--r--scripts/hoary3
-rw-r--r--scripts/hoary.buildd3
-rw-r--r--scripts/potato3
-rw-r--r--scripts/sarge3
-rw-r--r--scripts/sarge.buildd3
-rw-r--r--scripts/sid4
-rw-r--r--scripts/warty3
-rw-r--r--scripts/warty.buildd3
-rw-r--r--scripts/woody3
-rw-r--r--scripts/woody.buildd3
18 files changed, 73 insertions, 22 deletions
diff --git a/debian/changelog b/debian/changelog
index 804616b..c7955de 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,22 @@
+debootstrap (1.0.78+nmu1) unstable; urgency=medium
+
+ * Non-maintainer upload.
+ * Split setup_devices in setup_devices (which now only deals with static
+ device nodes) and setup_dynamic_devices, and move the calls to
+ setup_devices from the beginning of the second stage to the end of the
+ first stage.
+ setup_dynamic_devices mounts the appropriate filesystems which provide
+ dynamic device nodes for the architectures which need one in
+ debootstrap (kfreebsd and hurd).
+ This fixes a bug in --second-stage introduced in 1.0.34 and exposed
+ by the devices-related changes of 1.0.76: the second stage debootstrap
+ runs "dpkg --print-architecture >/dev/null" at the very beginning of
+ the program when /dev is still empty, so it creates an empty regular
+ file in place of /dev/null and this will cause mknod to fail later.
+ (Closes: #813232)
+
+ -- Marco d'Itri <md@linux.it> Wed, 17 Feb 2016 01:23:23 +0100
+
debootstrap (1.0.78) unstable; urgency=high
* Use HTTPS for Vcs-* URLs, and link to cgit rather than gitweb.
diff --git a/functions b/functions
index be4919f..e0e6056 100644
--- a/functions
+++ b/functions
@@ -1046,6 +1046,7 @@ setup_proc_fakechroot () {
ln -s /proc "$TARGET"
}
+# create the static device nodes
setup_devices () {
if doing_variant fakechroot; then
setup_devices_fakechroot
@@ -1054,11 +1055,11 @@ setup_devices () {
case "$HOST_OS" in
kfreebsd*)
- in_target mount -t devfs devfs /dev ;;
+ ;;
freebsd)
- mount -t devfs devfs $TARGET/dev ;;
+ ;;
hurd*)
- setup_devices_hurd ;;
+ ;;
*)
if true; then
setup_devices_simple
@@ -1071,6 +1072,22 @@ setup_devices () {
esac
}
+# enable the dynamic device nodes
+setup_dynamic_devices () {
+ if doing_variant fakechroot; then
+ return 0
+ fi
+
+ case "$HOST_OS" in
+ kfreebsd*)
+ in_target mount -t devfs devfs /dev ;;
+ freebsd)
+ mount -t devfs devfs $TARGET/dev ;;
+ hurd*)
+ setup_devices_hurd ;;
+ esac
+}
+
setup_devices_simple () {
# The list of devices that can be created in a container comes from
# src/core/cgroup.c in the systemd source tree.
diff --git a/scripts/aequorea b/scripts/aequorea
index fddd777..d55eee0 100644
--- a/scripts/aequorea
+++ b/scripts/aequorea
@@ -57,6 +57,8 @@ first_stage_install () {
chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
fi
+ setup_devices
+
x_feign_install () {
local pkg="$1"
local deb="$(debfor $pkg)"
@@ -77,7 +79,7 @@ Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
}
second_stage_install () {
- setup_devices
+ setup_dynamic_devices
x_core_install () {
smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
diff --git a/scripts/breezy b/scripts/breezy
index e0f0de1..2148cec 100644
--- a/scripts/breezy
+++ b/scripts/breezy
@@ -44,6 +44,8 @@ first_stage_install () {
chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
fi
+ setup_devices
+
x_feign_install () {
local pkg="$1"
local deb="$(debfor $pkg)"
@@ -71,7 +73,6 @@ second_stage_install () {
baseprog="$(($baseprog + ${1:-1}))"
}
- setup_devices
setup_proc
umount_on_exit /dev/.static/dev
umount_on_exit /dev
diff --git a/scripts/dapper b/scripts/dapper
index 4755240..af83c0c 100644
--- a/scripts/dapper
+++ b/scripts/dapper
@@ -51,6 +51,8 @@ first_stage_install () {
chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
fi
+ setup_devices
+
x_feign_install () {
local pkg="$1"
local deb="$(debfor $pkg)"
@@ -78,7 +80,6 @@ second_stage_install () {
baseprog="$(($baseprog + ${1:-1}))"
}
- setup_devices
setup_proc
in_target /sbin/ldconfig
diff --git a/scripts/edgy b/scripts/edgy
index 8175a0a..01d6568 100644
--- a/scripts/edgy
+++ b/scripts/edgy
@@ -57,6 +57,8 @@ first_stage_install () {
chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
fi
+ setup_devices
+
x_feign_install () {
local pkg="$1"
local deb="$(debfor $pkg)"
@@ -84,8 +86,6 @@ second_stage_install () {
baseprog="$(($baseprog + ${1:-1}))"
}
- setup_devices
-
if doing_variant fakechroot; then
setup_proc_fakechroot
else
diff --git a/scripts/feisty b/scripts/feisty
index b97b440..b0a4631 100644
--- a/scripts/feisty
+++ b/scripts/feisty
@@ -57,6 +57,8 @@ first_stage_install () {
chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
fi
+ setup_devices
+
x_feign_install () {
local pkg="$1"
local deb="$(debfor $pkg)"
@@ -84,8 +86,6 @@ second_stage_install () {
baseprog="$(($baseprog + ${1:-1}))"
}
- setup_devices
-
if doing_variant fakechroot; then
setup_proc_fakechroot
else
diff --git a/scripts/gutsy b/scripts/gutsy
index bb39bf5..c91c322 100644
--- a/scripts/gutsy
+++ b/scripts/gutsy
@@ -64,6 +64,8 @@ first_stage_install () {
chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
fi
+ setup_devices
+
x_feign_install () {
local pkg="$1"
local deb="$(debfor $pkg)"
@@ -91,8 +93,6 @@ second_stage_install () {
baseprog="$(($baseprog + ${1:-1}))"
}
- setup_devices
-
if doing_variant fakechroot; then
setup_proc_fakechroot
else
diff --git a/scripts/hoary b/scripts/hoary
index 985ace5..e5fe9fc 100644
--- a/scripts/hoary
+++ b/scripts/hoary
@@ -65,6 +65,8 @@ first_stage_install () {
chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
fi
+ setup_devices
+
x_feign_install () {
local pkg="$1"
local deb="$(debfor $pkg)"
@@ -98,7 +100,6 @@ second_stage_install () {
baseprog=0
bases=7
- setup_devices
setup_proc
umount_on_exit /.dev
umount_on_exit /dev
diff --git a/scripts/hoary.buildd b/scripts/hoary.buildd
index f553963..8d10d80 100644
--- a/scripts/hoary.buildd
+++ b/scripts/hoary.buildd
@@ -61,6 +61,8 @@ first_stage_install () {
chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
fi
+ setup_devices
+
x_feign_install () {
local pkg="$1"
local deb="$(debfor $pkg)"
@@ -93,7 +95,6 @@ second_stage_install () {
baseprog=0
bases=40
- setup_devices
setup_proc
in_target /sbin/ldconfig
diff --git a/scripts/potato b/scripts/potato
index d187100..b6dedab 100644
--- a/scripts/potato
+++ b/scripts/potato
@@ -54,6 +54,8 @@ Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
}
+ setup_devices
+
x_feign_install dpkg
if [ -e "$TARGET/usr/bin/perl-5.005.dist" ]; then
@@ -71,7 +73,6 @@ second_stage_install () {
export DEBIAN_FRONTEND=Noninteractive
- setup_devices
setup_proc
ln "$TARGET/sbin/ldconfig.new" "$TARGET/sbin/ldconfig"
in_target /sbin/ldconfig
diff --git a/scripts/sarge b/scripts/sarge
index 719543f..aa37d94 100644
--- a/scripts/sarge
+++ b/scripts/sarge
@@ -107,6 +107,8 @@ first_stage_install () {
chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
fi
+ setup_devices
+
x_feign_install () {
local pkg="$1"
local deb="$(debfor $pkg)"
@@ -134,7 +136,6 @@ second_stage_install () {
baseprog="$(($baseprog + ${1:-1}))"
}
- setup_devices
setup_proc
in_target /sbin/ldconfig
diff --git a/scripts/sarge.buildd b/scripts/sarge.buildd
index bc8be10..c674672 100644
--- a/scripts/sarge.buildd
+++ b/scripts/sarge.buildd
@@ -68,6 +68,8 @@ first_stage_install () {
chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
fi
+ setup_devices
+
x_feign_install () {
local pkg="$1"
local deb="$(debfor $pkg)"
@@ -95,7 +97,6 @@ second_stage_install () {
baseprog="$(($baseprog + ${1:-1}))"
}
- setup_devices
setup_proc
in_target /sbin/ldconfig
diff --git a/scripts/sid b/scripts/sid
index bf3404f..7b32ac2 100644
--- a/scripts/sid
+++ b/scripts/sid
@@ -53,6 +53,8 @@ first_stage_install () {
chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
fi
+ setup_devices
+
x_feign_install () {
local pkg="$1"
local deb="$(debfor $pkg)"
@@ -73,7 +75,7 @@ Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
}
second_stage_install () {
- setup_devices
+ setup_dynamic_devices
x_core_install () {
smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
diff --git a/scripts/warty b/scripts/warty
index d774871..e21a6d8 100644
--- a/scripts/warty
+++ b/scripts/warty
@@ -53,6 +53,8 @@ first_stage_install () {
chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
fi
+ setup_devices
+
x_feign_install () {
local pkg="$1"
local deb="$(debfor $pkg)"
@@ -84,7 +86,6 @@ second_stage_install () {
DEBCONF_NONINTERACTIVE_SEEN=true
export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
- setup_devices
setup_proc
in_target /sbin/ldconfig
diff --git a/scripts/warty.buildd b/scripts/warty.buildd
index 7e2fe74..09c5467 100644
--- a/scripts/warty.buildd
+++ b/scripts/warty.buildd
@@ -61,6 +61,8 @@ first_stage_install () {
chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
fi
+ setup_devices
+
x_feign_install () {
local pkg="$1"
local deb="$(debfor $pkg)"
@@ -93,7 +95,6 @@ second_stage_install () {
baseprog=0
bases=40
- setup_devices
setup_proc
in_target /sbin/ldconfig
diff --git a/scripts/woody b/scripts/woody
index d1b326f..12c65a3 100644
--- a/scripts/woody
+++ b/scripts/woody
@@ -93,6 +93,8 @@ first_stage_install () {
chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
fi
+ setup_devices
+
x_feign_install () {
local pkg="$1"
local deb="$(debfor $pkg)"
@@ -120,7 +122,6 @@ second_stage_install () {
baseprog="$(($baseprog + ${1:-1}))"
}
- setup_devices
setup_proc
in_target /sbin/ldconfig
diff --git a/scripts/woody.buildd b/scripts/woody.buildd
index 094fc9a..0dd8d50 100644
--- a/scripts/woody.buildd
+++ b/scripts/woody.buildd
@@ -68,6 +68,8 @@ first_stage_install () {
chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
fi
+ setup_devices
+
x_feign_install () {
local pkg="$1"
local deb="$(debfor $pkg)"
@@ -95,7 +97,6 @@ second_stage_install () {
baseprog="$(($baseprog + ${1:-1}))"
}
- setup_devices
setup_proc
in_target /sbin/ldconfig