So I can go into /etc/default/grub and change the distribution name and then run update-grub, but that only changes the name of the operating system in a that particular grub menu. The name picked up by OS prober from another installation continues to use the same name. Is there any way to change the name of the OS picked up by OS-prober?
Announcement
Collapse
No announcement yet.
Changing OS name picked up by OS prober
Collapse
This topic is closed.
X
X
-
The short answer is "no." The issue is grub on Kubuntu has no real way to determine what is on any other partition as it is configured now.
You could sort of "cheat" your way into what you want. The place to start is /etc/grub.d/30_osprober. There's a way to change the names used by 30_so-prober. For example, this part:
Code:for OS in ${OSPROBED} ; do DEVICE="`echo ${OS} | cut -d ':' -f 1`" LONGNAME="`echo ${OS} | cut -d ':' -f 2 | tr '^' ' '`" LABEL="`echo ${OS} | cut -d ':' -f 3 | tr '^' ' '`" BOOT="`echo ${OS} | cut -d ':' -f 4`" if [ -z "${LONGNAME}" ] ; then LONGNAME="${LABEL}" fi
Code:menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' $CLASS --class os \$menuentry_id_option 'osprober-chain-$(grub_get_device_id "${DEVICE}")' {
Code:menuentry '$(echo "${LABEL} $onstr" | grub_quote)' $CLASS --class os \$menuentry_id_option 'osprober-chain-$(grub_get_device_id "${DEVICE}")' {
- Top
- Bottom
-
Two approaches.
Firstly, the file /etc/lsb-release might look like:Code:DISTRIB_ID=Ubuntu DISTRIB_RELEASE=13.10 DISTRIB_CODENAME=saucy DISTRIB_DESCRIPTION="Ubuntu 13.10"
Secondly.
At the top of /boot/grub/grub.cfg, there is the legend:Code:# DO NOT EDIT THIS FILE # # It is automatically generated by grub-mkconfig using templates # from /etc/grub.d and settings from /etc/default/grub
Originally posted by https://www.gnu.org/software/grub/manual/grub/grub.html#Configurationthose who feel that it would be easier to write grub.cfg directly are encouraged to do so
However, I suggest that a halfway approach may be right for you. That would be to write a script, maybe with sed commands, that changes the menu items to what you want. And whenever update-grub is run, either by yourself or as a result of an update, re-run your script to update grub.cfg. For example, I have an old drive with an install of 15.10 on it, and the menu entry generated for it beginsmenuentry 'Ubuntu 14.10 (14.10) (on /dev/sdb6)' --class ubuntu...
Code:sed -i.bak -e "s/^menuentry 'Ubuntu 14\.10[^']*'/menuentry 'Kubuntu Utopic'/" /boot/grub/grub.cfg
Regards, John Little
- Top
- Bottom
Comment
-
Originally posted by jlittle View PostFirstly, the file /etc/lsb-release
So all I need to do is install,
sudo nano /etc/default/grub
sudo nano /etc/lsb-release
Job done!
If the grub is not on my default os, I can just re-install at anytime. I wish I'd had this info years ago, it would have saved a lot of trouble. Only a few days ago I accidentally overwrote my Tumbleweed install. Not the end of the world but still irritating and avoidable. I might write this up and put it on my website at some point.
- Top
- Bottom
Comment
Comment