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

Does not UEFI-boot from WinPE ISOs #101

Closed steve6375 closed 4 years ago

steve6375 commented 4 years ago

WinPE ISOs have a \sources\boot.wim but no install.wim

as a quick test I changed win_test.sh like this:

#set win_prefix=(loop)/sources/install;
set win_prefix=(loop)/sources/boot;

and now I get a 'Install Windows' option and it successfully UEFI boots WinPE ISOs :-)

if \sources\boot.wim but no \sources\install.wim then show 'Boot WinPE' menu text instead of 'Install Windows'?

No XML List is wanted though.

It will not hurt to leave in start.bat and mount_x64.exe etc. because some WinPEs will need a mounted ISO (Usually mounted on Y:).

steve6375 commented 4 years ago

image

a1ive commented 4 years ago

After commit 917b53f67ea586f168c133d3a586c026ce30d560 there is no 'win_test.sh'.

steve6375 commented 4 years ago

Sorry, thought this was fixed but it appears not.

iso/loop_detect.sh only detects windows install iso's but not winpe ISOs with \sources\boot.wim.

Also, if I copy loop_test.sh to my local rules/iso folder, it contains source ${prefix}/rules/iso/loop_detect.sh; so I need to change this to source (${user})/boot/grubfm/rules/iso/loop_detect.sh;

Can it be changed to check for a user version first please?

a1ive commented 4 years ago

Sorry I don't understand. Are you trying to boot winpe.iso and inject iso drivers into wim?

steve6375 commented 4 years ago

Most WinPE ISOs ignore the winpeshl.ini anyway so they boot to WinPE just fine. If I change loop_detect.sh to detect /sources/boot.wim instead of /sources/install.* then most WinPEs boot OK.

However, some WinPEs do run the injected winpeshl and start.bat but the current start.bat fails and when the cmd window is closed by the user, then the WinPE shuts down.

Ideally, I would like to inject winpeshl.ini and start.bat but the start.bat loads the ISO as drive Y: and then allows WinPE to continue. This is because many WinPEs expect the ISO to be mounted as Y:.

Otherwise simply changing the /sources/install. to /sources/boot. in loop_detect.sh will be fine for now.

a1ive commented 4 years ago

Most WinPE ISOs ignore the winpeshl.ini anyway so they boot to WinPE just fine. If I change loop_detect.sh to detect /sources/boot.wim instead of /sources/install.* then most WinPEs boot OK.

Where to download these WinPEs for testing? (e.g. 'Hiren's Boot CD'?)

steve6375 commented 4 years ago

I have tested some common WinPEs (UEFI64) using the Install Windows win.sh script. Most work OK and the winpeshl does not run. However, start.bat does need some changes:

  1. If no install.* file is found then do not run Setup.exe image

  2. If Y: drive does not already exist - run ImDisk and attach ISO to Y: drive letter - else attach ISO to next available drive letter.


BobOmbs - OK (does not run winpeshl) (https://mega.nz/#!gywx3Ihb!cNTwL_IC2RcfCJzga_4JOJnhHiNGF9omWBKeMcp03eM) https://drive.google.com/file/d/12iOULllhRHNmoW5ItGQWRB04Pp7YhHk3/view

HBCD PE - OK (does not run winpeshl) (https://www.hirensbootcd.org/download/)

WinPESE-x64 - OK - (does not run winpeshl)

WinPE 2019 (ChrisPE ISO) - WinPeshl runs - Windows could not collect information for (OSImage) because X:\Windows\system32\:\sources\install.wim does not exist - start.bat needs changing so does not run setup.exe if no install.* found

Gandalf https://usersdrive.com/wp0ro5w4x6k3.html - requires ISO mounted as Y: (autorun.cmd) http://d1.usersdrive.com:182/d/z6jz5zim2as5ln23gtj7jwzzedq5dfdxrdq4j5lbkzswi236nippphkyqrf4mipkhd3zbomg/Gandalfs.Win10.PE.07-28-2019.win64.rar https://usersdrive.com/wp0ro5w4x6k3.html

Strelec - agFM map menu entry boots - but SSTR folder needs extracting - no Windows option

a1ive commented 4 years ago

downloaded, plz delete @steve6375

a1ive commented 4 years ago

If no install.* file is found then do not run Setup.exe

If don't run setup.exe, what exe should we run (ChrisPE ISO)?

steve6375 commented 4 years ago

don't run any exe.

a1ive commented 4 years ago

I tried but it will reboot if no exe runs after mounting iso.

steve6375 commented 4 years ago

maybe do not end batch file with exit ???

a1ive commented 4 years ago

yes, no exit

steve6375 commented 4 years ago

Sergei Strelec WinPE - https://www.majorgeeks.com/files/details/sergei_strelecs_winpe.html Not typical WinPE!

a1ive commented 4 years ago

Gandalf https://usersdrive.com/wp0ro5w4x6k3.html

I can't boot this pe using wimboot (could not patch boot.wim)

steve6375 commented 4 years ago

Here is grubfm file for Sergei Strelec. WinPE10_8_Sergei_Strelec_x86_x64_2017.10.03_English.grubfm.zip

With current releae of agFM you have to press ENTER to exit the cmd shell.

steve6375 commented 4 years ago

I use slightly different version and it boots OK using win.sh image

Have you set enough RAM in VM?

image

steve6375 commented 4 years ago

https://archive.org/download/gandalfswin10pex64redstone307102018

a1ive commented 4 years ago

Have you set enough RAM in VM?

yes (8GB), and this stage won't use RAM. 深度截图_选择区域_20200221205908

steve6375 commented 4 years ago

If wim file has been made using non-dism (maybe wimlib) then wimboot has problems patching it. Sorry! Try the gandalfswin10pex64redstone307102018 version (only 5GB!).

a1ive commented 4 years ago

Try the gandalfswin10pex64redstone307102018 version

This wim boots ok, but it can't find iso drive (I can't mount iso to Y:)

a1ive commented 4 years ago

HBCD PE and WinPESE-x64 are also ok if use 'map' menu entry, no need to use wimboot (to bypass secure boot).

a1ive commented 4 years ago

I think we need to write .grubfm menu for every winpe ISO, rather than use win.sh.

steve6375 commented 4 years ago

OK. I am trying to change start.bat mount_%arch%.exe -m:r "%isodrive%%isopath%" now mount_%arch%.exe -m:y "%isodrive%%isopath%"

but in both cases the ISO is always mounted on the next available drive letter (not r: or y:). http://www.yubsoft.com/imgdrive/portable.htm#command_line

Is this a bug in the exe?

a1ive commented 4 years ago

but in both cases the ISO is always mounted on the next available drive letter (not r: or y:). Is this a bug in the exe?

maybe. Or we could switch to imdisk? (Is there a portable version?)

steve6375 commented 4 years ago

I dont think it is worth the trouble. Thanks for testing. As Secure Boot won't work, using map is a better option.

a1ive commented 4 years ago

I found that some Chinese WinPE use Y: when initializing. if Y: exists, it can't load external programs. Screenshot_20200611_191735 (Y: was occupied by CD or external drive, will boot without external programs.) Maybe we should use B:

steve6375 commented 4 years ago

Maybe that type of WinPE does not need the ISO mounted at all? What is it trying to mount on Y:?

Y: is expected by many popular WinPEs. They wont work if B: is used. Only Y: will work. Using A: or B: can also cause problems because some WinPEs don't search A or B (it thinks they are floppy disks).

a1ive commented 4 years ago

Maybe that type of WinPE does not need the ISO mounted at all? What is it trying to mount on Y:?

No, they need the ISO mounted. I'm not an expert in WinPE, maybe it uses Y: to load some large programs e.g. Chrome.

a1ive commented 4 years ago

Screenshot_20200611_194735 They use Y: to mount 32-bit large programs. MS Office, PotPlayer, Opera, IE, Virtual PC.

steve6375 commented 4 years ago

Maybe WinPE ISOs could have some sort of optional INI config file

\iso\winpexxx.iso \iso\winpexxx.ini

[ISO_LOAD] Letter=Y (load as Y: - default if no INI found)

Letter=ANY (load as first free letter)

Letter=NONE (do not load ISO as virtual DVD)

WinPESHL=NO (do not add winpeshl.ini or batch file into boot.wim)

steve6375 commented 4 years ago

also could contain entry for name of .bat file to run ???

a1ive commented 4 years ago

No. Most of Chinese WinPE use PECMD, and scripts are encrypted.

steve6375 commented 4 years ago

I mean an entry for the grubfm_startbat variable so it will run a users own batch file from winpeshl.ini.

a1ive commented 4 years ago

https://github.com/a1ive/grub2-filemanager/commit/0aa9b5ed9f36585d22e23e3b52dbf02054574099 now we can use grubfm_startpebat

a1ive commented 4 years ago

If wim file has been made using non-dism (maybe wimlib) then wimboot has problems patching it. Sorry! Try the gandalfswin10pex64redstone307102018 version (only 5GB!).

This wim uses xpress-huffman compression, which is not supported by wimboot. I've added xpress compression support in wimboot module (https://github.com/a1ive/grub/commit/8c1ccc0c04a93cc6167f4de0b2263cfa998d372a), so wimboot could patch it now.