if some.iso not exists then hide this menu entry
#51
Posted 03 December 2011 - 09:57 PM
IMHO with [command] in post #43 is better. Command can be various, for example [ls /fred.iso], [is64bit], [geometry (hd1)] or anything else.
#52
Posted 03 December 2011 - 10:08 PM
I am currently coding this and have just got it to work! The syntax is
title [IFEXIST filespec] your title goes here
dsd
sds
Is this addressed only at chenall? If not, you need to give us more to go on... for testing, an example will help.This version is latest chenall build 2011-12-02 with title [IFEXIST filespec] code addition and some small bugfixes to tolerate spaces etc.
Let me know if you try it!
Based on Sphinx114 comment, I also suggest an easy to edit menu without need of special editor or utility
--
Any thoughts on the background splash in new (maybe now old) menu?
#53
Posted 03 December 2011 - 10:30 PM
I have sent code to chenall and he may add it to a build.steve, your grldr works, but where internal grldr menu? I can't edit it by bootice or notepad.
IMHO with [command] in post #43 is better. Command can be various, for example [ls /fred.iso], [is64bit], [geometry (hd1)] or anything else.
Adding a general IF test inside the [ ] brackets may be possible but it is tricky to code and may have limitations.
P.S. If you used RMPrepUSB to install grub4dos MBR then it will probably not work with bootice. The version of grubinst that I used with RMPrepUSB is a special version which is patched to put a more compatible MBR or PBR on the disk (PBR works with MS-DOS unlike standard grubinst PBR!) - it is not compatible with bootice. Use a normal version of grubinst to install the grub4dos MBR and then copy over my new grldr file.
#54
Posted 03 December 2011 - 10:40 PM
Forget about "internal menues".
Have *any* VM with a floppy image or hard disk image (or both) ALREADY working with a "normal" grldr and your own menu.lst.
Boot and go to grub4dos command line.
Issue:
find --set-root /IO.SYS[ENTER]
grub4dos will reply with the actual drive where it found /IO.SYS, as an example (fd0) or (hd0,0).
Replace in the following <drive> wit the actual (fd0) or (hd0,0) or whatever you got.
Add to your EXISTING/TESTED menu.lst TWO COPIES of *any* entry that you know for sure worked on that VM/configuration.
Example say that in your menu.lst there is an entry for MS-DOS, like:
Copy it to:title find MS-DOS root
find --set-root /IO.SYS
chainloader /IO.SYS
andtitle [IFEXIST <drive>/ifexist.txt] MS-DOS IFEXIST 1
find --set-root /IO.SYS
chainloader /IO.SYS
title [ifexist <drive>/ifexist.txt] MS-DOS IFEXIST2
find --set-root /IO.SYS
chainloader /IO.SYS
Try booting and selecting these newly added entries (IF you can see them).
Now create an empty ifexist.txt file from DOS (on the SAME drive you got before and where you have IO.SYS:
type nul>ifexist.txtReplace the grldr with the one from steve6375
Try booting and selecting these newly added entries (IF you can see them).
Now delete the ifexist.txt file and boot again and try and selecting these newly added entries (IF you can see them).
What happens?
Wonko
P.S. @steve6375 The command is CaSe SeNsItIvE (as expected), maybe it should either be explicitly specified that it needs to be in CAPITAL LETTERS as grub4dos commands are usually lower case. (or decide to re-code it as lower case )
I kust did what I described above on an old floppy with the boot code invoking grldr coming from 0.4.4 and the IFEXIST worked EXACTLY as "advertised"
#55
Posted 03 December 2011 - 10:48 PM
title [IFEXIST /fred.iso ] Helloor
title [ IFEXIST (bd)/fred.iso ]Hello(note odd spacing in 2nd example!) - both should work as expected...
#56
Posted 03 December 2011 - 10:55 PM
Sure , but what if (like in my case) I boot the VM from floppy (fd0) which is "root" BUT the /IO.SYS is in on (hd0,0)?You don't need to specify a drive if the file is on the same drive as the boot drive. You can use:
title [IFEXIST /fred.iso ] Helloortitle [ IFEXIST (bd)/fred.iso ]Hello(note odd spacing in 2nd example!) - both should work as expected...
Or, is it possible to have something like:
[IFEXIST find /ifexist.txt]or even:
[IFEXIST find --set-root /ifexist.txt]
Wonko
#57
Posted 03 December 2011 - 11:36 PM
title [IFEXIST /pmagic-6.7.iso ] Parted Magic 6.7
#58
Posted 04 December 2011 - 10:10 AM
#59
Posted 04 December 2011 - 01:24 PM
please test.
add command iftitle
usage:
iftitle [command] titleinfontitlehelp
Must have at least one space after ']'
grldr
or download from
http://code.google.c...es/detail?id=53
iftitle [if exist (hd0,0)/test.img] (hd0,0)/test.img map --mem (hd0,0)/test.img (fd0) map --hook chainloader (fd0)+1 iftitle [find --set-root /test.img] /test.img find --set-root /test.img map --mem /test.img (fd0) map --hook chainloader (fd0)+1 iftitle [is64bit] for 64bit system .... ...
Edited by chenall, 04 December 2011 - 01:29 PM.
#60
Posted 04 December 2011 - 02:56 PM
the new grldr. I think this will be better
please test.
Perfect.
The iftitle seems like a better option.
If I get it right, the generic syntax is:
iftitle [<command>] Actual Title displayed\nOptional help line
If I may, it could be nice if the "if exist" could use also disks and partitions as argument.
I.e. this works:
iftitle [if exist (hd0,0)/io.sys] If you see me DOS is on (hd0)But it would be nice if we could have something like:
iftitle [if exist (hd1)] If you see me you have two hard disks
iftitle [if exist (hd1,0)] If you see me you have two hard disks and the second one is partitioned
Or is it already possible *somehow*?
Wonko
#61
Posted 04 December 2011 - 03:42 PM
#62
Posted 04 December 2011 - 03:44 PM
#63
Posted 04 December 2011 - 04:05 PM
iftitle [if exist (hd1)+1] If you see me you have two hard disks
@steve6375
iftitle [if exist (hd1,0)+1] If you see me you have two hard disks AND first partition on it exists
Wonko
#64
Posted 04 December 2011 - 04:11 PM
use this,do not have more space here after "nul".iftitle [ ls (hd0,0) ] dddd works but ls (hd0,0) > nul does not so cannot stop it displaying on screen.
iftitle [ls (hd0,0)/ > nul] xxxxxx
here is the new test,will stop display on screen.
grldrfortest
@Wonko the Sane
the generic syntax is:
iftitle [<command>] Actual Title displayednOptional help line
the command can use like menu-init command.
iftitle [checkrange 0x80 read 0x8290] you are boot from harddisk
clear
Edited by chenall, 04 December 2011 - 04:24 PM.
#65
Posted 04 December 2011 - 04:31 PM
title reload configure configfile /menu.lst iftitle [ ls /grldr ] here is grldr using ls E YES boot iftitle [ ls /grldrx ] here is grldrx using ls F - IF SPACE BEFORE ] like this then stops previous menu from appearing! boot
@chenall this exact menu gives a strange problem. The 2nd menu item and 3rd menu item are not displayed, but if you remove the space before the ] then it works as expected. There should be no file called grldx present when you test this.
#66
Posted 04 December 2011 - 04:37 PM
SET A=help
iftitle [if "%A%"=="help"] here is grldr using if variable A YES
boot
#67
Posted 04 December 2011 - 04:49 PM
Should this work - it doesn't...?
SET A=help
iftitle [if "%A%"=="help"] here is grldr using if variable A YES
boot
it doesn't.
#68
Posted 04 December 2011 - 06:03 PM
iftitle [find /test.txt ] test find test.txt echo found test.txt find --set-root /test.txt cat /test.txt pause root ()
#69
Posted 04 December 2011 - 06:35 PM
@Wonko This works
Wonko
#70
Posted 04 December 2011 - 07:09 PM
1) foreground/background colors not supported (with splashimage).
2) strange behavior if regular title entries in menu e.g. where not using iftitle entries.
Causes countdown timer to start from boot.ini (not menu.lst) and once started, any selection, even iftitle just restarts counter.title Boot hard drive
rootnoverify (hd0,0)
hiddenflag (hd0,0) && rootnoverify (hd0,1)
chainloader +1
title CommandLine
commandline
title Shutdown
halt
title Reboot
reboot
3) No PXE Stack warning at load screen (don't know if this is glitch or feature).
Thanks for the hard work
#71
Posted 05 December 2011 - 05:25 AM
1.the bug will fix next release.
2.???
3.because in embeded menu of grldr the first line is "pxe detect",this is for pxe boot..
#72
Posted 05 December 2011 - 05:30 AM
What info can I give you?2.???
What additional info do you need? Can you reproduce this behavior?
Here is the menu where issue occurs menu.rar 2.34KB 370 downloads
When you scroll through the list, everything seems OK until you reach one of the title entries without if before it e.g. 'title Boot hard drive'. Then, just by highlighting the entry (not selecting it), a countdown begins but it's the 5 sec. count from my boot.ini, not the 10 sec. count from the menu.lst. Once this occurs, scrolling to next and all subsequent entries just resets the 5 sec. countdown.
#73
Posted 05 December 2011 - 06:04 AM
What info can I give you?
What additional info do you need? Can you reproduce this behavior?
Here is the menu where issue occurs menu.rar 2.34KB 370 downloads
When you scroll through the list, everything seems OK until you reach one of the title entries without if before it e.g. 'title Boot hard drive'. Then, just by highlighting the entry (not selecting it), a countdown begins but it's the 5 sec. count from my boot.ini, not the 10 sec. count from the menu.lst. Once this occurs, scrolling to next and all subsequent entries just resets the 5 sec. countdown.
in grub4dos_readme.txt
****************************************************************************** *** Use a single key to select menu item *** ****************************************************************************** Some machines have a simplified keyboard. The keyborad might have only the number keys 0 .. 9 plus a few other keys. When the menu displayed, the user can strike a key for 8 times. When the menu handler detects the continuous single keypress, it will assume the user want to use this key to select a menu item and boot. This single key will act as the RIGHT-ARROW key for the user to select a menu item. And 5 seconds later after the user stops the keypress, the selected menu item will automatically boot. Any normal keys can be used as a single key for this purpose, except for a few functional keys like b, e, Enter, etc. Once another key is pressed, the feature of Single-Key-Selection will disappear immediately.
#74
Posted 05 December 2011 - 07:25 AM
The countdown doesn't appear, even after 20-30 'continuous single' keystrokes (down arrow) until you land on the first 'title' line. This works going either way around; down to 'title Boot hard drive' or up to 'title Reboot' i.e. only occurs when first non iftitle is reached. This behavior does not occur with old menu/grldr setup even with same menu list and number of keystrokes invoked. Also, it's not a normal countdown; if the timer is allowed to zero out, the selected entry is not launched but rather you are presented with boot.ini options again.
#75
Posted 05 December 2011 - 09:23 AM
How can I reproduce this behavior?
can you please make a iso or image for this?
I use qemu to test.
and you can try the new release(testonly) first
http://grub4dos-chen...b-2011-12-05.7z
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users