Re: [PATCH] Enable pager by default
I agree. One of the Super Grub2 Disk options consists on showing from its menu the COPYRIGHT page... the pager variable is set to true so that the output is paged when the cat command is run. This usecase might not work anymore if something else than prompting a message on the interactive screen was used. El mié., 30 oct. 2019 a las 13:12, Daniel Kiper () escribió: > On Fri, Oct 25, 2019 at 11:02:04AM +0200, Javier Martinez Canillas wrote: > > Hello Daniel, > > > > On 10/24/19 4:50 PM, Daniel Kiper wrote: > > > > [snip] > > > > >> > > >> From 7c4da6295ebd3a034d1f7e32099eab33efa465d4 Mon Sep 17 00:00:00 2001 > > >> From: Javier Martinez Canillas > > >> Date: Tue, 22 Oct 2019 15:35:12 +0200 > > >> Subject: [PATCH v2] Add a GRUB_COMMAND_FLAG_PAGINATED to request > paginated > > >> output for commands > > >> > > >> When user enters into the GRUB shell and tries to use help command, > lot of > > >> information is scrolled out of screen and the user doesn't have > chance to > > >> read it. Also, there isn't any information about 'set pager=1' at the > end > > >> of the help output, to tell the user how scrolling could be enabled. > > >> > > >> Since the out for some commands may not fit into a screen, add a new > flag > > >> GRUB_COMMAND_FLAG_PAGINATED that can be used when registering > commands that > > >> can be used to request the pager to be enabled while executing the > handler. > > >> > > >> Signed-off-by: Javier Martinez Canillas > > > > > > In general I like the idea but I think patch requires some polishing... > > > > > > Hmmm... Still thinking about "-p" flag which allows user to choose > > > between pager on/off. Or something which I proposed in the email to > > > Michael... > > > > I'm OK with any of the other two approaches too. But it seems that > Vladimir > > is worried about the added complexity for these. > > > > I honestly think that the approach in this patch is the least bad option > since > > it doesn't require a special configuration or the user to do anything, > just > > execute the command printing a lot of stuff and get paginated output by > default. > > > > Can't think why users would want to execute commands that print a lot of > messages > > without the output being paginated, or why they would want to execute a > command > > like help in in batch mode. It's only useful in interactive mode. > > > > And also the patch is quite trivial, it already uses all the existing > code for > > the pager option. > > > > But I'll wait for the discussion to settle and a solution to be agreed > upon, > > before posting a new patch for this. > > After some thinking it seems to me that Valdimir is right and we should > not over-complicate the solution. Let's print the message on interactive > screen how to enable paging. > > Daniel > > ___ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel > -- Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. https://www.supergrubdisk.org/donate/ ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: grub-install deleting long UEFI entries bug ?
2017-04-23 6:36 GMT+02:00 Andrei Borzenkov : > 23.04.2017 03:54, adrian15 пишет: > > grub-install seems to be deleting long UEFI entries > > > > (*) What the bug is > > > > * Add an UEFI entry with this label (Remove the single quotes): > > '(Rescapp added) \EFI\ubuntu\MokManager.efi' > > > > Example: > > > > efibootmgr -c \ > > -d /dev/sda \ > > -p 2 \ > > -L '(Rescapp added) \EFI\ubuntu\MokManager.efi' \ > > -l '\EFI\ubuntu\MokManager.efi' > > > > * Run grub-install /dev/sda or maybe just grub-install > > > > I expect the newly added uefi entry to be there. > > What I find is that the entry has been lost or deleted! > > > > What is value of GRUB_DISTRIBUTOR in /etc/default/grub? > After evaluating the bash expression the GRUB_DISTRIBUTOR value is Ubuntu. > ... > > > > Maybe grub-install uses efibootmgr as an auxiliar tool and the problem > > is in Ubuntu's efibootmgr? > > > > Yes. > Yeah, I see it right in the source code. More to come. > > > It would be nice if someone could point us on where does grub-install > > handles the uefi boot entries so that we can take a deeper look into it. > > > > grub-core/osdep/unix/platform.c > Thank you. I've taken a look at: grub-core/osdep/unix/platform.c file (on 2.02-rc2 tag) and I have some comments about it. There's the function: grub_install_remove_efi_entries_by_distributor which has some interesting snippets: 1) First of all this matches all the line: if (!strcasestr (line, efi_distributor)) continue; That means that if you add a custom label which matches the efi distributor then it gets removed. I think that's what happened to me. I would prefer something more precise that would check the complete efi file path agains e.g. EFI/vendor/ . 2) Then there's: if (grub_memcmp (line, "Boot", sizeof ("Boot") - 1) != 0 || line[sizeof ("Boot") - 1] < '0' || line[sizeof ("Boot") - 1] > '9') continue; which might be wrong because of 0 and 9 and maybe not because of the array indexes. Let's go into details about that. 2.1) Boot First entry BootA000 Second entry Shouldn't the look for A to F hexadecimal letters too? And... 2.2) line[sizeof ("Boot") - 1] < '0' Am I doing it right? sizeof ("Boot") = 4 So it's line [4 - 1] and therefore: line [3] . And as a consequence... line[3] = 't'. line[3] is always going to be 't' when the first OR condition is not true...so no need of the third or the fourth condition then. Or is there something about indexes or character size (unicode being 16bit?) that I am missing? Thank you. adrian15 -- Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/ . ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: Adding spoken lenguages to the menu
Hi Pol, I think we already do this in Super Grub2 Disk ( https://github.com/supergrub/supergrub ) . I did not implement the translation system myself so I don't know how exactly you would apply to a bare GNU/Grub system. Our translation documentation is here: https://github.com/supergrub/supergrub/blob/master/TRANSLATION . As far as I understand GNU/GRUB supports the use of PO files and by using $"some text" you make that text translatable depending on the $lang variable value. Probably the GNU/GRUB documentation has a chapter on menues translation too. 2017-05-23 11:18 GMT+02:00 Pol Destroyerrocket : > Hi everyone who's taking the time to read this. > > First I should say that this is just an idea and I haven't read the whole > code yet > > The idea is to add a option to grub.cfg to select a language (default > English USA) to change the text displayed on the default menu. > > I will start working actively on it when summer arrives, because I'm a > student without any time for projects during the year. > > Any kind of help, documentation or advice will be appreciated! > > Thank you for your time! > > Pol M. > > ___ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel > > -- Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/index.php?pid=10 ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Are you going to Debconf9?
Hi, I am adrian15 from Super Grub Disk. I have been quite for a while. I was asking myself if some of you are going to Debconf. I won't mind meeting some of you and learning about grub2 (I am a bit outdated) and maybe try to code some lines. Or just meet someone like _x86, marco_g or nyu face to face. http://debconf9.debconf.org/index.xhtml.en Debian Conference is the annual Debian developers meeting, an event filled with coding parties, discussions and workshops - all of them highly technical in nature. It will be held in Cáceres, Extremadura, Spain, from July 23 to 30, 2009. Thank you. adrian15 -- Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/index.php?pid=10 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Osprober lua script problems when setting root
Hi Grub-devel, I have built a custom grub2-based cdrom (I am using grub2 from debian unstable) that uses osdetect.lua which I have fetched from phcoder git two or three days ago. I have an Ubuntu 9.04 installation in my Virtualbox test machine. After running the AUTO MAGIC BOOT which actually sources $prefix/osdetect.lua I get an entry called: Linux 2.6.28-11-generic. Its content is: set root = hd0,1 linux /boot/vmlinuz-2.6.28-11-generic root=UUID= ro initrd /boot/initrd.img-2.6.28-11-generic When booting the entry I get: error: not an assignment. The first bug is that error message seems not meaningful to me. The second bug is that it seems that the set root line should not have spaces around the equals sign. So it should have produced: set root=hd0,1. Or is it maybe that Debian's grub2 is not updated enough to allow spaces around the equals sign and svn version it is? Thank you for you attention. phcoder, whenever the bug is fixed can you please send me a download url for the updated file? Thank you. adrian15 -- Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/index.php?pid=10 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
GRUB 2.04 RC01 does not build on Debian Jessie
ecipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory '/home/rescatuxs/gnu/sgd/git/supergrub2/sg2d_grub_builds/hybrid_i386_pc' Makefile:3332: recipe for target 'all' failed make: *** [all] Error 2 Any help or tip is appreciated. I suspect I might be missing some dependencies that were not needed for 2.02 but now are needed for 2.04 but I'm not sure. So, thank you again. Note: I know I should probably need to use a more recent distribution suchs as Debian 9 (stretch) but I think it's better to report the hipothetic bug here, you know, just in case. Note: A quick search finds Jesús Diéguez as the one who added those msr modules on February/March 2019 which their build seems to fail. I CC him too. adrian15 -- Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/ ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: GRUB 2.04 RC01 does not build on Debian Jessie
El 12/04/19 a las 07:52, Christian Hesse escribió: > adrian15 on Fri, 2019/04/12 07:37: >> --target="i386-pe" \ > > No idea if it make a difference, but I guess this should read "i386-pc"? I am building like this since 2017 and I had no problem. Is i386-pe no longer an accepted target when using 2.04rc1 ? Here you can find the different target and platforms that I try to build: https://github.com/supergrub/supergrub/blob/grub2.04/grub-build-003-build-all#L83 . I only reported here the "i386-pe target + pc platform" combination just to keep things simple. Everyone of my other target/platform combinations fail at the 'make' stage too. adrian15 -- Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/ ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: [PATCH] x86/msr: Fix build with older GCC versions
I confirm this patch applied over 2.04rc1 tag enables me to build grub on my system. Thank you very much! adrian15 El 12/04/19 a las 13:59, Daniel Kiper escribió: > Some older GCC versions produce following error when x86 MSR modules are > build: > > In file included from commands/i386/rdmsr.c:29:0: > ../include/grub/i386/rdmsr.h:27:29: error: no previous prototype for > ‘grub_msr_read’ [-Werror=missing-prototypes] >extern inline grub_uint64_t grub_msr_read (grub_uint32_t msr_id) >^ > cc1: all warnings being treated as errors > > This is due to incorrect use of extern keyword. So, replace it with > static keyword. > > Additionally, fix incorrect coding style. > > Reported-by: Eric Snowberg > Reported-by: adrian15 > Signed-off-by: Daniel Kiper > --- > include/grub/i386/rdmsr.h | 3 ++- > include/grub/i386/wrmsr.h | 3 ++- > 2 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/include/grub/i386/rdmsr.h b/include/grub/i386/rdmsr.h > index bddb7..c0a0c717a 100644 > --- a/include/grub/i386/rdmsr.h > +++ b/include/grub/i386/rdmsr.h > @@ -24,7 +24,8 @@ > * Accessing a reserved or unimplemented MSR address results in a GP#. > */ > > -extern inline grub_uint64_t grub_msr_read (grub_uint32_t msr_id) > +static inline grub_uint64_t > +grub_msr_read (grub_uint32_t msr_id) > { >grub_uint32_t low, high; > > diff --git a/include/grub/i386/wrmsr.h b/include/grub/i386/wrmsr.h > index e14d7807f..dea60aed1 100644 > --- a/include/grub/i386/wrmsr.h > +++ b/include/grub/i386/wrmsr.h > @@ -24,7 +24,8 @@ > * Accessing a reserved or unimplemented MSR address results in a GP#. > */ > > -extern inline void grub_msr_write(grub_uint32_t msr_id, grub_uint64_t > msr_value) > +static inline void > +grub_msr_write(grub_uint32_t msr_id, grub_uint64_t msr_value) > { >grub_uint32_t low = msr_value, high = msr_value >> 32; > > -- Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/ ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Super Grub2 Disk 2.04rc1s1 beta 4 released (GRUB 2.04~rc1)
Super Grub2 Disk 2.04rc1s1 beta 4 has been released. Downloads and more details here: https://www.supergrubdisk.org/2019/04/14/super-grub2-disk-2-04rc1s1-beta-4-released/ Super Grub2 Disk is a live cd that helps you to boot into most any Operating System (OS) even if you cannot boot into it by normal means. At its core it uses GRUB 2. This last version features GRUB 2.04~rc1 which was recently announced. You can test GRUB in many ways, installing it on your system might be one of them. Probably it's the best one because you hardly use GRUB as if it was a live cd/usb. But sometimes this is not possible. By the means of using Super Grub2 Disk, which it's a live cd/usb you can easily test it and see if there are some problems on this version without even touching your hard disk. You probably want to use the options: * Boot manually... * grub.cfg (GRUB2 configuration files) to examine how GRUB 2.04~rc1 deals with your current grub.cfg file compared to your current installed GRUB. Disclaimer: Although we use upstream GRUB sources at 2.04~rc1 git tag as a base for building Super Grub2 Disk this should not be considered as an official GRUB release. If you ever report a bug based on your Super Grub2 Disk 2.04rc1s1 beta 4 experience please mention it just in case the problem might arise because of different ./configure switches used. Note: In order to put Super Grub2 Disk image into a usb device use 'dd' command. Be aware that your usb device will be completely erased. If you write the destination device where to write Super Grub2 Disk device you might end up losing your internal hard disk content. adrian15 -- Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/ ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: [PATCH] x86/msr: Fix build with older GCC versions
El 18/04/19 a las 12:29, Daniel Kiper escribió: > On Sat, Apr 13, 2019 at 12:54:53PM +0200, adrian15 wrote: >> I confirm this patch applied over 2.04rc1 tag enables me to build grub >> on my system. >> Thank you very much! > > May I add "Tested-by: adrian15 " to this patch? > > Daniel No problem. adrian15 -- Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/ ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: 2.02~beta3 release
Super Grub2 Disk 2.02s4 which it's based on: 2.02~beta3 is available. More information at: http://www.supergrubdisk.org/2016/03/11/super-grub2-disk-2-02s4-released/ . Well, I usually don't make those announcements here but I wanted to let you know that I have told my users: " If Super Grub2 Disk 2.02s3 let you boot into your OS but Super Grub2 Disk 2.02s4 does not let you boot into your OS please report it so that we can report it back to the grub team which tries to release a Grub 2.02 stable release. " So, yes, hopefully someone will give us some feedback on regressions and we can pass it to you so that you can make a better rc1. Thank you for hard work on Grub. adrian15 El 28/02/16 a las 15:21, Vladimir 'φ-coder/phcoder' Serbinenko escribió: Hello, all. I've just released 2.02~beta3. The goal of this release is to chase bugs so that we can move to 2.02 release. So from now on if you think that your patch should be included in 2.02 rather than in 2.03, please add [2.02] to the beginning of your email subject The tarball is available at http://alpha.gnu.org/gnu/grub/grub-2.02~beta3.tar.xz and signature at http://alpha.gnu.org/gnu/grub/grub-2.02~beta3.tar.xz.sig Signed with following fingerprint: E53D 497F 3FA4 2AD8 C9B4 D1E8 35A9 3B74 E82E 4209 It's also available as a signed tag grub-2.02-beta3 in official git repository. If you don't have xz support alternatively you may consider files http://alpha.gnu.org/gnu/grub/grub-2.02~beta3.tar.xz and signature at http://alpha.gnu.org/gnu/grub/grub-2.02~beta3.tar.xz.sig ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel -- Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/ ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: Grub module to return partuuid of a device such as (hd0, gpt1) at boot time
What's your use case? adrian15 El 12/08/16 a las 16:11, Steve Kenton escribió: As far as I can tell there is no search module that can be used to get the partuuid at boot time given a grub root device such as (hd0,gtp1). I think is would be a useful addition since the resulting partuuid could be passed directly to the kernel as root=PARTUUID=xxx and it does not seem like it should be hard to do. Am I missing something obvious? And, before I jump end the deep end of the pool and try to write it, is anyone else working on something similar? Not subscribed, please cc me on reply. Steve Kenton ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel -- Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/ ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Super Grub2 Disk 2.02s7 released (GRUB 2.02~rc1)
Super Grub2 Disk 2.02s7 has been released. Downloads and more details here: http://www.supergrubdisk.org/2017/02/17/super-grub2-disk-2-02s7-released/ Super Grub2 Disk is a live cd that helps you to boot into most any Operating System (OS) even if you cannot boot into it by normal means. At its core it uses GRUB 2. This last version features GRUB 2.02~rc1 which was recently announced. You can test GRUB in many ways, installing it on your system might be one of them. Probably it's the best one because you hardly use GRUB as if it was a live cd/usb. But sometimes this is not possible. By the means of using Super Grub2 Disk, which it's a live cd/usb you can easily test it and see if there are some problems on this version without even touching your hard disk. You probably want to use the options: * Boot manually... * grub.cfg (GRUB2 configuration files) to examine how GRUB 2.02~rc1 deals with your current grub.cfg file compared to your current installed GRUB. Disclaimer: Although we use upstream GRUB sources at 2.02~rc1 git tag as a base for building Super Grub2 Disk this should not be considered as an official GRUB release. If you ever report a bug based on your Super Grub2 Disk 2.02s7 experience please mention it just in case the problem might arise because of different ./configure switches used. Note: In order to put Super Grub2 Disk image into a usb device use 'dd' command. Be aware that your usb device will be completely erased. adrian15 -- Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/ ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Super Grub2 Disk 2.02s8 released (GRUB 2.02~rc2)
Super Grub2 Disk 2.02s8 has been released. Downloads and more details here: http://www.supergrubdisk.org/2017/03/18/super-grub2-disk-2-02s8-released/ Super Grub2 Disk is a live cd that helps you to boot into most any Operating System (OS) even if you cannot boot into it by normal means. At its core it uses GRUB 2. This last version features GRUB 2.02~rc2 which was recently announced. You can test GRUB in many ways, installing it on your system might be one of them. Probably it's the best one because you hardly use GRUB as if it was a live cd/usb. But sometimes this is not possible. By the means of using Super Grub2 Disk, which it's a live cd/usb you can easily test it and see if there are some problems on this version without even touching your hard disk. You probably want to use the options: * Boot manually... * grub.cfg (GRUB2 configuration files) to examine how GRUB 2.02~rc2 deals with your current grub.cfg file compared to your current installed GRUB. Disclaimer: Although we use upstream GRUB sources at 2.02~rc2 git tag as a base for building Super Grub2 Disk this should not be considered as an official GRUB release. If you ever report a bug based on your Super Grub2 Disk 2.02s8 experience please mention it just in case the problem might arise because of different ./configure switches used. Note: In order to put Super Grub2 Disk image into a usb device use 'dd' command. Be aware that your usb device will be completely erased. If you write the destination device where to write Super Grub2 Disk device you might end up losing your internal hard disk content. adrian15 -- Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/ ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
grub-install deleting long UEFI entries bug ?
grub-install seems to be deleting long UEFI entries (*) What the bug is * Add an UEFI entry with this label (Remove the single quotes): '(Rescapp added) \EFI\ubuntu\MokManager.efi' Example: efibootmgr -c \ -d /dev/sda \ -p 2 \ -L '(Rescapp added) \EFI\ubuntu\MokManager.efi' \ -l '\EFI\ubuntu\MokManager.efi' * Run grub-install /dev/sda or maybe just grub-install I expect the newly added uefi entry to be there. What I find is that the entry has been lost or deleted! (*) Exact version where is found 2.02~beta2-36ubuntu3.2 (Ubuntu 16.04's grub) (*) Can be this replicated? Can anyone replicate this is in upstream's git head? Maybe is it a well known bug which was already fixed? (*) Video of the bug This is a video of the bug: https://www.youtube.com/watch?v=rhAg_ojj3VQ . At 18 minutes 9 seconds I start to add an uefi entry. At 21 minutes 3 seconds I run an option so that update-grub and grub-install is run. At 22 minutes 31 seconds I find the bug for the first time. At 27 minutes 37 seconds I start to the debug the problem manually to discard any of the Rescapp scripts being involved in the problem. (*) What might be the problem. I initially thought that the problem was because of '(', ')' or '\' characters. After additional tests there seems to be a problem with the length of the UEFI boot entry. Maybe grub-install uses efibootmgr as an auxiliar tool and the problem is in Ubuntu's efibootmgr? It would be nice if someone could point us on where does grub-install handles the uefi boot entries so that we can take a deeper look into it. Thank you! adrian15 -- Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/ ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: grub-install deleting long UEFI entries bug ?
El 23/04/17 a las 10:45, Andrei Borzenkov escribió: > 23.04.2017 11:21, adrian15 adrian15 пишет: >> 2017-04-23 6:36 GMT+02:00 Andrei Borzenkov : >> >>> 23.04.2017 03:54, adrian15 пишет: >>>> grub-install seems to be deleting long UEFI entries >>>> >>>> (*) What the bug is >>>> >>>> * Add an UEFI entry with this label (Remove the single quotes): >>>> '(Rescapp added) \EFI\ubuntu\MokManager.efi' >>>> >>>> Example: >>>> >>>> efibootmgr -c \ >>>> -d /dev/sda \ >>>> -p 2 \ >>>> -L '(Rescapp added) \EFI\ubuntu\MokManager.efi' \ >>>> -l '\EFI\ubuntu\MokManager.efi' >>>> >>>> * Run grub-install /dev/sda or maybe just grub-install >>>> >>>> I expect the newly added uefi entry to be there. >>>> What I find is that the entry has been lost or deleted! >>>> >>> >>> What is value of GRUB_DISTRIBUTOR in /etc/default/grub? >>> >> >> After evaluating the bash expression the GRUB_DISTRIBUTOR value is Ubuntu. >> > > Yes, historically grub did case insensitive substring search. This > probably is wrong, we should just take everything after boot number > literally. I see, like removing what you are about to add I guess. The problem that I see is that efibootmgr output (even if --verbose switch) it's not machine readable. I guess efibootmgr itself would need an specific switch in order to produce output suitable for scripts. Another option is include some of the efibootmgr functionality/libraries into grub itself. Maybe there's something on upstream's efibootmgr. Not a clue about that. I have only checked Debian stretch's efibootmgr. I might ask about it in debian-efi mailing list. > ... >> 1) First of all this matches all the line: >> >> if (!strcasestr (line, efi_distributor)) >> continue; >> >> That means that if you add a custom label which matches the efi distributor >> then it gets removed. I think that's what happened to me. I would prefer >> something more precise that would check the complete efi file path agains >> e.g. EFI/vendor/ . >> >> 2) Then there's: >> >> if (grub_memcmp (line, "Boot", sizeof ("Boot") - 1) != 0 >> || line[sizeof ("Boot") - 1] < '0' >> || line[sizeof ("Boot") - 1] > '9') >> continue; >> >> which might be wrong because of 0 and 9 and maybe not because of the array >> indexes. >> >> Let's go into details about that. >> >> 2.1) Boot First entry >> BootA000 Second entry >> >> Shouldn't the look for A to F hexadecimal letters too? >> > > Yes. Patches are welcome for both problems. Second one is actually bug > fix so should be independent. > >> And... Well, I think just checking 0 to 9 in the first character is a good compromise. Some outputs have: BootCurrent . So 'BootC' can be found in e.g. 'BootC001' too. So that would be adding another problem because 'BootCurrent' would be considered as a right entry. Just checking the first character leaves place for 16^3 = (2^4)^3 = 2 ^ (4 * 3 ) = 2 ^12 = 4096 . That should be enough for most of the usecases. >> >> 2.2) line[sizeof ("Boot") - 1] < '0' >> >> Am I doing it right? >> >> sizeof ("Boot") = 4 >> > > It is 5. Ok, yes, sizeof is not length so... it shows what it takes to save it. So... 4 bytes and the 'finish string byte' so that makes 5. Well, I have finally decided not to put the full path to efi file and only the basename of it. That will avoid custom entries being suddenly removed by grub-install. Thank you for your feedback. adrian15 -- Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/ ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: Should the website still say that GRUB 2 is currently under development?
Felix Zielcke escribió: I think the currently under development part can be now removed. Or would it be better to wait for the 1.97 release? (which hopefully comes before December) That would be nice because Debian freezes at December. adrian15 -- Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/index.php?pid=10 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
os-detect lua space fix
Here you a have a patch that fixes the error that osdetect.lua script had with spaces around the equals sign. Now it does not complain when assigning the variable. adrian15 -- Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/index.php?pid=10 diff -urN original/osdetect.lua equals_space_fixed/osdetect.lua --- original/osdetect.lua 2009-08-15 18:59:48.0 +0200 +++ equals_space_fixed/osdetect.lua 2009-08-22 17:33:52.0 +0200 @@ -156,7 +156,7 @@ local initrd title = "Linux " .. kernels[i] - source = "set root = " .. device .. + source = "set root=" .. device .. "\nlinux /boot/" .. kernelnames[i] .. " root=UUID=" .. " ro" ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
os-detect lua uuid fix
Here you a have a patch that fixes the error that osdetect.lua script had uuid not being set. Now the linux kernel does not complain about not finding root device. The only problem that this patch has is that is made with grub shell in mind instead of lua. I suppose that we can do the same thing but getting the uuid values from lua script itself. If I am able to do so I will also send a patch for it. adrian15 -- Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/index.php?pid=10 diff -urN original/osdetect.lua uuid_fix/osdetect.lua --- original/osdetect.lua 2009-08-22 17:42:43.0 +0200 +++ uuid_fix/osdetect.lua 2009-08-22 18:23:12.0 +0200 @@ -156,9 +156,11 @@ local initrd title = "Linux " .. kernels[i] + uuid_setup = "search --set=sgd_linux_kernel -f /boot/" .. kernelnames[i] .. "\n" + uuid_set = "probe -u ($sgd_linux_kernel) --set=sgd_root_uuid" .. "\n" source = "set root=" .. device .. "\nlinux /boot/" .. kernelnames[i] .. - " root=UUID=" .. " ro" + " root=UUID=" .. "$sgd_root_uuid" .. " ro" if grub.file_exist (root .. "boot/initrd-" .. kernels[i] .. ".img") then @@ -171,7 +173,7 @@ initrd = "" end - grub.add_menu (source .. initrd, title) + grub.add_menu (uuid_setup .. uuid_set .. source .. initrd, title) grub.add_menu (source .. " single" .. initrd, title .. " (single-user mode)") end ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Grub2 LUA API?
Hi, I have been playing a bit with osdetect.lua file. I have seen many calls to grub.addmenu, grub.file_exist and so on. I am now interested in making a table where to store all the uuid associated to each one of the kernel that I find (I mean kernel's filesystem's uuid). As long as I suppose there is no documentation written about it I would like to know where should I look into the grub2 source code in order to know which grub.WHATEVER calls I can make, what are their arguments/options , their outputs and so on. So where should I look into in the source code? Thank you very much! adrian15 -- Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/index.php?pid=10 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: Some ideas about new features of grub
Robert Millan escribió: On Thu, Jul 02, 2009 at 04:48:56PM +0800, Bean wrote: LUA integration. LUA is quite powerful, it's more suitable to do complicated task than sh script. For example, we can use it to detect os at runtime, implement simple commands, or draw the graphic menu. I feel similarly about LUA as I do about writable filesystems. In fact I'm considering a configure flag so that it's only enabled only when user requests it. But I know both Marco and Pavel feel strongly about this. Please can you comment? I am against a configure flag (if configure is the one from configure, make, make install) but a configure flag (as something specified in grub.cfg) is ok. adrian15 -- Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/index.php?pid=10 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: Grub2 LUA API?
Bean escribió: Hi, You can use grub.enum_device, which pass the uuid to the callback function, then you can store the device->uuid mapping in a table. Thank you. I will check your advice. If you're looking for source code, check out script/lua/grub_lib.c I would have prefered documentation but source code is ok. I will, of course, report back with more improvements/doubts on this subject. Thank you again. adrian15 -- Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/index.php?pid=10 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Trying to build Rescue image for three different target and platform
Basically what I want to do is to use grub-mkrescue to generate a grub2 rescue disk with some custom files (The Super Grub2 Disk stuff). However I want to build different files depending on target+platform combination. My four combinations are: * (Hybrid) x86_64+efi and i386+pc * i386 - pc * x86_64 - efi * i386 - efi More about this setup. 1) As an initial setup I work with a Debian Unstable Sid Chroot amd64 as described in: http://www.supergrubdisk.org/wiki/Super_Grub2_Disk_Sid_Chroot#Introduction 2) I use Debian's Grub2 source code so that I do not have to deal manually with dependencies. That's explained here: http://www.supergrubdisk.org/wiki/Super_Grub2_Disk_Sid_Chroot_Grub2_Build_And_Installation (just before Hybrid build section). 3) x86_64_efi build is working. Basically what I run in the src dir is: sudo rm -rf /usr/local/share/grub sudo rm -rf /usr/local/lib/grub make clean make distclean bash linguas.sh bash autogen.sh ./configure --target=i386 --with-platform=efi && make && sudo make uninstall make clean make distclean ./configure --target=i386 --with-platform=pc && make && sudo make uninstall make clean make distclean ./configure --target=x86_64 --with-platform=efi && make && sudo make uninstall make clean make distclean make clean make distclean bash linguas.sh bash autogen.sh ./configure --target=x86_64 --with-platform=efi && make && sudo make install And what I do for generating the file image is: grub-mkrescue --output=super_grub2_disk_x86_64_efi_2.00s1-beta6.iso $(mktemp -d) 4) i386_pc build is not working. Basically what I run in the src dir is: sudo rm -rf /usr/local/share/grub sudo rm -rf /usr/local/lib/grub make clean make distclean bash linguas.sh bash autogen.sh ./configure --target=i386 --with-platform=efi && make && sudo make uninstall make clean make distclean ./configure --target=i386 --with-platform=pc && make && sudo make uninstall make clean make distclean ./configure --target=x86_64 --with-platform=efi && make && sudo make uninstall make clean make distclean make clean make distclean bash linguas.sh bash autogen.sh ./configure --target=i386 --with-platform=pc && make && sudo make install And what I do for generating the file image is: grub-mkrescue --output=super_grub2_disk_i386_pc_2.00s1-beta6.iso $(mktemp -d) 5) I attach the current helper scripts that I use. supergrub-mkrescue : This is a very simple wrapper around: grub-mkrescue. You do not need to take care about it. supergrub-meta-mkrescue : This is what I have explained above. This script assumes that you have setup your grub2 source code in: /home/adrian/gnu/sgd/debian_grub2/grub2-2.00 and that supergrub-mkrescue script is found in the same folder as supergrub-meta-mkrescue. Currently supergrub-meta-mkrescue has been modified so that it ends (Check the return 0 ; line) after building: * x86_64_efi and * i386 - pc . 6) When I build i386 - pc I get this error: xorriso : FAILURE : Given path does not exist on disk: -boot_image system_area='/usr/local/lib/grub/i386-pc/boot_hybrid.img' Why is it failing to create /usr/local/lib/grub/i386-pc/boot_hybrid.img file? 7) Is it useful that I insist on building an i386+efi release? Any machine system that uses it? Some old Mac-something hardware perhaps? 8) What's the best way to build and install an hybrid system that includes both: x86_64_efi and i386 - pc stuff? Current code is: ./configure --target=i386 --with-platform=pc && make && sudo make install make clean make distclean ./configure --target=x86_64 --with-platform=efi && make && sudo make install 9) A) What's the best way to remove grub configuration files installed on the system so that I can start from scratch so that already built target+platform grub binaries or configurations are ignored? B) That's what I try to do in clean_every_build function in supergrub-meta-mkrescue script but I do not think its an efficient way of doing it. C) You know I would like to remove the rm -rf /usr/local/share/grub and rm -rf /usr/local/lib/grub lines (too weird) and just use the: ./configure ; make ; make uninstall part. D) Which I do not know if could be re-written as: ./configure ; make uninstall (Notice that there is not a make step). Does removing the make default target call (make) breaks "make uninstall" functionality? 10) As a summary I basically want to build and install from upstream source code and then make one rescue disk for each one of these four combinations. (And make theses rescue diks in a row) * (Hybrid) x86_64+efi and i386+pc * i386 - pc * x86_64 - efi * i386 - efi So... any help on this build au
How one is supposed to write kind-of-library cfg files?
( Using 2.02~beta2-7 from Debian Unstable ) I have tried to write some cfg files to kind of organise them as libraries but it does not work as expected. It seems as the sourced cfg files are being interpreted. Here below you will find the overall idea in an theoric example. Attached you will find an actual code (although you are missing some pieces from Super Grub2 Disk). When selecting the "Boot manually..." submenu (not when trying to run one of their options) I am getting these errors: BEGIN error: syntax error error: Incorrect command. error: syntax error error: Incorrect command. error: syntax error error: syntax error error: Incorrect command. error: syntax error error: can't find command `searchindevice' FATAL: int13_cdrom: function 42. Can't use 64bits lba END searchindevice is a function which it's sourced in main.cfg so it should be detected ok. But anyways... the run_option function is being interpreted while I do not want it !!! I have also tried to replace source command by extract_entries_source. I get different output but the same problem, the sourced file is being interpreted (I mean it is being run). Thank you. ### caller.cfg function process_option { set option_cfg="${1}" source ${option_cfg} menuentry ${option_title} { source ${option_cfg} run_option } } process_option ${prefix}/called.cfg process_option ${prefix}/option2.cfg ### called.cfg set option_title="My title" function run_option { function aux_lib { } function aux_lib2 { } aux_lib aux_lib2 do_interesting_stuff } adrian15 -- Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/ # Super Grub Disk Main Configuration file # Copyright (C) 2009 Adrian Gibanel Lopez. # # Super Grub Disk is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Super Grub Disk is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GRUB. If not, see <http://www.gnu.org/licenses/>. # Configure gfxterm, but allow it to be disabled by holding shift during boot. # gfxterm is required to display non-ASCII translations. loadfont "$prefix/unifont.pf2" if keystatus --shift; then disable_gfxterm=true # export disable_gfxterm is needed so that the setting will persist even after # a "configfile /boot/grub/main.cfg" (which is what language_select.cfg does after # you select a new language) export disable_gfxterm # The following strings are intentionally not made translateable. echo "It has been detected that the shift key was held down. Because of this SG2D" echo "will use VGA text mode rather than gfxterm. This will cause display problems" echo "when using some non-English translations." echo echo "Press escape to continue to the main menu" sleep --interruptible fi if [ "$disable_gfxterm" != true ]; then insmod all_video gfxmode=640x480 if terminal_output --append gfxterm; \ then \ terminal_output --remove console; \ fi fi # Export the variables so that they persist when loading a new menu. export menu_color_normal export menu_color_highlight export menu_color_background export bwcolor function set_sgd_colors { if [ "$bwcolor" = "yes" ]; then menu_color_normal=white/black menu_color_highlight=black/white menu_color_background=black/white else menu_color_normal=white/brown menu_color_highlight=white/blue menu_color_background=yellow/cyan fi } set_sgd_colors # Set secondary_locale_dir to the directory containing SG2D specific mo files. # This makes grub aware of translations for SG2D specific strings. secondary_locale_dir="${prefix}/sgd_locale/" insmod part_acorn insmod part_amiga insmod part_apple insmod part_bsd insmod part_gpt insmod part_msdos insmod part_sun insmod part_sunpc # Prepare environment variables, needed mostly for update_paths() export prefix_device prefix_path prefix_uuid regexp -s prefix_device '^\((.*)\)/' "$prefix" regexp -s prefix_path '^\(.*\)/(.*)$' "$prefix" probe --fs-uuid --set=prefix_uuid "$prefix_device" # Define a function for updating paths when device names change. # search.mod is required for update-paths, and must be loaded before device # names change because $prefix will be invalid. insmod searc
Re: How one is supposed to write kind-of-library cfg files?
El 16/03/14 04:49, adrian15 escribió: ( Using 2.02~beta2-7 from Debian Unstable ) I have tried to write some cfg files to kind of organise them as libraries but it does not work as expected. It seems as the sourced cfg files are being interpreted. I have managed to write a minimal working example. It would seem that the problem is having a function inside another function. Is it perhaps not officially supported? The problem happens when one selects: "This is a submenu..." . error: syntax error error: Incorrect command. error: syntax error ... can't find command thisisanunknowncommand ... error: syntax error Thank you. ### caller.cfg function process_option { set option_cfg="$1" source "${option_cfg}" menuentry "${option_title}" { source "${option_cfg}" run_option } } menuentry $"Languages..." { configfile "${prefix}/language_select.cfg" } submenu $"This is a submenu..." { process_option "${prefix}/called.cfg" } menuentry $"Everything" { configfile "${prefix}/everything.cfg" } called.cfg set option_title=$"The called option" function run_option { function freebsd_ufs_variants { set device=$1 set fstype=$2 set uuid=$3 menuentry "${finaloption_tab_str}FreeBSD ($fstype $device) (Default boot loader)" $device $uuid { set root=$2 kfreebsd /boot/loader } } thisisanunknowncommand menuentry "menuinsideoption" { source "${prefix}/topbootmenu.cfg" set root="(hd0,0)" chainloader +1 } } adrian15 -- Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/ ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
How to deal with fatal device seeks?
I use a for loop for detecting Operating systems like this one: for dev in (*); do echo $dev done but it hangs !!! So some clues: * Using 2.02~beta2-7 from Debian Unstable. * The disk is an hybrid one (x86_64_efi + i386_pc). * The error only happens when using Virtualbox in a non-EFI setup. So some questions: * Is it a bug that a non seekable device like (cd,apple4) or (cd,gpt1) is available in non-EFI mode? * Is it perhaps a Virtualbox bug? * I cannot catch these fatal error as if they were exceptions inside a try-catch. Or can I? I will probably improve my searchindevices functions so that it also filters these (cdsomething) devices as a workaround. Thank you. These are the minimal tests: --- Using Qemu as EFI gives no problem: echo (*) (fd0) ... (cd) ... (cd,apple2),... (cd,gpt2) ls (cd,apple4)/ error: unknown filesystem. ls (cd,gpt1)/ error: unknown filesystem. --- Using Virtualbox as BIOS (Ex. 1) (Problem): echo (*) (fd0) ... (cd) ... (cd,apple2),... (cd,gpt2) ls (cd,apple4)/ FATAL: int13_cdrom: function 42. Can't use 64bits lba --- Using Virtualbox as BIOS (Ex. 2) (No problem): echo (*) (fd0) ... (cd) ... (cd,apple2),... (cd,gpt2) ls (cd,gpt4)/ error: unknown filesystem. --- Using Virtualbox as BIOS (Ex. 3) (Problem): echo (*) (fd0) ... (cd) ... (cd,apple2),... (cd,gpt2) ls (cd,gpt1)/ FATAL: int13_cdrom: function 42. Can't use 64bits lba adrian15 -- Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/ ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: Trying to build Rescue image for three different target and platform
El 13/03/14 06:51, Andrey Borzenkov escribió: В Sun, 09 Mar 2014 17:14:04 +0100 adrian15 пишет: Basically what I want to do is to use grub-mkrescue to generate a grub2 rescue disk with some custom files (The Super Grub2 Disk stuff). However I want to build different files depending on target+platform combination. My four combinations are: * (Hybrid) x86_64+efi and i386+pc * i386 - pc * x86_64 - efi * i386 - efi 3) x86_64_efi build is working. Basically what I run in the src dir is: sudo rm -rf /usr/local/share/grub sudo rm -rf /usr/local/lib/grub make clean make distclean bash linguas.sh bash autogen.sh ./configure --target=i386 --with-platform=efi && make && sudo make uninstall make clean make distclean ./configure --target=i386 --with-platform=pc && make && sudo make uninstall make clean make distclean ./configure --target=x86_64 --with-platform=efi && make && sudo make uninstall make clean make distclean make clean make distclean bash linguas.sh bash autogen.sh ./configure --target=x86_64 --with-platform=efi && make && sudo make install To be honest, I do not understand what you are trying to do here. The same thing as in: https://forja.cenatic.es/plugins/scmgit/cgi-bin/gitweb.cgi?p=supergrub2/supergrub2.git;a=blob_plain;f=supergrub-meta-mkrescue;hb=22683e2b5fa0d65141c1be1a7487914b1d43f4dd (which uses Debian packages) but using source code. 6) When I build i386 - pc I get this error: xorriso : FAILURE : Given path does not exist on disk: -boot_image system_area='/usr/local/lib/grub/i386-pc/boot_hybrid.img' Why is it failing to create /usr/local/lib/grub/i386-pc/boot_hybrid.img file? This file should be built and installed on 386-pc platform. If not either there is a bug, or you are doing something wrong. It is hard to tell, you are doing so many steps ... I see. 8) What's the best way to build and install an hybrid system that includes both: x86_64_efi and i386 - pc stuff? Just built and install grub for each platform you want to use; grub-mkrescue will automatically include every platform it finds. Any advice for the special where I want to build x86_64_efi + x86_pc hybrid disk? Current code is: ./configure --target=i386 --with-platform=pc && make && sudo make install make clean make distclean ./configure --target=x86_64 --with-platform=efi && make && sudo make install It is better to explicitly force host platform with --host= to make sure user space is always the same. Otherwise it should be fine. Ok, I'll check that. I prefer to build every platform in separate directory, there were issues with incomplete cleanup. If you hit one, please report. Well, as I don't want to have a separate directory for each build my question would be: What is it the official commands for doing a safe cleanup? 9) A) What's the best way to remove grub configuration files installed on the system so that I can start from scratch so that already built target+platform grub binaries or configurations are ignored? There are no configuration files after "make install" (if we do not count /etc/grub.d as configuration). I meant the ones that someone makes grub-mkrescue to look for the /usr/local/lib/grub/i386-pc/boot_hybrid.img files which I suppose are not found in source code but in the system (Gnu/Linux filesystem I mean). Hope it's a bit more clear what I mean. Thank you. adrian15 -- Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/ ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: Trying to build Rescue image for three different target and platform
El 16/03/14 08:04, Andrey Borzenkov escribió: В Sun, 16 Mar 2014 06:56:46 +0100 adrian15 пишет: To be honest, I do not understand what you are trying to do here. The same thing as in: https://forja.cenatic.es/plugins/scmgit/cgi-bin/gitweb.cgi?p=supergrub2/supergrub2.git;a=blob_plain;f=supergrub-meta-mkrescue;hb=22683e2b5fa0d65141c1be1a7487914b1d43f4dd (which uses Debian packages) but using source code. Why would you want to build separate ISO for every platform? The whole point of using grub-mkrescue is to create single ISO image that supports and can be booted on all platforms. Because I want to support all the GRUB2 platforms but not having a single 60 MB (random size guess) download for that. The other reason is because a: i386-efi + x86_64_efi + x86_pc hybrid did not boot in a x86_64_efi only system. Right now I'm not sure if I built it from source or if I made the iso with Debian binaries but, what it's sure is that it did not boot at all. It just hung. So I want a separate ISO for every platform. 8) What's the best way to build and install an hybrid system that includes both: x86_64_efi and i386 - pc stuff? Just built and install grub for each platform you want to use; grub-mkrescue will automatically include every platform it finds. Any advice for the special where I want to build x86_64_efi + x86_pc hybrid disk? Not really. Just build and install both platforms using the same prefix and run grub-mkrescue that is build to use the same prefix. Ok. As mentioned, when building you should distinguish between host (grub utils) and target (boot time). It is perfectly valid to build utils for x86 and target for ARM as long as you have suitable cross tools. In your case all builds should use the same host (which defaults to target which may be wrong even for x86 case - consider 32 vs. 64 bit). See INSTALL how to set various options for each environment. Ok,I'll check that. I prefer to build every platform in separate directory, there were issues with incomplete cleanup. If you hit one, please report. Well, as I don't want to have a separate directory for each build my question would be: What is it the official commands for doing a safe cleanup? I always used "make distclean". But IIRC there are some files that are not removed. Not sure to which extent they affect subsequent builds. I had problems when re-building on Windows but they should be fixed now. From my point of view, "make distclean" is official and if it does not work it is a bug that has to be fixed. make distclean . Written down. 9) A) What's the best way to remove grub configuration files installed on the system so that I can start from scratch so that already built target+platform grub binaries or configurations are ignored? There are no configuration files after "make install" (if we do not count /etc/grub.d as configuration). I meant the ones that someone makes grub-mkrescue to look for the /usr/local/lib/grub/i386-pc/boot_hybrid.img files which I suppose are not found in source code but in the system (Gnu/Linux filesystem I mean). There are no special configuration files. If grub-mkrescue is called without --directory option, it will enumerate all platforms found under /usr/local/lib/grub (in your example). Just place additional platform directory there and grub-mkrescue will pick it up. So I just need to purge the /usr/local/lib/grub contents so that I can start again without the fear of grub-mkrescue picking up an earlier built platform (That's what I tried to achieve before with make uninstall by the way). That's exactly what I wanted to know. Thank you very much! I do not know when I will be able to try all of this but now it's much more clear everything and I'll be able to report GRUB build errors (or runtime) more easily for my special use case. adrian15 -- Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/ ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: How to deal with fatal device seeks?
I'm getting the same problem ( FATAL: int13_cdrom: function 42. Can't use 64bits lba ) with hd0, hd1, hd2, hd3, and worse: * hd2,msdos5 ls (hd2,msdos5)/ Is this a bug? adrian15 El 16/03/14 06:26, adrian15 escribió: I use a for loop for detecting Operating systems like this one: for dev in (*); do echo $dev done but it hangs !!! So some clues: * Using 2.02~beta2-7 from Debian Unstable. * The disk is an hybrid one (x86_64_efi + i386_pc). * The error only happens when using Virtualbox in a non-EFI setup. So some questions: * Is it a bug that a non seekable device like (cd,apple4) or (cd,gpt1) is available in non-EFI mode? * Is it perhaps a Virtualbox bug? * I cannot catch these fatal error as if they were exceptions inside a try-catch. Or can I? I will probably improve my searchindevices functions so that it also filters these (cdsomething) devices as a workaround. Thank you. These are the minimal tests: --- Using Qemu as EFI gives no problem: echo (*) (fd0) ... (cd) ... (cd,apple2),... (cd,gpt2) ls (cd,apple4)/ error: unknown filesystem. ls (cd,gpt1)/ error: unknown filesystem. --- Using Virtualbox as BIOS (Ex. 1) (Problem): echo (*) (fd0) ... (cd) ... (cd,apple2),... (cd,gpt2) ls (cd,apple4)/ FATAL: int13_cdrom: function 42. Can't use 64bits lba --- Using Virtualbox as BIOS (Ex. 2) (No problem): echo (*) (fd0) ... (cd) ... (cd,apple2),... (cd,gpt2) ls (cd,gpt4)/ error: unknown filesystem. --- Using Virtualbox as BIOS (Ex. 3) (Problem): echo (*) (fd0) ... (cd) ... (cd,apple2),... (cd,gpt2) ls (cd,gpt1)/ FATAL: int13_cdrom: function 42. Can't use 64bits lba adrian15 -- Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/ ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: How to deal with fatal device seeks?
El 16/03/14 17:43, Andrey Borzenkov escribió: В Sun, 16 Mar 2014 17:05:53 +0100 adrian15 пишет: I'm getting the same problem ( FATAL: int13_cdrom: function 42. Can't use 64bits lba ) This message does not exist in grub sources, so it likely comes from firmware. 64 bit LBA would mean size over 2TB. So the first question - what size of disks do you have? SATA 0: 200 GB (Windows 7) SATA 1: 1 GB (Rescatux USB. E.g. Grub mkrescue disk) SATA 2: 20 GB (SteamOS E.g. Debian) with hd0, hd1, hd2, hd3, and worse: * hd2,msdos5 ls (hd2,msdos5)/ Is this a bug? Hard to tell. Do you actually have working filesystem(s) on these partitions? The message itself simply means that grub attempts to read very high offset. I wonder if it can be somehow byte order related. From GRUB point of view: * (hd2,msdos1) is Gnu/Linux root filesystem * (hd2,msdos2) No such partition * (hd2,msdos3) No such partition * (hd2,msdos4) No such partition * (hd2,msdos5) FATAL: int13_cdrom: function 42. Can't use 64bits lba From GNU/Linux point of view: Disk /dev/sdc: 21.5 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders, total 41943040 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00068a9f Device Boot Start End Blocks Id System /dev/sdc1 *20484013670320067328 83 Linux /dev/sdc24013875041940991 9011215 Extended /dev/sdc54013875241940991 901120 82 Linux swap / Solaris If I try: ls (hd2,msdos5)/ from a 2.00-15 system mkrescue image (Super Grub2 Disk 2.00s1-beta6) I get: error: unknown filesystem. So, it's ok, because it is not a fatal error. It would seem that somewhere between 2.00-15 and 2.02~beta2-7 (Debian version) the bug arises. Or maybe the error was before because grub did actually to arise a FATAL error and it didn't. Thank you for any indication on how to make more tests. adrian15 -- Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/ ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: How to deal with fatal device seeks?
El 16/03/14 18:16, adrian15 escribió: If I try: ls (hd2,msdos5)/ from a 2.00-15 system mkrescue image (Super Grub2 Disk 2.00s1-beta6) I get: error: unknown filesystem. So, it's ok, because it is not a fatal error. It would seem that somewhere between 2.00-15 and 2.02~beta2-7 (Debian version) the bug arises. Or maybe the error was before because grub did actually to arise a FATAL error and it didn't. 2.00-22 does not have the error. So it narrows the search between 2.00-22 and 2.02~beta2-7. adrian15 Thank you for any indication on how to make more tests. adrian15 -- Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/ ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: How to deal with fatal device seeks?
I have digged the git log for partition related commits just in case you might think that they have something to do with my problem (From 2.00 release to current head on master branch). I have tried to filter them. So I have removed the ones related with strange table partitions or emulation code. Here there are the commits: http://git.savannah.gnu.org/cgit/grub.git/commit/?id=e88f0420b90c2565637962754cc26fa8a4ed9256 http://git.savannah.gnu.org/cgit/grub.git/commit/?id=4bad23a15fc129218f611f51dcb268c246b207f1 http://git.savannah.gnu.org/cgit/grub.git/commit/?id=25fc51a87929262c1cc132bc29cc083ce98f0e0e http://git.savannah.gnu.org/cgit/grub.git/commit/?id=df6da5a52dc2ec424203c0f8001903435b177fa8 http://git.savannah.gnu.org/cgit/grub.git/commit/?id=b7b78edb1ca05f30dd07ebed4bcb3d5a39aa5358 http://git.savannah.gnu.org/cgit/grub.git/commit/?id=258f43b7d7bf4b03799b6cd3004b5372e082d01b http://git.savannah.gnu.org/cgit/grub.git/commit/?id=86d08fdb18b0142c1ce1b95db1aae989502956c5 Just hope that you, that deal with GRUB source code every day, can find what might be the faulty commit so that I can test that the special commit source code and reproduce it (or not to reproduce it). Thank you for any idea! adrian15 El 16/03/14 19:05, adrian15 escribió: El 16/03/14 18:16, adrian15 escribió: If I try: ls (hd2,msdos5)/ from a 2.00-15 system mkrescue image (Super Grub2 Disk 2.00s1-beta6) I get: error: unknown filesystem. So, it's ok, because it is not a fatal error. It would seem that somewhere between 2.00-15 and 2.02~beta2-7 (Debian version) the bug arises. Or maybe the error was before because grub did actually to arise a FATAL error and it didn't. 2.00-22 does not have the error. So it narrows the search between 2.00-22 and 2.02~beta2-7. adrian15 Thank you for any indication on how to make more tests. adrian15 -- Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/ ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: Chainloadig from grub2 to isolinux
El 07/08/14 16:52, Beeblebrox escribió: If you use loopback.cfg as intended it will all work. loopback.cfg contains the linux/initrd entries relevant to each distro's iso (or at least that's what the wiki page shows). That's exactly the problem - each iso has different settings for linux/initrd entries, and if you get them wrong, it really does not matter what file the entry was placed in. Also as confirmed by ben, it's apparently not going to work on a number of Debian-based iso's. Usually the solution is to include casper in the CD to make this happen AFAIK. As part of us releasing Rescatux as an isolinux based distro (before it was a super grub2 disk (or grub2) based distro) I am supposed to work with Debian Live people so that any Debian live cd has a default working loopback.cfg file. Not sure if I'm going to do it in the next Rescatux stable release but definitively is in my TODO list. Probably the most intelligent workaround for this problem is doing an isolinux.cfg, pxelinux.cfg or syslinux.cfg parser for grub2 in a similar way to the menu.lst parser. As pxelinux.cfg has now some submenues I'm not sure that would work too good. I, personally, don't think it's worth the effort to implement such a parser but if you want it so much please implement it. I, personally, going to advocate for the loopback.cfg method. adrian15 -- Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/ ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: Does grub-mkrescue support UEFI hybrid USB/DVD images?
El 22/01/15 a las 22:25, Kris Moore escribió: Hey all, We are trying to create hybrid USB/DVD images, and they work just fine on BIOS. However it doesn't seem to work when creating UEFI. We are using the following: # grub-mkrescue -d "/usr/local/lib/grub/x86_64-efi" -o -- -volid "OURLABEL" This image does boot UEFI via DVD, but when copied to a USB stick with dd it fails to boot with the following: Hi, I'm going to describe what I use for making a USB/CDROM EFI/x86 hybrid image for building SG2D (An improved Grub2 Disk). But my question (after reading other replies to this question) is why Grub2 should be patched for what he wants ? Is it a non standard EFI boot maybe? Thank you. Debian way == Install these two packages: grub-efi-amd64-bin grub-pc-bin Run: grub-mkrescue -o ./my_grub.iso Upstream way (I actually want to ask here if this recipe could be improved, but that would be probably need another email thread) Make sure no Debian grub package is found in chroot apt-get remove '.grub.' Grub2 (efi+pc)) Build and installation # Make sure we are testing the right revision mkdir grub_upstream cd grub_upstream git clone git://git.savannah.gnu.org/grub.git . git checkout COMMIT-TO-TEST # Remove any non git related file - BEGIN git reset --hard git clean -f -d git clean -f -x -d # Remove any non git related file - END # Build efi based grub and install it - BEGIN ./autogen.sh && ./configure --enable-grub-mkfont --with-platform=efi && make # Dont forget to delete any rest of previous installation - BEGIN sudo rm -rf /usr/local/etc/grub.d/ /usr/local/bin/grub-* /usr/local/share/grub/ # Dont forget to delete any rest of previous installation - END sudo make install # Build efi based grub and install it - END make clean # Prepare for next build ./configure --enable-grub-mkfont --with-platform=pc && make # Prepare for a i386 build sudo make install # Install i386 build TL;DR: Make sure no Grub Debian package is installed, install grub twice, one configured for x86, the other one configured for efi. Then grub-mkrescue detects both modules and adds to the final image which by default is ISO/USB hybrid. By the way. I was told how to build the image without doing make install (thus not having to remove any Debian Grub package) so I might re-adapt this recipe in the future. grub-mkrescue -o ./my_grub.iso adrian15 -- Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/ ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: Does grub-mkrescue support UEFI hybrid USB/DVD images?
El 24/01/15 a las 01:12, adrian15 escribió: El 22/01/15 a las 22:25, Kris Moore escribió: Hey all, We are trying to create hybrid USB/DVD images, and they work just fine on BIOS. However it doesn't seem to work when creating UEFI. We are using the following: # grub-mkrescue -d "/usr/local/lib/grub/x86_64-efi" -o -- -volid "OURLABEL" This image does boot UEFI via DVD, but when copied to a USB stick with dd it fails to boot with the following: Hi, I'm going to describe what I use for making a USB/CDROM EFI/x86 hybrid image for building SG2D (An improved Grub2 Disk). But my question (after reading other replies to this question) is why Grub2 should be patched for what he wants ? Is it a non standard EFI boot maybe? Thank you. Debian way == I just wanted to say that recipe does not produce an image that can be booted from UEFI hard disk. I had assumed all this time that it worked (I only tested the EFI CDROM boot) because if you read it here: https://www.gnu.org/software/grub/manual/html_node/Making-a-GRUB-bootable-CD_002dROM.html#Making-a-GRUB-bootable-CD_002dROM grub-mkrescue -o grub.iso iso This produces a file named grub.iso, which then can be burned into a CD (or a DVD), or written to a USB mass storage device. So, if I'm not mistaken that's not true when you boot from EFI (Well, I know that you are fixing it on this thread). adrian15 -- Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/ ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: Does grub-mkrescue support UEFI hybrid USB/DVD images?
El 25/01/15 a las 09:03, adrian15 escribió: El 24/01/15 a las 01:12, adrian15 escribió: El 22/01/15 a las 22:25, Kris Moore escribió: Hey all, We are trying to create hybrid USB/DVD images, and they work just fine on BIOS. However it doesn't seem to work when creating UEFI. We are using the following: # grub-mkrescue -d "/usr/local/lib/grub/x86_64-efi" -o -- -volid "OURLABEL" This image does boot UEFI via DVD, but when copied to a USB stick with dd it fails to boot with the following: Hi, I'm going to describe what I use for making a USB/CDROM EFI/x86 hybrid image for building SG2D (An improved Grub2 Disk). But my question (after reading other replies to this question) is why Grub2 should be patched for what he wants ? Is it a non standard EFI boot maybe? Thank you. Debian way == I just wanted to say that recipe does not produce an image that can be booted from UEFI hard disk. I had assumed all this time that it worked (I only tested the EFI CDROM boot) because if you read it here: https://www.gnu.org/software/grub/manual/html_node/Making-a-GRUB-bootable-CD_002dROM.html#Making-a-GRUB-bootable-CD_002dROM grub-mkrescue -o grub.iso iso This produces a file named grub.iso, which then can be burned into a CD (or a DVD), or written to a USB mass storage device. So, if I'm not mistaken that's not true when you boot from EFI (Well, I know that you are fixing it on this thread). adrian15 (Hopefully I'm not creating new threads when replying) I had only tested 2.00 version (Where the hard disk is not detected as an EFI boot at all). My 2.02 version from GIT (old commit bac5d1a64ab4191058a8fd4c05f6b3b339e249e7) gives the same result as the OP: error: disk `' not found. Entering rescue mode... grub rescue> So I'll try the suggested patch and reply to the email which announced it so that you can get more than one feedback from it. I guess that in grub 2.02 you made sure that image produced from grub-mkrescue would boot from UEFI hard disk but somehow somewhere a regression was introduced. In any case anyone is wondering I have made my UEFI boot tests thanks to: kvm -bios /usr/share/ovmf/OVMF.fd -boot c -hda super_grub2_disk_hybrid_2.02s1-beta1.iso adrian15 -- Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/ ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: Does grub-mkrescue support UEFI hybrid USB/DVD images?
El 25/01/15 a las 09:15, adrian15 escribió: El 25/01/15 a las 09:03, adrian15 escribió: El 24/01/15 a las 01:12, adrian15 escribió: El 22/01/15 a las 22:25, Kris Moore escribió: (Hopefully I'm not creating new threads when replying) I had only tested 2.00 version (Where the hard disk is not detected as an EFI boot at all). My 2.02 version from GIT (old commit bac5d1a64ab4191058a8fd4c05f6b3b339e249e7) gives the same result as the OP: error: disk `' not found. Entering rescue mode... grub rescue> So I'll try the suggested patch and reply to the email which announced it so that you can get more than one feedback from it. I guess that in grub 2.02 you made sure that image produced from grub-mkrescue would boot from UEFI hard disk but somehow somewhere a regression was introduced. In any case anyone is wondering I have made my UEFI boot tests thanks to: kvm -bios /usr/share/ovmf/OVMF.fd -boot c -hda super_grub2_disk_hybrid_2.02s1-beta1.iso adrian15 I confirm you that using current GIT head as a base (commit dd430afbf874f6212742c079d72b4b9e959e0542) my steps for making two-dimensional hybrid disk (Both CDROM / Harddisk and BIOS / EFI) seem to work ok. So I confirm that you have succesfully fixed the problem about grub rescue not finding grub device which the OP reported. I paste here my steps here again (I know the steps can be improved). How do I build and prepare my system Make sure no Debian grub package is found in chroot apt-get remove '.grub.' Grub2 (efi+pc)) Build and installation # Make sure we are testing the right revision mkdir grub_upstream cd grub_upstream git clone git://git.savannah.gnu.org/grub.git . git checkout COMMIT-TO-TEST # Remove any non git related file - BEGIN git reset --hard git clean -f -d git clean -f -x -d # Remove any non git related file - END # Build efi based grub and install it - BEGIN ./autogen.sh && ./configure --enable-grub-mkfont --with-platform=efi && make # Dont forget to delete any rest of previous installation - BEGIN sudo rm -rf /usr/local/etc/grub.d/ /usr/local/bin/grub-* /usr/local/share/grub/ # Dont forget to delete any rest of previous installation - END sudo make install # Build efi based grub and install it - END make clean # Prepare for next build ./configure --enable-grub-mkfont --with-platform=pc && make # Prepare for a i386 build sudo make install # Install i386 build Super Grub2 Disk build -- sudo grub-mkrescue --output=/tmp/test1.iso -- Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/ ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
gsd grub2 option proposal
Well, Here I am subscribed to devel grub mailing list. I supposed that my former email (grub2 grub super disk proposals, remember?) you have decided that is good idea to implement commands called: grub_title echo and some other ideas. I wanted to talk about user interaction. User Interaction is very important on Grub Super Disk. I need the user to choose some options some variables. Just below a option line there has to be a command which is neither title neither option. Once every option is read (till next title or till end of file) the options are presented (in a menu): 2nd hard disk 3rd hard disk 4th hard disk and once one of them is selected the lines which are below the selected option and the next one are executed. In my example when we choose 2nd hard disk the line: swapped_hd_value=(hd1) is executed. So I am going to write you a hipotetical grub2 menu.lst grub2.cfg you call it now? with the option idea and you tell me if you have already developed something similar or if you're planning to do it. # Default values of swapped disks and devices to boot swapped_hd=2nd hard disk swapped_hd_value=(hd1) boot_dev=(fd0) # grub_title is the variable for showing the grub title (in place of free mem and grub version) grub_title=Swap 1st hard disk with $swapped_hd and boot $boot_dev title Select Swapped hard disk option 2nd hard disk swapped_hd=2nd hard disk swapped_hd_value=(hd1) option 3rd hard disk swapped_hd=3rd hard disk swapped_hd_value=(hd2) option 4th hard disk swapped_hd_value=(hd3) swapped_hd=4th hard disk title Select device to boot option 1st partition 2nd hard disk boot_dev=(hd1,0) option floppy boot_dev=(fd0) option cdrom boot_dev=(cd) title Go! map (hd0) $swap_hd_value map $swap_hd_value (hd0) rootnoverify $boot_dev boot That's all folks! adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: gsd grub2 option proposal
>First you need to define "Grub Super Disk," because I really don't know > what you're talking about... Floppy image of Grub Super Disk: http://adrian15.raulete.net/ficheros/gsd_0.87_beta.img Cdrom image of Grub Super Disk: http://adrian15.raulete.net/ficheros/sdg_087.iso Grub Super Disk definition (more or less): http://lists.gnu.org/archive/html/bug-grub/2005-06/msg00026.html Screenshots of Grub Super Disk: http://adrian15.raulete.net/imagenes/sdg/ .. code of menu.lst prototype... >This might even work now, although obviously you would need to select two >entries: some hard disk, and then "Go!". Doesn't seem very convenient to me. But option as a grub command is not implemented in grub2, no? >If you're just trying to avoid typing that stuff under "Go!", I guess a >script function would be useful here. So in grub2 I will be able to make functions, great. -Hollis My question was the following you're in a menu with 3 or 4 options... and I want to prompt the user to choose between 4 options more... without having to load another configfile (menu.lst), without having to quit the current configfile. Would it be possible with grub2 easily? adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Disabling pause after an error
This is a question about 0.x series, the legacy grub. I want to make an option in Grub Super Disk called "Auto Load your Lost Linux" that what in fact does is: configfile (hd0,0)/boot/grub/menu.lst configfile (hd0,1)/boot/grub/menu.lst configfile (hd0,0)/grub/menu.lst configfile (hd0,1)/grub/menu.lst and so on. What i do not want is the user to have to press a key when menu.lst from hd0,0 or hd0,1 is not loaded because there's no such menu.lst Is there any HALT_ON_ERRORS variable in grub itself or should I hack the source code in order to disable pauses after errors? Thank you, adrian15 P.D.: This option will be useful when your windows xp rewrites your MBR and you cannnot boot into your appreciated Linux. ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: Fun abusing grub...
> > Greetings, > > I didn't try to break any records, but I did try to make a good > reference machine for each of these operating systems and > get real experience about handling real devices. > > Enclosed, read the touching tale of my attempts at installing 9 > different operating systems under Grub. > > --Chris Hi Chris I am doing a thing called Grub Super Disk and I am very interested on seeing your grub.conf file or menu.lst, the one from Fedora /boot, it might give me some hints on how to improve Grub Super Disk. Can you please send it by email or upload it somewhere... or just paste it in an email? adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
gsd proposal : dd
Let's suppose that MBR has this structure: Boot Code: 466 bytes Partition table: 66 bytes Let's do the following with Linux: dd if=/dev/zero of=./blank.img count=1 bs=466 dd if=./blank.img of=/dev/hda I think that this two commands will make a thing similar to fdisk /mbr that's to say give a blank mbr. Supposing that this is equivalent to fdisk /mbr let's build a grub disk with the following extra file: blank.img stored int /boot/grub/ folder. My first instict, my first thought was to do: install p /boot/grub/blank.img INTO (hd0) (Sorry, I don't remember the correct syntax right now, but I suppose you get the point) The problem is that when I read install command documentation it says that Grub before embedding stage1 into the MBR checks if it's a right Grub stage1 image. So... I suppose I cannot embedd this image into the MBR. So some questions arise right now: 1) When Grub embeds an stage1 image into the MBR does it copy it into the 1st 466 bytes or not? And... why its size is 512 bytes instead of 466 bytes as in my scheme? 2) Can I make a fake blank.img which is approved as a good grub stage1 by grub itself? 3) (THIS IS THE PROPOSAL) Will Grub 2 include a dd command... so that you can dd some images as a blank mbr or a mbr backup ? Thank you for your questions in advance. Ah,... I've made a Grub Super Disk version totally translated into English... check version 0.8.9 in floppy or cdrom here: http://adrian15.raulete.net/ficheros/gsd_0.89.iso http://adrian15.raulete.net/ficheros/gsd_0.89_en.img adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: Automatic backup with grub
> On Thursday 27 Oct 2005 17:03, E Leibovich wrote: > > As I'm planning to use it as a recovery console I > > prefer loading linux won't be dependable of loading > > windows, but that it'll be loaded on its on each week > > or each 10 boots. It seems to me that grub requires a > > very small patch in order to make partitionX loaded 10 > > times and then to go back to default - am I correct? > > No, you can use GRUB Legacy's savedefault command. See: > http://www.gnu.org/software/grub/manual/grub.html#Booting-once_002donly > That way requires 10 menu entries for booting Windows. Hi! What have you done at the end? Have you tried my solution (http://lists.gnu.org/archive/html/bug- grub/2005-10/msg00049.html ) or do you prefer the savedefault one (the one above here) because you do not depend on windows xp? adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: Scripting support (PATCH)
> > I think also. Because theese modifications are lost after boot they > > are generally modified only to boot one time an OS with specifical > > parameters and you don't need scripts for this. > > Right. The only reason I see for editing the script in general is to > edit some menu generation routine. But that is a very rare case I > think. If it turns out not to be a rare case, we can provide this > feature later on. I'm not quite sure if this discussion will affect my next development of GSD based on grub2 but I'll tell you my opinnion: Grub2 config files should be interpreted as if you were running a bash script. (I actually don't know if it corresponds to approach #1 or #2 or if it hasn't any relation with it) The thing is that for developing GSD easily I will need some menu generation routines... althought... now that I think it better... I can made these routines from normal bash scripts. In conclusion, I'm quite confused but try to help further GSD development. adrian15 Grub Super Disk (GSD) : http://adrian15.raulete.net/grub/ ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: [GRUB1] Accessibility: Add beep support
> Hi, > > I know that no new feature are added to grub1, but this really small > feature (it can be just implemented as "echo ^G") would be _much_ useful > for blind people. Please see details on > https://savannah.gnu.org/bugs/?func=detailitem&item_id=14661 > I proposed a patch adding an "echo" command: > https://savannah.gnu.org/bugs/download.php?item_id=14661&item_file_id=30 > 77 > Could this be commited? > > Regards, > Samuel Hi Samuel, if you happen to build a grub cdrom with this feature in it please send it to me or tell me an url to it. I think that the beep thing should be easily OFF or ON. Why don't you make a beep ON OFF command. My idea for GSD would be default entry (in 5 seconds) activates beep and not default entry do not activates it. (Useful in Offices where there are a lot of people) Then I could assign each GSD option a sound or something. Well, I'm not quite sure. Do you think GSD is useful for a blind person? adrian15 GSD is found at http://adrian15.raulete.net/grub/ ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
grub variables semi support on grub legacy
I recently sent an email to http://lists.gnu.org/archive/html/bug- grub/2005-12/msg00023.html and nobody answered me. So... I will continue this message here... because there are some grub legacy developers round here or at least I hope so. I've already begun on implementing variables support on grub legacy. (Sorry code is at home). I've added to share.h ( http://cvs.savannah.gnu.org/viewcvs/grub/grub/stage2/shared.h?rev=1.99 &view=auto ) some BUF and LEN variables to store var1, var2 and var3. I've define and initialized variables on cmain() of stage2.c ( http://cvs.savannah.gnu.org/viewcvs/grub/grub/stage2/stage2.c?rev=1.46 &view=auto) so that every variable has it's first character to 0 (or \0 if you prefer). And then I modify the variables in builtins.c with two new commands: echov N: Shows the contents of a variable. set N contents: Sets contents of a variable to contents. N is a number between 1 and 3. And both commands work. I want to add more variables by using a function that receives a pointer to char... and returns a pointer to char. So that if I read 1 it returns the pointer to var+(VAR_SIZE*(1-1)) and if I read 2 it returns pointer to var+(VAR_SIZE*(2-1)) and so on... so that I do not have to define var1, var2, var3 but var where variables buffer begins. If you have better ideas of implement it or whatever you just say them. In the following weekends I'll try to implement addv to add a variable contents to another one. And adds to add an string to another variable. And what I wanted to ask about the run command which I think I will implement it (For the sake of simplicity) with "run N" ... where N is a variable... and variable can have "configfile (hd0,1)/grub/menu.lst) as contents. Well, waiting for comments. Can I add the variables that I want, with the size (300 currently) that I want or is there a limit size somewhere ? adrian15 P.D. Can anyone explain #define MENU_BUFLEN (0x8000 + PASSWORD_BUF - MENU_BUF) this line of shared.h... Isn't it supposed to be PASSWORD_BUF lesser than MENU_BUF...? Why's this MENU_BUFLEN defined this way? P.D.: I also want to implement a "call" command which loads a configfile let's you select you one option and then configfiles the previous menu. But that's another tale. ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
booting grub, loading kernels and unloading kernels question
A question. It may be stupid but I have to ask it. Can we boot grub and boot linux so that linux don't write on grub reserved memory (let's say first 640k) And then make an special halt command that halts linux and boots again grub? (without rebooting) I think this has a lof of possibilities for using OSes as a grub module in live cds but I do not know if it is feasible. Currently I want an easy way of showing an image with a lot of colours in grub without having to code vesa and all of that. (Talking about grub legacy, as always ;) ) If this works... I will need to know how to patch the kernel and how to strip gnu/linux distro to have only the display command or equivalent to show images in framebuffer or equivalent. adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
idea for storing menu.lst with 1_5 stage or equivalent on grub2
This is a idea for making installations of Grub safer. It is based on Grub Legacy but I think you will find an equivalent on grub2. Most people ask about grub showing grub> and not knowing what do to do when that happens. (Usually when they remove Linux from pc). If I understand it correctly that means that 1_5 stage has been loaded but it does not have found /boot/grub/menu.lst because it does not exist. My idea is that when embedd 1_5 stage we should also add a configuration file with the following contents: timeout 0 default 0 title correct install configfile /boot/grub/menu.lst HERE GOES CONTENTS of /boot/grub/menu.lst from the first title. This way if the file /boot/grub/menu.lst is there it is loaded but if it does not exists its backup is loaded. So... everyone is happy. adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
proposals for grub2 (i think 3rd email)
So that we don't forget: http://lists.nongnu.org/archive/html/grub-devel/2005-08/msg00163.html 1) fexists FILE functions. Gives OK if the file exists. Gives ERROR if the file not exists. 2) Being able to mount tar.gz files. 3) Being able to mount loopback devices. 4) Mapping partitions directly to Grub partitions. Is it possible ? 5) dd equivalent command. That's all. I'm seeing that you've advanced a lot on scripting support and there're some beginnings on graphics area. Great work! adrian15 P.S.: I think I sent another mail but I do not find it. ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: proposals for grub2 (i think 3rd email)
adrian15 <[EMAIL PROTECTED]> writes: 2) Being able to mount tar.gz files. Why? This was a real need with my stupid implementation of Grub Legacy on Super Grub Disk that made me having a lot of different little lst files (till 8000 files) and thus made it impossible to save it into a floppy. (You know 8000 files occuppy more space than these 8000 files in a single tar and if it is gz is smaller) Due to the script nature of "lst?" files of grub2 I think there won't be need of such a feature. At least I won't need it. Maybe other people will need it but let's not insist on this proposal then. 3) Being able to mount loopback devices. This is possible already. GREAT! 4) Mapping partitions directly to Grub partitions. Is it possible ? Huh? I know that Grub does not take in account partitions as a single entity but rather devices that can have or not its partitions. I am not very sure but I suppose that there are some ocassions where it is useful to treat partitions as a single entity such as from inside the grub shell inside a linux shell using the device command (which could be renamed to partition) and trying to access to a "partition" that could be: * A partition from these new things called: Logical Volume Manager (LVM) * A partition that has being "dded" to a file and thus don't need to be a hard disk image. (I'm talking about a file because you say that you can loopback!) That's all for the reply! But there's an idea left. The other day I was talking with a friend about the development of Super Grub Disk and specifically on the part of Grub Legacy Source Code. He told me that we could manage to build a c function so that it creates on the fly a menu on which you could choose all the hard disks and then all the partitions of the hard disks but not fixed ones (Let's say from 1st to 20th partitions) but real ones... if you have 3 partitions you only see 3 partitions... if you have 4 partitions you only see 4 partitions. Would there some kind of function/menu that let the user select its own partitions detected by grub on grub2? adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: Parted/GRUB joint-venture
Hello, I am the representative of GNU Parted and am also interested in the development of GRUB2 (I've been lurking on this list for some months). James from the GNU SoC team wrote me: < I do not know if okuji has talked to you directly. Have you seen this? http://www.gnu.org/software/grub/grub-soc.html Parted integration Integrate GNU Parted's library (libparted) with GRUB so that we can make use of the full power of the Parted's functionality at boot time. Parted supports creation, deletion, resizing of partitions and filesystems. These features are extremely useful when you get troubled or have a complicated boot environment. Because libparted uses some external libraries, you will have to think how to make things run on the GRUB's environment, where you cannot use POSIX or Unix system calls. This should be implemented as an optional dynamic module by using the module loading feature in GRUB 2. adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
SOC - SGD based on grub2 - Menu and scripting status
I've reading the G'SOC document: http://www.gnu.org/software/grub/grub-soc.html and I've been tented to add a new proposal for grub2. As you all should have guessed it would a Super Grub Disk ( http://adrian15.raulete.net/grub/ ) but not based on grub legacy but grub2. If I want the project to be feasible I need that the grub2 api relative to menues and scriptings is fixed. That means that the name of the commands and its behavior don't change since I begin the project to the end of it. So here are some questions that have arised... 1) Marco Gerards: Do you think that commands/functions/variables related to menues files are going to change a lot? But I don't mean RIGHT NOW. I mean in the beginnings of SOC... which I don't know... let's see... 23th May. (in one month time). If these commands are available where should I get a list of them and their behaviour? 2) Do you like the Super Grub2 CD name... or should it be Grub2 CD or Grub CD and that's all? Grub Rescue CD perhaps? 3) What features would you like to see apart from the ones that are already implemented in Super Grub Disk ( http://adrian15.raulete.net/grub/tiki-index.php?page=En )? 4) What is the best way for dealing with languages and translations when developing? 5) I need to define "something" (In my grub legacy fork is a menu.lst) that lets me choose the harddisk-partition which I want to work on. Can I make it easily? Can Grub2 api write me in an array or a similar the partitions that can read in a given hard disk? So that if there are 3 partitions they are saved into an array of size 3? adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: SOC - SGD based on grub2 - Menu and scripting status
5) I need to define "something" (In my grub legacy fork is a menu.lst) that lets me choose the harddisk-partition which I want to work on. Can I make it easily? You mean as a variable? That's possible. I will explain this point in more detail if you don't mind. Here goes copy-pasted 1) the first the "lst" for hard disks and then 2)the second one the "sh" that makes the "lst" for partitions. 3) An "lst" for making easier to call the selection of partitions from inside a function or whatever. 4) An example of how this menues/selectors are called. (lst) I'm not asking you to develop a command for giving me this lst on the fly adapted to the user pc. You know what I was telling before: If the users hard disk has only three partitions make an array with only three values which are the partitions. I'm asking you to think about new features that scripting should have so that the developing of this command is far easy. OFFTOPIC NOTE: I am working on grub legacy call and back commands so that what you see below actually works. I think this night it will work ok but who knows. adrian15 hard.disk.lst: == title $(choose_title) pause title NATURAL LINUX-IDE LINUX-SCSI GNU/GRUB pause title 1.hda sdahd0 set out_device=hd0 set out_hd=hd0 set out_lide_hd=hda set out_lscsi_hd=sda back title 2.hdb sdbhd1 set out_device=hd1 set out_hd=hd1 set out_lide_hd=hdb set out_lscsi_hd=sdb back title 3.hdc sdchd2 set out_device=hd2 set out_hd=hd2 set out_lide_hd=hdc set out_lscsi_hd=sdc back title 4.hdd sddhd3 set out_device=hd3 set out_hd=hd3 set out_lide_hd=hdd set out_lscsi_hd=sdd back generate_part_lst.sh: == SDG_PARTITIONS_LIST="0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17"; cat << EOF title \$(choose_title) pause title NATURAL LINUX-IDE LINUX-SCSI GNU/GRUBGNU/HURD pause EOF for n_partition in $SDG_PARTITIONS_LIST; do ln_partition=$[$n_partition + 1]; cat << EOF title ${ln_partition} \$(out_lide_hd)${ln_partition} \$(out_lscsi_hd)${ln_partition} (\$(out_hd),${n_partition}) \$(out_hurd_hd)s${ln_partition} set out_device=(\$(out_hd),${n_partition}) set out_part=(\$(out_hd),${n_partition}) set out_lide_part=\$(out_lide_hd)${ln_partition} set out_lscsi_part=\$(out_lscsi_hd)${ln_partition} set out_hurd_part=\$(out_hurd_hd)s${ln_partition} EOF done partition.lst: === default 0 timeout 0 title Choose hard disk and partition call $(grub_device)/boot/grub/choose/hard_disk.lst call $(grub_device)/boot/grub/choose/part.lst back test.lst: === title THIS IS A TEST FOR CALLING hard disk set choose_title="TEST FOR CHOOSING HARD DISK TITLE" call $(grub_device)/boot/grub/choose/hard_disk.lst title THIS IS A TEST FOR CALLING part.lst set choose_title="TEST FOR CHOOSING PART ONLY TITLE" call $(grub_device)/boot/grub/choose/part.lst title THIS IS A TEST FOR CALLING partition (Both hard disk and partition) set choose_title="TEST FOR CHOOSING PART AND HD TITLE" call $(grub_device)/boot/grub/choose/partition.lst This is the begginnings of the generated part.lst and you know it is 9 times bigger: === title $(choose_title) pause title NATURAL LINUX-IDE LINUX-SCSI GNU/GRUBGNU/HURD pause title 1 $(out_lide_hd)1 $(out_lscsi_hd)1($(out_hd),0) $(out_hurd_hd)s1 set out_device=($(out_hd),0) set out_part=($(out_hd),0) set out_lide_part=$(out_lide_hd)1 set out_lscsi_part=$(out_lscsi_hd)1 set out_hurd_part=$(out_hurd_hd)s1 title 2 $(out_lide_hd)2 $(out_lscsi_hd)2($(out_hd),1) $(out_hurd_hd)s2 set out_device=($(out_hd),1) set out_part=($(out_hd),1) set out_lide_part=$(out_lide_hd)2 set out_lscsi_part=$(out_lscsi_hd)2 set out_hurd_part=$(out_hurd_hd)s2 adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: SOC - SGD based on grub2 - Menu and scripting status
On Monday 24 April 2006 20:36, Marco Gerards wrote: Will this mean Adrian can use it for menu entries as well? I think that is what he wants to do. In my idea, yes. I can say anything before implementing. ;) Okuji Yes... The thing that when meaning translation I was thinking about SGD, which is kind of a GUI for Grub so... I did not think about Grub messages but to menu entries as Marco suggested. However you're right Grub messages could also be translated. Currently I have SGD (only menu entries) translated to various languages with a three-level structure... one for algorithm... one for "kind of universal language" and one for the actual languages. It's implemented with bash variables and uses sed and other unix tools and it is not perfect... I know there was this gettext thing and in the first place I didn't get to work it with bash (I think I needed to recompile it) so I discarded the idea. Maybe I will take a look at gettext again for SG2D. adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: SOC - SGD based on grub2 - Menu and scripting status
5) I need to define "something" (In my grub legacy fork is a menu.lst) that lets me choose the harddisk-partition which I want to work on. Can I make it easily? I was thinking about an iterator function. Perhaps that might be the easiest to use... Please watch CVS closely. I am actively working on scripting, as much as time permits. An iterator function among the various partitions of a hard disk... that could be interesting. Unfortunately I can't watch CVS closely so I will wait till you announce it in this list. :) The iterator function should increment a variable for knowing the total amount of partitions on a given hard disk. adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: Changing the default OS
It's very interesting why people ask questions about GRUB Legacy here again and again, although I have written "Do not use this list for GRUB Legacy" in everywhere. Okuji Is it so difficult to rename mailing-lists ? Rename bug-grub to grub Rename grub-devel to grub2 or grubbeta and you will see how there are some changes. adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
test -e command for grub2
I attach then new test.c for grub2. (I worked from Grub 1.94 version). It only implements the test -e feature. I haven't been able to check it. ./configure says something about a LZO version. 1) Why cat uses the file = grub_gzfile_open (args[0], 1); sentence to check if a file can be opened or not? Is it cat supposed to cat also gzipped files? Is it better for me to use grub_gzfile_open on my test command? 2) I've done this: static const struct grub_arg_option options[] = { {"file", 'e', 0, "test if a file exists", 0, 0}, {0, 0, 0, 0, 0, 0} }; copying-pasting from search.c but I do not understand it too much... if this is repeated in test.c and search.c the compiler should complain... isn't it ? 3) And you're free to tell to only attach patchs instead of the full file... and you're free to tell me an url for a gnu c syntax or convention as far as I do not know if the gnu project has any. And, of course, tell me if it compiles or not. adrian15 P.S.: I am going to update from Knoppix 4 to Knoppix 5 soon and I think I won't hae the lzo problem. /* test.c -- The test command.. */ /* * GRUB -- GRand Unified Bootloader * Copyright (C) 2005 Free Software Foundation, Inc. * * GRUB is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GRUB; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include #include static void test_file_exists (const char *key, const char *var) { char *p; grub_file_t file; file = grub_file_open (key); if (file) { grub_printf (" %s", key); grub_file_close (file); grub_errno = GRUB_ERR_NONE; return 0; } else { grub_error (GRUB_ERR_FILE_NOT_FOUND, "File does not exists."); } } static const struct grub_arg_option options[] = { {"file", 'e', 0, "test if a file exists", 0, 0}, {0, 0, 0, 0, 0, 0} }; static grub_err_t grub_cmd_test (struct grub_arg_list *state, int argc, char **args) { const char *var = 0; if (argc == 0) return grub_error (GRUB_ERR_INVALID_COMMAND, "no argument specified"); if (state[0].set) test_file_exists (args[0], var); return grub_errno; } GRUB_MOD_INIT(test) { (void)mod; /* To stop warning. */ grub_register_command ("[", grub_cmd_test, GRUB_COMMAND_FLAG_CMDLINE, "[ EXPRESSION ]", "Evaluate an expression", 0); grub_register_command ("test", grub_cmd_test, GRUB_COMMAND_FLAG_CMDLINE, "test EXPRESSION", "Evaluate an expression", 0); } GRUB_MOD_FINI(test) { grub_unregister_command ("["); grub_unregister_command ("test"); } ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: grub2+qemu El Torito boot
Hi, I've written a script that might be interesting to those who would like to test GRUB2 in qemu without any use of root privileges. I am one of this. Thank you. This is a two-stage approach that uses GRUB Legacy to load GRUB2 from a CD image, which GRUB2 then uses as a hard drive (whole device, no partition table). This is effectively native El Torito, except that GRUB Legacy handles the initial boot. It's a pity that GRUB2 does not handle ElTorito itself yet. Oh, and I wasn't able to get this to work with GRUB 1.94: I'm using a cvs pull that is a few hours old, since 1.94 seems to go into rescue mode no matter what I do. It's pity because i only have grub 1.94 at hand. I will try it nevertheless. adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
grub2 file browser draft
Marco Gerards you asked me the other day about scripting. If there was something missing or any other thing that he could do. This draft about a grub2 file draft can help him thinking about how powerful is his scripting or not. The user sees inside a menu: Floppy1 Floppy2 HardDisk1 HardDisk2 He selects HardDisk1. He sees another menu: View Save as Argument 1 Save as Argument 2 Setup Grub Here This is Grub Root (Only if the hard disk/device has no partitions) He selects View. He sees another menu: hda1 hda2 hda3 hda4 hda5 He selects hda1. He sees another menu: View Save as Argument 1 Save as Argument 2 Setup Grub Here This is Grub Root (Only if partition filesystem is grub readable) He selects View. He sees another menu: /boot /etc /var He selects /etc. He sees another menu: View Save as Argument 1 Save as Argument 2 He selects View. He sees another menu: fstab config1 config2 He select fstab. He sees another menu: View Save as Argument 1 Save as Argument 2 Let's say he returns to previous menu where he is seeing /etc folder. He select my_index.html. He sees another menu: View inside a web browser (GRUB2 will have a module with basic html reading I suppose) View Save as Argument 1 Save as Argument 2 So Marco Gerards Do you think that this can be done with your grub scripting? Or the grub2 scripting needs more hacking? adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: grub2 file browser draft
I noticed you mention hda1 here, which is a Linux device name. I have explained you before it is technically not possible to translate GRUB device names to Linux device names. I wish it was possible, but unfortunately it currently isn't because the BIOS is used to access harddisks. I am sorry, I did not want to start over the discussion. I just wanted to know if given a hard disk device we could iterate over its partitions or at least generate a menu from them. I've seen that you say we cannot iterate over files so I supose that it also means that we cannot iterate over partitions yet. adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: Scripting (IMPORTANT!)
Hi, - root: The active disk/partition (rw, global) - prefix: The pathname used to load grub.cfg and the modules (rw, global) - platform: Set to the platform, eg. EFI, IEEE1275, PCBIOS, etc. (ro, global) - processor: Processor architecture GRUB was compiled for, eg. PPC, x86 (ro, global). - debug: Print debugging messages for certain parts of the code, or all messages when set to all. (rw, global?) - pager: When set to `1', wait for a key when the bottom of the screen was reached. Marco, my problems comes when I want to load with configfile and source many files from a grub2 cdrom. I just want to make sure that I am loading from the cdrom but not from another place. Currently I use something like this in SGD: configfile $(grub_device)/my_folder/myfile.lst $(grub_device) is a variable that stores (cd), (fd0) or (hd0) depending from which place has SGD booted. Let's suppose that you can change grub2's root variable with the ROOTC command (I do not know which it is the legacy's root equivalent in grub2, I will name it ROOTC in order to distinguish it from the variable). Let's see an example. You boot from a cd. root is (cd). Then you select a menu that loads a configfile file from the hard disk. So root is changed to (hd0,0). Ok... If there is an error and want to come back to my menues... How can I change the root variable back so that something as: configfile ${root}/my_folder/myfile.lst works as expected (loading a file from the cdrom not from the hard disk). CONCLUSION: I would add a grub_device or first_boot_device variable. function funcname { code } > if command ; then commands fi > for x in (*) ; do commands ; done A question arises to me... Do we have to type this commands in a single line or can we write them in multiple lines? Arguments can be passed to functions. In the function body they can be accessed as in bash ($1, $2, etc). I do not know why this should be useful... but would $0 return the name of the function? ==> Idea: Exporting functions to be full featured commands that can be tab completed, documented, etc. This way functions can be implemented by scripts instead of C code. Yes, please. If I need a more complex search command, I will need to implement it as a function and thus I will use it in a lot of scripts and exporting it would be a good idea. Menu entries ==> Discussion: Perhaps I will change the #1 into $1, although this is not really a variable. This is interesting. If I was myself coding I will choose the #1 syntax. However I suppose that people will get used to the $1 and will understand better the $1 syntax. I think it is better the $1 syntax. However, let's see a problematic example. function boot_linux_part_menu_gen { begins loop that sets i = 1...x @ "Partition $i" $i { linux /vmlinuz root=/dev/hda#{1} } ends loop that sets i = 1...x } Sorry... Let's use the another syntax... function boot_linux_part_menu_gen { begins loop that sets i = 1...x @ "Partition $i" $i { linux /vmlinuz root=/dev/hda${1} } ends loop that sets i = 1...x } VOILA... ${1} refers to the boot_linux_part_menu_gen function first argument or to the Partition mennu first argument ? My final vote is for the #{1} syntax for the sake of simplicity. Iterating over files: for x in (hd0,3)/foo/* ; do commands ; done I think we need an start variable and a max variable for generating menus from big folders. I do not know which it is the number of files of /etc folder in linux folders but I think it is very big. The idea is with a start=0 show 20 files (like search engines) in a menu and the last entry calls the same menu generator function with the: start=20 show 20 files argument so that we can see the next 20 files. This will remove memory-eating problems I think. foreach x in files ; do commands ; done I would improve this like this: foreach x in files ($folder) ; do commands ; done From: Johan Rydberg What about a 'prompt' variable? I think that fits into the cd and pwd discussion that M. Gerards wanted to start. In my opinnion there should be a pwd variable for each of the scopes of grub. By the way... I configfile one.cfg From one.cfg I source two.cfg. Then from two.cfg I configfile three.cfg. Then from the three.cfg the hipotetical exit command is run do we return to the middle of one.cfg execution or not ? A question... Will I be able to use relative paths (./, ../path/)at last? adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
for statements allowed outside menuentries?
This is a question for Marco Gerards I suppose. I was asking myself if in grub2 code I was allowed to do: for (part in partitions) { menuentry($part) { whatever($part.grub_string); } } or if it was all restricted to for inside menuentries like: menuentry() { for (hd in harddisks) { whatever hd } } adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: disk vs partition numbering
On Saturday 09 December 2006 01:17, Hollis Blanchard wrote: > On Tue, 2006-12-05 at 20:46 +0100, Yoshinori K. Okuji wrote: As you know very well, GRUB Legacy follows the former. I decided to change it to the latter in GRUB 2, as I don't have to care about compatibilities with GRUB Legacy so much, and I learned that theoretical beauty is often just a masturbation when coming to the user interfaces with experience. > > But which is more important in a long run: easy for existing users to migrate to GRUB 2, or easy for new comers to adapt GRUB 2? How difficult is it that existing users know GRUB now follows the same rule as others? How difficult is it that beginners study a rule different from others, so not intuitive at all? If Gnu/Linux it is as good as it seems the most of the people that are going to begin to use grub2 would be the ones that come from migrating from Windows. For them their first hard disk (Who is going to have a zero-hard disk in the real world. It has no sense) is C:, but you could name it 1. And when they partition their hard disk they suppose that the first cut it is the 1 not the 0. I advise to use the hard disk from 1 and partition from 1 convention on grub2. About your arguments... mine are: Grub2 users are not unix OS or its sysadmins but Windows ones. Grub2 should address to this kind of users in my opinnion. Nevertheless sysadmins will learn (reading the manual) how to make grub work but normal users will complain because if it is not straightforward it is not worthy. adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: disk vs partition numbering
On Wednesday 13 December 2006 09:59, adrian15 wrote: > For them their first hard disk (Who is going to have a zero-hard disk in > the real world. It has no sense) is C:, but you could name it 1. > And when they partition their hard disk they suppose that the first cut > it is the 1 not the 0. And you could name it 0. This is in computing world... but if you go to a building you go to the ground floor or to the 1st floor but you not do go to the 0th floor! > About your arguments... mine are: Grub2 users are not unix OS or its > sysadmins but Windows ones. Grub2 should address to this kind of users > in my opinnion. Hmm... I don't agree that most users are Windows users. AFAIK, most Windows users stick to the default selector (ntldr), and does not try to see how GRUB works at all. When I talked about Windows users I was talking about Windows users that do not stick the Windows but the ones that migrates, and thus dual boot with Gnu/Linux. But you are comparing apples with oranges here. What Windows does is to count only partitions for hard disks and count only disk for floppy disks and CD/DVD drives. C: is not a disk. It is a partition that Windows can recognize as a primary partition. D: is a second partition, regardless of whether it is in the same disk as C: or in next disk, or in next next disk. So you cannot compare GRUB's scheme with Windows' simply. Yes. You're right. So.. please compare the building floors scheme (what everyone understands) with hard disks and partitions. Personally, I think it is really unfortunate that the way of Windows is of no use. Really no use. If Windows were not that crap, everybody else could follow the same way, and everybody would be quite happy. I am of the same opinnion. :) I suppose the MS-DOS original developer (that one that Bill bought the OS with little money) thought that letters were less scary for identifying devices. Okuji adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
grub2 sci-fi, the usb problem and the solution
Science fiction part... It is the 28th February 2009 and grub2 is stable enough and used on all main linux distributions, as always Debian Stable uses grub legacy. The MDP* success has made that no one uses cdrom anymore and floppies are a museum piece. adrian15 decides not working any more on Super Grub Disk (Based on Grub Legacy) but working on a thing called Super Grub2 Disk. Marco_Gerards reads him on the irc and says: "You have been very late on making your decision :)" So adrian15 tries to install this brand new thing: grub2 in a MDP (Read a current USB drive)... and when he tries to implement the Boot Linux option.** he sees that he can see the first hard disk partitions as the second hard disk partitions. (He sees hd1 where usually it is hd0). Trying to boot its first hard disk (not the usb one) makes an error about a not found partition! And then he remembers... yes... that's it. The BIOS sets the pendrive as the first hard drive so grub2 sees it as hd0, and the first hard disk is set as the second hard disk. Shit! I had the same problem with grub legacy and they had not fixed it!!! What the hell have Marco Gerards, Okuji and the other guys doing all these 2 long years? Ah, yes, scripting, Hurd and Xen support! Back to the reality... == Scenario: Every distro installer has decided that when booting a Linux kernel root command should be run before the kernel and initrd commands, that it means that gives problem when booting grub from a usb drive. You boot grub from a usb drive, BIOS sets the usb drive as hd0. You try to boot your linux distro in hda2 like this: grub> configfile (hd1,1)/boot/grub/menu.lst and after the timeout an error issues: (hd0,1) partition does not exists. Oh, yes, the usb pendrive only has one partition. My solution for grub legacy is more or less (I need some advice if you do not mind) this one: 1) Add a "preprocessor if" somewhere to see if we're going to build a normal grub or a usb rescue grub. # if defined(USB_RESCUE) static const char *preset_menu = "usbshift\n"; # endif I think that activates the preset menu or kind of. Then usbshift command checks if grub is running from hd0, if it is true it should do the following thing with map commands. Before: usb1 disk1 disk2 disk3 disk4 disk5 hd0 hd1 hd2 hd3 hd4 hd5 After: disk1 disk2 disk3 disk4 disk5 usb1 hd0 hd1 hd2 hd3 hd4 hd5 then it should boot hd5 (last phisical hard disk) with these commands: rootnoverify (hd5) chainloader +1 boot Now Boot Linux works perfectly. Thoughts == As long as I know grub2 depends on BIOS naming for deciding which hard diks is the first one or the second one or... so you have the same problem as I do with usb drives (pretented to be rescue usb drives) that have grub2 installed. You know that you can also have installed grub2 on a usb drive for installing there a linux distro. (I mean this distro should work only when hd0=usb drive.) If you want to install a Linux distro in a usb pendrive you have to use the normal grub. If you want to install a Linux distro in a usb pendrive and being able to use if as a rescue grub you have to use the normal grub patched so that lets you run manually the usbshift command. adrian15 *: Movable Data Pieces are these digital camera memory sticks that exist right now but with 1024 times its current storage. You insert it into your pendrive (All the new pendrives have MDP slots) and you can read it in any computer with usb support as a hard disk. Now the last Spanish films (Spanish film industry has won the Hollywood industry.) are sold in read-only MDPs. MDP are also very popular in portable media devices like iphones. **: Boot Linux option: Shows you the partitions on all your hard disk where /boot/grub/grub2.cfg or /grub/grub2.cfg is found and tries to load it when you select the desired partition. (SGD currently has a equivalent option that works with menu.lst or grub.conf) ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
int13 and non-reboot drives mapping
This is about the drive shift that I wrote the other day about grub2 sci-fi and all. I've finally decided that this usbshift command should be run as a normal command not anything inside a preset menu. I've seen that we have to boot into the usb drive again to make effective changes of mapping drives. It is very annoying! And, of course, I do not want to boot into the pendrive once booted into it. I've studied grub legacy's root command source code (check at the email bottom) and I ask myself if I could write a command that only will do this part of the code I suppose that without the gateA20(0) (I've read something related to high memory but I think it is not useful for mapping.) but as I am not very sure I need your advice if you do not mind. My idea is that the usbshift command should first shift the drives thanks to map command and then run the mentioned piece of code. My AdamLGrub's variable: grub_device (that represents grub device) should be set to (hd4,0) if it was to set to (hd0,0) and there are 5 hard disks (including the usb drive). And then the next command to run is a configfile to somewhere like: configfile $(grub_device)/boot/sgd/menu.lst this will update the grub legacy's variables concerning to where grub is working like: saved_drive and saved_partition... As long as menu.lst files are run from the RAM there should not be any problem like there would be with a function trying to read from a hard disk. If you do not like the configfile idea you could also set them inside the usbshift command calling to root command so that it accepts as an argument (NEWUSBHD,OLDPART) such as: (hd4,0). I suppose that BIOS ints are better handled (more elegant) in grub2 and it should be easier for you to do that. Any idea, mistake, advice? adrian15 /* Check if we should set the int13 handler. */ if (bios_drive_map[0] != 0) { int i; /* Search for SAVED_DRIVE. */ for (i = 0; i < DRIVE_MAP_SIZE; i++) { if (! bios_drive_map[i]) break; else if ((bios_drive_map[i] & 0xFF) == saved_drive) { /* Exchage SAVED_DRIVE with the mapped drive. */ saved_drive = (bios_drive_map[i] >> 8) & 0xFF; break; } } /* Set the handler. This is somewhat dangerous. */ set_int13_handler (bios_drive_map); } gateA20 (0); boot_drive = saved_drive; chain_stage1 (0, BOOTSEC_LOCATION, boot_part_addr); break; ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
uuid support on grub2 status
Hi, I am intereested on reading uuid from ext2 partitions. I've been searching on grub2 source code and I suppose it is very similar to the fs->label function (or whatever it is), maybe only a transformation from binary UUID to ascii UUID is the only complicated thing to add. But before implementing anything... Has anyone worked on uuid support for ext2 on grub2? adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: Google Summer of Code 2007
I agree, but we could give proposals for implementing features that work towards this goal a higher priority than those that don't. E.g. giving CDROM support and the fancy menu interface a higher priority, because that are two things GRUB Legacy already has (in most major distributions at least). And certainly without the fancy menu the major distributions aren't going to switch to GRUB2. Jeroen Dekkers I vote for grub2 cdrom support. I suppose that you have designed grub2 the best way possible but Grub legacy wasn't. These two years that I've been working with grub cdroms I've found two or three problems from the fact that grub cdrom was not tested fully. For example when an error happened the cur_part_offset variable had to be reset so that the cdrom was read ok and it wasn't reset. Moreover I think that if we want grub2 to be a great software it should be tested in a earlier stage of development on all the devices where it can it boot from. adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: My Summer of Code Project
Hello list, My name is Alex Roman and I have been selected as a Summer of Code student for the GRUB2 project. I will be adding CD-ROM booting functionality to GRUB2. Welcome! Cdrom booting funcionality for grub2 is a good piece of news. The first stage of the project will attempt to use BIOS calls to achieve this functionality (which is, of course, dependent on the BIOS's capabilities, standards compliance, etc.). Ok. That's how it works in Grub legacy I suppose. > The second stage will involve writing a complete ATA/ATAPI driver which would bypass the BIOS completely, thus allowing it to work on virtually any system out there. I suppose that it is going to be difficult. I give you my encouragement! Unfortunately I only have access to ATAPI CD-ROM drives, so I won't be able to work on SCSI and/or USB, I don't have either. > however I will try to separate the system to load the boot image from the driver itself as much as possible so that future driver developments for SCSI and USB will just be sort of drop-in replacements. So, just thought I'd talk a bit about what I'll be doing... Comunication is a good thing. Thank you for your attention and time. I'm sure I'll have lots of questions in the months to come. :) If this happens, it's a good sign of grub2 development health. adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: pretty colors in gfxterm
> Ah yes, I forgot to mention we're planning a big migration :-). Here are > the > details: > > http://wiki.debian.org/GrubTransition > > -- > Robert Millan > >CDROM support. Not really important since Debian isn't using GRUB for CD >boot atm, but it might be an interesting option for lenny. > >* 64-bit detection on x86: needed for multi-arch DVDs. In my opinnion Grub2 should be also used for cd boot. To boot from cd I mean. This will make Grub2 the live cd standard boot loader and would led us to find more bugs that only the ones that appear when you boot from a hard disk. As long as I know Grub2 boot from a cd is not being developed yet (see http://lists.gnu.org/archive/html/grub-devel/2007-04/msg00053.html ) We will have to wait for it or code it. :) adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
test -e patch
Attached you will find the patch adding test -e support for grub2. This is my first patch. I have compiled it without no errors. However as long as the grub2.tar.gz that Marco gave me did not have any documentation about how to create a floppy (or at least I did not manage to find it) I have not tested it. Could you please test it? I have applied the GNU Coding Standards Style on the patch although the copy-pasted code that you will find in the mail body has not the GCS applied. Here there are some doubts: > static const struct grub_arg_option options[] = { {"file", 'e', 0, "test if a file exists", 0, 0}, {0, 0, 0, 0, 0, 0} }; Is this correct? What's that last line for? Is it compulsory ? Should I write "Test if a file exists" instead of "test if a file exists" or "FILE exists"? static void test_file_exists (const char *key) Do you prefer another name like: file_exists_test ? { grub_file_t file; file = grub_file_open (key); if (file) { grub_printf (" %s", key); Should I prompt the existent file or not? Should I prompt %s exists maybe ? Should I prompt an \n also? grub_file_close (file); grub_errno = GRUB_ERR_NONE; } else { grub_error (GRUB_ERR_FILE_NOT_FOUND, "File does not exists."); How the hell should I treat grub errors. Maybe the test_file_exists has to return a static grub_err_t and then from grub_cmd_test I should call it like this: return (test_file_exists (args[0])) so that the error propagates ? What are the error polices ? } } static grub_err_t grub_cmd_test (struct grub_arg_list *state __attribute__ ((unused)), int argc, char **args) { char *eq; char *eqis; if (state[0].set) I suppose this refers to the first line of static const struct grub_arg_option options and thus as -e is the first option and if its set we should run the correspondent function. One question. Should we put the test-e function into a separate file or not ? test_file_exists (args[0]); else { /* XXX: No fancy expression evaluation yet. */ if (argc == 0) return 0; eq = grub_strdup (args[0]); eqis = grub_strchr (eq, '='); if (! eqis) return 0; *eqis = '\0'; eqis++; /* Check an expression in the form `A=B'. */ if (grub_strcmp (eq, eqis)) grub_error (GRUB_ERR_TEST_FAILURE, "false"); grub_free (eq); } return grub_errno; } GRUB_MOD_INIT(test) { (void)mod;/* To stop warning. */ grub_register_command ("[", grub_cmd_test, GRUB_COMMAND_FLAG_CMDLINE, "[ EXPRESSION ]", "Evaluate an expression", 0); grub_register_command ("test", grub_cmd_test, GRUB_COMMAND_FLAG_CMDLINE, "test EXPRESSION", "Evaluate an expression", 0); } I understand this register commands. I suppose this information is read from the help command or it isn't ? Or maybe it also reads from: static const struct grub_arg_option options ? The question is if the user will see the -e, -f or other options when querying the test command help or not ? GRUB_MOD_FINI(test) { grub_unregister_command ("["); grub_unregister_command ("test"); } That's all for my first compiled patch. I hope that Marco_g is happy :). But you know Marco_g I will continue my non-sense grub legacy development too. ;) adrian15 diff -urN grub2_2007_05_31_original/commands/test.c grub2_2007_05_31/commands/test.c --- grub2_2007_05_31_original/commands/test.c 2005-11-13 16:47:08.0 +0100 +++ grub2_2007_05_31/commands/test.c 2007-06-01 12:13:11.0 +0200 @@ -24,32 +24,64 @@ #include #include #include +#include + +static const struct grub_arg_option options[] = + { +{"file", 'e', 0, "Test if a file exists", 0, 0}, +{0, 0, 0, 0, 0, 0} + }; + +static void +test_file_exists (const char *key) +{ + grub_file_t file; + + file = grub_file_open (key); + if (file) +{ + grub_printf (" %s", key); + grub_file_close (file); + grub_errno = GRUB_ERR_NONE; +} + else +{ + grub_error (GRUB_ERR_FILE_NOT_FOUND, "File does not exists."); +} +} + static grub_err_t grub_cmd_test (struct grub_arg_list *state __attribute__ ((unused)), int argc, char **args) { + char *eq; char *eqis; - /* XXX: No fancy expression evaluation yet. */ + if (state[0].set) +test_file_exists (args[0]); + else + { +/* XXX: No fancy expression evaluation yet. */ - if (argc == 0) -return 0; +if (argc == 0) + return 0; + +eq = grub_strdup (args[0]); +eqis = grub_strchr (eq, '='); +if (! eqis) + return
gcs doubt #1
In the GNU Coding Standards they say in: 5.2 Commenting Your Work Please put a comment on each function saying what the function does, what sorts of arguments it gets, and what the possible values of arguments mean and are used for. Is it ok that the search.c and test.c (commands/ folder) do not have any of these comments at all? You do not comment them at all? You comment them in another place? Maybe it's ok with the help description that it is set when you register a command? Maybe this is a bug and should be fixed? adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
how to build a grub2 floppy with fs adventure
You can advice me to run easier commands. Here is my experience. I do not want to install grub2 in my production environment so I plan to install into a floppy. The cat and dd way of install grub ( cat boot.img core.img | dd of=foo.img seek=0 conv=notrunc ) does not convince me because I want to be able to read a filesystem from my grub2, i.e., the floppy filesystem. I've finally decided myself to use grub-install command from the compiled sources directory ( In my system it is: /home/adrian/Desktop/gnu/grub2/grub2_2007_05_31 1st problem: no core.img == The first problem is that no core.img is available once you run 'make'. So I build one core.img like this: ./grub-mkimage -d ./ -o core.img Once I have the come.img, I try to use grub-install, I finally found this to work: ./grub-install --root-directory=/media/floppy --modules=*.mod --grub-setup=./grub-setup --grub-mkimage=./grub-mkimage --grub-mkdevicemap=./grub-mkdevicemap --grub-probe=./grub-probe /dev/fd0 where the /media/floppy is the place where I mount my floppy and, of course, the floppy has to be mounted!!! (I think the grub-legacy's grub-install did mount whatever was needed automatically although I am not very sure about that.) 2nd problem: grub-probe and partmap module = Then the grub-probe command complained about a partmap module not being found so I decided to comment these lines from ./grub-install : # Then the partition map module. #partmap_module=`$grub_probe --target=partmap --device-map=${device_map} ${grubdir}` #if test "x$partmap_module" = x -a "x$modules" = x; then #echo "Auto-detection of a partition map module failed." 1>&2 #echo "Please specify the module with the option \`--modules' explicitly." 1>&2 #exit 1 #fi 3rd problem: grub-install did complain about not finding: /usr/local/lib/grub/i386-pc === so I created it as a link to /home/adrian/Desktop/gnu/grub2/grub2_2007_05_31 (compiled sources dir) 4th problem: = In order to fix the /usr/local/lib/grub/i386-pc problem I invented myself another option for grub-install called --pkglibdir so that I could specify the directory myself. However I think that other grub-install subprograms such as grub-probe or grub-mkimage also tried to find that /usr/local/lib/grub/i386-pc folder which it is annoying. This is why I did the link trick. It works! = Finally I unmounted the floppy and tried to run it from qemu... it worked! adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
test -e #1 test
What a mail subjet :) Here you are: Running from a floppy that has grub2 installed in it inside qemu: grub> test /boot/grub/und-pc.lst /boot/grub/und-pc.lst grub> test /boot/grub/ error: File does not exists. grub> test /boot/grub error: File does not exists. grub> test -e /boot/grub/und-pc.lst error: Unknown argument '-e' grub> help test Usage: test EXPRESSION Evaluate an expression -h, --help display this help and exit -u, --usage display the usage of this command and exit My question is: Why help search works as expected ? What was wrong with my options? adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: test -e patch
> I have applied the GNU Coding Standards Style on the patch although the > copy-pasted code that you will find in the mail body has not the GCS > applied. Btw, you can also test it with grub-emu. What are the differences between grub-emu and the grub legacy's grub shell ? An example of how to use it? adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: test -e patch
On Wed, Jun 06, 2007 at 01:42:48AM +0200, adrian15 wrote: Attached you will find the patch adding test -e support for grub2. This is my first patch. I have compiled it without no errors. However as long as the grub2.tar.gz that Marco gave me did not have any documentation about how to create a floppy (or at least I did not manage to find it) This should work: cat boot.img core.img | dd of=foo.img seek=0 conv=notrunc I would like to have a floppy with the fs on it. See my other mail about my floppy creation adventure. > static const struct grub_arg_option options[] = { {"file", 'e', 0, "test if a file exists", 0, 0}, {0, 0, 0, 0, 0, 0} }; Is this correct? What's that last line for? Is it compulsory ? It's common practice for arrays to make them null-terminated to be able to determine their limits without making assumptions about their size. Doing it with structs is akin to null-terminating a char array. Ok. I understand then. { grub_file_t file; file = grub_file_open (key); What happens if file is a device node, or a directory? Does grub_file_open work with these? I have not tried a device node, but with a directory it fails. Perhaps grub_file_stat would make more sense You might be right but why then you (grub2 developers) have developed the search command with the help of grub_file_open ?? Should the search command be reimplemented with grub_file_stat ? What are the error polices ? IMHO, an error would be if existance of the file cannot be determined. I don't think non-existance should be considered an error too. However, existing code in the test plugin already does this, which puzzles me. We will have to wait for marco_g for telling us how it works, then. GRUB_MOD_INIT(test) { (void)mod; /* To stop warning. */ grub_register_command ("[", grub_cmd_test, GRUB_COMMAND_FLAG_CMDLINE, "[ EXPRESSION ]", "Evaluate an expression", 0); grub_register_command ("test", grub_cmd_test, GRUB_COMMAND_FLAG_CMDLINE, "test EXPRESSION", "Evaluate an expression", 0); } I understand this register commands. I suppose this information is read from the help command or it isn't ? Yes. Also with "test --help". Or maybe it also reads from: static const struct grub_arg_option options ? That too. The question is if the user will see the -e, -f or other options when querying the test command help or not ? Yes, based on options[]. But you should really test that and not blindly believe me :-) I've checked that it does not read from struct grub_arg_option options , strange thing. +static const struct grub_arg_option options[] = + { +{"file", 'e', 0, "Test if a file exists", 0, 0}, Do we want a long option here? bash/coreutils don't have any. I do not want a long option :) adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: test -e patch
GRUB_MOD_INIT(test) { (void)mod;/* To stop warning. */ grub_register_command ("[", grub_cmd_test, GRUB_COMMAND_FLAG_CMDLINE, "[ EXPRESSION ]", "Evaluate an expression", 0); grub_register_command ("test", grub_cmd_test, GRUB_COMMAND_FLAG_CMDLINE, "test EXPRESSION", "Evaluate an expression", 0); } I understand this register commands. I suppose this information is read from the help command or it isn't ? Or maybe it also reads from: static const struct grub_arg_option options ? I've found it. It reads from the register command and ALSO from options IF you tell it to do so with: (void)mod;/* To stop warning. */ grub_register_command ("[", grub_cmd_test, GRUB_COMMAND_FLAG_CMDLINE, "[ EXPRESSION ]", "Evaluate an expression", options); grub_register_command ("test", grub_cmd_test, GRUB_COMMAND_FLAG_CMDLINE, "test EXPRESSION", "Evaluate an expression", options); adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
grub2 common argument parser
I have an idea that I am not able to implement in bash because I have no time. It consists about an xml file that has all the arguments of a command and how they should be (a file, a device, an string), if an argument is compulsory or not, if two arguments are incompatible. This xml file can be read by a GUI program that can present you a GUI to any of your console programs. Like if it was an interactive 'man'. Each option has its explanation and you can fill the empty boxes. And the next step is that the man files instead of being man files would be these xml files. Well one thing more or less equivalent that could be done in grub2 is a "grub2 common argument parser". I think it can be done because most of the argument types are the same ones: FILE, ENVVAR, MODULE, TERM, EXPRESSION, DEVICENME, PATTERN. Why we should let every command parse its own arguments when we could have a common argument parser. The idea is the following one: When you define a command argument by the means of options... static const struct grub_arg_option options[] = { {"file", 'f', 0, "search devices by a file (default)", 0, 0}, {"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}, {0, 0, 0, 0, 0, 0} }; Hey... there's something about it on the search.c code but it is not complete. It seems that the 3rd filed is what I need and maybe the last one. Hey it seems that this is already in the TODO list. (normal/arg.c) case ARG_TYPE_DEVICE: case ARG_TYPE_DIR: case ARG_TYPE_FILE: case ARG_TYPE_PATHNAME: /* XXX: Not implemented. */ That's a good and bad piece of news. That means that I will have to reimplement the test -e command in a future in order to take advantage of this implementation. The ARG_TYPE_FILE check is only trying to open it with grub_file_open () or maybe the grub_file_stat ... hummm... someone on the mailing list adviced me to use this second one but I do not find it. It seems for me that the filesystem modules or drivers do only have these commands: .name = "ext2", .dir = grub_ext2_dir, .open = grub_ext2_open, .read = grub_ext2_read, .close = grub_ext2_close, .label = grub_ext2_label, .next = 0 A question for marco_g == This .next is for file iteration inside a folder, maybe? And another question for everybody... do we need to implement a grub_file_stat function or not? adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
grub2 miscelanea questions (1/2)
Dear grub2 developers, here there are some questions about grub2 that I have that would have generated too many little emails. 1)lst files on a grub2 floppy == As I told you in another email, in order to build my grub2 floppy I did a soft link from /usr/local/lib/grub/i386-pc to /home/adrian/Desktop/gnu/grub2/grub2_2007_05_31 (compiled sources dir) and my floppy is full of lst files. Usually in a grub2 floppy there are not any lst file, isn't it? 2) What are these lst files for, are they useful or are they like the C .o files, only needed for compilation purposes? 3) Why any grub2.cfg file (I suppose it's the substitute for menu.lst) is inside the grub2 source code? 4) Why any doc folder is inside the grub2 source code? 5) grub2 lacks == 5.1) pager - When I want to do a big ls the output does not stop screen by screen... Is there any hidden pager that I do not know? Maybe is not implemented yet? 5.2) Chainload DEVICES How the hell do you boot windows? Maybe from a file that has inside it the first 512 bytes from the Windows partition? 6) Compulsory Argument dilemma If I run help I can seen things like this: ls [-f|-l|-s] NAME and [ EXPRESSION ] If [ ] means optional it should also mean optional in the case of the test alias [ .!!! 7) set help incomplete Set help should say that if no argument is set then it shows all the environment variables. 8) exported and no exported variables === Why the set does not show any difference (like a * in the beginning) about the exported and no exported variables (with the export command) 9) help does not complain when no command help is available = The commands: help marco_g help okuji help dachaac do not complain at all, and it is not a "hidden pascua egg" from these people,... any non-command has the same answer: NONE. I think there should be something like: Error: This command does not exist. Or better even: It should prompt all the commands. 10) help --all = In grub-legacy when typing help some commands were some sort of hidden. However if you typed help --all these commands were also shown. Do we need this functionality in grub2? 11) help help === Running help help says: Usage: help [PATTERN ...] Show a help message. It should say that if no argument is entered then all the commands are shown. And it should say: Show a command help described in PATTERN. (Or something like this). 12) ls and -h argument This is not an error but it curious. You can ask for the help of command with this: command -h however ls -h works in a different way. I suppose we may have the same problem with '-u' in the future. 13) videotest This is a test command and it will not be available when grub2 is out there. Isn't it ? :) Continues on grub2 miscelanea questions (2/2) adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
grub2 miscelanea questions (2/2)
Comes from grub2 miscelanea questions (1/2) 14) help linux = Usage: linux FILE [ARGS...] Load a linux kernel. I think that a message telling the user that the ARGS are arguments for the linux kernel instead of arguments for the grub's linux command would be a good idea. 15) lsmod == As long as I am unable to run a pager can anyone tell me what the three columns mean? cat 1 normal,gzio gzio6 boot1 normal 16) help play === Usage: play FILE Play a tune What is the FILE format? Is it an AIFF, an AU, a WAV, or is it an ASCII file that has tones? I should not go to the source code for knowing it. 17) play ideas == It seems a rather complicated file... is there any utility for creating it from grub2 or is it standard file that I do not know of? Maybe it should have a --loop and -l argument. So that if no key is pressed the file is played again. Another --delay -d argument can be useful for determining the delay period between one reproduction and another. 18) source, . , and configfile = If both source and '.' commands say that: Load another config file without changing context. Then the configfile command should say: Load another config file (with a new context) instead of saying: Load another config file. 19) rescue and exit failure on qemu == I think that booting from my computer does not give this error. If I boot from QEMU and type: grub> rescue and then : grub rescue> exit it says: FATAL: INT18: BOOT FAILURE 20) grub rescue help help : Types the commands and a minimal explanation: OK help any_command : Types the commands and a minimal explanation: NOT OK help not_a_command : Types the commands and a minimal explanation: NOT OK 21) grub rescue exit help === When you are in grub rescue mode and you type help the exit line it's the following one: exitexit from GRUB Should it not prompt ? exitexit from GRUB rescue 22) copyright message missing Why isn't there (when Grub is running) any message about the GRUB Copyright and the GPL license and that you should have received and this and that? Is it a memory problem? (In grub legacy there was not any message like this either) Maybe we should implement an 'about' command and run it when booting :) ? 23) set read only variables == unset prefix lets me "delete" the prefix variable. unset root does not let me the "root" variable. I remember that bash has an option to set read only variables. Maybe the root variable is a read only variable? 24) 'Command' commands == Is there any special reason why the rescue, set, unset, export, insmod, rmmod, lsmod commands are in a single file called: normal/command.c instead of being in separate files in commands/ folder ? adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: test -e patch
adrian15 <[EMAIL PROTECTED]> writes: > Attached you will find the patch adding test -e support for grub2. > > This is my first patch. I have compiled it without no errors. Urgh... I thought/hoped I told you I had a test.c rewrite sitting on my harddisk? Or did I tell Robert to poke me until next weekend so I will work on it? It includes everything you expect from test.c, expect the cleanup and testing. ;-) Do you mean you also have the '-e' option ? Please have a look at the wiki. It has quite some information about GRUB 2. Whenever possible I'll download some info from the wiki. > Should I write "Test if a file exists" instead of "test if a file > exists" or "FILE exists"? FILE FILE or FILE exists ? Or have you coded it yourself too? > How the hell should I treat grub errors. Maybe the test_file_exists has > to return a static grub_err_t and then from grub_cmd_test I should call > it like this: return (test_file_exists (args[0])) so that the error > propagates ? Right. Otherwise the error will be lost. Ok. I will try that every function propagates errors. > What are the error polices ? Returning the err_t that grub_error returns when possible. Ok. > One question. Should we put the test-e function into a separate file or > not ? No, the problem is that the design of test.c (which is just a placeholder) is wrong. It needs a proper parser for the arguments and a way to deal with this... Ok. We will wait for your code. > The question is if the user will see the -e, -f or other options when > querying the test command help or not ? They should. But I am not sure if the final version will support this. Especially because of the nested syntax of the test arguments. Do you mean the -e options support or do you mean the -e options showing at help test support ? > +static void > +test_file_exists (const char *key) Why not filename? test_filename_exists or filename ? > { > + You accidently introduced a whiteline. No whitelines after an initial {. I write down it. > + if (state[0].set) > +test_file_exists (args[0]); > + else > + { This means that this check is run for any other expression. This is quite error sensitive. In my code the only implemented option is '-e'. When there will be more I could add more nested if with the other options, or maybe better we will enjoy your improved code. adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: gcs doubt #1
> Please put a comment on each function saying what the function does, > what sorts of arguments it gets, and what the possible values of > arguments mean and are used for. > > Is it ok that the search.c and test.c (commands/ folder) do not have any > of these comments at all? The currect test.c is a dummy so the `if' expression can be used/tested. If you can provide a patch for sourcecode to improve or add comments in a sane way, I am willing to commit those patches. Just please don't make the mistake to add useless comments. An useful comment is one that: -Describes a function algorithm -Describes what a function does (as a black box) -Boot of them ? adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: GSoC: CD-ROM booting options
Do we want to be able to boot the computer from GRUB2 installed on a medium (whatever it may be), then be able to boot from a CD (in whatever mode - emulation or no emulation)? Do we also want to be able to boot the computer through the BIOS from a CD on which GRUB2 was installed and continue booting from the CD (like GRUB legacy does)? Do we want to support both? Personally, I think both are important to support, but I want to see what the majority of developers and users think we should support. Although a lot of people want you to begin with the second option and although it's a good thing for an hipothetical super grub2 disk... I want to remind you what's the okuji thought about this: === My name is Alex Roman and I have been selected as a Summer of Code > > student for the GRUB2 project. I will be adding CD-ROM booting > > functionality to GRUB2. > > Welcome! Cdrom booting funcionality for grub2 is a good piece of news. > > > The first stage of the project will attempt to use BIOS calls > > to achieve this functionality (which is, of course, dependent on the > > BIOS's capabilities, standards compliance, etc.). > > Ok. That's how it works in Grub legacy I suppose. Nope. This is a different thing. This is a new feature which is not present in GRUB Legacy. Although people often mistake this, booting a CD from GRUB is quite different from booting a GRUB installed into a CD. GRUB Legacy has the latter feature, but not the former one. GRUB 2 needs to support both cases, but I prefer to see something not present in GRUB Legacy implemented in GRUB 2 first. === But do as you want, maybe it is better to begin with the easiest task and then doing the more difficult task. adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: gcs doubt #1
If you can provide a patch for sourcecode to improve or add comments in a sane way, I am willing to commit those patches. Just please don't make the mistake to add useless comments. An useful comment is one that: -Describes a function algorithm -Describes what a function does (as a black box) -Boot of them ? Yes, but I oppose to adding obvious comments. But patches will be reviewed, so you will learn fast enough what we want :-). You had to choose one of the three options :). Well... it doesn't matter. I've understood that I have to send patches and learn by trial-error. adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: test -e patch
adrian15 <[EMAIL PROTECTED]> writes: Attached you will find the patch adding test -e support for grub2. Do you mean you also have the '-e' option ? I mean I have everything that is possible. That includes `-e', but also all other features. Ok. +static void +test_file_exists (const char *key) Why not filename? test_filename_exists or filename I mean instead of key. You are right. It was a not clean copy-paste from search command. adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: grub2 miscelanea questions (1/2)
3) Why any grub2.cfg file (I suppose it's the substitute for menu.lst) is inside the grub2 source code? What do you mean? Usually a program should include examples on how to use their files and document examples and so on... why isn't there any grub2.cfg ? 4) Why any doc folder is inside the grub2 source code? There is? We need documentation... :) I might work on this too... but as an unofficial documentation. I do not like the rigid official documentations. 5) grub2 lacks == 5.1) pager - When I want to do a big ls the output does not stop screen by screen... Is there any hidden pager that I do not know? Maybe is not implemented yet? set pager=1 It just isn't documented :-/ We should be able to prompt with help command (help variables perhaps?) these kind of tricks or pseudocommands. 5.2) Chainload DEVICES How the hell do you boot windows? Maybe from a file that has inside it the first 512 bytes from the Windows partition? chainload (hd0,1)+ boot I've checked that this works: chainloader (hd0,1)+1 boot 6) Compulsory Argument dilemma If I run help I can seen things like this: ls [-f|-l|-s] NAME and [ EXPRESSION ] Yes? If [ ] means optional it should also mean optional in the case of the test alias [ .!!! What do you mean? The [] has not a single meaning in this program. If it's written after a command in the help description it means: Optional. If it's used as a program it means that it runs the test command. It might be confusing for some users I suppose. Why did not use to new bash syntax? $((variable)) 7) set help incomplete Set help should say that if no argument is set then it shows all the environment variables. Why would it? Only using set shows all env. variables. Because it is a hidden feature. If you do not how grub does work and type "help set" it shows "Set an environment variable". The user is unable to know that "Only using set shows all env. variables" because it isn't written anywhere. 9) help does not complain when no command help is available = How it currently works is looking at the first characters. For example try "help l". I know... but if the first characters do not match with any command beginning I think an error should be prompted. Don't you think so? 10) help --all = Do we need this functionality in grub2? Are there hidden commands for which this is important? In that case, yes. The hipotetical dd command. :) 12) ls and -h argument This is not an error but it curious. You can ask for the help of command with this: command -h however ls -h works in a different way. I suppose we may have the same problem with '-u' in the future. Ehm, I am not sure. You mean `-h' is short for help and we should remove it? I mean that if an user gets used to use the "-h" option for getting grub commands help then when using ls, he will be confused a little. adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: grub2 miscelanea questions (2/2)
19) rescue and exit failure on qemu == I think that booting from my computer does not give this error. If I boot from QEMU and type: grub> rescue and then : grub rescue> exit it says: FATAL: INT18: BOOT FAILURE Weird. Can you debug this? I've checked this again. If I do this booting from my pc I get the grub2 floppy booting again. If I do this from qemu the FATAL: INT18: BOOT FAILURE appears again. I would bet that it is a qemu bios's lack of the 18 interruption. 20) grub rescue help help : Types the commands and a minimal explanation: OK help any_command : Types the commands and a minimal explanation: NOT OK help not_a_command : Types the commands and a minimal explanation: NOT OK huh? You boot grub2 and you see grub> you type rescue and you see grub rescue> and now what it is funny that if you type the help command, an space, and whatever you want to write it always shows all the commands help. It may confuse some users as "Grub is not working". 21) grub rescue exit help === When you are in grub rescue mode and you type help the exit line it's the following one: exitexit from GRUB Should it not prompt ? exitexit from GRUB rescue The exit command terminates GRUB and continues the boot process, IIRC. You are right. Exit from GRUB is right, then. 22) copyright message missing Why isn't there (when Grub is running) any message about the GRUB Copyright and the GPL license and that you should have received and this and that? Why should there be such message? This comes from GPL 2: If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. Maybe we should implement an 'about' command and run it when booting :) ? Perhaps, but I don't see the added value. See above about the GPL. 23) set read only variables == unset prefix lets me "delete" the prefix variable. unset root does not let me the "root" variable. I remember that bash has an option to set read only variables. Maybe the root variable is a read only variable? You can easily modify the code. But I do not like making such variables read-only. I did not want to make any variable read only. I only wanted to make you know that the "root" variable was actually a read only variable because there is no way to delete (unset) it. It always comes to live again. Is it a normal thing? adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Grub Loading Linux? kernel
When you boot Grub... it prompts something like: Grub loading kernel then you see: Welcome to GRUB. and then you see the prompt. Let's see an irc conversation of the future. noob> Hey My Grub loads the linux kernel but then nothing happens. master> noob, if Grub loads the linux kernel then if it does not boot it's usually a linux kernel problem not a grub one. noob> What should I do then? master> Go to #linux channel and ask there please. The problem here is that user has seen in the screen: Grub loading kernel and he has thought that Grub was loading actually his linux kernel what it isn't true at all. So... why don't we prompt something like: Grub loading... or Grub loading itself ? adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
map command for grub2 draft
I want to implement the map command for grub2 as long as it is an interesting thing for stupid windows oses and because it's the clue for making an "usbshift" equivalent command (See Super Grub Disk usbshift command for more details). 1st) Where to save an array? = If I mimic the grub legacy map command I need to save an array with the map definitions. static unsigned short bios_drive_map[DRIVE_MAP_SIZE + 1]; So that each time I call something like: map (hd0) (hd1) it modifies this vector. Any example on where should I define this vector so that I can use it from each command ? 2nd) boot_func and actual mapping If you look at grub legacy boot command case KERNEL_TYPE_CHAINLOADER: /* Chainloader */ /* Check if we should set the int13 handler. */ if (bios_drive_map[0] != 0) { int i; /* Search for SAVED_DRIVE. */ for (i = 0; i < DRIVE_MAP_SIZE; i++) { if (! bios_drive_map[i]) break; else if ((bios_drive_map[i] & 0xFF) == saved_drive) { /* Exchage SAVED_DRIVE with the mapped drive. */ saved_drive = (bios_drive_map[i] >> 8) & 0xFF; break; } } /* Set the handler. This is somewhat dangerous. */ set_int13_handler (bios_drive_map); } gateA20 (0); boot_drive = saved_drive; chain_stage1 (0, BOOTSEC_LOCATION, boot_part_addr); break; you will see that among other things it detects if you want to do a chainloader boot. If you do a chainloader boot it checks the bios_drive_map array,... run some BIOS calls so that there's an actual map and then it finally boots. When I told marco_g that I want to modificy grub2's boot command he became scared because the boot command was arquitecture specific (or maybe not, I actually did not understood what he meant) and as long as I understood I was not meant to modify it. how should I implement this then? adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
grub2 miscelanea questions #2
1) search command file not found: = If you search for an inexistant file like: search -f /boot/grub/und-video it complains: error: no such device Shouldn't it be: error: no such file /boot/grub/und-video I mean it has to talk about files not devices and it has also to prompt the file you have searched for... or maybe not, I do not know. I ask marco_g if I am going to be able to use this command inside an if statement. if `search -f /boot/grub/grub2.cfg` then 2) chainload a device It seems that if I run: chainloader (hd0)+1 boot It boots my hard disk installed bootloader. However chainloader help only prompts: chainloader [-f] FILE I think the help should be: chainloader [-f] FILE|DEVICE 3) DEVICE vs DEVICENAME If you check the loopback command help you will see that you can use a DEVICENAME as an argument. Should we choose DEVICE or DEVICENAME when talking about a DEVICE ? 4) About linux command I do not like the linux command too much. What happens with bsd and other kernels that are not multiboot? why don't we have something as: kernel --type linux whatever kernel --type bsd whateverelse ? Or maybe is better to have a bsd command or bsd will become at last a multiboot os? 5) windows command === Can we add a windows command that does: chainloader (hd0,0)+1 boot A question for marco_g... which it is the best way so that a command can call other commands? Using grub_cmd_name where name is the name of the command or can I write a grub.cfg file on the fly and then send it to some cfg interpreter function? 6) boot command boots also boot loaders = If we can use chainloader for preparing to boot another boot loader... then boot help should read: Boot an operating system or another boot loader. instead of: Boot an operating system. adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: grub-mkrescue: Make GRUB rescue image
Robert Millan escribió: I'm attaching a small utility to generate a floppy or cdrom (based on floppy emulation) rescue image, that takes all the hassle of generating the image and doesn't need root permissions. If nobody objects, I'd like to put this in CVS. The rescue disk can recover a grub2 installation with something similar to the grub legacys' root and setup commands ? Or is it a disk that where you only see grub rescue > ? adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: pager (Re: grub2 miscelanea questions (1/2))
Marco Gerards escribió: set pager=1 How about setting it to 0 by default, so it shows up when you list the variables. Currently it just doesn't exist. That's a good idea. Where is the place (file) for setting default variables values? adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: Grub Loading Linux? kernel
Robert Millan escribió: OTOH, if you replace: "GRUB loading kernel" with: "Loading GRUB kernel" Maybe this archieves to resolve both concerns? I vote for it. I think I might do a miscelanea patch with all these little details that I've been finding in the last two days. adrian15 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
help, configfile, pager and
Here is a patch for some of the problems that I found in my miscelanea mails. More to come. :) adrian15 diff -urN grub2_2007_05_31_original/ChangeLog grub2_2007_05_31_small_fixes/ChangeLog --- grub2_2007_05_31_original/ChangeLog 2007-05-20 11:10:05.0 +0200 +++ grub2_2007_05_31_small_fixes/ChangeLog 2007-06-10 18:48:40.0 +0200 @@ -1,3 +1,10 @@ +2007-06-21 adrian15 <[EMAIL PROTECTED]> + * kern/main.c: Pager variable is now set to 0 by default. + * commands/help.c: Help command help shows that with no pattern + all the commands are shown. + * commands/configfile.c: Configfile command help tells the user that + that it runs the config file with another context. + 2007-05-20 Robert Millan <[EMAIL PROTECTED]> * util/update-grub_lib.in: New file. diff -urN grub2_2007_05_31_original/commands/configfile.c grub2_2007_05_31_small_fixes/commands/configfile.c --- grub2_2007_05_31_original/commands/configfile.c 2006-06-04 17:56:54.0 +0200 +++ grub2_2007_05_31_small_fixes/commands/configfile.c 2007-06-10 18:36:19.0 +0200 @@ -60,7 +60,7 @@ (void) mod; /* To stop warning. */ grub_register_command ("configfile", grub_cmd_configfile, GRUB_COMMAND_FLAG_BOTH, "configfile FILE", -"Load another config file.", 0); +"Load another config file with a new context.", 0); grub_register_command ("source", grub_cmd_source, GRUB_COMMAND_FLAG_BOTH, "source FILE", "Load another config file without changing context.", diff -urN grub2_2007_05_31_original/commands/help.c grub2_2007_05_31_small_fixes/commands/help.c --- grub2_2007_05_31_original/commands/help.c 2005-11-13 16:47:08.0 +0100 +++ grub2_2007_05_31_small_fixes/commands/help.c2007-06-10 18:20:03.0 +0200 @@ -98,7 +98,7 @@ { (void)mod; /* To stop warning. */ grub_register_command ("help", grub_cmd_help, GRUB_COMMAND_FLAG_CMDLINE, -"help [PATTERN ...]", "Show a help message.", 0); +"help [PATTERN ...]", "Show a command help. No pattern shows all available commands.", 0); } GRUB_MOD_FINI(help) diff -urN grub2_2007_05_31_original/kern/main.c grub2_2007_05_31_small_fixes/kern/main.c --- grub2_2007_05_31_original/kern/main.c 2006-04-25 22:08:31.0 +0200 +++ grub2_2007_05_31_small_fixes/kern/main.c2007-06-10 18:12:53.0 +0200 @@ -127,6 +127,9 @@ grub_machine_set_prefix (); grub_set_root_dev (); + /* Set pager and other unimportant variables */ + grub_env_set ("pager", "0"); + /* Load the normal mode module. */ grub_load_normal_mode (); diff -urN grub2_2007_05_31_original/ChangeLog grub2_2007_05_31_small_fixes/ChangeLog --- grub2_2007_05_31_original/ChangeLog 2007-05-20 11:10:05.0 +0200 +++ grub2_2007_05_31_small_fixes/ChangeLog 2007-06-10 18:48:40.0 +0200 @@ -1,3 +1,10 @@ +2007-06-21 adrian15 <[EMAIL PROTECTED]> + * kern/main.c: Pager variable is now set to 0 by default. + * commands/help.c: Help command help shows that with no pattern + all the commands are shown. + * commands/configfile.c: Configfile command help tells the user that + that it runs the config file with another context. + 2007-05-20 Robert Millan <[EMAIL PROTECTED]> * util/update-grub_lib.in: New file. diff -urN grub2_2007_05_31_original/commands/configfile.c grub2_2007_05_31_small_fixes/commands/configfile.c --- grub2_2007_05_31_original/commands/configfile.c 2006-06-04 17:56:54.0 +0200 +++ grub2_2007_05_31_small_fixes/commands/configfile.c 2007-06-10 18:36:19.0 +0200 @@ -60,7 +60,7 @@ (void) mod; /* To stop warning. */ grub_register_command ("configfile", grub_cmd_configfile, GRUB_COMMAND_FLAG_BOTH, "configfile FILE", -"Load another config file.", 0); +"Load another config file with a new context.", 0); grub_register_command ("source", grub_cmd_source, GRUB_COMMAND_FLAG_BOTH, "source FILE", "Load another config file without changing context.", diff -urN grub2_2007_05_31_original/commands/help.c grub2_2007_05_31_small_fixes/commands/help.c --- grub2_2007_05_31_original/commands/help.c 2005-11-13 16:47:08.0 +0100 +++ grub2_2007_05_31_small_fixes/commands/help.c 2007-06-10 18:20:03.0 +0200 @@ -98,7 +98,7 @@ { (void)mod; /* To stop warning. */ grub_register_command ("help", grub_cmd_help, GRUB_COMMAND_FLAG_CMDLINE, - "help [PATTERN ...]", "Show a help message.
Re: map command for grub2 draft
adrian15 escribió: 1st) Where to save an array? = If I mimic the grub legacy map command I need to save an array with the map definitions. static unsigned short bios_drive_map[DRIVE_MAP_SIZE + 1]; So that each time I call something like: map (hd0) (hd1) it modifies this vector. Any example on where should I define this vector so that I can use it from each command ? I ask the question again. I've begun to implement commands/i386/pc/map.c (I suppose the map.c is pc specific althought I am not sure). The question is how do I get the bios number for a given hard disk? Thank you. You know hd0 is usually 0x80, that's the number that I want. Here is the source code written so far which I have not compiled. adrian15 static grub_err_t grub_cmd_map (struct grub_arg_list *state __attribute__ ((unused)), int argc, char **args) { grub_disk_t map_disk_1,map_disk_2; if (argc != 2) return grub_error (GRUB_ERR_BAD_ARGUMENT, "Two devices required"); map_disk_1 = grub_disk_open (args[0]); if (! map_disk_1) return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Unknown 1st disk"); map_disk_2 = grub_disk_open (args[1]); if (! map_disk_2) return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Unknown 2nd disk"); /* How do I get the BIOS number for a given disk */ ___ 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