mirror of
https://github.com/linuxboot/heads.git
synced 2025-01-29 15:44:07 +00:00
shell script to setup dmverity device
This commit is contained in:
parent
e5e16bd47f
commit
2438460503
26
verity-sign
26
verity-sign
@ -76,17 +76,27 @@ my $hash_algorithm = $params{'Hash algorithm'}
|
|||||||
die "Missing parameter: ", join(', ', @missing), "\n"
|
die "Missing parameter: ", join(', ', @missing), "\n"
|
||||||
if @missing;
|
if @missing;
|
||||||
|
|
||||||
|
# Compute the derived parameters
|
||||||
my $data_size = $data_blocks * $data_block_size;
|
my $data_size = $data_blocks * $data_block_size;
|
||||||
my $data_size_512b = $data_size / 512;
|
my $data_size_512b = $data_size / 512;
|
||||||
my $first_hash_block = $data_blocks + 1;
|
my $first_hash_block = $data_blocks + 1;
|
||||||
|
|
||||||
print <<"";
|
# The table must be on a single line
|
||||||
0 $data_size_512b verity $hash_type
|
my $table = sprintf "0 %d verity %d %s %s %d %d %d %d %s %s %s",
|
||||||
$dev $dev
|
$data_size_512b,
|
||||||
$data_block_size $hash_block_size
|
$hash_type,
|
||||||
$data_blocks $first_hash_block
|
$dev,
|
||||||
$hash_algorithm
|
$dev,
|
||||||
$root_hash
|
$data_block_size,
|
||||||
$salt
|
$hash_block_size,
|
||||||
|
$data_blocks,
|
||||||
|
$first_hash_block,
|
||||||
|
$hash_algorithm,
|
||||||
|
$root_hash,
|
||||||
|
$salt,
|
||||||
|
;
|
||||||
|
|
||||||
|
print "dmsetup create --readonly boot --table '$table'\n";
|
||||||
|
print "dmsetup mknodes boot\n";
|
||||||
|
|
||||||
__END__
|
__END__
|
||||||
|
Loading…
x
Reference in New Issue
Block a user