Splitting out swap handling and rewriting to a live-boot subscript.
[live-boot-grml.git] / initramfs-tools / scripts / live-bottom / 12fstab
1 #!/bin/sh
2
3 #set -e
4
5 # initramfs-tools header
6
7 PREREQ=""
8 FSTAB=/root/etc/fstab
9
10 prereqs()
11 {
12         echo "${PREREQ}"
13 }
14
15 case "${1}" in
16         prereqs)
17                 prereqs
18                 exit 0
19                 ;;
20 esac
21
22 # live-boot header
23
24 # FIXME: stop hardcoding overloading of initramfs-tools functions
25 . /scripts/functions
26 . /lib/live/boot/initramfs-tools.sh
27
28 if [ -n "${NOFSTAB}" ]
29 then
30         exit 0
31 fi
32
33 log_begin_msg "Configuring fstab"
34
35 # live-boot script
36
37 if ! grep -qs  "^${UNIONTYPE}" "${FSTAB}"
38 then
39         echo "${UNIONTYPE} / ${UNIONTYPE} rw 0 0" >> "${FSTAB}"
40 fi
41
42 if ! grep -qs "^tmpfs /tmp" "${FSTAB}"
43 then
44         echo "tmpfs /tmp tmpfs nosuid,nodev 0 0" >> "${FSTAB}"
45 fi
46
47 if [ "${NOFASTBOOT}" != "true" ]
48 then
49         touch root/fastboot
50 fi
51
52 log_end_msg