#!/bin/sh . /etc/initrd.defaults . /etc/initrd.d/00-splash.sh . /etc/initrd.d/00-common.sh . /etc/initrd.d/00-fsdev.sh . /etc/initrd.d/00-devmgr.sh . /etc/initrd.d/00-zfs.sh . /etc/initrd.d/00-modules.sh . /etc/initrd.d/00-livecd.sh . /etc/initrd.d/00-nfs.sh . /etc/initrd.d/00-keymaps.sh . /etc/initrd.d/00-crypt.sh . /etc/initrd.d/00-suspend.sh . /etc/initrd.d/00-iscsi.sh . /etc/initrd.d/00-rootdev.sh getdvhoff() { echo $(( $(hexdump -n 4 -s $((316 + 12 * $2)) -e '"%i"' $1) * 512)) } # If devtmpfs is mounted, try move it to the new root # If that fails, try to unmount all possible mounts of devtmpfs as # stuff breaks otherwise move_mounts_to_chroot() { for fs in /run /dev /sys /proc; do if grep -qs "$fs" /proc/mounts; then local chroot_dir="${CHROOT}${fs}" mkdir -p "${chroot_dir}" if ! mount --move $fs "${chroot_dir}" then umount $fs || \ bad_msg "Failed to move and umount $fs!" fi fi done }