help-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding configfile entry to grub.cfg


From: Arbiel (gmx)
Subject: Re: Adding configfile entry to grub.cfg
Date: Mon, 14 Sep 2015 12:34:57 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0

Hi

Yes, you can add entries into your grub.cfg on the SSD.

The lines to add should read something like

menuentry 'boot from my USB key' {
configfile (usb0,msdos1)/boot/grub2/grub.cfg
}



1) 40_custom
This way, you also have to update grub

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply
type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

2) 41_custom
If your grub.cfg file already contains these lines

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

you only have to record the lines into the /boot/grub2/custom.cfg file.

Arbiel

Le 14/09/2015 09:18, Kevin Wilson a écrit :
> Hi,
> I have an embedded device which uses grub successfully from SSD.
> It works fine.
> Now, there are times when I need to install an image on that machine
> from a USB diskOnKey.
> I do it by
> Pressing "C" when the device boots, which leads me to the grub command line.
> >From there , in order to boot from USB, I type the following:
>
> configfile (usb0,msdos1)/boot/grub2/grub.cfg
>
> And then I press enter.
>
> I use this procedure quite frequently.
> Is there a way in which I can add an entry to the grub.cfg on the SSD,
> so that selecting it and pressing enter will cause the device to boot
> from the USB diskOnKey  so I will achieve the same as typing it
> manually and booting from the DiskOnKey ?
>
> Regards,
> Kevin
>
> _______________________________________________
> Help-grub mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/help-grub
>


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]