@@ -106,11 +106,11 @@ func prepareGrubConfigForVerity(imageChroot *safechroot.Chroot) error {
106
106
}
107
107
108
108
func updateGrubConfigForVerity (rootfsVerity imagecustomizerapi.Verity , rootHash string , grubCfgFullPath string ,
109
- partIdToPartUuid map [string ]string , partitions []diskutils.PartitionInfo ,
109
+ partIdToPartUuid map [string ]string , partitions []diskutils.PartitionInfo , buildDir string ,
110
110
) error {
111
111
var err error
112
112
113
- newArgs , err := constructVerityKernelCmdlineArgs (rootfsVerity , rootHash , partIdToPartUuid , partitions )
113
+ newArgs , err := constructVerityKernelCmdlineArgs (rootfsVerity , rootHash , partIdToPartUuid , partitions , buildDir )
114
114
if err != nil {
115
115
return fmt .Errorf ("failed to generate verity kernel arguments:\n %w" , err )
116
116
}
@@ -155,16 +155,17 @@ func updateGrubConfigForVerity(rootfsVerity imagecustomizerapi.Verity, rootHash
155
155
}
156
156
157
157
func constructVerityKernelCmdlineArgs (rootfsVerity imagecustomizerapi.Verity , rootHash string ,
158
- partIdToPartUuid map [string ]string , partitions []diskutils.PartitionInfo ) ([]string , error ) {
158
+ partIdToPartUuid map [string ]string , partitions []diskutils.PartitionInfo , buildDir string ,
159
+ ) ([]string , error ) {
159
160
// Format the dataPartitionId and hashPartitionId using the helper function.
160
161
formattedDataPartition , err := systemdFormatPartitionId (rootfsVerity .DataDeviceId ,
161
- rootfsVerity .DataDeviceMountIdType , partIdToPartUuid , partitions )
162
+ rootfsVerity .DataDeviceMountIdType , partIdToPartUuid , partitions , buildDir )
162
163
if err != nil {
163
164
return nil , err
164
165
}
165
166
166
167
formattedHashPartition , err := systemdFormatPartitionId (rootfsVerity .HashDeviceId ,
167
- rootfsVerity .HashDeviceMountIdType , partIdToPartUuid , partitions )
168
+ rootfsVerity .HashDeviceMountIdType , partIdToPartUuid , partitions , buildDir )
168
169
if err != nil {
169
170
return nil , err
170
171
}
@@ -218,11 +219,11 @@ func partitionMatchesDeviceId(configDeviceId string, partition diskutils.Partiti
218
219
219
220
// systemdFormatPartitionId formats the partition ID based on the ID type following systemd dm-verity style.
220
221
func systemdFormatPartitionId (configDeviceId string , mountIdType imagecustomizerapi.MountIdentifierType ,
221
- partIdToPartUuid map [string ]string , partitions []diskutils.PartitionInfo ,
222
+ partIdToPartUuid map [string ]string , partitions []diskutils.PartitionInfo , buildDir string ,
222
223
) (string , error ) {
223
224
partUuid := partIdToPartUuid [configDeviceId ]
224
225
225
- partition , _ , err := findPartition (imagecustomizerapi .MountIdentifierTypePartUuid , partUuid , partitions )
226
+ partition , _ , err := findPartition (imagecustomizerapi .MountIdentifierTypePartUuid , partUuid , partitions , buildDir )
226
227
if err != nil {
227
228
return "" , err
228
229
}
@@ -274,7 +275,7 @@ func validateVerityDependencies(imageChroot *safechroot.Chroot) error {
274
275
func updateUkiKernelArgsForVerity (rootfsVerity imagecustomizerapi.Verity , rootHash string ,
275
276
partIdToPartUuid map [string ]string , partitions []diskutils.PartitionInfo , buildDir string ,
276
277
) error {
277
- newArgs , err := constructVerityKernelCmdlineArgs (rootfsVerity , rootHash , partIdToPartUuid , partitions )
278
+ newArgs , err := constructVerityKernelCmdlineArgs (rootfsVerity , rootHash , partIdToPartUuid , partitions , buildDir )
278
279
if err != nil {
279
280
return fmt .Errorf ("failed to generate verity kernel arguments:\n %w" , err )
280
281
}
0 commit comments