Browse Source

qemu-x86_64: use gpt for efi boot, cfgfs needs to be fixed

Waldemar Brodkorb 1 year ago
parent
commit
a255f372e4

+ 3 - 3
package/grub/files/grub.cfg

@@ -6,9 +6,9 @@ set default=0
 set timeout=3
 
 menuentry "OpenADK" {
-  insmod part_msdos
+  insmod part_gpt
   insmod ext2
-  set root='hd0,msdos1'
+  set root='hd0,gpt2'
   echo "Loading OpenADK"
-  linux16 /boot/kernel root=/dev/sda1 rootfstype=ext4 rootwait panic=10
+  linux /boot/kernel root=/dev/sda2 rootfstype=ext4 rootwait panic=10
 }

+ 2 - 1
target/config/Config.in.rootfs

@@ -163,6 +163,7 @@ config ADK_TARGET_ROOTFS_GENIMAGE
 	bool "Create a disk image for the target"
 	select ADK_LINUX_KERNEL_EXT4_FS if ADK_TARGET_OS_LINUX
 	select ADK_LINUX_KERNEL_VFAT_FS if ADK_TARGET_OS_LINUX
+	select ADK_LINUX_KERNEL_EFI_PARTITION if ADK_TARGET_OS_LINUX
 	select ADK_TARGET_QEMU_WITH_BLOCK if ADK_TARGET_QEMU
 	select ADK_TARGET_QEMU_WITH_BOOTLOADER if ADK_TARGET_QEMU
 	select ADK_HOST_BUILD_GENIMAGE
@@ -194,7 +195,7 @@ config ADK_TARGET_DUAL_BOOT
 
 config ADK_TARGET_GENIMAGE_FILENAME
 	string
-	default "genimage-efi-dual.cfg" if ADK_PACKAGE_GRUB_EFI_X86_64 || ADK_PACKAGE_GRUB_EFI_X86 && ADK_TARGET_DUAL_BOOT
+	default "genimage-efi-dual.cfg" if (ADK_PACKAGE_GRUB_EFI_X86_64 || ADK_PACKAGE_GRUB_EFI_X86) && ADK_TARGET_DUAL_BOOT
 	default "genimage-efi.cfg" if ADK_PACKAGE_GRUB_EFI_X86_64 || ADK_PACKAGE_GRUB_EFI_X86
 	default "genimage-dual.cfg" if ADK_TARGET_DUAL_BOOT
 	default "genimage.cfg"

+ 8 - 7
target/x86_64/qemu-x86_64/genimage-efi.cfg

@@ -3,6 +3,9 @@ image efi-part.vfat {
     file EFI {
       image = "efi-part/EFI"
     }
+    file kernel {
+      image = "kernel"
+    }
   }
   size = 32M
 }
@@ -10,21 +13,19 @@ image efi-part.vfat {
 image disk.img {
 
   hdimage {
+    partition-table-type = "gpt"
   }
 
   partition boot {
-    partition-type = 0xEF
     image = "efi-part.vfat"
+    partition-type-uuid = U
+    offset = 32K
+    bootable = true
   }
 
   partition root {
-    partition-type = 0x83
+    partition-type-uuid = 44479540-f297-41b2-9af7-d131d5f0458a
     image = "rootfs.ext"
   }
 
-  partition cfgfs {
-    partition-type = 0x88
-    image = "cfgfs.img"
-  }
-
 }