Skip to content

Commit

Permalink
Remove debug messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
gmileka committed Jan 8, 2025
1 parent 363db60 commit 49b7a36
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 26 deletions.
8 changes: 6 additions & 2 deletions toolkit/tools/pkg/imagecustomizerlib/customizeverity.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ func updateGrubConfigForVerity(rootfsVerity imagecustomizerapi.Verity, rootHash
partIdToPartUuid map[string]string, partitions []diskutils.PartitionInfo,
rootHashSignatureArgument string, requireRootHashSignatureArgument string, bootPartitionUuid string,
) error {
logger.Log.Debugf("---- debug ---- updateGrubConfigForVerity()")

var err error

newArgs, err := constructVerityKernelCmdlineArgs(rootfsVerity, rootHash, partIdToPartUuid, partitions,
Expand All @@ -123,7 +125,7 @@ func updateGrubConfigForVerity(rootfsVerity imagecustomizerapi.Verity, rootHash
return fmt.Errorf("failed to generate verity kernel arguments:\n%w", err)
}

logger.Log.Debugf("---- debug ---- newArgs=(%s)", newArgs)
logger.Log.Debugf("---- debug ---- updateGrubConfigForVerity() - newArgs=(%s)", newArgs)

grub2Config, err := file.Read(grubCfgFullPath)
if err != nil {
Expand Down Expand Up @@ -289,13 +291,15 @@ func updateUkiKernelArgsForVerity(rootfsVerity imagecustomizerapi.Verity, rootHa
partIdToPartUuid map[string]string, partitions []diskutils.PartitionInfo, buildDir string,
rootHashSignatureArgument string, requireRootHashSignatureArgument string, bootPartitionUuid string,
) error {
logger.Log.Debugf("---- debug ---- updateUkiKernelArgsForVerity()")

newArgs, err := constructVerityKernelCmdlineArgs(rootfsVerity, rootHash, partIdToPartUuid, partitions,
rootHashSignatureArgument, requireRootHashSignatureArgument, bootPartitionUuid)
if err != nil {
return fmt.Errorf("failed to generate verity kernel arguments:\n%w", err)
}

logger.Log.Debugf("---- debug ---- newArgs=(%s)", newArgs)
logger.Log.Debugf("---- debug ---- updateUkiKernelArgsForVerity() - newArgs=(%s)", newArgs)

// UKI is enabled, update ukify kernel cmdline args file instead of grub.cfg.
err = appendKernelArgsToUkiCmdlineFile(buildDir, newArgs)
Expand Down
17 changes: 0 additions & 17 deletions toolkit/tools/pkg/imagecustomizerlib/partitionutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,18 +129,10 @@ func findRootfsPartition(diskPartitions []diskutils.PartitionInfo, buildDir stri

tmpDir := filepath.Join(buildDir, tmpParitionDirName)

logger.Log.Debugf("---- debug ---- findRootfsPartition()")

var rootfsPartitions []*diskutils.PartitionInfo
for i := range diskPartitions {
diskPartition := diskPartitions[i]

logger.Log.Debugf("---- debug ---- findRootfsPartition() - diskPartition.Name =(%s)", diskPartition.Name)
logger.Log.Debugf("---- debug ---- findRootfsPartition() - diskPartition.Type =(%s)", diskPartition.Type)
logger.Log.Debugf("---- debug ---- findRootfsPartition() - diskPartition.FileSystemType=(%s)", diskPartition.FileSystemType)
logger.Log.Debugf("---- debug ---- findRootfsPartition() - diskPartition.Path =(%s)", diskPartition.Path)
logger.Log.Debugf("---- debug ---- findRootfsPartition() - diskPartition.Mountpoint =(%s)", diskPartition.Mountpoint)

// Skip over disk entries.
if diskPartition.Type != "part" {
continue
Expand All @@ -156,8 +148,6 @@ func findRootfsPartition(diskPartitions []diskutils.PartitionInfo, buildDir stri
continue
}

logger.Log.Debugf("---- debug ---- findRootfsPartition() - 1")

// Temporarily mount the partition.
partitionMount, err := safemount.NewMount(diskPartition.Path, tmpDir, diskPartition.FileSystemType, unix.MS_RDONLY,
"", true)
Expand All @@ -173,8 +163,6 @@ func findRootfsPartition(diskPartitions []diskutils.PartitionInfo, buildDir stri
return nil, fmt.Errorf("failed to check if /etc/fstab file exists (%s):\n%w", diskPartition.Path, err)
}

logger.Log.Debugf("---- debug ---- findRootfsPartition() - 2")

if exists {
rootfsPartitions = append(rootfsPartitions, &diskPartition)
}
Expand All @@ -184,8 +172,6 @@ func findRootfsPartition(diskPartitions []diskutils.PartitionInfo, buildDir stri
if err != nil {
return nil, fmt.Errorf("failed to close partition mount (%s):\n%w", diskPartition.Path, err)
}

logger.Log.Debugf("---- debug ---- findRootfsPartition() - 3")
}

if len(rootfsPartitions) > 1 {
Expand Down Expand Up @@ -259,11 +245,8 @@ func fstabEntriesToMountPoints(fstabEntries []diskutils.FstabEntry, diskPartitio
return nil, err
}

logger.Log.Debugf("---- debug ---- source=(%s)", source)

// ToDo: device mapper and overlay return an empty string
if source == "" {
logger.Log.Debugf("---- debug ---- skipping")
continue
}

Expand Down
7 changes: 0 additions & 7 deletions toolkit/tools/pkg/imagecustomizerlib/shrinkfilesystems.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,6 @@ func shrinkFilesystems(imageLoopDevice string, verity []imagecustomizerapi.Verit
}

// Resize the partition with parted resizepart
// _, stderr, err = shell.ExecuteWithStdin("yes" /*stdin*/, "flock", "--timeout", "5", imageLoopDevice,
// "parted", "---pretend-input-tty", imageLoopDevice, "resizepart",
// strconv.Itoa(partitionNumber), end)
// if err != nil {
// return fmt.Errorf("failed to resizepart %s with parted (and flock):\n%v", partitionLoopDevice, stderr)
// }

_, stderr, err = shell.ExecuteWithStdin("yes" /*stdin*/, "flock", "--timeout", "5", imageLoopDevice,
"parted", "---pretend-input-tty", imageLoopDevice, "resizepart",
strconv.Itoa(partitionNumber), end)
Expand Down

0 comments on commit 49b7a36

Please sign in to comment.