File: get_mountoptions

package info (click to toggle)
partman-basicfilesystems 156
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,616 kB
  • sloc: sh: 1,149; makefile: 2
file content (37 lines) | stat: -rwxr-xr-x 702 bytes parent folder | download | duplicates (7)
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
31
32
33
34
35
36
37
#!/bin/sh

. /usr/share/debconf/confmodule

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

cd $dev

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

devtype=${dev#*=dev=}
devtype=${devtype%[0-9]*}

if [ -f /lib/partman/mountoptions/$devtype ] ; then
	optionsfiles="$optionsfiles /lib/partman/mountoptions/$devtype"
fi

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

echo $options