Transforming fstab bottom script into normal live-boot script.
[live-boot-grml.git] / scripts / boot / fstab.sh
1 #!/bin/sh
2
3 #set -e
4
5 Fstab ()
6 {
7         # FIXME: stop hardcoding overloading of initramfs-tools functions
8         . /scripts/functions
9         . /lib/live/boot/initramfs-tools.sh
10
11         if [ -n "${NOFSTAB}" ]
12         then
13                 return
14         fi
15
16         if [ -e /run ]
17         then
18                 # wheezy
19                 _FSTAB="/root/etc/fstab.d/live"
20         else
21                 # squeeze
22                 _FSTAB="/root/etc/fstab"
23         fi
24
25         log_begin_msg "Configuring fstab"
26
27         if ! grep -qs  "^${UNIONTYPE}" "${_FSTAB}"
28         then
29                 echo "${UNIONTYPE} / ${UNIONTYPE} rw 0 0" >> "${_FSTAB}"
30         fi
31
32         if ! grep -qs "^tmpfs /tmp" "${_FSTAB}"
33         then
34                 echo "tmpfs /tmp tmpfs nosuid,nodev 0 0" >> "${_FSTAB}"
35         fi
36
37         log_end_msg
38 }