1 # This file is part of the 'dragora-installer'.
3 # Purpose: Make mount points and mount non-root filesystems from fstab.
5 # Make declared mount points from fstab, exclude:
6 # commentaries, root, and possible swapfile.
9 grep -E -v '^#|swap|/ ' "${SUBTMPDIR}/fstab" | \
10 awk '{ print substr($2,2) }' | while read -r directory
12 test -n "$directory" || continue
14 # Make sure to translate converted \040 blank spaces
15 # into common spaces for directory creation (see MakeFS)
16 directory="$(printf '%s' "$directory" | tr '\\040' ' ')"
18 if test ! -d "/media/dragora-root/$directory"
20 mkdir -p -- "/media/dragora-root/$directory"
27 if test -s "${SUBTMPDIR}/fstab"
29 awk '!/^#/ && !/\/ / && !/fd0/ && !/proc/ && !/swap/ { print $1,$2 }' \
30 "${SUBTMPDIR}/fstab" | while IFS=" " read -r device mntpoint
32 umount "$device" > /dev/null 2>&1 || true
34 mntpoint="$(printf '%s' "$mntpoint" | tr '\\040' ' ')"
35 mntpoint="/media/dragora-root/${mntpoint}"
38 echo "Mounting the rest of the file systems ..."
39 mount -v "$device" "$mntpoint" || exit $?
45 if test ! -e /media/dragora-root/etc/fstab
50 # Copy fstab into root partition
51 mkdir -p -- /media/dragora-root/etc && \
52 cp -f -- "${SUBTMPDIR}/fstab" /media/dragora-root/etc/
54 dialog --no-shadow --colors \
55 --backtitle "\\ZbFile system table (fstab)" \
56 --title "EXISTING FILE SYSTEM TABLE" \
58 "A file system table already exists on the mounted root
59 partition (/media/dragora-root/etc/fstab).\\n\\n\
60 Overwrite this file only if:\\n\
61 - This is a new installation.\\n\
62 - You are installing a new kernel image.\\n\
63 - To create a boot disk with a new kernel.\\n\\n\
64 In this case, you must configure the system to boot\\n\
66 Do not overwrite the file system table if you are adding\\n\
67 software to the existing system...\\n\\n\
68 Do you want to replace the existing fstab with the new one?" \
69 $((LINES - 4)) 64 || return 0
72 mkdir -p -- /media/dragora-root/etc && \
73 cp -f -- "${SUBTMPDIR}/fstab" /media/dragora-root/etc/
76 unset mountPoint mountNonRoot