+# Mount the additional things as required by udev & systemd
+if [ -f ${NEW_ROOT}/etc/initramfs.mounts ]; then
+ fslist=$(get_mounts_list)
+else
+ fslist="/usr"
+fi
+
+for fs in $fslist; do
+ dev=$(get_mount_device $fs)
+ [ -z "${dev}" ] && continue
+ # Resolve it like util-linux mount does
+ [ -L ${dev} ] && dev=`readlink ${dev}`
+ # In this case, it's probably part of the filesystem
+ # and not a mountpoint
+ [ -z "$dev" ] && continue
+ fstype=$(get_mount_fstype $fs)
+ if get_mount_options $fs | fgrep -q bind ; then
+ opts='bind'
+ dev=${NEW_ROOT}${dev}
+ else
+ # ro must be trailing, and the options will always contain at least 'defaults'
+ opts="$(get_mount_options $fs | strip_mount_options),ro"
+ fi
+ mnt=${NEW_ROOT}${fs}
+ cmd="mount -t $fstype -o $opts $dev $mnt"
+ good_msg "Mounting $dev as ${fs}: $cmd"
+ if ! $cmd; then
+ bad_msg "Unable to mount $dev for $fs"
+ fi
+done
+