summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2017-02-06 01:06:54 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2017-02-06 01:06:54 +0100
commitb1f2caa3651aeb6db3701a207b228e70f44646c9 (patch)
tree5bcc6d755c07bc4030efeb952216ffe487708f86
parent0906d4acb286d0584a8f1c15bb1c3077502b0f6d (diff)
add different genimage configs for PC Bios and EFI
-rw-r--r--mk/image.mk2
-rw-r--r--package/grub/Makefile2
-rw-r--r--rules.mk1
-rw-r--r--target/config/Config.in.rootfs5
-rw-r--r--target/x86_64/qemu-x86_64/genimage-efi.cfg30
-rw-r--r--target/x86_64/qemu-x86_64/genimage.cfg21
6 files changed, 49 insertions, 12 deletions
diff --git a/mk/image.mk b/mk/image.mk
index aa91e65d3..5db333b19 100644
--- a/mk/image.mk
+++ b/mk/image.mk
@@ -307,7 +307,7 @@ endif
-d "$(TARGET_DIR)" \
-o $(FW_DIR)/rootfs.ext $(MAKE_TRACE)
PATH='${HOST_PATH}' genimage \
- --config "$(ADK_TOPDIR)/target/$(ADK_TARGET_ARCH)/$(ADK_TARGET_SYSTEM)/genimage.cfg" \
+ --config "$(ADK_TOPDIR)/target/$(ADK_TARGET_ARCH)/$(ADK_TARGET_SYSTEM)/$(ADK_TARGET_GENIMAGE_FILENAME)" \
--tmppath "${FW_DIR}/temp" \
--rootpath "$(TARGET_DIR)" \
--inputpath "$(FW_DIR)" \
diff --git a/package/grub/Makefile b/package/grub/Makefile
index 6dc540cdd..0198c5337 100644
--- a/package/grub/Makefile
+++ b/package/grub/Makefile
@@ -114,6 +114,8 @@ ifeq ($(ADK_PACKAGE_GRUB_PC),y)
-p "$(GRUB_PREFIX)" \
-o $(IDIR_GRUB)/$(GRUB_DIR)/core.img \
-c ./files/embed.cfg ext2 part_msdos biosdisk
+ $(CP) $(WRKINST)/usr/lib/grub/i386-pc/boot.img \
+ $(FW_DIR)/
endif
ifeq ($(ADK_PACKAGE_GRUB_EFI_X86)$(ADK_PACKAGE_GRUB_EFI_X86_64),y)
${CP} ${WRKINST}/usr/lib/grub/$(GRUB_ARCH) \
diff --git a/rules.mk b/rules.mk
index 03c0eb24b..b01fd63d2 100644
--- a/rules.mk
+++ b/rules.mk
@@ -72,6 +72,7 @@ ADK_TARGET_KERNEL_GIT:= $(strip $(subst ",, $(ADK_TARGET_KERNEL_GIT)))
ADK_TARGET_KERNEL_GIT_VER:= $(strip $(subst ",, $(ADK_TARGET_KERNEL_GIT_VER)))
ADK_TARGET_KERNEL_GIT_TYPE:= $(strip $(subst ",, $(ADK_TARGET_KERNEL_GIT_TYPE)))
ADK_TARGET_KERNEL_DEFCONFIG:= $(strip $(subst ",, $(ADK_TARGET_KERNEL_DEFCONFIG)))
+ADK_TARGET_GENIMAGE_FILENAME:= $(strip $(subst ",, $(ADK_TARGET_GENIMAGE_FILENAME)))
ADK_TARGET_KARCH:=$(ADK_TARGET_ARCH)
diff --git a/target/config/Config.in.rootfs b/target/config/Config.in.rootfs
index 28d8f2254..96fb5c1a2 100644
--- a/target/config/Config.in.rootfs
+++ b/target/config/Config.in.rootfs
@@ -164,3 +164,8 @@ config ADK_TARGET_ROOTFS_GENIMAGE
Create a complete disk image for the target with genimage.
endchoice
+
+config ADK_TARGET_GENIMAGE_FILENAME
+ string
+ default "genimage-efi.cfg" if ADK_PACKAGE_GRUB_EFI_X86_64 || ADK_PACKAGE_GRUB_EFI_X86
+ default "genimage.cfg"
diff --git a/target/x86_64/qemu-x86_64/genimage-efi.cfg b/target/x86_64/qemu-x86_64/genimage-efi.cfg
new file mode 100644
index 000000000..a59d75e47
--- /dev/null
+++ b/target/x86_64/qemu-x86_64/genimage-efi.cfg
@@ -0,0 +1,30 @@
+image efi-part.vfat {
+ vfat {
+ file EFI {
+ image = "efi-part/EFI"
+ }
+ }
+ size = 32M
+}
+
+image disk.img {
+
+ hdimage {
+ }
+
+ partition boot {
+ partition-type = 0xEF
+ image = "efi-part.vfat"
+ }
+
+ partition root {
+ partition-type = 0x83
+ image = "rootfs.ext"
+ }
+
+ partition cfgfs {
+ partition-type = 0x88
+ image = "cfgfs.img"
+ }
+
+}
diff --git a/target/x86_64/qemu-x86_64/genimage.cfg b/target/x86_64/qemu-x86_64/genimage.cfg
index a59d75e47..0b8992731 100644
--- a/target/x86_64/qemu-x86_64/genimage.cfg
+++ b/target/x86_64/qemu-x86_64/genimage.cfg
@@ -1,20 +1,19 @@
-image efi-part.vfat {
- vfat {
- file EFI {
- image = "efi-part/EFI"
- }
- }
- size = 32M
-}
-
image disk.img {
hdimage {
}
partition boot {
- partition-type = 0xEF
- image = "efi-part.vfat"
+ in-partition-table = "no"
+ image = "boot.img"
+ offset = 0
+ size = 512
+ }
+
+ partition grub {
+ in-partition-table = "no"
+ image = "grub.img"
+ offset = 512
}
partition root {