@@ -135,14 +135,17 @@ func (p *BootcDisk) getOrInstallImageToDisk(quiet bool) error {
135
135
if ! errors .Is (err , os .ErrNotExist ) {
136
136
return err
137
137
}
138
+ logrus .Debugf ("No existing disk image found" )
138
139
return p .bootcInstallImageToDisk (quiet )
139
140
}
141
+ logrus .Debug ("Found existing disk image, comparing digest" )
140
142
defer f .Close ()
141
143
buf := make ([]byte , 4096 )
142
144
len , err := unix .Fgetxattr (int (f .Fd ()), imageMetaXattr , buf )
143
145
if err != nil {
144
146
// If there's no xattr, just remove it
145
147
os .Remove (diskPath )
148
+ logrus .Debugf ("No %s xattr found" , imageMetaXattr )
146
149
return p .bootcInstallImageToDisk (quiet )
147
150
}
148
151
bufTrimmed := buf [:len ]
@@ -170,7 +173,7 @@ func align(size int64, align int64) int64 {
170
173
171
174
// bootcInstallImageToDisk creates a disk image from a bootc container
172
175
func (p * BootcDisk ) bootcInstallImageToDisk (quiet bool ) (err error ) {
173
- println ( "Creating bootc disk image..." )
176
+ fmt . Printf ( "Executing ` bootc install to- disk` from container image %s to create disk image \n " , p . RepoTag )
174
177
p .file , err = os .CreateTemp (p .Directory , "podman-bootc-tempdisk" )
175
178
if err != nil {
176
179
return err
@@ -186,6 +189,7 @@ func (p *BootcDisk) bootcInstallImageToDisk(quiet bool) (err error) {
186
189
if err := syscall .Ftruncate (int (p .file .Fd ()), size ); err != nil {
187
190
return err
188
191
}
192
+ logrus .Debugf ("Created %s with size %v" , p .file .Name (), diskSize )
189
193
doCleanupDisk := true
190
194
defer func () {
191
195
if doCleanupDisk {
@@ -260,16 +264,19 @@ func (p *BootcDisk) runInstallContainer(quiet bool) (err error) {
260
264
}
261
265
262
266
p .bootcInstallContainerId = createResponse .ID //save the id for possible cleanup
267
+ logrus .Debugf ("Created install container, id=%s" , createResponse .ID )
263
268
264
269
// run the container to create the disk
265
270
err = containers .Start (p .Ctx , p .bootcInstallContainerId , & containers.StartOptions {})
266
271
if err != nil {
267
272
return fmt .Errorf ("failed to start container: %w" , err )
268
273
}
274
+ logrus .Debugf ("Started install container" )
269
275
270
276
var exitCode int32
271
277
if quiet {
272
278
//wait for the container to finish
279
+ logrus .Debugf ("Waiting for container completion" )
273
280
exitCode , err = containers .Wait (p .Ctx , p .bootcInstallContainerId , nil )
274
281
if err != nil {
275
282
return fmt .Errorf ("failed to wait for container: %w" , err )
@@ -311,6 +318,7 @@ func (p *BootcDisk) runInstallContainer(quiet bool) (err error) {
311
318
}()
312
319
313
320
//wait for the container to finish
321
+ logrus .Debugf ("Waiting for container completion (streaming output)" )
314
322
exitCode , err = containers .Wait (p .Ctx , p .bootcInstallContainerId , nil )
315
323
if err != nil {
316
324
return fmt .Errorf ("failed to wait for container: %w" , err )
0 commit comments