Jump to content











Photo
- - - - -

remove uneccessary messages on loading grldr


  • Please log in to reply
50 replies to this topic

#26 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13750 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 06 August 2013 - 12:46 PM

Just for the record, these lines:



find --set-root --ignore-floppies --ignore-cd /menu.lst && configfile /menu.lst
find --set-root --ignore-floppies --ignore-cd /boot/grub/menu.lst && configfile /boot/grub/menu.lst
find --set-root --ignore-floppies --ignore-cd /grub/menu.lst && configfile /grub/menu.lst

will attempt to find the first occurrence of any among:

/menu.lst

/boot/grub/menu.lst

/grub/menu.lst

 

(only on volumes belonging to "hard disk like" devices).

 

Volumes will be scanned in a given order, starting from (hd0,0), then (hd0,1).... then (hd1,0) etc.

 

The "embedded menu" in grldr or in grub.exe can be edited alright (and booting might be faster).

If you prefer you can "install" or "hard code" the path to the menu.lst.

If you edit the "embedded menu" to something *like*:



default 0
timeout 0
title just boot
configfile (hd0,0)/menu.lst

the actual booting time might be noticeably faster.

 

Editing the embedded menu.lst isn't particularly difficult.

 

You can extract from grub.exe the last bytes starting from "pxe detect" with a hex editor (to know how long exactly is the space "dedicated" to the menu), then create a new menu.lst, use the hex editor to merge the new menu.lst on a new file the same size as the one you extracted earlier.

In batch, this would be easily done using gsar and the tools from the dsfok toolkit, sometjhing *like*:



@ECHO OFF
SETLOCAL ENABLEEXTENSIONS
SET Source=grub.exe
SET menu_offset=
FOR /F "tokens=2 delims=:" %%A IN ('gsar -b -spxe:x20detect %Source%^|FIND /v "match"') DO SET /A menu_offset=%%A
SET menu_offset
IF EXIST embmenu.txt DEL embmenu.txt
FOR /F "tokens=2 delims= " %%A IN ('dsfo %Source% %menu_offset% 0 embmenu.txt 2^>^&1') DO SET /A menu_size=%%A
SET menu_size
edit embmenu.txt
ECHO DO YOU WANT TO REPLACE THE EMBEDDED MENU with embmenu.txt?
SET Confirm=NO
SET /P Confirm=Enter YES (CAPITAL LETTERS) to confirm:
IF %Confirm%.==YES. GOTO :do_patch
ECHO Nothing to do ....
PAUSE
GOTO :EOF

:do_patch
fsz embmenu.txt %menu_size%
dsfi %Source% %menu_offset% 0 embmenu.txt
PAUSE

should do nicely.

 

Please understand that once you have removed the leading "pxe detect" the batch won' t work anymore on the edited grub.exe.

 

@Steve6375

Possibly one of the things to ask Chenall would be to add a "header", something *like*:



embeddedmenulstbegin:

or maybe there is already somewhere in grldr and grub.exe (at a given offset) that represents a pointer to the actual beginning of the embedded menu.lst? :unsure:

 

:cheers:

Wonko



#27 steve6375

steve6375

    Platinum Member

  • Developer
  • 6629 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 06 August 2013 - 01:24 PM

The menu.lst is at the very end of grldr (and end of grub.exe followed by lots of 00's).

I did ask chenall to suppress the display of the menu but he insisted it was needed for debug purposes.

it can be safely patched using

cat --number=1 --locate="\x0atimeout 1\x0a" --replace="\x0atimeout 0\x0a" /grub.exe

(or grldr)

 

p.s. For your script, why not start the replacement script with #!#  (or some unique comment string) and then write your script  to detect either 'pxe detect' or '#!#' - that way it can be patched again and again?



#28 nando4

nando4

    Frequent Member

  • Advanced user
  • 112 posts
  •  
    Australia

Posted 06 August 2013 - 01:52 PM

The menu.lst is at the very end of grldr (and end of grub.exe followed by lots of 00's).
I did ask chenall to suppress the display of the menu but he insisted it was needed for debug purposes.
it can be safely patched using

cat --number=1 --locate="\x0atimeout 1\x0a" --replace="\x0atimeout 0\x0a" /grub.exe
(or grldr)
 
p.s. For your script, why not start the replacement script with #!#  (or some unique comment string) and then write your script  to detect either 'pxe detect' or '#!#' - that way it can be patched again and again?


While replacing 'timeout 1' with 'timeout 1' is a good solution, I'm attempting to go one step further by implement Wonko's solution changing the internal default menu.lst with another. Now I'd prefer not to use bootice. So how to do this using patchme.g4b instead? Then I can leave a call to patchme.g4b and it does it's job automatically if I upgrade grub4dos versions.

I used a hexeditor finding there is a "pxe detect\x0aconfigfile" string that starts that menu. I tried the following but it doesn't do anything. Is there some limits to the cat command doing replacement?
 
cat --locate="pxe detect\x0aconfigfile" --number=1 --replace="default 0\x0atimeout 0\x0atitle just boot\x0aconfigfile (hd0,0)/menu.lst\0\0" ()/grub.exe > nul

Edited by nando4, 06 August 2013 - 02:21 PM.


#29 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13750 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 06 August 2013 - 02:31 PM

p.s. For your script, why not start the replacement script with #!#  (or some unique comment string) and then write your script  to detect either 'pxe detect' or '#!#' - that way it can be patched again and again?

Yep, that would be an idea :thumbup:, following is a - still half @§§ed - modified batch (completely UNlike tested).
@ECHO OFF
SETLOCAL ENABLEEXTENSIONS
SET Source=grub.exe
SET menu_offset=
FOR /F "tokens=2 delims=:" %%A IN ('gsar -b -spxe:x20detect %Source%^|FIND /v "match"') DO SET /A menu_offset=%%A
IF NOT DEFINED menu_offset FOR /F "tokens=2 delims=:" %%A IN ('gsar -b -s#ModMenu# %Source%^|FIND /v "match"') DO SET /A menu_offset=%%A
IF NOT DEFINED menu_offset GOTO :Error
SET menu_offset
ECHO #ModMenu#>modmenu.txt
IF EXIST embmenu.txt DEL embmenu.txt
FOR /F "tokens=2 delims= " %%A IN ('dsfo %Source% %menu_offset% 0 embmenu.txt 2^>^&1') DO SET /A menu_size=%%A

SET menu_size
edit embmenu.txt
ECHO DO YOU WANT TO REPLACE THE EMBEDDED MENU with embmenu.txt?
SET Confirm=NO
SET /P Confirm=Enter YES (CAPITAL LETTERS) to confirm:
IF %Confirm%.==YES. GOTO :do_patch
ECHO Nothing to do ....
PAUSE
GOTO :EOF

:do_patch
copy modmenu.txt+embmenu.txt
fsz modmenu.txt %menu_size%
dsfi %Source% %menu_offset% 0 modmenu.txt
PAUSE
GOTO :EOF

:Error
ECHO Ooops! Something went terribly wrong!
PAUSE
@nando4
Try not doing everything at once.
Start by going to command line (and NOT directly in a grub4dos script) and try in it the simplest command:





cat --locate="pxe detect\x0aconfigfile" --number=1 /grub.exe
Does it work? :whistling:
 
:cheers:
Wonko

#30 steve6375

steve6375

    Platinum Member

  • Developer
  • 6629 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 06 August 2013 - 02:48 PM

yes, the locate string is limited to 16 characters, the --replace string to well over 32 chars  (in 2013 grub4dos, previous versions were 16+16).

 

for your menu, you don't need a timeout or a title, try

cat --locate="pxe detect\x0a" --number=1 --replace="configfile (hd0,0)/menu.lst\0" ()/grub.exe > nul

if you want more than 32 characters, you will have to be crafty and do it line by line in grub4dos...

cat --locate="pxe detect\x0a" --number=1 --replace="##!##\x0aZaz" ()/grub.exe > nul
#look for start marker so we can repatch again if required
cat --locate="##!##\x0a" --replace="##!##\x0aZaz"
set l=default 0
cat --locate="Zaz" --number=1 --replace="%l%\x0aZaz" ()/grub.exe > nul
set l=timeout 0
cat --locate="Zaz" --number=1 --replace="%l%\x0aZaz" ()/grub.exe > nul
set l=title just boot
cat --locate="Zaz" --number=1 --replace="%l%\x0aZaz" ()/grub.exe > nul
set l=configfile (hd0,0)/menu.lst
cat --locate="Zaz" --number=1 --replace="%l%\x0aZaz" ()/grub.exe > nul

#last line - get rid of end marker
cat --locate="Zaz" --number=1 --replace="\0" ()/grub.exe > nul

(untested!)

 

P.S. new 2013 grub4dos has a much larger replace string allowance (may be up to 255 - I haven't tested it past 32 characters!).  Locate string must be 16 chars or less.



#31 steve6375

steve6375

    Platinum Member

  • Developer
  • 6629 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 06 August 2013 - 03:08 PM

just tested with a 300 character string for --replace and it worked! So no need to do it in stages.



#32 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13750 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 06 August 2013 - 03:14 PM

just tested with a 300 character string for --replace and it worked! So no need to do it in stages.

Well, no need even without this (BTW nice :)) confirmation, though the 16 byte limit was too "tight", the 255 would have been more than enough for this particular scope.

The idea was to write a SIMPLER, SHORTER, (hardcoded) menu.lst, not the 2013 version of the Divina Commedia;) :whistling:

 

:cheers:
Wonko



#33 nando4

nando4

    Frequent Member

  • Advanced user
  • 112 posts
  •  
    Australia

Posted 06 August 2013 - 04:31 PM

Wonko and Steve. Thank you. Problem with the short yet distracting flash of default internal menu.lst is solved.

#34 planejanez

planejanez

    Newbie

  • Members
  • 10 posts
  •  
    United States

Posted 20 October 2013 - 02:44 AM

I appreciated seeing this topic having fairly recent activity since i was looking to accomplish the same thing. I attempted to use the patch posted by steve6375 which worked for some of the messages I was seeing on grub4dos bootup. So I decided instead of trying to update the patch, that I would look at the grub4dos source code which was pretty interesting. One thing I noticed while looking at the source code was a comment regarding debug mode, which indicated that pressing the insert key on the keyboard while grub4dos is booting would enable debug mode. So I pressed the insert key while grub4dos was booting up, and it went into debug mode stopping code processing as it processed it one step at a time. It allowed me to see which source code file and the exact line in the source code that was producing the text output to the screen. I thought this info might be helpful for those looking to suppress the text on the screen prior to the grub4dos menu appearing.

 

I'm very new to grub4dos so the only version that I've used is the chenall grub4dos-0.4.6a-2013-10-17. So I don't know if debug mode in present in all versions chenall has produced.


Edited by planejanez, 20 October 2013 - 02:53 AM.


#35 steve6375

steve6375

    Platinum Member

  • Developer
  • 6629 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 20 October 2013 - 09:00 AM

http://www.rmprepusb...Single-Stepping

 

Latest patch file attached.

 

Attached Files


  • planejanez likes this

#36 planejanez

planejanez

    Newbie

  • Members
  • 10 posts
  •  
    United States

Posted 20 October 2013 - 02:24 PM

Thanks steve6375, your latest patch covers all the grub4dos bootup messages I was seeing. There was an additional message I was seeing that was showing on the screen immediately after the grub4dos messages. I initially thought it was just another grub4dos message that I needed to patch but I found out it wasn't. The message was "Initializing gfx code..." and I determined it was actually the init file inside the message file (cpio archived file) for gfxmenu that was producing the message. I was able to use a hex editor on the init file to suppress the message.



#37 steve6375

steve6375

    Platinum Member

  • Developer
  • 6629 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 21 October 2013 - 12:06 AM

I haven't tested this, but if you run

# move cursor off screen
call Fn.5 0 128
# inhibit debug messages
debug 0
<do gfxmenu /message here>
clear     ;; # (or use call Fn.5 0 0  to set cursor to top left)

before calling gfxmenu, it may hide the 'Initializing gfx code' message without needing to patch it each time you make one?



#38 planejanez

planejanez

    Newbie

  • Members
  • 10 posts
  •  
    United States

Posted 21 October 2013 - 01:44 AM

I haven't tested this, but if you run

# move cursor off screen
call Fn.5 0 128
# inhibit debug messages
debug 0
<do gfxmenu /message here>
clear     ;; # (or use call Fn.5 0 0  to set cursor to top left)

before calling gfxmenu, it may hide the 'Initializing gfx code' message without needing to patch it each time you make one?

 

Thanks steve6375 your suggestion worked great. Also wanted to thank you for the fine RMPrepUSB tool you developed, and the fine website http://www.rmprepusb.com/ you maintain. I've been using your tool alot, and reading your tutorials. I would suggest making the audio for your video tutorials a little louder though. I could barely hear your voice at full volume.


Edited by planejanez, 21 October 2013 - 01:48 AM.

  • steve6375 likes this

#39 steve6375

steve6375

    Platinum Member

  • Developer
  • 6629 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 21 October 2013 - 09:12 AM

 I would suggest making the audio for your video tutorials a little louder though. I could barely hear your voice at full volume.

Probably a good thing!  There is one video where the audio is very low, but the others should be OK???



#40 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 02 December 2014 - 06:18 PM

http://www.rmprepusb...Single-Stepping

 

Latest patch file attached.

 

Tried on latest 0.46a version but now I see this message at startup: "A20 debug: C806 Done ..."

Is this normal for 0.46a?



#41 steve6375

steve6375

    Platinum Member

  • Developer
  • 6629 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 02 December 2014 - 06:47 PM

a = alpha, b=beta, c=release

 

0.4.6a is alpha status and I would not use it as my 'main' grub4dos or trust it.

 

If you find a problem, then report it

https://github.com/c...grub4dos/issues



#42 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 02 December 2014 - 07:19 PM

You're right, of course :)



#43 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13750 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 02 December 2014 - 08:43 PM

You're right, of course :)

UNfortunately not this time. :(
Steve6375's explanation is simple and clear :thumbsup:, but not entirely accurate, it's much more complex than that.

The grub4dos naming is complex, but the "a" does not really mean "alpha" and the "b" does not really mean "beta" (let alone what the "c" means) :w00t:.
The last version of the 0.4.5a is dated 2010-04-20 http://grub4dos.chen...egories/0-4-5a/
The first version of 0.4.5b is dated 2010-06-15 http://grub4dos.chen...egories/0-4-5b/
The last version of the 0.4.5b is dated 2012-01-16
The first version of the 0.4.5c is dated 2012-01-17 http://grub4dos.chen...egories/0-4-5c/
The last version of the 0.4.5c is dated 2014-11-27
BUT the first version of the 0.4.6a is dated 2012-01-01 http://grub4dos.chen...egories/0-4-6a/
AND the last version of the 0.4.6a is dated 2014-12-02

The idea is that after the first 0.4.5c has been released, it was considered "mature enough" for common use (but the 0.4.5c as you can see is continuously updated), whilst all experimental new features were first added to the 0.4.6a series (and some have over the time been "ported back" to the 0.4.5c series), and any bugfix in 0.4.5c has been normally "ported forward" onto 0.4.6s.

 

On the old site some specific releases were marked "testonly" or "featured", a piece of information that is lost now.

Any normal user should use the 0.4.5c, while for testing (and for testing only) the 0.4.6a should be used (but the addition of the USB stack to the 0.4.6a version has additionally "mixed together" the use or intended use or "common use" of the releases :ph34r:).

You can think as the actual version number (5 or 6) as a "main" release and to the letter (a, b or c) as the "level of maturity" the release has reached.

:duff:
Wonko



#44 steve6375

steve6375

    Platinum Member

  • Developer
  • 6629 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 02 December 2014 - 10:23 PM

UNfortunately not this time. :(
Steve6375's explanation is simple and clear :thumbsup:, but not entirely accurate, it's much more complex than that.

The grub4dos naming is complex, but the "a" does not really mean "alpha" and the "b" does not really mean "beta" (let alone what the "c" means) :w00t:.

:duff:
Wonko

 

Guess I shouldn't believe everything I read  :exclamation:  or is it OK for you to simplify it but not me?

http://reboot.pro/to...os/#entry169151



#45 tinybit

tinybit

    Gold Member

  • Developer
  • 1052 posts
  •  
    China

Posted 03 December 2014 - 01:37 AM

Recent 0.4.6a's have changed greatly and introduced bugs while trying to integrate some ipxe features.

 

Please use 2014-11-27 or older, or wait some time for the bugs to be fixed.



#46 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13750 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 03 December 2014 - 09:33 AM

Guess I shouldn't believe everything I read  :exclamation:  or is it OK for you to simplify it but not me?

http://reboot.pro/to...os/#entry169151

I wonder what is the issue in:

 

 

Steve6375's explanation is simple and clear :thumbsup:, but not entirely accurate, it's much more complex than that.
 

Is there a better way to say "simple and clear (good), but not entirely accurate (good enough but not exact)"? :unsure:

:duff:

Wonko



#47 steve6375

steve6375

    Platinum Member

  • Developer
  • 6629 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 23 March 2015 - 11:49 AM

P.S.

a = alpha, b=beta, c=release

 

0.4.6a is alpha status and I would not use it as my 'main' grub4dos or trust it.

 

If you find a problem, then report it

https://github.com/c...grub4dos/issues

 

From chenall's own documentation

https://github.com/c...ME_GRUB4DOS.txt

******************************************************************************
***                            Version numbering                           ***
******************************************************************************
Now we append a letter 'a', 'b', 'c' or 'p' to the version number(e.g., 0.4.5).
So the version will become 0.4.5a, 0.4.5b, 0.4.5c, 0.4.5 or 0.4.5p.
'a' - alpha test. unstable, especially when there are known bugs.
'b' - beta test. the developers think it has no bugs and want a widely testing.
'c' - release candidate.
''(nothing) - official release.
'p' - patched versions to the official release.


#48 Loginsky

Loginsky
  • Members
  • 2 posts
  •  
    Poland

Posted 14 July 2016 - 09:27 AM

Hi

I'm newbie how to install Patchg4d.g4b ?


 

 



#49 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13750 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 14 July 2016 - 12:54 PM

Hi
I'm newbie how to install Patchg4d.g4b ?

You don't install it, you run it (once), like:
http://www.rmprepusb...essages-silent-

Suppress grub4dos startup/bootup messages (silent)
grub4dos (grldr) echoes some debug messages to the screen on startup as it boots, which you may not want the user to see. They can be patched out by using a grub4dos batch file.
Run this patchg4d.g4b batch file at the start of your menu.lst - it will automatically make the code patches to blank out the messages the first time it is run.
It only needs to be run once (on a real system, not QEMU) for the patch to take affect.
e.g.

# patch out messages for silent startup
/patchg4d.g4b

of course a copy of the file needs to be in root, or you need to add the path to it to the line, examples:
# patch out messages for silent startup
/mypath/patchg4d.g4b
or
# patch out messages for silent startup
find --set-root /mypath/patchg4d.g4b /
/mypath/patchg4d.g4b
or you can press the "c" key and run it from the grub4dos prompt instead of (temporarily) adding it to a menu.lst.

What is the doubt? :unsure:
 
:duff:
Wonko

#50 Loginsky

Loginsky
  • Members
  • 2 posts
  •  
    Poland

Posted 14 July 2016 - 02:39 PM

thx this works






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users