a1ive / grub2-filemanager

GRUB2-based file manager
https://a1ive.github.io/grub2-filemanager/
GNU General Public License v3.0
527 stars 106 forks source link

Request: for Ventoy integration #256

Closed steve6375 closed 3 years ago

steve6375 commented 4 years ago

Could F5.sh check for \EFI\BOOT\ventoyx64.efi first please? This would allow a user to add all the Ventoy files and folders to an existing grubfm FAT32 partition 2 (just rename ventoy \EFI\BOOT\BOOTX64.efi to ventoyx64.efi so that it does not overwrite the existing grubfm efi boot file).

Also, I cannot find a way to mbr boot the core.img of ventoy (on an Easy2Boot stick, pressing F5 in MBR mode just reloads grub4dos). I have tried adding core.img from the Ventoy download and then using multiboot (hd0,2)/ventoy/core.img but it does not work. Any ideas?

a1ive commented 4 years ago

This would allow a user to add all the Ventoy files and folders to an existing grubfm FAT32 partition 2 (just rename ventoy \EFI\BOOT\BOOTX64.efi to ventoyx64.efi so that it does not overwrite the existing grubfm efi boot file).

Ventoy files are not portable.You can't copy it from another disk.

Could F5.sh check for \EFI\BOOT\ventoyx64.efi first please?

https://github.com/a1ive/grub2-filemanager/blob/54491eedea91c6085a2aceb8d51a4daea89c51d6/boot/grubfm/init.sh#L79

Also, I cannot find a way to mbr boot the core.img of ventoy (on an Easy2Boot stick, pressing F5 in MBR mode just reloads grub4dos).

https://github.com/a1ive/grub2-filemanager/blob/54491eedea91c6085a2aceb8d51a4daea89c51d6/boot/grubfm/f5.sh#L33 Ventoy writes its boot code (core.img and bootstrap code) to mbr, so it must appear as the first boot loader.

steve6375 commented 4 years ago

I have UEFI64 Ventoy working.

partition 1 = ISOs partition 2 = grubfm + ventoy files

image

Very simple! Just copy partition 2 of Ventoy to grubfm partition 2 (but rename ventoy bootx64 to ventoyx64.efi first)

image image

a1ive commented 4 years ago

I have UEFI64 Ventoy working.

partition 1 = ISOs partition 2 = grubfm + ventoy files

image

Very simple! Just copy partition 2 of Ventoy to grubfm partition 2 (but rename ventoy bootx64 to ventoyx64.efi first)

image image

Have you tried to boot the ISO with it?(Linux ISO/ non-contiguous WinPE ISO) https://www.ventoy.net/en/doc_disk_layout.html

steve6375 commented 4 years ago

I tried Ubuntu, Win8 and Acronis ISOs - OK. Partition 1 = NTFS Partition 2 = FAT32

crasadure commented 4 years ago

hi @steve6375 ; @awengers44 from TNCTR has developed your project below TNCTR link.you can examine this project from this link --> https://www.tnctr.com/topic/766182-ventoy-boot-grubfm-modifiye/ Ventoy Boot + Grubfm + Modified Project Download Link --> https://yadi.sk/d/2TZR8Yk0-BGLog

Captured Video-Turkish Language (Ventoy Boot + Grub File Manager Modified MultiBoot System Setup) https://youtu.be/2RP54UEiCrM

I captured a video for installation and usage it :) https://vimeo.com/452920578

steve6375 commented 4 years ago

That is booting grubfm from Ventoy. It is not what I want. I want to boot Ventoy from grubfm.

steve6375 commented 4 years ago

Something like this for F5.sh would be great to support UEFI64 Ventoy.

if [ -n "${aioboot}" ];
then
  if [ "${grub_platform}" = "efi" ];
  then
    chainloader -t (${aioboot})/efi/boot/boot${EFI_ARCH}.efi;
  else
    multiboot (${aioboot})/AIO/grub/i386-pc/core.img;
  fi;
  boot;
elif [ -n "${ventoy}" ];
then
  if [ "${grub_platform}" = "efi" ];
  then
    if [ -f (${ventoy})/efi/boot/VENTOY${EFI_ARCH}.efi ]; then chainloader -t (${ventoy})/efi/boot/VENTOY${EFI_ARCH}.efi;
    else
    chainloader -t (${ventoy})/efi/boot/BOOT${EFI_ARCH}.efi;  fi
  fi
  else
    regexp --set=1:vtdisk '(hd[0-9]+)[0-9,]*' "${ventoy}";
    chainloader (${vtdisk})+1;
  fi;
  boot;
else
  configfile ${prefix}/netboot.sh;
fi;
steve6375 commented 4 years ago

The core.img file at https://github.com/ventoy/Ventoy/blob/master/INSTALL/grub/i386-pc/core.img now works! So users could add this to the /ventoy folder on partition 2 and you could boot it using F5.sh

set root=$ventoy
multiboot /ventoy/core.img

So now we can MBR or UEFI-boot to Ventoy from grubfm. Could you modify F5.sh to use these two files (core.img and ventoyx64.ef) if they exist please? It means users can easily add Ventoy to their grubfm partition.

if [ -n "${aioboot}" ];
    then
    if [ "${grub_platform}" = "efi" ];
        then
        chainloader -t (${aioboot})/efi/boot/boot${EFI_ARCH}.efi;
    else
        multiboot (${aioboot})/AIO/grub/i386-pc/core.img;
    fi;
    boot;
elif [ -n "${ventoy}" ];
    then
    if [ "${grub_platform}" = "efi" ];
        then
        if [ -f (${ventoy})/efi/boot/VENTOY${EFI_ARCH}.efi ]; 
            then 
            chainloader -t (${ventoy})/efi/boot/VENTOY${EFI_ARCH}.efi;
        else
            chainloader -t (${ventoy})/efi/boot/BOOT${EFI_ARCH}.efi;  
        fi
    else
        set root=$ventoy
        if [ -f /ventoy/core.img ]; 
            then 
            multiboot /ventoy/core.img; 
        else
            regexp --set=1:vtdisk '(hd[0-9]+)[0-9,]*' "${ventoy}";
            chainloader (${vtdisk})+1;
        fi;
    fi;
    boot;
else
  configfile ${prefix}/netboot.sh;
fi;
crasadure commented 4 years ago

Hi steve6375; @serhat100 from TNCTR he had merged this two system on one multiboot platform. You can examine this project from below link:

Altay Grub2fm + Ventoy Multiboot V8.4 2020 https://www.tnctr.com/topic/370214-altay-grub2fm-ventoy-multiboot-v84-2020/

Project download link: https://yadi.sk/d/yEb6OFFGdBfpDA rar password :aLTay

steve6375 commented 4 years ago

https://rmprepusb.blogspot.com/2020/09/agfm-v157-beta-with-ventoy-support.html How to add Ventoy to Easy2Boot USB drive.

a1ive commented 3 years ago

Now grubfm will load /ventoy/core.img and /efi/boot/ventoyXXX.efi

devdevadev commented 3 years ago

Thanks a lot a1ive for providing Ventoy support in grubfm...