+
+function distro_specify_initrd_file_phase2 {
+ if [ -f (loop)/boot/initrd.img ]; then
+ vt_linux_specify_initrd_file /boot/initrd.img
+ elif [ -f (loop)/Setup/initrd.gz ]; then
+ vt_linux_specify_initrd_file /Setup/initrd.gz
+ elif [ -f (loop)/isolinux/initramfs ]; then
+ vt_linux_specify_initrd_file /isolinux/initramfs
+ elif [ -f (loop)/boot/iniramfs.igz ]; then
+ vt_linux_specify_initrd_file /boot/iniramfs.igz
+ elif [ -f (loop)/initrd-x86_64 ]; then
+ vt_linux_specify_initrd_file /initrd-x86_64
+ elif [ -f (loop)/live/initrd.img ]; then
+ vt_linux_specify_initrd_file /live/initrd.img
+ elif [ -f (loop)/initrd.img ]; then
+ vt_linux_specify_initrd_file /initrd.img
+ elif [ -f (loop)/sysresccd/boot/x86_64/sysresccd.img ]; then
+ vt_linux_specify_initrd_file /sysresccd/boot/x86_64/sysresccd.img
+ elif [ -f (loop)/CDlinux/initrd ]; then
+ vt_linux_specify_initrd_file /CDlinux/initrd
+ elif [ -f (loop)/parabola/boot/x86_64/parabolaiso.img ]; then
+ vt_linux_specify_initrd_file /parabola/boot/x86_64/parabolaiso.img
+ if [ -f (loop)/parabola/boot/i686/parabolaiso.img ]; then
+ vt_linux_specify_initrd_file /parabola/boot/i686/parabolaiso.img
+ fi
+ elif [ -f (loop)/EFI/BOOT/initrd.img ]; then
+ #Qubes
+ vt_linux_specify_initrd_file /EFI/BOOT/initrd.img
+ if [ "$grub_platform" != "pc" ]; then
+ vt_add_replace_file 0 "initrd.img"
+ fi
+ elif [ -f (loop)/initrd ]; then
+ vt_linux_specify_initrd_file /initrd
+ elif [ -f (loop)/live/initrd1 ]; then
+ vt_linux_specify_initrd_file /live/initrd1
+
+ fi
+}
+
+function ventoy_freebsd_proc {
+ if regexp "^12_[0-9]" $vt_volume_id; then
+ set vt_freebsd_ver=12.x
+ elif regexp "^11_[0-9]" $vt_volume_id; then
+ set vt_freebsd_ver=11.x
+ elif regexp "^10_[0-9]" $vt_volume_id; then
+ set vt_freebsd_ver=10.x
+ elif [ -e (loop)/bin/freebsd-version ]; then
+ vt_unix_parse_freebsd_ver (loop)/bin/freebsd-version vt_userland_ver
+ if regexp "\"12\.[0-9]-" $vt_userland_ver; then
+ set vt_freebsd_ver=12.x
+ elif regexp "\"11\.[0-9]-" $vt_userland_ver; then
+ set vt_freebsd_ver=11.x
+ elif regexp "\"10\.[0-9]-" $vt_userland_ver; then
+ set vt_freebsd_ver=10.x
+ fi
+ else
+ set vt_freebsd_ver=12.x
+ fi
+
+ if file --is-i386-kfreebsd (loop)/boot/kernel/kernel; then
+ set vt_freebsd_bit=32
+ else
+ set vt_freebsd_bit=64
+ fi
+
+ if [ -n "${vtdebug_flag}" ]; then
+ echo "This is FreeBSD $vt_freebsd_ver ${vt_freebsd_bit}bit"
+ fi
+
+ for file in "geom_nop" "ipmi"; do
+ if [ -e (loop)/boot/kernel/${file}.ko ]; then
+ set vt_unix_ko=$file
+ break
+ fi
+ done