Do you suggest me to run a script from linux that will make grub run windows after 10 times? I ment that the system will run windows (possibly XP) 10 times, and then run linux once. Altering grub from XP is not so simple, and exept relying on the XP to recover itself (IE switch to "boot from linux" itself) is not so wise - what if some defect will occur and my grub.exe will be deleted. I thought grub itself should do that. Can you run your script from grub?
--- Vladimir Serbinenko <[EMAIL PROTECTED]> wrote: > > > > >So what needs to be done is place an image back > once in a while. It > >should be possible to create a GRUB command for > that, I guess. :-) > > > > > Why a command? A better way, IMO, is using some > variables stored in file. > It could be presented as array SAVED_INTEGER of > integers and SAVED_FLAGS > of flags. > Then with command > initsaved <file> > where <file> must be created from OS (what about a > tool or shell script?) > then > > initsaved /grub2/savedvars > > if [[ SAVED_INTEGER[0] -ge 10]]; then > defwin = ""; > defrest="--default"; > else > defwin = "--default"; > defrest=""; > fi > > menu $defwin windows > { > ... # Load windows > ((SAVED_INTEGER[0]++)); > } > > menu $defrest restore windows > { > ... # Restore windows > SAVED_INTEGER[0]=0; > } > > menu reset counter > { > SAVED_INTEGER[0]=0; > } > > timeout=10; > > In this way first 10 times $defwin expands to > --default and "Load > windows" becomes default. Afterwards $defrest > expands to --default and > "restore windows" becomes default > > > > Vladimir 'phcoder' Serbinenko > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel > __________________________________ Start your day with Yahoo! - Make it your home page! http://www.yahoo.com/r/hs _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel