diff options
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. |