summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCyril Brulebois <kibi@debian.org>2016-01-24 07:55:11 (GMT)
committerCyril Brulebois <kibi@debian.org>2016-01-24 07:55:11 (GMT)
commit5518b79792dd93a416464c0744b87eb1a32ff770 (patch)
treefc2869393530f5a916d01ea5fa98c5ccb32b34ff
parentbaf3e6f22d126c49404eb5edc57cd6afc6096314 (diff)
downloaddebootstrap-5518b79792dd93a416464c0744b87eb1a32ff770.zip
debootstrap-5518b79792dd93a416464c0744b87eb1a32ff770.tar.gz
debootstrap-5518b79792dd93a416464c0744b87eb1a32ff770.tar.bz2
Stop creating useless device nodes (Closes: #571136).
Thanks to Marco d'Itri.
-rw-r--r--debian/changelog7
-rw-r--r--functions27
2 files changed, 28 insertions, 6 deletions
diff --git a/debian/changelog b/debian/changelog
index 8a938a3..77be5d1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+debootstrap (1.0.76) UNRELEASED; urgency=medium
+
+ [ Marco d'Itri ]
+ * Stop creating useless device nodes (Closes: #571136).
+
+ -- Cyril Brulebois <kibi@debian.org> Sun, 24 Jan 2016 08:54:06 +0100
+
debootstrap (1.0.75) unstable; urgency=medium
* Stop cleaning KEEP_DEBOOTSTRAP_DIR twice, as spotted by Chris Lamb
diff --git a/functions b/functions
index 8bef5e6..cd7f1ef 100644
--- a/functions
+++ b/functions
@@ -1060,19 +1060,34 @@ setup_devices () {
hurd*)
setup_devices_hurd ;;
*)
- if [ -e "$DEVICES_TARGZ" ]; then
+ if true; then
+ setup_devices_simple
+ elif [ -e "$DEVICES_TARGZ" ]; then
zcat "$DEVICES_TARGZ" | (cd "$TARGET"; tar -xf -)
else
- if [ -e /dev/.devfsd ] ; then
- in_target mount -t devfs devfs /dev
- else
- error 1 NODEVTGZ "no %s. cannot create devices" "$DEVICES_TARGZ"
- fi
+ error 1 NODEVTGZ "no %s. cannot create devices" "$DEVICES_TARGZ"
fi
;;
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.
+ mknod $TARGET/dev/null c 1 3
+ mknod $TARGET/dev/zero c 1 5
+ mknod $TARGET/dev/full c 1 7
+ mknod $TARGET/dev/random c 1 8
+ mknod $TARGET/dev/urandom c 1 9
+ mknod $TARGET/dev/tty c 5 0
+ mkdir $TARGET/dev/pts/ $TARGET/dev/shm/
+ ln -s pts/ptmx $TARGET/dev/ptmx
+ ln -s /proc/self/fd $TARGET/dev/fd
+ ln -s /proc/self/fd/0 $TARGET/dev/stdin
+ ln -s /proc/self/fd/1 $TARGET/dev/stdout
+ ln -s /proc/self/fd/2 $TARGET/dev/stderr
+}
+
setup_devices_hurd () {
# Use the setup-translators of the hurd package, and firmlink
# $TARGET/{dev,servers} to the system ones.