Re: default is static
From: Mike Meyer <[EMAIL PROTECTED]> Subject: Re: default is static Date: Mon, 7 Aug 2000 09:14:55 -0500 (CDT) > Given that you've just told me where, I'll look into finding out how > (any pointers would be greatly appreciated). If someone has another > suggestion for where, I'd like to hear that as well. First of all, read the Programmer Reference Manual in the document. Not all of the parts are up-to-date, but it should still be useful to start hacking GRUB. Next, once you have understood the boot sequence of GRUB, see "stage2/asm.S" and "stage2/start.S". The latter knows where the *second* sector of stage2 resides on a disk, while the former can store some information at predefined locations. Finally, read "stage2/builtins.c" carefully. All of the GRUB commands are written in the file. Especially, take a look at "install_func" and "embed_func". You should be able to get some hints from those commands. Of course, you should read other parts of GRUB, if possible. > The argument to "default" should be changed from "active", and a new > command to save the active entry as the default. Say "savedefault" and > "default saved"? That sounds nice to me. Okuji
Re: default is static
OKUJI Yoshinori writes: > From: Mike Meyer <[EMAIL PROTECTED]> > Subject: default is static > Date: Wed, 2 Aug 2000 17:46:50 -0500 (CDT) > > The attached patch makes default look for "active" as an argument, and > > sets the default to the number of the active partition. While this is > > very much a hack, it means the BootEasy behavior can be simulate with > > enough work - at least for my purposes. > I don't think your approach is right. It makes the flexibility of > GRUB worse, since partition numbers should be independent of GRUB's > boot entries. Instead, GRUB should save which entry was selected in > somewhere else (possibly the second sector of Stage 2). I'm aware of that problem - that's just one of the reasons I said it was very much a hack. Storing the actual entry number somewhere would be a much better solution - but I have no idea where/how (I'd only been using GRUB for about 2 days at the time). Given that you've just told me where, I'll look into finding out how (any pointers would be greatly appreciated). If someone has another suggestion for where, I'd like to hear that as well. The argument to "default" should be changed from "active", and a new command to save the active entry as the default. Say "savedefault" and "default saved"? Thanx,
Re: default is static
From: Mike Meyer <[EMAIL PROTECTED]> Subject: default is static Date: Wed, 2 Aug 2000 17:46:50 -0500 (CDT) > The attached patch makes default look for "active" as an argument, and > sets the default to the number of the active partition. While this is > very much a hack, it means the BootEasy behavior can be simulate with > enough work - at least for my purposes. I don't think your approach is right. It makes the flexibility of GRUB worse, since partition numbers should be independent of GRUB's boot entries. Instead, GRUB should save which entry was selected in somewhere else (possibly the second sector of Stage 2). Okuji
default is static
About the only behavior of BootEasy that I liked was that booting a partition made it the default partition for the next boot. GRUB is much nicer in all other ways, so I figured I'd take a crack at fixing this. The attached patch makes default look for "active" as an argument, and sets the default to the number of the active partition. While this is very much a hack, it means the BootEasy behavior can be simulate with enough work - at least for my purposes. For a GRUB boot entry to change itself to the default, it's entry number must be the same as it's partition number on the boot drive, and it must set itself as active. It's not clear that this can be made sane for systems that boot off multiple disks (not to imply that the current behavior is sane), but it's a start in the direction of providing this functionality. Thanx,
