+ # unionfs-fuse needs /dev to be bind-mounted for the duration of
+ # live-bottom; udev's init script will take care of things after that
+ if [ "${UNIONTYPE}" = unionfs-fuse ]
+ then
+ mount -n -o bind /dev "${rootmnt}/dev"
+ fi
+
+ # Open up two fifo's fd's for debconf-communicate to use. Speeds up
+ # the live-initramfs process considerably.
+ log_begin_msg "Creating debconf-communicate fifo mechanism"
+ mkfifo /tmp/debconf-in.fifo
+ mkfifo /tmp/debconf-out.fifo
+
+ # Make the template database read-only, so that passthrough debconf
+ # instances can write to it directly; otherwise templates are only
+ # passed through when necessary. Use temporary config databases as
+ # well; we'll copy their contents back at the end.
+ DEBCONF_TMPDIR="$(chroot /root mktemp -dt debconf.XXXXXX)"
+ cp -a /root/var/cache/debconf/config.dat "/root$DEBCONF_TMPDIR/"
+ cp -a /root/var/cache/debconf/passwords.dat "/root$DEBCONF_TMPDIR/"
+ sed "s,^Filename: /var/cache/debconf/\(config\|passwords\).dat$,Filename: $DEBCONF_TMPDIR/\1.dat,; /^Name: templatedb/a\
++Readonly: true" /root/etc/debconf.conf >"/root$DEBCONF_TMPDIR/debconf.conf"
+
+ # Save the PID so it can be killed later.
+ DEBCONF_SYSTEMRC="$DEBCONF_TMPDIR/debconf.conf" chroot /root debconf-communicate -fnoninteractive live-initramfs > /tmp/debconf-out.fifo < /tmp/debconf-in.fifo &
+
+ if [ ! -p /tmp/debconf-in.fifo ] || [ ! -p /tmp/debconf-out.fifo ]
+ then
+ log_warning_msg "failed to setup debconf-communicate channel"
+ fi
+ log_end_msg
+
+ # Order matters!
+ # These file descriptors must stay open until we're finished with
+ # debconf-communicate.
+ exec 4</tmp/debconf-out.fifo 3>/tmp/debconf-in.fifo
+