diff options
author | Marco d'Itri <md@linux.it> | 2016-02-18 01:10:50 (GMT) |
---|---|---|
committer | Samuel Thibault <sthibault@debian.org> | 2016-02-18 01:10:50 (GMT) |
commit | aaac37bbff19d26ac19790c70ee9f42ec92f019c (patch) | |
tree | b84f490c0bf31c20c5e92a147dd6f1659f0bf5ba /functions | |
parent | 745d40d7bb7a7b37885982ac3b06f836131a45d6 (diff) | |
download | debootstrap-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)
Diffstat (limited to 'functions')
-rw-r--r-- | functions | 23 |
1 files changed, 20 insertions, 3 deletions
@@ -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. |