On Sat, 22 Feb 2020 08:14:55 +0100 Johannes Schauer wrote:

[...]
> Quoting Francesco Poli (2020-02-21 23:14:12)
[...]
> > Does it make any sense?
> 
> No, it doesn't I have never seen the effects you see.

As I have already said, I am apparently very unlucky with this effort
of mine!

> 
> I have more ideas but I think you first somehow have to fix the guestfish
> problems that you are experiencing. What version of Debian and guestfish are
> you running?

I am running Debian testing (bullseye) and I was using
libguestfs-tools/1:1.40.2-7 (currently in testing).
When you asked, I noticed that there is a version rebuilt from the same
source in unstable, and I upgraded to it.

I have just retested my script with libguestfs-tools/1:1.40.2-7+b1:

  $ apt policy libguestfs-tools 
  libguestfs-tools:
    Installed: 1:1.40.2-7+b1
    Candidate: 1:1.40.2-7+b1
    Version table:
   *** 1:1.40.2-7+b1 500
          500 http://deb.debian.org/debian unstable/main amd64 Packages
          100 /var/lib/dpkg/status
       1:1.40.2-7 800
          800 http://deb.debian.org/debian testing/main amd64 Packages

but the result was the same.
At the end of the script guestfish fails with the same error and
qemu-img produces a really tiny .qcow2 image, which does not seem to
contain any bootable partition.

The mystery deepens, as soon as I try to issue the guestfish command
manually (after the script exited):

  $ guestfish --new debian-unstable_DEBUG.img=disk:"$SIZE" -- part-disk 
/dev/sda mbr : part-set-bootable /dev/sda 1 true : mkfs ext2 /dev/sda1 : mount 
/dev/sda1 / : tar-in debian-unstable.tar / : extlinux / : copy-in extlinux.conf 
/ : sync : umount / : shutdown

which exits successfully and produces a .img file which qemu-img is
able to convert into a reasonably sized .qcow2 file:

  $ ls --si -ltrF debian-unstable*
  -rw-r--r-- 1 $USER $GROUP 629M Feb 22 18:30 debian-unstable.tar
  -rw-rw---- 1 $USER $GROUP 2.2G Feb 22 18:30 debian-unstable.img
  -rw-r----- 1 $USER $GROUP 197k Feb 22 18:30 debian-unstable.qcow2
  -rw-rw---- 1 $USER $GROUP 2.2G Feb 22 18:31 debian-unstable_DEBUG.img
  -rw-r----- 1 $USER $GROUP 707M Feb 22 18:31 debian-unstable_DEBUG.qcow2

Nevertheless, debian-unstable_DEBUG.qcow2 does not boot with:

  $ qemu-system-x86_64 -enable-kvm -m 512 -serial unix:/tmp/ttyS0,server,nowait 
-drive  "file=./debian-unstable_DEBUG.qcow2,cache=unsafe,if=virtio,index=0"

It hangs exactly like the first image I obtained weeks ago (that is to
say, at the "Booting from Hard Disk..." message.

I cannot understand how (what really appears to be) the same guestfish
command behaves differently inside the script and outside (after the
end of the script)!
This looks like black magic to me...   :-|


-- 
 http://www.inventati.org/frx/
 There's not a second to spare! To the laboratory!
..................................................... Francesco Poli .
 GnuPG key fpr == CA01 1147 9CD2 EFDF FB82  3925 3E1C 27E1 1F69 BFFE

Attachment: pgptPo8t4kNIu.pgp
Description: PGP signature

Reply via email to