Browse Source

sync dual-boot with single boot, use gpt/efi

Waldemar Brodkorb 1 year ago
parent
commit
90e4f5d187
3 changed files with 16 additions and 9 deletions
  1. 1 1
      mk/image.mk
  2. 8 4
      package/grub/files/grub-dual.cfg
  3. 7 4
      target/x86_64/qemu-x86_64/genimage-efi-dual.cfg

+ 1 - 1
mk/image.mk

@@ -357,7 +357,7 @@ ifeq ($(ADK_RUNTIME_FIX_PERMISSION),y)
 endif
 ifeq ($(ADK_TARGET_DUAL_BOOT),y)
 	$(CP) $(FW_DIR)/kernel $(TARGET_DIR)
-	$(CP) $(FW_DIR)/*.dtb $(TARGET_DIR)
+	-$(CP) $(FW_DIR)/*.dtb $(TARGET_DIR)
 	mkdir $(TARGET_DIR)/extlinux
 	$(CP) $(EXTLINUX) $(TARGET_DIR)/extlinux
 	$(SED) "s#root=.*#root=/dev/$(ADK_TARGET_ROOTDEV)p1#" $(TARGET_DIR)/extlinux/extlinux.conf

+ 8 - 4
package/grub/files/grub-dual.cfg

@@ -40,11 +40,15 @@ function savedefault {
 }
 
 menuentry "OpenADK1" {
-  set root=(hd0,2)
-  linux (hd0,2)/kernel root=/dev/@@ROOTDEV@@2 rootfstype=ext4 rootwait panic=5
+  insmod part_gpt
+  insmod ext2
+  set root=(hd0,gpt2)
+  linux (hd0,2)/boot/kernel root=/dev/@@ROOTDEV@@2 rootfstype=ext4 rootwait panic=5
 }
 menuentry "OpenADK2" {
-  set root=(hd0,3)
-  linux (hd0,3)/kernel root=/dev/@@ROOTDEV@@3 rootfstype=ext4 rootwait panic=5
+  insmod part_gpt
+  insmod ext2
+  set root=(hd0,gpt3)
+  linux (hd0,3)/boot/kernel root=/dev/@@ROOTDEV@@3 rootfstype=ext4 rootwait panic=5
 }
 

+ 7 - 4
target/x86_64/qemu-x86_64/genimage-efi-dual.cfg

@@ -10,27 +10,30 @@ 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 root1 {
-    partition-type = 0x83
+    partition-type-uuid = 44479540-f297-41b2-9af7-d131d5f0458a
     image = "rootfs.ext"
     size = 128M
   }
 
   partition root2 {
-    partition-type = 0x83
+    partition-type-uuid = 44479540-f297-41b2-9af7-d131d5f0458a
     image = "rootfs.ext"
     size = 128M
   }
 
   partition cfgfs {
-    partition-type = 0x88
+    partition-type-uuid = 44479540-f297-41b2-9af7-d131d5f0458a
     image = "cfgfs.img"
   }