File: get_mountoptions

package info (click to toggle)
partman-basicfilesystems 69
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 2,048 kB
  • ctags: 10
  • sloc: sh: 1,018; makefile: 2
file content (30 lines) | stat: -rwxr-xr-x 528 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh

. /usr/share/debconf/confmodule

dev=$1
id=$2
part=$dev/$id
filesystem=$(cat $part/acting_filesystem)
os=$(udpkg --print-os)

cd $dev

optionsfile=''
if [ -f /lib/partman/mountoptions/$filesystem.$os ] ; then
	optionsfile="/lib/partman/mountoptions/$filesystem.$os"
else
	optionsfile="/lib/partman/mountoptions/$filesystem"
fi

options=''
for op in $(cat $optionsfile); do
	if [ -f $part/options/$op ]; then
		options="${options:+$options,}$op"
	fi
done
if [ -z "$options" ]; then
	options=defaults
fi

echo $options