LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   GRUB2 scripts to use labels for friendly names (https://www.linuxquestions.org/questions/linux-newbie-8/grub2-scripts-to-use-labels-for-friendly-names-4175537114/)

actmnophn 03-18-2015 06:55 AM

GRUB2 scripts to use labels for friendly names
 
I am using linux mint and the grub menu gets configured automatically using scripts in /etc/grub.d. The menuentry that gets created is something like
Code:

"linux mint (on /dev/sda1)"
. I use external drives sometimes and also have linux on my harddrive which I also switch between computers. It gets confusing when it says /dev/sda2 when it means something else. It boots fine because that actual boot command uses uuid. How can I change the text of the (script generated) description to also use partition labels or uuid (or the first few chars) just so I know which install will actually boot. like this:
Code:

"Linux Mint (OFFICESSD)"
"Linux Mint (HOMEHDD)"
"Ubuntu (SANDISK)"
"Ubuntu (IMATION)"

I realise (maybe its the best way) I can change the "GRUB_TITLE=Linux Mint 17 Cinnamon 64-bit" in /etc/linuxmint/info but would rather a smoother way.

actmnophn 03-18-2015 08:28 AM

Would this be considered acceptable:
Code:

onstr="$(gettext_printf "(on s) [%s]" "${DEVICE}" "${UUID}")"
to replace
Code:

onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
in os-prober script. it would only work for other than running linux.


All times are GMT -5. The time now is 11:26 PM.