OSDN Git Service

fix quotes
[instantos/instantARCH.git] / disk / mount.sh
1 #!/bin/bash
2
3 # mounts all partitions to to the installation medium
4
5 # mountpart partname mountpoint
6 mountpart() {
7     if iroot part$1; then
8         TMPPART="$(iroot part$1)"
9         echo "mounting $TMPPART to $2"
10         mount "$TMPPART" "$2"
11     else
12         echo "using default partition for $2"
13     fi
14 }
15
16 # todo: optional efi
17 mountpart efi /efi
18
19 mountpart root /mnt
20 # home is optional
21 mkdir /mnt/home
22 mountpart home /mnt/home
23 sleep 2
24
25 if iroot partswap; then
26     echo "activating swap"
27     swapon "$(iroot partswap)"
28 fi
29
30 if ! mount | grep -q '/mnt'; then
31     echo "mount failed"
32     exit 1
33 fi