#!/bin/sh -x exec 2>/tmp/re.log . install2-init-functions here() { echo $* >&2; grep $destdir /proc/mounts >&2; } sync here "before umount" umount $destdir/dev/pts chroot "$destdir" umount -a for d in /run /sys /proc /dev/pts /dev; do umount "$destdir$d" ||: done umount "$destdir" here "after umount" cat /proc/mdstat >&2 mdadm --examine --scan > /tmp/mdadm.conf mdadm --stop --scan dmsetup remove_all #rmmod dm_mod #sleep 0.1 #modprobe dm_mod #sleep 0.5 # might have stored it in ../initinstall.d/10-disk.sh echo 1000000 > /proc/sys/dev/raid/speed_limit_max mdadm --assemble --run --scan --config=/tmp/mdadm.conf cat /proc/mdstat >&2 # FIXME: copy from chroot in advance if [ -x "/sbin/lvm" ]; then lvm pvscan lvm vgscan lvm vgchange -ay --noudevsync fi rootfs="$(awk '{ if ($2=="/") print $1 }' < /tmp/fstab)" case "$rootfs" in UUID=*) mount "`blkid -U ${rootfs#UUID=}`" $destdir;; LABEL=*) mount "`blkid -L ${rootfs#LABEL=}`" $destdir;; /*) mount "$rootfs" "$destdir";; *) echo "11-remount.sh: PANIC" >&2; exit 2;; esac # FIXME: /run #for d in /dev /dev/pts /proc /sys; do mount "$destdir$d"; done mount --bind /dev $destdir/dev mount -t sysfs sysfs "$destdir/sys" mount -t proc proc "$destdir/proc" chroot "$destdir" mount -a here "after mount"