target.mk: add GRUB2 EFI support for loongarch64

This commit is contained in:
coolsnowwolf 2024-01-12 10:13:05 +08:00
parent 9c8d196759
commit c6c5c79e3d
2 changed files with 11 additions and 5 deletions

View File

@ -198,15 +198,15 @@ menu "Target Images"
default ""
config GRUB_IMAGES
bool "Build GRUB images (Linux x86 or x86_64 host only)"
bool "Build GRUB images"
depends on TARGET_x86
depends on TARGET_ROOTFS_EXT4FS || TARGET_ROOTFS_JFFS2 || TARGET_ROOTFS_SQUASHFS
select PACKAGE_grub2
default n
config GRUB_EFI_IMAGES
bool "Build GRUB EFI images (Linux x86 or x86_64 host only)"
depends on TARGET_x86 || TARGET_armvirt
bool "Build GRUB EFI images"
depends on TARGET_x86 || TARGET_armvirt || TARGET_loongarch64
depends on TARGET_ROOTFS_EXT4FS || TARGET_ROOTFS_JFFS2 || TARGET_ROOTFS_SQUASHFS
select PACKAGE_grub2 if TARGET_x86
select PACKAGE_grub2-efi if TARGET_x86
@ -276,7 +276,7 @@ menu "Target Images"
config VMDK_IMAGES
bool "Build VMware image files (VMDK)"
depends on TARGET_x86 || TARGET_armvirt
depends on TARGET_x86 || TARGET_armvirt || TARGET_loongarch64
depends on GRUB_IMAGES || GRUB_EFI_IMAGES
default y
select PACKAGE_kmod-e1000
@ -289,7 +289,7 @@ menu "Target Images"
config TARGET_IMAGES_GZIP
bool "GZip images"
depends on TARGET_ROOTFS_EXT4FS || TARGET_x86 || TARGET_armvirt || TARGET_malta
depends on TARGET_ROOTFS_EXT4FS || TARGET_x86 || TARGET_armvirt || TARGET_loongarch64 || TARGET_malta
default y
comment "Image Options"
@ -308,6 +308,7 @@ menu "Target Images"
config TARGET_ROOTFS_PARTSIZE
int "Root filesystem partition size (in MiB)"
depends on USES_ROOTFS_PART || TARGET_ROOTFS_EXT4FS
default 232 if TARGET_loongarch64
default 400 if TARGET_x86
default 160
help

View File

@ -262,6 +262,11 @@ ifeq ($(DUMP),1)
CPU_TYPE ?= riscv64
CPU_CFLAGS_riscv64:=-mabi=lp64d -march=rv64imafdc
endif
ifeq ($(ARCH),loongarch64)
CPU_TYPE ?= generic
CPU_CFLAGS := -O2 -pipe
CPU_CFLAGS_generic:=-march=loongarch64
endif
ifneq ($(CPU_TYPE),)
ifndef CPU_CFLAGS_$(CPU_TYPE)
$(warning CPU_TYPE "$(CPU_TYPE)" doesn't correspond to a known type)