File: forget_old_efi

package info (click to toggle)
partman-efi 110
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 676 kB
  • sloc: sh: 435; makefile: 2
file content (21 lines) | stat: -rwxr-xr-x 561 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
#!/bin/sh
set -e

. /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
		method=$(cat $id/method)
		if [ -n "$method" ] && [ "$method" != efi ] && [ -f $id/old_efi ]; then
			# new method, so forget that the partition was EFI
			log "efi_debug: new method $method set to former EFI partition $path, so remove old_efi"
			rm -f $id/old_efi
		fi
	done
	close_dialog
done