chenall / grub4dos

外部命令和工具源码:https://github.com/chenall/grubutils 下载:
http://grub4dos.chenall.net
GNU General Public License v2.0
651 stars 136 forks source link

grub4dos/grub4efi: DLCBoot v4.1 - ISO UDF filesystem access bad when using map #357

Open steve6375 opened 2 years ago

steve6375 commented 2 years ago

DLCBoot (www.dlcboot.com) v4.0 ISO was OK. The latest version of DLCBoot v4.1 ISO shows this problem with grub4dos

map /_ISO/WINPE/DLCBoot\ 2022\ v4.1.220628_.isowin.iso (0xff)
map --hook
ls (0xff)/DLC1/WinPE/
pause

image

files under WinPE folder corrupt!

Issue occurs under latest grub4dos and grldr 2019_11 version too. Both ISO files are contiguous and on NTFS volume.

image

image

I have remade the ISO three times using DLCBoot.exe. The ISO passes WinZip 'Test' function. The ISO is OK under grubfm, lists the WinPE folder correctly and boots to the .wim files (grub2). It appears to be perhaps a size problem? Tested under VBox 5 and real system (Lenovo IdeaPad 300).

problem DLC v4.1 ISO information image

steve6375 commented 2 years ago

same issue with grub4efi image

steve6375 commented 2 years ago

I tried same file on exfat partition with same issue using legacy grub4dos. So not related to NTFS or exfat filesystem. image

Is there anything I can try under grub4dos to help narrow down the problem? As file is >4GB, is it a 32-bit pointer issue maybe in ISO code?

Same file on same drive under grub2 is OK image

.

steve6375 commented 2 years ago

I extracted all files from the DLC v4.1 5GB ISO to a new folder. Then I used PowerISO to make a new ISO file from the extracted files. Now it works in grub4dos! image

I assume that the file positions within the ISO is now different (before 4GB?). Also ISO is not Rockridge+UDF like original ISO file was? image

steve6375 commented 2 years ago

I remade the ISO again as follows: I loaded the 'good' Joliet ISO into PowerISO I changed the Propertiies to ISO9660+Rockridge+UDF I saved as a new ISO Now it FAILS in same way as original issue. image So bug in UDF ISO code?

steve6375 commented 2 years ago

I made another ISO as ISO9660+UDF - it FAILS in same way. So bug in UDF code?

steve6375 commented 2 years ago

Note: The previous v4.0 ISO that worked was not in UDF format: image

a1ive commented 2 years ago

I made another ISO as ISO9660+UDF - it FAILS in same way. So bug in UDF code?

Could you please upload a minimal ISO that reproduces the problem?

steve6375 commented 2 years ago

I suspect iso needs to be over 4gb. Just make the iso yourself Download dlcboot.com winpe rar file Extract Run dlcboot.exe Click on CD icon at top right to make iso

steve6375 commented 2 years ago

https://mega.nz/file/03IQxTxS#MzLwVzyy8caVOHT0ie3EikajOuezcSbcQ86SUPn8i54

steve6375 commented 2 years ago

I made a small ISO with few files and just one wim file. It still cannot list the wim file in the /DLC1/WinPE folder but can list files above that. image So not a size issue image

steve6375 commented 2 years ago

DLC4.1_REMADE_9660_UDFTEST7MIN.isowin.iso.zip DLC4.1_REMADE_9660_UDFTEST8MIN.isowin.iso.zip

Here are two stripped out ISOs

TEST8 does not show the issue TEST7 gives a file not found The difference between the two is that I removed most files from \DLC1 folder in TEST8 image

steve6375 commented 2 years ago

DLC4.1_REMADE_9660_UDFTEST7aMIN.isowin.iso.zip This is OK. If I remove some of the files from DLC1 folder - it is OK.

image

These files were removed from DLC1 folder image

In TEST7 (FAILING FILE) it has 51 files on \WinPE folder.

steve6375 commented 2 years ago

Maybe number of files. If I remove 8 files from failing TEST7 ISO then it works. If I remove 4 files from TEST7 ISO it fails I removed different files from the last test (TEST7 v. TEST8) so it is nothing to do with filenames. temp.zip This zip file has good and bad ISOs - only difference is 4 .cmd files deleted in GOOD one.

yaya2007 commented 2 years ago

On QEMU virtual machine, Test7 was tested with grub4dos-0.4.6a-2020-02-29 (real machine 2020-03-04), and there was no reproduction problem. temp.zip test also found no problems.

steve6375 commented 2 years ago

yes. I get no problem with basic menu with Test7a - problem occurs when in Easy2boot menu.

However I do still get a problem in only the basic menu with the full ISO

color white/blue 
color normal=0x0c highlight=0x1e helptext=0x0D standard=0x02 border=0x0c
title Full ISO
map /_ISO/WINPE/DLCBoot\ 2022\ v4.1.220628_.isowin.iso (0xff)
map --hook
ls (0xff)/DLC1/WinPE/
pause

I will try to find a smaller file that still shows the problem...

steve6375 commented 2 years ago

DLC4.1_REMADE_9660_UDFTEST7MIN.isowin.iso.zip This shows issue with basic menu.lst

title test7 DLC4.1_REMADE_9660_UDF_TEST7MIN_.isowin.iso
map /_ISO/WINPE/DLC4.1_REMADE_9660_UDF_TEST7MIN_.isowin.iso (0xff)
map --hook
ls (0xff)/DLC1/WinPE/
pause
boot

I get no file found image

yaya2007 commented 2 years ago

Test7 test, problem discovery: File not found To be investigated.

yaya2007 commented 2 years ago

Test7 test, problem discovery: File not found To be investigated.

yaya2007 commented 2 years ago

Please test grldr.rar.txt

steve6375 commented 2 years ago

Looks good :-) Works even with full 5GB DLC1 ISO.

steve6375 commented 2 years ago

Note: The new grldr does not work with E2B fully because the hotkey utility and other utilities are not compatible with the new version of grldr. Please could you consider adding multiple path support as in https://github.com/chenall/grub4dos/issues/322 so the both grub4dos and grub4efi can use the same helper batch files, etc, but a different utilities folder.

yaya2007 commented 2 years ago

if exist @uefi command --set-path=(bd)/extefi;(bd)/common if not exist @uefi command --set-path=(bd)/extmbr;(bd)/common

This function can be realized at present.

steve6375 commented 2 years ago

todays test grub4dos version

image

Did I do something wrong ?

yaya2007 commented 2 years ago

There must be no comments at the end of the parameter。

command --set-path=(bd)/_ISO/e2b/grub/bios_utils/ext

steve6375 commented 2 years ago

But I need to set two search paths.

yaya2007 commented 2 years ago

if exist @uefi command --set-path=(bd)/extefi if not exist @uefi command --set-path=(bd)/extmbr

steve6375 commented 2 years ago

But I want to set two paths. One path is for common batch files which will boot both in legacy mode and uefi mode The other path is for the ext utilities folder - one for legacy and one for uefi

This means I can have a single menu system which calls batch files to boot various payloads.

In my case, _ISO\e2b\grub contains general purpose batch files for booting different kinds of payloads, plus support batch files, etc. But these batch files need to call utility files such as hotkey, fat, bios, chkpci, etc.

If I used a scheme as you suggest:

if exist https://github.com/UEFI command --set-path=(bd)/extefi
if not exist https://github.com/UEFI command --set-path=(bd)/extmbr

It means I would have to keep two copies of most of the common batch files and utilities in both /extefi and /extmbr. It means I would have to update both folders each time I changed a batch file as well as take up twice the room. Currently I have 80 .g4b batch files which are common to both legacy and efi.

alarm.g4b
AntiPanda.g4b
AUTOMN.g4b
BootWinEfi.g4b
centrehd.g4b
CheckAccess.g4b
checkdate.g4b
checkptns.g4b
Choose_File.g4b
Choose_Kbd.g4b
Choose_Lang.g4b
configX.g4b
copyFF.g4b
countfiles.g4b
Date.g4b
delptn3.g4b
display_cpuid.g4b
display_ptns.g4b
DLC.g4b
dow.g4b
efiboothd.g4b
FARkeyXML.g4b
FARXML.g4b
FindFile.g4b
Fix30.g4b
getline.g4b
getpass.g4b
getstr.g4b
GETWCNT.G4B
Grab.g4b
HitmanXfer.g4b
isoboot.g4b
KBD_AZERTY.g4b
KBD_CZECH_QWERTY.g4b
KBD_CZECH_QWERTZ.g4b
KBD_DANISH.g4b
KBD_DVORAK_USA.g4b
KBD_FRENCH.g4b
KBD_GERMAN.g4b
KBD_ITALIANO.g4b
KBD_JAPAN_106.g4b
KBD_LATIN_USA.g4b
KBD_PORTU_BRAZIL.g4b
KBD_QWERTY_UK.g4b
KBD_QWERTY_USA.g4b
KBD_QWERTZ.g4b
KBD_QWERTZ_HUN.g4b
KBD_QWERTZ_SLOV_CROAT.g4b
KBD_SPANISH.g4b
KBD_SWEDISH.g4b
KBD_TURKISH_Q.g4b
KBD_VIETNAMESE.g4b
KeyCheck.g4b
ListDir.g4b
ListPtns.g4b
LstFExt.g4b
order_ptns.g4b
PickaFile.g4b
QAUTO.g4b
QRUN.g4b
QRUNefi.g4b
REP3.g4b
RestoreMBR.g4b
rtl.g4b
RunVista.g4b
RunWin8.g4b
SearchBS.g4b
SetHPAD.g4b
SnipStr.g4b
SoakKeys.g4b
strelec.g4b
SubMenu.g4b
TimeAccess.g4b
TimeDiskAccess.g4b
tp.g4b
true_hide.g4b
true_unhide.g4b
VarsLeft.g4b
VistaMn.g4b
Win8Mn.g4b
XLATE.g4b
XPWINNT.g4b
yaya2007 commented 2 years ago

set path_efi=(bd)/extefi set path_bios=(bd)/extmbr

if exist https://github.com/UEFI set path=%path_efi% if not exist https://github.com/UEFI set path=%path_bios%

%path%hotkey -A [F3] "commandline"

steve6375 commented 2 years ago

That uses an extra variable

If I use %@uefi%hotkey then it will run 64hotkey or hotkey. Or I can use hotkey%@uefi% to use hotkey64 or hotkey.

So I just rename the efi utilities.

But --set-ext can use multiple extensions - .g4b;.bat so why not command --set-path ???

memoarfaa commented 2 years ago

@yaya2007 if there is any method to check UEFI architecture x32 or x64 if exist @UEFI64 load /efi/grub/ntfs_x64.efi if exist @UEFI32 load /efi/grub/ntfs_ia32.efi

yaya2007 commented 2 years ago

if %@uefi%==64 load /efi/grub/ntfs_x64.efi

if %@uefi%==32 load /efi/grub/ntfs_ia32.efi