Skip to content

Commit

Permalink
printf
Browse files Browse the repository at this point in the history
  • Loading branch information
pothos committed Nov 21, 2023
1 parent e49954f commit cf70f17
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
From cae210b50372c63a03ff221f7d00c0e3139f4cf4 Mon Sep 17 00:00:00 2001
From: Kai Lueke <[email protected]>
Date: Tue, 21 Nov 2023 17:39:23 +0100
Subject: [PATCH] printf

---
internal/exec/stages/disks/partitions.go | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/internal/exec/stages/disks/partitions.go b/internal/exec/stages/disks/partitions.go
index 97591c2f..3d5ee8f3 100644
--- a/internal/exec/stages/disks/partitions.go
+++ b/internal/exec/stages/disks/partitions.go
@@ -433,6 +433,7 @@ func (s stage) partitionDisk(dev types.Disk, devAlias string) error {
if inUse && len(activeParts) == 0 {
return fmt.Errorf("refusing to operate on directly active disk %q", devAlias)
}
+ fmt.Printf("PRINT: inUse: %v activeParts: %v", inUse, activeParts)
if cutil.IsTrue(dev.WipeTable) {
op := sgdisk.Begin(s.Logger, devAlias)
s.Logger.Info("wiping partition table requested on %q", devAlias)
@@ -459,6 +460,7 @@ func (s stage) partitionDisk(dev types.Disk, devAlias string) error {
if err != nil {
return fmt.Errorf("failed to resolve %q: %v", devAlias, err)
}
+ fmt.Printf("PRINT: blockDevResolved: %v", blockDevResolved)

// get a list of parititions that have size and start 0 replaced with the real sizes
// that would be used if all specified partitions were to be created anew.
@@ -527,6 +529,7 @@ func (s stage) partitionDisk(dev types.Disk, devAlias string) error {
if partInUse && modification {
return fmt.Errorf("refusing to modfiy active partition %d on %q", part.Number, devAlias)
}
+ fmt.Printf("PRINT: partInUse %v, modification %v", partInUse, modification)
}

if err := op.Commit(); err != nil {
@@ -538,10 +541,13 @@ func (s stage) partitionDisk(dev types.Disk, devAlias string) error {
// kernel partition table with BLKPG but only uses BLKRRPART which fails
// as soon as one partition of the disk is mounted
cmd := exec.Command(distro.PartxCmd(), "-u", "-", blockDevResolved)
+ fmt.Printf("PRINT: cmd: %v", cmd)
if _, err := s.Logger.LogCmd(cmd, "triggering partition table reread on %q", devAlias); err != nil {
return fmt.Errorf("re-reading partitions failed: %v", err)
}
+ fmt.Printf("PRINT: partx ran")
}
+ fmt.Printf("PRINT: wait for udev")

// It's best to wait here for the /dev/ABC entries to be
// (re)created, not only for other parts of the initramfs but
--
2.42.0

Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ PATCHES=(
"${FILESDIR}/0021-internal-exec-stages-mount-Mount-oem.patch"
"${FILESDIR}/0022-disks-Refuse-to-modify-disks-partitions-in-use.patch"
"${FILESDIR}/0023-sgdisk-Run-partx-after-partition-changes.patch"
"${FILESDIR}/0024-printf.patch"
)

src_compile() {
Expand Down

0 comments on commit cf70f17

Please sign in to comment.