File: ufs_root

package info (click to toggle)
partman-ufs 14
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 432 kB
  • sloc: sh: 355; makefile: 2
file content (44 lines) | stat: -rwxr-xr-x 933 bytes parent folder | download | duplicates (3)
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
38
39
40
41
42
43
44
#!/bin/sh
# Check that the root partition is of type UFS.

case "$(udpkg --print-os)" in
	"kfreebsd")
	;;
	*)
		exit 0
	;;
esac

. /lib/partman/lib/base.sh

for dev in $DEVICES/*; do
	[ -d "$dev" ] || continue
	cd $dev
	open_dialog PARTITIONS
	while { read_line num id size type fs path name; [ "$id" ]; }; do
		[ "$fs" != free ] || continue
		[ -f $id/method ] || continue
		[ -f $id/acting_filesystem ] || continue
		[ -f $id/mountpoint ] || continue
		mountpoint=$(cat $id/mountpoint)
		filesystem=$(cat $id/acting_filesystem)
		if [ "$mountpoint" = / ]; then
			root_fs=$filesystem
			root_type=$type
			root_path=$path
		fi
	done
	close_dialog
done

# We need a root UFS or ZFS filesystem
if [ "$root_fs" != ufs ] && [ "$root_fs" != zfs ]; then
	db_set partman-ufs/root_not_ufs true
	db_input critical partman-ufs/root_not_ufs || true
	db_go || true
	db_get partman-ufs/root_not_ufs
	if [ "$RET" = true ]; then
		exit 1
	fi
fi