mirror of
https://github.com/ventoy/Ventoy.git
synced 2025-05-06 01:28:11 -04:00
grub-core/ventoy: add some define and code for loongarch64
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
This commit is contained in:
parent
066a25975f
commit
c40640c6d1
@ -316,6 +316,11 @@ static int ventoy_arch_mode_init(void)
|
|||||||
g_ventoy_plat_data = VTOY_PLAT_MIPS_UEFI;
|
g_ventoy_plat_data = VTOY_PLAT_MIPS_UEFI;
|
||||||
grub_snprintf(g_arch_mode_suffix, sizeof(g_arch_mode_suffix), "%s", "mips");
|
grub_snprintf(g_arch_mode_suffix, sizeof(g_arch_mode_suffix), "%s", "mips");
|
||||||
}
|
}
|
||||||
|
else if (grub_strcmp(GRUB_TARGET_CPU, "loongarch64") == 0)
|
||||||
|
{
|
||||||
|
g_ventoy_plat_data = VTOY_PLAT_LOONGARCH64_UEFI;
|
||||||
|
grub_snprintf(g_arch_mode_suffix, sizeof(g_arch_mode_suffix), "%s", "loongarch64");
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
g_ventoy_plat_data = VTOY_PLAT_X86_64_UEFI;
|
g_ventoy_plat_data = VTOY_PLAT_X86_64_UEFI;
|
||||||
|
@ -69,12 +69,15 @@
|
|||||||
#define VTOY_PLAT_X86_64_UEFI 0x55454649
|
#define VTOY_PLAT_X86_64_UEFI 0x55454649
|
||||||
#define VTOY_PLAT_X86_LEGACY 0x42494f53
|
#define VTOY_PLAT_X86_LEGACY 0x42494f53
|
||||||
#define VTOY_PLAT_MIPS_UEFI 0x4D495053
|
#define VTOY_PLAT_MIPS_UEFI 0x4D495053
|
||||||
|
#define VTOY_PLAT_LOONGARCH64_UEFI 0xf595124d
|
||||||
|
|
||||||
#define VTOY_COMM_CPIO "ventoy.cpio"
|
#define VTOY_COMM_CPIO "ventoy.cpio"
|
||||||
#if defined(__arm__) || defined(__aarch64__)
|
#if defined(__arm__) || defined(__aarch64__)
|
||||||
#define VTOY_ARCH_CPIO "ventoy_arm64.cpio"
|
#define VTOY_ARCH_CPIO "ventoy_arm64.cpio"
|
||||||
#elif defined(__mips__)
|
#elif defined(__mips__)
|
||||||
#define VTOY_ARCH_CPIO "ventoy_mips64.cpio"
|
#define VTOY_ARCH_CPIO "ventoy_mips64.cpio"
|
||||||
|
#elif defined(__loongarch__)
|
||||||
|
#define VTOY_ARCH_CPIO "ventoy_loongarch64.cpio"
|
||||||
#else
|
#else
|
||||||
#define VTOY_ARCH_CPIO "ventoy_x86.cpio"
|
#define VTOY_ARCH_CPIO "ventoy_x86.cpio"
|
||||||
#endif
|
#endif
|
||||||
|
@ -1547,6 +1547,11 @@ grub_err_t ventoy_cmd_load_cpio(grub_extcmd_context_t ctxt, int argc, char **arg
|
|||||||
debug("cpio busybox proc %s\n", args[3]);
|
debug("cpio busybox proc %s\n", args[3]);
|
||||||
ventoy_cpio_busybox64((cpio_newc_header *)g_ventoy_cpio_buf, "m64");
|
ventoy_cpio_busybox64((cpio_newc_header *)g_ventoy_cpio_buf, "m64");
|
||||||
}
|
}
|
||||||
|
else if (grub_strcmp(args[3], "busybox=l64") == 0)
|
||||||
|
{
|
||||||
|
debug("cpio busybox proc %s\n", args[3]);
|
||||||
|
ventoy_cpio_busybox64((cpio_newc_header *)g_ventoy_cpio_buf, "l64");
|
||||||
|
}
|
||||||
|
|
||||||
VENTOY_CMD_RETURN(GRUB_ERR_NONE);
|
VENTOY_CMD_RETURN(GRUB_ERR_NONE);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user