#!/bin/sh
# /etc/initramfs-tools/scripts/init-premount/runbootcdproberoot
# local-top geht nicht weil root=auto nicht nach local kommt

# See manpage initramfs-tools(8)
. /scripts/functions

PREREQ="udev"
prereqs()
{
    echo "$PREREQ"
}

case $1 in
prereqs)
    prereqs
    exit 0
    ;;
esac

if [ "$(grep "\<bootcd=" /proc/cmdline)" ]; then
  # we are not called from cd with option bootcd=bootcd or bootcd=standard

  [ -x "/usr/share/bootcd/bootcdproberoot" ] || panic "bootcdproberoot not found"

  log_begin_msg "Starting bootcdproberoot"
  oldroot=$(cat /proc/sys/kernel/real-root-dev)
  /usr/share/bootcd/bootcdproberoot ||panic "bootcdproberoot failed"

  log_end_msg
fi

exit 0
