MountRoot 890 B

1234567891011121314151617181920212223242526272829303132333435
  1. # This file is part of the 'dragora-installer'.
  2. #
  3. # Purpose: Mount root partition, device from declared fstab.
  4. dialog --colors \
  5. --backtitle "\\ZbRoot partition" \
  6. --title "ROOT MOUNT" --sleep 2 \
  7. --infobox "Preparing to mount designated root partition for installation..." 3 68
  8. # Figure out device name from fstab
  9. ROOT_DEVICE="$(awk '$2 == "/" { print $1 }' "${SUBTMPDIR}/fstab" | cut -f 1 -d ' ')"
  10. # Expose 'ROOT_DEVICE' for MenuBootloader
  11. echo "$ROOT_DEVICE" > "${SUBTMPDIR}/root_device"
  12. # Create mount-point destination
  13. mkdir -p -- /media/dragora-root
  14. if mountpoint -q /media/dragora-root
  15. then
  16. umount /media/dragora-root
  17. fi
  18. umount "$ROOT_DEVICE" > /dev/null 2>&1 || true
  19. dialog --clear
  20. echo "Mounting $ROOT_DEVICE on /media/dragora-root ..."
  21. sleep 1
  22. mount -v "$ROOT_DEVICE" /media/dragora-root
  23. sleep 2
  24. # This will be used later (e.g bootloader entry)
  25. export ROOT_DEVICE