File: no_btrfs_boot

package info (click to toggle)
partman-btrfs 54
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 524 kB
  • sloc: sh: 334; makefile: 2
file content (42 lines) | stat: -rwxr-xr-x 825 bytes parent folder | download | duplicates (5)
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
#!/bin/sh
# most bootloaders that read the filesysm do support /boot on
# btrfs. Some are known not to work, e.g. zipl on s390x. Detect and
# warn.

. /lib/partman/lib/base.sh

ARCH="$(archdetect)"
case $ARCH in
    s390x/*)
        ;;
    *)
        exit 0
        ;;
esac

get_btrfs_root_boot () {
	(for i in /lib/partman/fstab.d/*; do
		[ -x "$i" ] || continue
		$i
	done) |
	while read fs mp type options dump pass; do
		if [ "$mp" = / ]; then
			echo root_type=$type
		elif [ "$mp" = /boot ]; then
			echo boot_type=$type
		fi
	done
}
eval "$(get_btrfs_root_boot)"

if [ "$boot_type" = btrfs ]; then
	db_input critical partman-btrfs/btrfs_boot || true
	db_go || exit 1
	exit 1
fi

if [ "$boot_type" = "" ] && [ "$root_type" = btrfs ]; then
	db_input critical partman-btrfs/btrfs_root || true
	db_go || exit 1
	exit 1
fi