#!/bin/bash
# Under the terms of the 'COPYRIGHT.TXT' file.

# Toma por valor la particin root:
ROOT_DEV=$(awk '$2 == "/" { print $1 }' ${TMP}/fstab | cut -f 1 -d ' ')

# Desmonta lo que este montado sobre /mnt y la particin root:
umount /mnt 1> /dev/null 2>&1
umount $ROOT_DEV 1> /dev/null 2>&1

# Monta la particin root en /mnt:
mount $ROOT_DEV /mnt 1> $OUTPUT_TTY 2>&1
CODE=$?
if (( $CODE != 0 )); then
  dialog --title "ERROR" --msgbox \
"Error while trying to mount the root partition.\n\n\
mount error code $CODE" 0 0
  exit 99;
fi

echo "$ROOT_DEV" > ${TMP}/ROOT_DEV

