Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Start up boot
#2
(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     
}
Reply


Messages In This Thread
Start up boot - by AAA3A - 04-11-2021, 11:10 AM
RE: Start up boot - by AAA3A - 04-11-2021, 05:02 PM
RE: Start up boot - by AAA3A - 04-11-2021, 07:11 PM
RE: Start up boot - by longpanda - 04-12-2021, 03:03 PM
RE: Start up boot - by AAA3A - 04-13-2021, 02:17 PM
RE: Start up boot - by longpanda - 04-14-2021, 12:57 AM
RE: Start up boot - by AAA3A - 04-14-2021, 07:57 AM
RE: Start up boot - by longpanda - 04-14-2021, 08:36 AM
RE: Start up boot - by AAA3A - 04-14-2021, 08:42 AM
RE: Start up boot - by longpanda - 04-14-2021, 09:31 AM
RE: Start up boot - by AAA3A - 04-14-2021, 09:52 AM
RE: Start up boot - by longpanda - 04-14-2021, 10:21 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)