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

Re: How to change menu entries in grub?



The grub-legacy (grub1) bootloader was referred to simply as 'grub' up until version 5.0~a7-1 released in mid-2015, though some references to the old name actually have survived until I personally fixed them the other day.

It's not a very good idea to re-use an old saved config from years ago. You should throw it away and generate a new one.

Note that as explained in the `live-manual` you can create an `auto/config` file to hold a set of `lb config` options, which gets run automatically upon simply running `lb config`, thus that way you can keep a saved copy of your preferred options, while allowing a fresh saved config to be generated.

You'll still need to delete the old config before generating a new one (there's some very basic issues with config handling that I'm personally working on addressing currently so things should improve in future).

Note that the current versions even lack a lot of simple config validation checks, which will be much better in the next version, with some improvements I've already completed.

So:

If you already happen to have an `auto/config` file:
1. Take a look at the `lb config` man page (`man lb config`) and update it accordingly.
2. Delete your existing saved config files (easiest way is to just `rm -rf config` if you've not got any other customisations in there).
3. Run `lb config` to regenerate.
4. Build (`lb build`).

If you do **not** already have an `auto/config` file:
1. Take a look at the `lb config` man page (`man lb config`) to determine what options you want to now use.
2. Take a look through your existing saved config files if necessary to remind yourself what options you may have used last time (ignore the "defaults" data in it, it's misleading and is removed in future versions).
3. Delete your existing saved config files (easiest way is to just `rm -rf config` if you've not got any other customisations in there).
4. Either directly run `lb config` with your selected set of options to generate a new "saved config" which the build process will read, or save them into an `auto/config` file as instructed in `live-manual` and just run `lb config`. Beware running `lb config` multiple times without deleting the existing saved files inbetween, there's a "stale data" issue in doing so that could potentially cause problems.
5. Build (`lb build`).

Of course now switching to grub2, before building you'll want to replace the default splash (bootloader background image) per the instructions I previously gave.

Note however, actual grub2 use is currently broken. The default, for ISOs at least, is currently syslinux+grub-efi which works fine, where syslinux (isolinux) is used for BIOS systems and grub2 is used for EFI systems. If you try to use grub-pc (grub2) instead of syslinux, you'll find that it won't boot. I've personally fixed this for the next version.

(you'll want to replace the splash in any case).

Regards,
Lyndon

On Sat, 2020-05-02 at 22:58 +0530, Harshad Joshi wrote:
I have not defined grub legacy in either my packages or current live build, but I do understand that the grub setting i did way back in 2014 is now probably unmaintained or called as grub-legacy in 2020

I want the settings for current grub2 package that is currently being used in live CD installer 

--sent from OnePlus device--

On Sat, 2 May, 2020, 10:30 PM , <jnqnfe@gmail.com> wrote:
Ah, you speak of "boot/grub/menu.list", which is the configuration file for grub-legacy. I presumed that you meant grub2 (grub-pc|grub-efi).

The grub-legacy support is largely unmaintained, and their is no **config option** for replacing the "Debian" text in the grub-legacy menus. That's not to say it's impossible though, it **is** possible.

Since this is just text in text based files, you can easily enough construct a "hook" that you can place in your config to make the necessary modification to the binary contents before it is finally wrapped up as an ISO/IMG/whatever.

So:
1. You create a small "hook" script in your config directory which does text replacement on the binary/boot/grub/menu.list file.
2. You execute the build.

What happens:
1. When the build reaches the grub-legacy setup stage, it writes the config with "Debian" strings.
2. A little later the binary hooks stage is reached, and your hook gets run, which modifies that file to replace those strings as you desire.
3. After this the stage for wrapping things up as an ISO or whatever is reached, completing your image.

You should find instructions for writing hooks in the `live-manual`.

Alternatively, stop using grub-legacy.

Regards,
Lyndon

On Sat, 2020-05-02 at 21:52 +0530, Harshad Joshi wrote:
No it is not about the graphics that are displayed on grub menu. I have my own kernel and set of binaries that don't have debian license so calling my live+install CD as debian os would be wrong. 

Hence I want to rename the debian entry in grub as something else. I had previously done this by editing /boot/grub/menu.lst in 2013-14 but now a lot has changed underneath both the debian live wrapper and grub itself. 

So please assist me in making those required changes that will reflect my os name after live CD installation on hdd. 

--sent from OnePlus device--

On Sat, 2 May, 2020, 5:10 AM , <jnqnfe@gmail.com> wrote:
I presume that what you really mean is the text at the top of the screen in the bootloader? Like "Debian GNU/Linux 10 (buster)".

If that's what you mean, it's a part of the background image (splash), automatically generated from an SVG, with the text hard coded into live-build.

At the current time the only solution available to you, besides hacking live-build, is to use a custom bootloader splash, which involves:
1. making a "bootloaders" directory within your config.
2. copying the folders for the bootloaders you're using from /usr/share/live/build/bootloaders into it.
3. replacing the splash.
4. doing a build of course.

Note that you can throw away the SVG file in your syslinux (isolinux|syslinux|extlinuz|pxelinux) folder and replace with a PNG instead. grub only takes a PNG.

Note that grub (default used for EFI) has a wierd thing in its config where it actually uses the syslinux (default used for BIOS) splash if present instead of the one in its folder, but you're probably going to replace both anyway... This was probably added because only the syslinux code has the code for converting an SVG splash.

Expect this to improve in future.
1. In the next version of live-build (being worked on) the bootloader files in your config are merged with the default ones, so you only need a copy of the files you want to replace (splash).
2. Some work has been done to remove some old derivative distro hacks mess, and more is to be done, including ensuring that a proper mechanism exists for users to override strings like the one you refer to.

I personally introduced change #1 (completed) and I personally am intending to take care of change #2 in the near future (it's on my todo list [1]).


Regards,
Lyndon

Help support my work
---------------------
Please consider supporting my work. My links are below.
(please also consider the team's work reviewing my work)


On Mon, 2020-04-27 at 12:06 +0530, Harshad Joshi wrote:
My CD contains non debian components and hence I want to change its name from debian to something else. 

Currently live installer shows menuentry as debian. 

Current grub2 settings don't have any settings for same. 

--sent from OnePlus device--

Reply to: