diff options
Diffstat (limited to 'src/partvi')
-rwxr-xr-x | src/partvi | 18 |
1 files changed, 14 insertions, 4 deletions
@@ -53,11 +53,23 @@ get_root_hash() | |||
53 | sed -ne 's/^Root hash:[ \t]*//p' "$1" | 53 | sed -ne 's/^Root hash:[ \t]*//p' "$1" |
54 | } | 54 | } |
55 | 55 | ||
56 | require_exists() | ||
57 | { | ||
58 | local f | ||
59 | for f | ||
60 | do | ||
61 | [ -f "$f" ] || die "Not a file: $f" | ||
62 | done | ||
63 | } | ||
64 | |||
65 | set -e | ||
66 | |||
56 | builddir=_build | 67 | builddir=_build |
57 | mkdir -p "$builddir" | 68 | mkdir -p "$builddir" |
58 | 69 | ||
59 | for f in part*.conf | 70 | for f in part*.conf |
60 | do | 71 | do |
72 | notice "Processing $f" | ||
61 | img=${f%.conf} | 73 | img=${f%.conf} |
62 | 74 | ||
63 | read_config_file "$img" || warn "Received error return from command: read_config_file $img" | 75 | read_config_file "$img" || warn "Received error return from command: read_config_file $img" |
@@ -92,9 +104,7 @@ do | |||
92 | case "$type" in | 104 | case "$type" in |
93 | dm-verity-hashes|dm-verity-data) | 105 | dm-verity-hashes|dm-verity-data) |
94 | require_var data_path | 106 | require_var data_path |
95 | [ -f "$data_path" ] | 107 | require_exists "$data_path" "$data_path".verity "$data_path".verity.log |
96 | [ -f "$data_path".verity ] | ||
97 | [ -f "$data_path".verity.log ] | ||
98 | root_hash=$(get_root_hash "$data_path".verity.log) | 108 | root_hash=$(get_root_hash "$data_path".verity.log) |
99 | [ ${#root_hash} = 64 ] | 109 | [ ${#root_hash} = 64 ] |
100 | ;; | 110 | ;; |
@@ -108,7 +118,7 @@ do | |||
108 | case "$type" in | 118 | case "$type" in |
109 | efi-system-partition) mkfs.vfat "$tmp" || die "mkfs.vfat failed" ;; | 119 | efi-system-partition) mkfs.vfat "$tmp" || die "mkfs.vfat failed" ;; |
110 | bios-grub) mkfs.vfat "$tmp" || die "mkfs.vfat failed" ;; | 120 | bios-grub) mkfs.vfat "$tmp" || die "mkfs.vfat failed" ;; |
111 | samizdat-keys) mkfs.btrfs "$tmp" || die "mkfs.btrfs failed" ;; | 121 | samizdat-keys) mkfs.btrfs -q "$tmp" || die "mkfs.btrfs failed" ;; |
112 | dm-verity-data) | 122 | dm-verity-data) |
113 | partuuid=${root_hash:0:32} | 123 | partuuid=${root_hash:0:32} |
114 | cp -f -T --reflink "$data_path" "$builddir"/"$partuuid" | 124 | cp -f -T --reflink "$data_path" "$builddir"/"$partuuid" |