X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/Ventoy.git/blobdiff_plain/ebaa4d954aa0b3d70f14b2fd6fec63df1599b8ce..17da2e2a21bb3eb37bfc2a3b0dbba12fdcd04a1d:/INSTALL/grub/grub.cfg diff --git a/INSTALL/grub/grub.cfg b/INSTALL/grub/grub.cfg index 0540d46..15fe1e6 100644 --- a/INSTALL/grub/grub.cfg +++ b/INSTALL/grub/grub.cfg @@ -92,6 +92,9 @@ function get_os_type { elif [ -e (loop)/bin/freebsd-version ]; then set vtoy_os=Unix set vt_unix_type=FreeBSD + elif vt_str_begin "$vt_system_id" "DragonFly"; then + set vtoy_os=Unix + set vt_unix_type=DragonFly elif [ -e (loop)/boot/kernel/kernel ]; then @@ -106,13 +109,13 @@ function get_os_type { fi if [ -n "${vtdebug_flag}" ]; then - echo ISO is $vtoy_os + echo ISO is "$vtoy_os" fi } function vt_check_compatible_pe { #Check for PE without external tools - if [ -f $1/HBCD_PE.ini ]; then + if [ -f "$1/HBCD_PE.ini" ]; then set ventoy_compatible=YES fi } @@ -270,6 +273,8 @@ function distro_specify_initrd_file_phase2 { fi elif [ -f (loop)/blackarch/boot/x86_64/archiso.img ]; then vt_linux_specify_initrd_file /blackarch/boot/x86_64/archiso.img + elif [ -f (loop)/blackarch/boot/x86_64/initramfs-linux.img ]; then + vt_linux_specify_initrd_file /blackarch/boot/x86_64/initramfs-linux.img elif [ -f (loop)/install.amd/initrd.gz ]; then vt_linux_specify_initrd_file /live/initrd2.img @@ -277,7 +282,21 @@ function distro_specify_initrd_file_phase2 { vt_linux_specify_initrd_file /install.amd/gtk/initrd.gz elif [ -f (loop)/boot/grub/kernels.cfg ]; then vt_linux_parse_initrd_grub file (loop)/boot/grub/kernels.cfg - + elif [ -f (loop)/austrumi/initrd.gz ]; then + vt_linux_specify_initrd_file /austrumi/initrd.gz + if [ -f (loop)/EFI/BOOT/bootx64.efi ]; then + vt_cpio_busybox64 "64h" + fi + elif [ -f (loop)/boot/initfs.x86_64-efi ]; then + vt_linux_specify_initrd_file /boot/initfs.x86_64-efi + if [ -f (loop)/boot/initfs.i386-pc ]; then + vt_linux_specify_initrd_file /boot/initfs.i386-pc + fi + elif [ -f (loop)/antiX/initrd.gz ]; then + vt_linux_specify_initrd_file /antiX/initrd.gz + elif [ -f (loop)/360Disk/initrd.gz ]; then + vt_linux_specify_initrd_file /360Disk/initrd.gz + fi } @@ -419,6 +438,22 @@ function ventoy_freebsd_proc { vt_unix_replace_conf FreeBSD "${1}${chosen_path}" } +function ventoy_dragonfly_proc { + + unset vt_unix_mod_path + for file in "/boot/kernel/initrd.img.gz"; do + if [ -e (loop)${file} ]; then + set vt_unix_mod_path=${file} + break + fi + done + + vt_unix_replace_ko $vt_unix_mod_path ${vtoy_path}/dragonfly.mfs.xz + vt_unix_fill_image_desc + vt_unix_gzip_new_ko + vt_unix_replace_conf DragonFly "${1}${chosen_path}" +} + function ventoy_unix_comm_proc { vt_unix_reset @@ -427,11 +462,12 @@ function ventoy_unix_comm_proc { if [ "$vt_unix_type" = "FreeBSD" ]; then ventoy_freebsd_proc "$1" "${chosen_path}" + elif [ "$vt_unix_type" = "DragonFly" ]; then + ventoy_dragonfly_proc "$1" "${chosen_path}" elif [ "$vt_unix_type" = "NetBSD" ]; then echo "NetBSD not supported" - else if [ -n "${vtdebug_flag}" ]; then echo "Unknown unix type" @@ -543,6 +579,12 @@ function uefi_linux_menu_func { elif [ -d (loop)/blackarch ]; then if [ -f (loop)/blackarch/boot/x86_64/archiso.img ]; then vt_add_replace_file $vtindex "EFI\\archiso\\archiso.img" + elif [ -f (loop)/blackarch/boot/x86_64/initramfs-linux.img ]; then + vt_add_replace_file $vtindex "blackarch\\boot\\x86_64\\initramfs-linux.img" + fi + elif [ -d (loop)/anarchy ]; then + if [ -f (loop)/anarchy/boot/x86_64/initramfs-linux.img ]; then + vt_add_replace_file $vtindex "anarchy\\boot\\x86_64\\initramfs-linux.img" fi elif [ -d (loop)/parabola ]; then if [ -f (loop)/parabola/boot/x86_64/parabolaiso.img ]; then @@ -580,6 +622,12 @@ function uefi_linux_menu_func { vt_linux_chain_data "${1}${chosen_path}" + if [ -n "$LoadIsoEfiDriver" -a $vt_chosen_size -lt 104857600 ]; then + if [ -f (loop)/efi/clover/cloverx64.efi ]; then + unset LoadIsoEfiDriver + fi + fi + if [ -n "$vtoy_chain_mem_addr" ]; then ventoy_acpi_param ${vtoy_chain_mem_addr} 2048 ventoy_cli_console @@ -748,6 +796,8 @@ function legacy_linux_menu_func { if [ -d (loop)/arch/boot/syslinux ]; then vt_linux_parse_initrd_isolinux (loop)/arch/boot/syslinux/ /arch/ vt_linux_parse_initrd_isolinux (loop)/arch/boot/syslinux/ /arch/boot/syslinux/ + elif [ -d (loop)/anarchy/boot/syslinux ]; then + vt_linux_parse_initrd_isolinux (loop)/anarchy/boot/syslinux/ /anarchy/ #manjaro elif [ -d (loop)/manjaro ]; then @@ -902,7 +952,9 @@ function ventoy_iso_busybox_ver { set ventoy_busybox_ver=64 elif vt_str_begin "$vt_volume_id" "smgl-test-quinq-x86_64"; then set ventoy_busybox_ver=64 - + elif vt_str_begin "$vt_volume_id" "LDiagBootable"; then + set ventoy_busybox_ver=64 + fi fi } @@ -1128,7 +1180,7 @@ function vtoyboot_common_func { linux16 $vtoy_path/ipxe.krn ${vtdebug_flag} bios80 sector512 mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size} boot else - ventoy_acpi_param ${vtoy_chain_mem_addr} 512 + vt_acpi_param ${vtoy_chain_mem_addr} 512 ventoy_cli_console chainloader ${vtoy_path}/ventoy_${VTOY_EFI_ARCH}.efi sector512 env_param=${ventoy_env_param} ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size} boot @@ -1382,15 +1434,15 @@ function img_common_menuentry { ventoy_img_easyos elif [ -e (vtimghd,1)/volumio.initrd ]; then ventoy_img_volumio - elif vt_str_begin $vtImgHd1Label "LAKKA"; then + elif vt_str_begin "$vtImgHd1Label" "LAKKA"; then ventoy_img_openelec lakka - elif vt_str_begin $vtImgHd1Label "LIBREELEC"; then + elif vt_str_begin "$vtImgHd1Label" "LIBREELEC"; then ventoy_img_openelec LibreELEC - elif vt_str_begin $vtImgHd1Label "paldo-live"; then + elif vt_str_begin "$vtImgHd1Label" "paldo-live"; then ventoy_img_paldo - elif vt_str_begin $vtImgHostname "freedombox"; then + elif vt_str_begin "$vtImgHostname" "freedombox"; then ventoy_img_freedombox - elif vt_str_begin $vtImgHd1Label "BATOCERA"; then + elif vt_str_begin "$vtImgHd1Label" "BATOCERA"; then ventoy_img_batocera elif [ "$vtImgHd2Label" = "RECALBOX" ]; then ventoy_img_recalbox @@ -1432,7 +1484,7 @@ function img_unsupport_menuentry { ############################################################# ############################################################# -set VENTOY_VERSION="1.0.30" +set VENTOY_VERSION="1.0.33" #ACPI not compatible with Window7/8, so disable by default set VTOY_PARAM_NO_ACPI=1 @@ -1453,14 +1505,16 @@ set VTOY_F6_CMD="ventoy_ext_menu" if [ "$grub_platform" = "pc" ]; then set VTOY_TEXT_MENU_VER="Ventoy $VENTOY_VERSION BIOS www.ventoy.net" -else - set VTOY_TEXT_MENU_VER="Ventoy $VENTOY_VERSION UEFI www.ventoy.net" +else if [ "$grub_cpu" = "i386" ]; then set VTOY_EFI_ARCH=ia32 + set VTOY_TEXT_MENU_VER="Ventoy $VENTOY_VERSION IA32 www.ventoy.net" elif [ "$grub_cpu" = "arm64" ]; then set VTOY_EFI_ARCH=aa64 + set VTOY_TEXT_MENU_VER="Ventoy $VENTOY_VERSION AA64 www.ventoy.net" else set VTOY_EFI_ARCH=x64 + set VTOY_TEXT_MENU_VER="Ventoy $VENTOY_VERSION UEFI www.ventoy.net" fi fi @@ -1505,6 +1559,7 @@ vt_load_part_table $vtoydev if [ -f $vtoy_iso_part/ventoy/ventoy.json ]; then clear vt_load_plugin $vtoy_iso_part + clear fi if [ -n "$VTOY_MENU_TIMEOUT" ]; then @@ -1576,6 +1631,17 @@ if [ -n "$VTOY_PLUGIN_SYNTAX_ERROR" ]; then read vtInputKey fi +for vtTFile in ventoy.json ventoy_grub.cfg; do + if [ -f $vtoy_efi_part/ventoy/$vtTFile ]; then + clear + echo -e "\n You need to put $vtTFile in the 1st partition which hold the ISO files.\n" + echo -e " $vtTFile 放错分区了,请放到镜像分区里的 ventoy 目录下(此目录需要手动创建)!\n" + echo -e "\n press ENTER to continue (请按 回车 键继续) ..." + read vtInputKey + fi +done + + #export necessary variable export theme export gfxmode