File: cros

package info (click to toggle)
partman-cros 14
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 436 kB
  • sloc: sh: 338; makefile: 2
file content (35 lines) | stat: -rwxr-xr-x 710 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
31
32
33
34
35
#!/bin/sh

# This script sets method "cros" for all partitions that have the
# chromeos_kernel flag set.

. /usr/lib/partman/lib/base.sh

for dev in /var/lib/partman/devices/*; do
	[ -d "$dev" ] || continue
	cd $dev
	partitions=
	open_dialog PARTITIONS
	while { read_line num id size type fs path name; [ "$id" ]; }; do
		if [ "$fs" != free ]; then
			partitions="$partitions $id"
		fi
	done
	close_dialog

	for id in $partitions; do
		cros=no
		open_dialog GET_FLAGS $id
		while { read_line flag; [ "$flag" ]; }; do
			if [ "$flag" = chromeos_kernel ]; then
				cros=yes
				# cannot break here
			fi
		done
		close_dialog
		if [ "$cros" = yes ]; then
			mkdir -p $id
			echo cros >$id/method
		fi
	done
done