Skip to content

Commit 977ae86

Browse files
authored
Revert "Image Customizer: Fix partition creation on Ubuntu build hosts." (#10901)
Reverts #10897. Wrong branch. :-(
1 parent 49c865c commit 977ae86

3 files changed

Lines changed: 2 additions & 19 deletions

File tree

toolkit/tools/pkg/imagecustomizerlib/imageutils.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,6 @@ func createImageBoilerplate(imageConnection *ImageConnection, filename string, b
183183
return nil, "", fmt.Errorf("failed to create partitions on disk (%s):\n%w", imageConnection.Loopback().DevicePath(), err)
184184
}
185185

186-
// Refresh partition entries under /dev.
187-
err = refreshPartitions(imageConnection.Loopback().DevicePath())
188-
if err != nil {
189-
return nil, "", err
190-
}
191-
192186
// Read the disk partitions.
193187
diskPartitions, err := diskutils.GetDiskPartitions(imageConnection.Loopback().DevicePath())
194188
if err != nil {

toolkit/tools/pkg/imagecustomizerlib/partitionutils.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import (
1818
"github.com/microsoft/azurelinux/toolkit/tools/internal/logger"
1919
"github.com/microsoft/azurelinux/toolkit/tools/internal/safechroot"
2020
"github.com/microsoft/azurelinux/toolkit/tools/internal/safemount"
21-
"github.com/microsoft/azurelinux/toolkit/tools/internal/shell"
2221
"github.com/microsoft/azurelinux/toolkit/tools/internal/sliceutils"
2322
)
2423

@@ -461,13 +460,3 @@ func getPartitionNum(partitionLoopDevice string) (int, error) {
461460

462461
return num, nil
463462
}
464-
465-
func refreshPartitions(diskDevPath string) error {
466-
err := shell.ExecuteLiveWithErr(1 /*stderrLines*/, "flock", "--timeout", "5", diskDevPath,
467-
"partprobe", "-s", diskDevPath)
468-
if err != nil {
469-
return fmt.Errorf("partprobe failed:\n%w", err)
470-
}
471-
472-
return nil
473-
}

toolkit/tools/pkg/imagecustomizerlib/shrinkfilesystems.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ func shrinkFilesystems(imageLoopDevice string, verity []imagecustomizerapi.Verit
108108
}
109109

110110
// Re-read the partition table
111-
err = refreshPartitions(imageLoopDevice)
111+
err = shell.ExecuteLive(true, "flock", "--timeout", "5", imageLoopDevice, "partprobe", "-s", imageLoopDevice)
112112
if err != nil {
113-
return err
113+
return fmt.Errorf("partprobe failed:\n%w", err)
114114
}
115115
}
116116
return nil

0 commit comments

Comments
 (0)