[Techtalk] Grub2 entry for booting into shell

Rudy Zijlstra rudy at grumpydevil.homelinux.org
Sun Feb 14 10:53:18 UTC 2016


Disclaimer: i used to be able to do this with Grub1. But never yet 
figured out how to do with grub2....

Op 14-02-16 om 11:31 schreef James Sutherland:
> On 14/02/2016 05:04, Gwen Morse wrote:
>> On Fri, Feb 12, 2016 at 5:21 AM, A. Mani <a.mani.cms at gmail.com> wrote:
>>
>>> On Wed, Feb 10, 2016 at 5:19 PM, Gwen Morse <gwen.morse at gmail.com> 
>>> wrote:
>>>> I'd like to create a GRUB2 menu option to allow me to boot into the 
>>>> shell
>>>> from the GRUB menu.
>>>
>>>
>>> You need to edit files in /etc/grub.d and generate the required
>>> configuration.
>>>
>>> RTFM
>>
>> This is the linuxchix techtalk list, isn't it? Did the list change, 
>> has it
>> stopped being a cooperative environment for women to ask Linux questions
>> without being brushed off with a "RTFM" response?
>>
>> Should I ask on the newchix list instead?
>>
>> PS - I have edited my files in /etc/grub.d and I am trying to 
>> generate the
>> required configuration but I'm failing. That's why I'm asking for
>> assistance.
>
> RTFM is indeed an unhelpful answer there! Presumably, if it were 
> actually explained in the FM, there'd be no need to ask here...
>
> The root problem is that the script you have at the moment just copies 
> itself minus the first few lines - leaving any variables as-is. I 
> *think* the answer is to replace that logic with a "heredoc", which 
> will interpret the variables as you want:
>
> cat <<EOF
> (text from the previous script goes here, including any $var bits)
> EOF
>
> You should be able to run the grub.d script itself on the command 
> line, by the way, and see exactly what it prints out. That might save 
> a bit of time re-building the config to get it the way you need.
>
Assuming here we are talking grub2. With Grub1 you could edit a specific 
file (forget which one) and at boot it would read and interpret that 
correctly. With grub2 you are not supposed to edit directly but to 
supply in the information in sub-files which grub-install then handles 
and combines in the right way. This is pretty vague as i would need to 
do a lot of investigation to understand how grub2 handles its config 
files... Would probably need to use a VM for that to experiment and 
learn by experimentation.



More information about the Techtalk mailing list