Re: Some comments on grub2 on gutsy
On Mon, 2007-06-11 at 20:13 +0200, Robert Millan wrote: > > On the GRUB menu apart from the regular entries there is also a > > chainload to GRUB 2. When I enter that I get a menu similar to GRUB > > menu but without any entries. Dunno why it is there, can anybody > > explain ? > > > > This is just a comment on how it looks on gutsy, nothing else, sorry > > if its out of line of context of the mailing list. > > If you mean to use the Debian package, please get the official one from > debian sid (rebuilding if necessary). This looks like an update-grub issue, > but I can't really tell since I don't know if the package has been modified > (or how). > Apparently if grub2 is installed on a debian system which has grub-legacy installed as the default bootloader, if you do and update grub, it automagically adds the chainload to grub2. -- Daniel Reurich Centurion Computer Technology (2005) Limited. Ph: 021 797 722 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: Some comments on grub2 on gutsy
Centurion Computer Technology (2005) Ltd wrote, on 2007-06-12 20:44: On Mon, 2007-06-11 at 20:13 +0200, Robert Millan wrote: On the GRUB menu apart from the regular entries there is also a chainload to GRUB 2. When I enter that I get a menu similar to GRUB menu but without any entries. Dunno why it is there, can anybody explain ? This is just a comment on how it looks on gutsy, nothing else, sorry if its out of line of context of the mailing list. If you mean to use the Debian package, please get the official one from debian sid (rebuilding if necessary). This looks like an update-grub issue, but I can't really tell since I don't know if the package has been modified (or how). Apparently if grub2 is installed on a debian system which has grub-legacy installed as the default bootloader, if you do and update grub, it automagically adds the chainload to grub2. Yes, this is the case, and one can run sh /usr/lib/grub-legacy/update-grub if one removes some of the kernels installed and want the changes reflected in the original menu. Arthur. ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Variables help inside a command help
If you check the man pages of some linux commands you will see that there is a place where it talks about ENVIRONMENT VARIABLES or something similar where it describes some variables than can modify the way a command works. As long as we can "register" the options help like this: {"label", 'l', 0, "search devices by a filesystem label", 0, 0}, {"set", 's', GRUB_ARG_OPTION_OPTIONAL, "set a variable to the first device found", "VAR", ARG_TYPE_STRING}, why shouldn't we do a similar thing for variables? I think a command should be able to register a: variable name - to set or not a value for this variable - to put a description for the variable so that when querying a command help this variable help also shows. And when querying "help variable" we see all the commands help about this variable. Let's see an example. cat defines this variable pager help: "1: Stops at each screen. 0: Do not stop." randomcolourcat defines this variable pager help: "1: Stops at each screen. 0: Do not stop." find defines this variable pager help: "1: Stops at each screen. 0: Do not stop." So if you type "help cat" apart from you see right now you see also: "1: Stops at each screen. 0: Do not stop." And if you type "help variable pager" you should see: cat: "1: Stops at each screen. 0: Do not stop." randomcolourcat: "1: Stops at each screen. 0: Do not stop." find: "1: Stops at each screen. 0: Do not stop." It's a stupid example but that's I mean. adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
how to add a new command
Once I write a new command like map.c or pause.c how am I supposed to add it to the standard grub? Should I write the makefiles manually?! or should I use some of the .sh files at the grub2 source code root folder? adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Pager does work from a menu?
This code from: normal/command.c /* Enable the pager if the environment pager is set to 1. */ if (interactive) pager = grub_env_get ("pager"); else pager = 0; if (pager && (! grub_strcmp (pager, "1"))) grub_set_more (1); Can anyone confirm my suspictions that even the pager variable set to 1 there is NO stop on the screen when running a grub option that has the cat command inside it with a big file? I am suspecting because in grub legacy there was the same stupid behaviour which I fixed of course. I also do not like the way that pager is run. I mean, putting a getkey inside the void grub_putcode (grub_uint32_t code) function from: kern/term.c it seems to me a bit childish although I do not know so far a better solution. adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Checking parametres that are not inside an option
If you take a look at search.c you can see that the -s parametrer is checked outside the command thanks to the ARG_TYPE_STRING constant. {"set", 's', GRUB_ARG_OPTION_OPTIONAL, "set a variable to the first device found", "VAR", ARG_TYPE_STRING} If I want not to check if an argument command that it IS NOT inside an option is something (a disk, i.e.) or not... how do I do it? I mean I want something like: map (hd0) (hd1) to be checked outside the command without using: map -disk1 (hd0) -disk2 (hd1) and the correspondent option definition at map.c how do I do it ? adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
How to call a command from another one
Hi, I want to implement the pause command so that it is the same thing as the echo command with all of its options and also that it stops. My first approach which I could not compile because I do not how to add a new command to grub2 is the following one: char key; if (argc!=0) grub_cmd_echo(state,argc,args); key = grub_getkey (); return 0; So my question is if it's an orthodox way of calling another command, if I should call it in another way or if I should not call it in any way. adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
grub_prefix
Is there any reason why grub_prefix is in boot.img rather than core.img ? This brings problems when the following conditions are met: - core.img is loaded directly without boot.img (via GRUB Legacy) - grub is not in /boot/grub (typicaly, when /boot is a separate partition) If grub_prefix is moved to core.img, then grub-mkimage could be modified to override prefix, supporting this setup. Is this a good way to fix it? -- Robert Millan My spam trap is [EMAIL PROTECTED] Note: this address is only intended for spam harvesters. Writing to it will get you added to my black list. ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: Some comments on grub2 on gutsy
On Tue, Jun 12, 2007 at 11:14:33PM +1200, Centurion Computer Technology (2005) Ltd wrote: > On Mon, 2007-06-11 at 20:13 +0200, Robert Millan wrote: > > > On the GRUB menu apart from the regular entries there is also a > > > chainload to GRUB 2. When I enter that I get a menu similar to GRUB > > > menu but without any entries. Dunno why it is there, can anybody > > > explain ? > > > > > > This is just a comment on how it looks on gutsy, nothing else, sorry > > > if its out of line of context of the mailing list. > > > > If you mean to use the Debian package, please get the official one from > > debian sid (rebuilding if necessary). This looks like an update-grub issue, > > but I can't really tell since I don't know if the package has been modified > > (or how). > > > Apparently if grub2 is installed on a debian system which has > grub-legacy installed as the default bootloader, if you do and update > grub, it automagically adds the chainload to grub2. Yes, and update-grub is also run for grub2, generating a (hopefuly) sane grub.cfg. This is the normal behaviour and works for most users of the Debian package. As for the Ubuntu forked version, I don't really know. Sometimes they add their own changes, but never tell me about them. Occasionaly they pick a version of the package that is broken and put that in release (IIRC this happened in edgy). No offence intended but, overall, this is why I ask him to test the official debian package first. -- Robert Millan My spam trap is [EMAIL PROTECTED] Note: this address is only intended for spam harvesters. Writing to it will get you added to my black list. ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: how to add a new command
On Tue, Jun 12, 2007 at 01:56:52PM +0200, adrian15 wrote: > Once I write a new command like map.c or pause.c how am I supposed to > add it to the standard grub? > Should I write the makefiles manually?! or should I use some of the > .sh > files at the grub2 source code root folder? Look at how other commands are hooked in. rgrep(1) is your friend :-) -- Robert Millan My spam trap is [EMAIL PROTECTED] Note: this address is only intended for spam harvesters. Writing to it will get you added to my black list. ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: How to call a command from another one
On Tue, Jun 12, 2007 at 01:57:11PM +0200, adrian15 wrote: > Hi, > > I want to implement the pause command so that it is the same thing as > the echo command with all of its options and also that it stops. > > My first approach which I could not compile because I do not how to > add > a new command to grub2 is the following one: > > > char key; > if (argc!=0) > grub_cmd_echo(state,argc,args); > key = grub_getkey (); > > return 0; > > > > So my question is if it's an orthodox way of calling another command, if > I should call it in another way or if I should not call it in any way. I don't know how to call other commands, but in this case, maybe grub_printf() will be good enough? -- Robert Millan My spam trap is [EMAIL PROTECTED] Note: this address is only intended for spam harvesters. Writing to it will get you added to my black list. ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: how to add a new command
On 12/06/07, adrian15 <[EMAIL PROTECTED]> wrote: Once I write a new command like map.c or pause.c how am I supposed to add it to the standard grub? Should I write the makefiles manually?! or should I use some of the .sh files at the grub2 source code root folder? I've been editing the .rmk files in conf/ which should cause the .mk files to get updated (at least that's my understanding of it, so far). Make sure the command is placed in the right Makefile... I had the problem where I was including the command in both grub-emu and grub/i386-pc and grub-emu didn't link due to undefined symbols (because those didn't exist in grub-emu). Cheers! -- Alex Roman <[EMAIL PROTECTED]> ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: Pager does work from a menu?
On Tue, Jun 12, 2007 at 01:57:42PM +0200, adrian15 wrote: > This code from: normal/command.c > > /* Enable the pager if the environment pager is set to 1. */ > if (interactive) > pager = grub_env_get ("pager"); > else > pager = 0; > if (pager && (! grub_strcmp (pager, "1"))) > grub_set_more (1); > > Can anyone confirm my suspictions that even the pager variable set to 1 > there is NO stop on the screen when running a grub option that has the > cat command inside it with a big file? Can you ellaborate? From the code you pasted, I just see that when "interactive" is set to 0, this has the same effect as pager being set to the "0" string. (btw, this pager = 0 assignment looks a bit confusing; I changed it to NULL altogether with the other two I spotted earlier) > I am suspecting because in grub legacy there was the same stupid > behaviour which I fixed of course. > > I also do not like the way that pager is run. I mean, putting a getkey > inside the > > void > grub_putcode (grub_uint32_t code) > > function from: kern/term.c > > it seems to me a bit childish although I do not know so far a better > solution. Please try to tear down that language! "stupid" and "childish" are in general not very appropiate words for a development list. I suppose you're referring to: grub_printf ("--MORE--"); grub_setcolorstate (GRUB_TERM_COLOR_STANDARD); key = grub_getkey (); What do you find wrong in this code? AFAICS, the message is printed and then we use grub_getkey to block untill a key is pressed. Sounds like normal pager-ish behaviour to me.. -- Robert Millan My spam trap is [EMAIL PROTECTED] Note: this address is only intended for spam harvesters. Writing to it will get you added to my black list. ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Vim rules for editing GRUB 2
Does anyone have some vim rules for editing on GRUB 2? I've noticed some files use both tabs and spaces for indentation, so I'm not sure which to use to please everyone (or most people?)... Also how many spaces should be used for indentation? Thanks in advance! -- Alex Roman <[EMAIL PROTECTED]> ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: how to add a new command
Robert Millan escribió: Look at how other commands are hooked in. rgrep(1) is your friend :-) I already did that and it seemed to me to complicated to add a simple command compared to grub legacy. That's why I asked, I'll try with Alex Roman suggestion. adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: How to call a command from another one
Robert Millan escribió: On Tue, Jun 12, 2007 at 01:57:11PM +0200, adrian15 wrote: Hi, I want to implement the pause command so that it is the same thing as the echo command with all of its options and also that it stops. I don't know how to call other commands, but in this case, maybe grub_printf() will be good enough? I agree with you but... I think it would be a good idea to have a pause message that has the same options as the echo command because the echo command has some nice options and because I like to reuse code. adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: Pager does work from a menu?
Robert Millan escribió: On Tue, Jun 12, 2007 at 01:57:42PM +0200, adrian15 wrote: This code from: normal/command.c /* Enable the pager if the environment pager is set to 1. */ if (interactive) pager = grub_env_get ("pager"); else pager = 0; if (pager && (! grub_strcmp (pager, "1"))) grub_set_more (1); Can anyone confirm my suspictions that even the pager variable set to 1 there is NO stop on the screen when running a grub option that has the cat command inside it with a big file? Can you ellaborate? From the code you pasted, I just see that when "interactive" is set to 0, this has the same effect as pager being set to the "0" string. That's what I mean. I think that interactive for grub2 means being in the grub2 shell (not in a menu). If you are in a menu (non interactive) then there is no stop between pages. But you know I am a bit lazy. I should at last try to do a grub.cfg and test it on my test floppy and see if I am right or not. I am suspecting because in grub legacy there was the same stupid behaviour which I fixed of course. I also do not like the way that pager is run. I mean, putting a getkey inside the void grub_putcode (grub_uint32_t code) function from: kern/term.c it seems to me a bit childish although I do not know so far a better solution. Please try to tear down that language! "stupid" and "childish" are in general not very appropiate words for a development list. Written down. Sorry, I'll try to use more formal synonims next time. I suppose you're referring to: grub_printf ("--MORE--"); grub_setcolorstate (GRUB_TERM_COLOR_STANDARD); key = grub_getkey (); What do you find wrong in this code? AFAICS, the message is printed and then we use grub_getkey to block untill a key is pressed. Sounds like normal pager-ish behaviour to me.. The code is ok. What I do not find ok is that the screen pause happens in a function which works it is to put a character on the screen. I do not quite understand why a function that only has to print a character on the screen has also to deal with the screen by screen stop problem. In my opinion this screen by screen stop problem should be solved in another part of the source code but so far I do not know where. adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
NTFS file system driver (update 2)
Changelog for this update: * Include Robert Millan's patch * Handle a rare situation where $BITMAP attribute is non-resident * Misc fixes -- Bean <[EMAIL PROTECTED]> 2007-06-12 Bean <[EMAIL PROTECTED]> * conf/common.rmk (pkgdata_MODULES): Add ntfs.mod. * conf/powerpc-ieee1275.rmk: Add fs/ntfs.c to grub-probe and grub-emu. * conf/i386-efi.rmk: Likewise. Also remove unused grub-setup definition. * conf/i386-pc.rmk: Add fs/ntfs.c to grub-probe, grub-emu and grub-setup. * fs/ntfs.c: New file. * kern/misc.c (grub_utf16_to_utf8): Fix unicode conversion bug. Index: conf/common.rmk === RCS file: /sources/grub/grub2/conf/common.rmk,v retrieving revision 1.14 diff -u -r1.14 common.rmk --- conf/common.rmk 20 May 2007 09:10:06 - 1.14 +++ conf/common.rmk 12 Jun 2007 16:03:34 - @@ -55,7 +55,7 @@ # Filing systems. pkgdata_MODULES += fshelp.mod fat.mod ufs.mod ext2.mod \ minix.mod hfs.mod jfs.mod iso9660.mod xfs.mod affs.mod \ - sfs.mod hfsplus.mod + sfs.mod hfsplus.mod ntfs.mod # For fshelp.mod. fshelp_mod_SOURCES = fs/fshelp.c @@ -117,6 +117,11 @@ hfsplus_mod_CFLAGS = $(COMMON_CFLAGS) hfsplus_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For ntfs.mod. +ntfs_mod_SOURCES = fs/ntfs.c +ntfs_mod_CFLAGS = $(COMMON_CFLAGS) +ntfs_mod_LDFLAGS = $(COMMON_LDFLAGS) + # Partition maps. pkgdata_MODULES += amiga.mod apple.mod pc.mod sun.mod acorn.mod gpt.mod Index: conf/i386-efi.rmk === RCS file: /sources/grub/grub2/conf/i386-efi.rmk,v retrieving revision 1.16 diff -u -r1.16 i386-efi.rmk --- conf/i386-efi.rmk 4 Jun 2007 19:48:53 - 1.16 +++ conf/i386-efi.rmk 12 Jun 2007 16:03:38 - @@ -15,14 +15,6 @@ grub_mkimage_SOURCES = util/i386/efi/grub-mkimage.c util/misc.c \ util/resolve.c -# For grub-setup. -#grub_setup_SOURCES = util/i386/pc/grub-setup.c util/i386/pc/biosdisk.c \ -# util/misc.c util/i386/pc/getroot.c kern/device.c kern/disk.c\ -# kern/err.c kern/misc.c fs/fat.c fs/ext2.c fs/xfs.c fs/affs.c\ -# fs/sfs.c kern/parser.c kern/partition.c partmap/pc.c\ -# fs/ufs.c fs/minix.c fs/hfs.c fs/jfs.c fs/hfsplus.c kern/file.c \ -# kern/fs.c kern/env.c fs/fshelp.c - # For grub-mkdevicemap. grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c @@ -32,7 +24,7 @@ kern/device.c kern/disk.c kern/err.c kern/misc.c fs/fat.c \ fs/ext2.c kern/parser.c kern/partition.c\ partmap/pc.c partmap/apple.c partmap/gpt.c \ - fs/ufs.c fs/minix.c fs/hfs.c fs/jfs.c kern/fs.c \ + fs/ufs.c fs/minix.c fs/hfs.c fs/jfs.c fs/ntfs.c kern/fs.c \ kern/env.c fs/fshelp.c fs/xfs.c fs/affs.c fs/sfs.c fs/hfsplus.c \ disk/lvm.c disk/raid.c @@ -48,6 +40,7 @@ disk/loopback.c \ fs/affs.c fs/ext2.c fs/fat.c fs/fshelp.c fs/hfs.c fs/iso9660.c \ fs/jfs.c fs/minix.c fs/sfs.c fs/ufs.c fs/xfs.c fs/hfsplus.c \ + fs/ntfs.c \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ kern/err.c \ Index: conf/i386-pc.rmk === RCS file: /sources/grub/grub2/conf/i386-pc.rmk,v retrieving revision 1.80 diff -u -r1.80 i386-pc.rmk --- conf/i386-pc.rmk11 Jun 2007 06:26:18 - 1.80 +++ conf/i386-pc.rmk12 Jun 2007 16:03:44 - @@ -67,7 +67,8 @@ kern/err.c kern/misc.c fs/fat.c fs/ext2.c fs/xfs.c fs/affs.c\ fs/sfs.c kern/parser.c kern/partition.c partmap/pc.c\ partmap/gpt.c fs/ufs.c fs/minix.c fs/hfs.c fs/jfs.c \ - fs/hfsplus.c kern/file.c kern/fs.c kern/env.c fs/fshelp.c \ + fs/hfsplus.c fs/ntfs.c kern/file.c kern/fs.c kern/env.c \ + fs/fshelp.c \ util/raid.c util/lvm.c # For grub-mkdevicemap. @@ -79,7 +80,7 @@ kern/device.c kern/disk.c kern/err.c kern/misc.c fs/fat.c \ fs/ext2.c kern/parser.c kern/partition.c\ partmap/pc.c partmap/apple.c partmap/gpt.c \ - fs/ufs.c fs/minix.c fs/hfs.c fs/jfs.c kern/fs.c \ + fs/ufs.c fs/minix.c fs/hfs.c fs/jfs.c fs/ntfs.c kern/fs.c \ kern/env.c fs/fshelp.c fs/xfs.c fs/affs.c fs/sfs.c fs/hfsplus.c \ disk/lvm.c disk/raid.c @@ -95,6 +96,7 @@ disk/loopback.c disk/raid.c disk/lvm.c \ fs/affs.c fs/ext2.c fs/fat.c fs/fshelp.c fs/hfs.c fs/iso9660.c \ fs/jfs.c
Re: How to call a command from another one
adrian15 <[EMAIL PROTECTED]> writes: > Robert Millan escribió: >> On Tue, Jun 12, 2007 at 01:57:11PM +0200, adrian15 wrote: >>> Hi, >>> >>> I want to implement the pause command so that it is the same thing as >>> the echo command with all of its options and also that it stops. >> I don't know how to call other commands, but in this case, maybe >> grub_printf() >> will be good enough? > > I agree with you but... > > I think it would be a good idea to have a pause message that has the > same options as the echo command because the echo command has some > nice options and because I like to reuse code. Make them share the same file. Call grub_cmd_echo with the same arguments which are used for pause. Before and after that you can do whatever you want. The disadvantage of this approach is that the set of arguments should be the same. -- Marco ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: Checking parametres that are not inside an option
adrian15 <[EMAIL PROTECTED]> writes: > If you take a look at search.c you can see that the -s parametrer is > checked outside the command thanks to the ARG_TYPE_STRING constant. > > {"set", 's', GRUB_ARG_OPTION_OPTIONAL, "set a variable to the first > device found", "VAR", ARG_TYPE_STRING} > > > If I want not to check if an argument command that it IS NOT inside an > option is something (a disk, i.e.) or not... how do I do it? > > I mean I want something like: > > map (hd0) (hd1) > > to be checked outside the command without using: > > map -disk1 (hd0) -disk2 (hd1) > and the correspondent option definition at map.c > > how do I do it ? That's not possible with the current code. You would have to add such check yourself, which should not be too hard. -- Marco ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: grub_prefix
On Tue, Jun 12, 2007 at 03:54:12PM +0200, Robert Millan wrote: > > Is there any reason why grub_prefix is in boot.img rather than core.img ? > > This brings problems when the following conditions are met: > > - core.img is loaded directly without boot.img (via GRUB Legacy) > - grub is not in /boot/grub (typicaly, when /boot is a separate partition) > > If grub_prefix is moved to core.img, then grub-mkimage could be modified to > override prefix, supporting this setup. > > Is this a good way to fix it? > I believe grub_prefix IS in core.img. It begins at 0x21C from the beginning of core.img. You may also want to modify the variable grub_install_dos_part at 0x214, for example, if booting from the first partition, set it to 0. The above variables are defined in kern/i386/pc/startup.S. -- Bean <[EMAIL PROTECTED]> ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel