Package: autopkgtest
Version: 5.15
Severity: minor
X-Debbugs-Cc: [email protected]

Dear Maintainer,

The following part of autopkgtest-virt-qemu gives impression that
autopkgtest ... -- qemu --efi supports QEMU testbed with UEFI.
Indeed, QEMU with UEFI testbed works fine for amd64, as
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=973038#30

    if args.efi:
        code = None
        data = None

        if 'qemu-system-x86_64' in args.qemu_command or \
                'qemu-system-i386' in args.qemu_command:
            code = '/usr/share/OVMF/OVMF_CODE.fd'
            data = '/usr/share/OVMF/OVMF_VARS.fd'
        elif 'qemu-system-aarch64' in args.qemu_command:
            code = '/usr/share/AAVMF/AAVMF_CODE.fd'
            data = '/usr/share/AAVMF/AAVMF_VARS.fd'
        elif 'qemu-system-arm' in args.qemu_command:
            code = '/usr/share/AAVMF/AAVMF32_CODE.fd'
            data = '/usr/share/AAVMF/AAVMF32_VARS.fd'
        else:
            VirtSubproc.bomb('Unknown architecture for EFI boot')

With the attached patch to vmdb2 and autopkgtest-build-qemu,
QEMU i386 UEFI testbed can be built without error.
But autopkgtest ... -- qemu --efi -q qemu-system-i386 does
not work, as the Linux in VM does not boot, at least on
my amd64 laptop.

This means that complete switching of autopkgtest-virt-qemu to
UEFI is impossible as of now, while arm64 QEMU autopkgtestbed
seems to require UEFI booting...

Best regards, Ryutaroh Matsumoto

-- System Information:
Debian Release: bullseye/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.8.0-1-amd64 (SMP w/12 CPU threads)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages autopkgtest depends on:
ii  apt-utils       2.1.11
ii  libdpkg-perl    1.20.5
ii  procps          2:3.3.16-5
ii  python3         3.8.2-3
ii  python3-debian  0.1.38

Versions of packages autopkgtest recommends:
ii  autodep8  0.24

Versions of packages autopkgtest suggests:
pn  lxc               <none>
pn  lxd               <none>
ii  ovmf              2020.08-1
ii  qemu-efi-aarch64  2020.08-1
ii  qemu-efi-arm      2020.08-1
ii  qemu-system       1:5.1+dfsg-4+b1
ii  qemu-utils        1:5.1+dfsg-4+b1
pn  schroot           <none>
ii  vmdb2             0.19-1

-- no debconf information
--- usr/lib/python3/dist-packages/vmdb/plugins/grub_plugin.py-orig      
2020-11-01 17:24:02.365918675 +0900
+++ usr/lib/python3/dist-packages/vmdb/plugins/grub_plugin.py   2020-11-01 
17:44:44.244822315 +0900
@@ -112,8 +112,8 @@
             raise Exception('"efi" or "efi-part" required in UEFI GRUB 
installation')
 
         vmdb.progress("Installing GRUB for UEFI")
-        grub_package = "grub-efi-amd64"
-        grub_target = "x86_64-efi"
+        grub_package = "grub-efi-ia32"
+        grub_target = "i386-efi"
         self.install_grub(values, settings, state, grub_package, grub_target)
 
     def install_bios(self, values, settings, state):
--- usr/bin/autopkgtest-build-qemu-orig 2020-10-31 10:05:36.350588392 +0900
+++ usr/bin/autopkgtest-build-qemu      2020-10-31 14:38:34.403340017 +0900
@@ -252,12 +252,20 @@
   - mkimg: "{{ image }}"
     size: $size
 
-  - mklabel: msdos
+  - mklabel: gpt
     device: "{{ image }}"
 
   - mkpart: primary
+    fs-type: fat32
     device: "{{ image }}"
     start: 0%
+    end: 200MiB
+    tag: efipart
+
+  - mkpart: primary
+    fs-type: ext4
+    device: "{{ image }}"
+    start: 200MiB
     end: 100%
     tag: root
 
@@ -266,6 +274,9 @@
   - mkfs: ext4
     partition: root
 
+  - mkfs: vfat
+    partition: efipart
+
   - mount: root
 
   - $debootstrap_cmd: $release
@@ -279,8 +290,9 @@
       - ifupdown
     tag: root
 
-  - grub: bios
+  - grub: uefi
     tag: root
+    efi: efipart
     console: serial
 
   - chroot: root
@@ -295,6 +307,9 @@
       rootdev=\$(ls -1 /dev/mapper/loop* | sort | tail -1)
       uuid=\$(blkid -c /dev/null -o value -s UUID \$rootdev)
       echo "UUID=\$uuid / ext4 errors=remount-ro 0 1" > \$ROOT/etc/fstab
+      efidev=\$(ls -1 /dev/mapper/loop* | sort | head -1)
+      uuid=\$(blkid -c /dev/null -o value -s UUID \$efidev)
+      echo "UUID=\$uuid /boot/efi vfat rw 0 2" >> \$ROOT/etc/fstab
     root-fs: root
 
   - shell: '$script \$ROOT'

Reply via email to