diff options
author | Cyril Brulebois <kibi@debian.org> | 2016-01-24 07:55:11 (GMT) |
---|---|---|
committer | Cyril Brulebois <kibi@debian.org> | 2016-01-24 07:55:11 (GMT) |
commit | 5518b79792dd93a416464c0744b87eb1a32ff770 (patch) | |
tree | fc2869393530f5a916d01ea5fa98c5ccb32b34ff /functions | |
parent | baf3e6f22d126c49404eb5edc57cd6afc6096314 (diff) | |
download | debootstrap-5518b79792dd93a416464c0744b87eb1a32ff770.zip debootstrap-5518b79792dd93a416464c0744b87eb1a32ff770.tar.gz debootstrap-5518b79792dd93a416464c0744b87eb1a32ff770.tar.bz2 |
Stop creating useless device nodes (Closes: #571136).
Thanks to Marco d'Itri.
Diffstat (limited to 'functions')
-rw-r--r-- | functions | 27 |
1 files changed, 21 insertions, 6 deletions
@@ -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. |