X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/Ventoy.git/blobdiff_plain/6b78603dd36f98a1ad20809739177c8c200e417b..425d6404807c0632b6c59c96b6fc32784c0a7d23:/INSTALL/grub/grub.cfg?ds=inline diff --git a/INSTALL/grub/grub.cfg b/INSTALL/grub/grub.cfg index 6c3c10d..5a17682 100644 --- a/INSTALL/grub/grub.cfg +++ b/INSTALL/grub/grub.cfg @@ -1401,7 +1401,7 @@ function vtoyboot_common_func { ventoy_pause fi fi - + vt_img_sector "${1}" vt_raw_chain_data "${1}" @@ -1629,13 +1629,15 @@ function ventoy_img_openwrt { fi vt_fs_enum_1st_dir (vtimghd,2) /lib/modules/ vt_dir_name - + if [ -f (vtimghd,2)/lib/modules/$vt_dir_name/dm-mod.ko ]; then + set openwrt_plugin_need=0 vt_img_extra_initrd_append (vtimghd,2)/lib/modules/$vt_dir_name/dm-mod.ko if [ -f (vtimghd,2)/lib/modules/$vt_dir_name/dax.ko ]; then vt_img_extra_initrd_append (vtimghd,2)/lib/modules/$vt_dir_name/dax.ko fi else + set openwrt_plugin_need=1 if [ ! -f ${vtoy_iso_part}/ventoy/ventoy_openwrt.xz ]; then ventoy_gui_console echo -e "\n ventoy_openwrt.xz not found. Please refer https://www.ventoy.net/en/doc_openwrt.html.\n" @@ -1659,12 +1661,14 @@ function ventoy_img_openwrt { return fi - vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver" vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit - vt_img_extra_initrd_append ${vtoy_iso_part}/ventoy/ventoy_openwrt.xz - + if [ $openwrt_plugin_need -eq 1 ]; then + if [ -f ${vtoy_iso_part}/ventoy/ventoy_openwrt.xz ]; then + vt_img_extra_initrd_append ${vtoy_iso_part}/ventoy/ventoy_openwrt.xz + fi + fi #boot image file vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=openwrt @@ -1736,10 +1740,6 @@ function img_common_menuentry { fi fi - if [ -d (vtimghd)/ ]; then - loopback -d vtimghd - fi - loopback vtimghd "${vtoy_iso_part}${vt_chosen_path}" vt_img_sector "${vtoy_iso_part}${vt_chosen_path}" @@ -1804,6 +1804,8 @@ function img_common_menuentry { fi fi + loopback -d vtimghd + set root=$vtback_root vt_pop_last_entry set theme=$vtback_theme