Ventoy Forums
Start up boot - Printable Version

+- Ventoy Forums (https://forums.ventoy.net)
+-- Forum: Ventoy General Use —— Ventoy 使用交流 (https://forums.ventoy.net/forumdisplay.php?fid=1)
+--- Forum: Ventoy Discussion Forum (https://forums.ventoy.net/forumdisplay.php?fid=2)
+--- Thread: Start up boot (/showthread.php?tid=1641)

Pages: 1 2


Start up boot - AAA3A - 04-11-2021

Hello,
In the F6 submenu, I would like that when we click on for example "Boot on linux iso", it boots on the right iso. Is there a grub command that allows you to do this: it's a bit like the menu expiration and autostart.
Thanks in advance


RE: Start up boot - AAA3A - 04-11-2021

(04-11-2021, 11:10 AM)AAA3A Wrote: Hello,
In the F6 submenu, I would like that when we click on for example "Boot on linux iso", it boots on the right iso. Is there a grub command that allows you to do this: it's a bit like the menu expiration and autostart.
Thanks in advance

After several weeks of research, I finally found the answer to my question.
Pressing E allows you to see which commands are hidden behind an option. So I found the function launched in grub.cfg and modify the commands with my own variable.
You have to copy the code below and put path in your iso directory.

Code:
menuentry "ISO" {
    unset path
    set path="/ISO/abcdefghij.iso"
    unset vt_system_id
    unset vt_volume_id
    vt_chosen_img_path vt_chosen_path vt_chosen_size
    vt_parse_iso_volume "${vtoy_iso_part}/${path}" vt_system_id vt_volume_id vt_volume_space
    if [ $vt_volume_space -ne $vt_chosen_size ]; then       
        vt_mod $vt_chosen_size 2048 vt_chosen_size_mod
        if [ $vt_chosen_size_mod -ne 0 ]; then
            echo -e "\n $vt_volume_space $vt_chosen_size $vt_chosen_size_mod\n"
            echo -e "\n The size of the iso file \"$vt_chosen_size\" is invalid. File corrupted ?\n"
            echo -e " 此ISO文件的大小 \"$vt_chosen_size\" 有问题,请确认文件是否损坏。\n"
            echo -e "\n press ENTER to exit (请按 回车 键返回) ..."
            read vtInputKey
            return
        fi
    fi
    if vt_check_password "${path}"; then
        return
    fi
    if ventoy_vcfg_proc "${path}"; then       
        return
    fi
    if vt_str_begin "$vt_volume_id" "Avira"; then
        vt_skip_svd "${vtoy_iso_part}${path}"
    fi
    ventoy_iso_busybox_ver
    #special process for Endless OS
    if vt_str_begin "$vt_volume_id" "Endless-OS"; then
        iso_endless_os_proc $vtoy_iso_part "${path}"
    elif vt_str_begin "$vt_volume_id" "TENS-Public"; then
        set vtcompat=1
    fi
    if [ "$grub_platform" = "pc" ]; then
        if vt_check_mode 0; then
            legacy_iso_memdisk $vtoy_iso_part "${path}"
        else
            legacy_iso_menu_func $vtoy_iso_part "${path}"
        fi
    else
        if vt_check_mode 0; then
            uefi_iso_memdisk $vtoy_iso_part  "${path}"
        else
            uefi_iso_menu_func $vtoy_iso_part  "${path}"
        fi
    fi     
}



RE: Start up boot - AAA3A - 04-11-2021

It doesn't work on UEFI!


RE: Start up boot - longpanda - 04-12-2021

Use this CI release:
https://github.com/ventoy/Ventoy/actions/runs/741502052

Aadd following menuentry in ventoy_grub.cfg

Code:
menuentry "Boot ISO" {  
    vt_ext_select_img_path  "/ISO/archlinux-2020.09.01-x86_64.iso"
    iso_common_menuentry
}



RE: Start up boot - AAA3A - 04-13-2021

(04-12-2021, 03:03 PM)longpanda Wrote: Use this CI release:
https://github.com/ventoy/Ventoy/actions/runs/741502052

Aadd following menuentry in ventoy_grub.cfg

Code:
menuentry "Boot ISO" {  
    vt_ext_select_img_path  "/ISO/archlinux-2020.09.01-x86_64.iso"
    iso_common_menuentry
}

Is there a code way or a way to integrate the changes directly into the main score?


RE: Start up boot - longpanda - 04-14-2021

It will be included in the next release.


RE: Start up boot - AAA3A - 04-14-2021

(04-14-2021, 12:57 AM)longpanda Wrote: It will be included in the next release.

I was wondering if when you put vhd_common_menuentry, this technique also works for .vhd?

About your hidden Easter egg in the source code, I spent a lot of time searching every file in the Ventoy partition without finding anything! It's really well hidden, I think it's hidden in one of those :
- ventoy_x86.cpio
- vtloopex.cpio
- ventoy_efiboot.img.xz
- ventoy_mips64.cpio
- ventoy_unix.cpio
- dragonfly.mfs.xz
- ventoy.cpio
- ventoy_arm64.cpio


RE: Start up boot - longpanda - 04-14-2021

It should work, but without test, you can test it.
ps:
vhd_common_menuentry is just for Windows VHD(x) boot.
ISO/VHD ... files must be in the 1st partition of Ventoy USB stick.


RE: Start up boot - AAA3A - 04-14-2021

(04-14-2021, 08:36 AM)longpanda Wrote: It should work, but without test, you can test it.
ps:
vhd_common_menuentry is just for Windows VHD(x) boot.
ISO/VHD ... files must be in the 1st partition of Ventoy USB stick.

It works for vhd by setting vhd_common_menuentry, but it tells me before booting that the first partition is not in ntfs when it is! On the next version of Ventoy (1.0.41), you will add this function and the code will be the same ?

Thank you very much for your work which helps a lot of people and makes it easier to create multifunctional bootable flash drives!


RE: Start up boot - longpanda - 04-14-2021

The NTFS warning is fixed in this CI release:
https://github.com/ventoy/Ventoy/actions/runs/747702905

All the modifications will be included in the next 1.0.41 release.