Announcement

Collapse
No announcement yet.

[SOLVED] have to manually tweak Grub.cfg after each update

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [SOLVED] have to manually tweak Grub.cfg after each update

    Hi,
    I made a search in the forum, but have not found anything answering my question.

    I have 4 systems on the HDD: WinXP, Ubuntu, Kubuntu and PuppyLinux.
    Grub2 is controlled by Kubuntu. I manually tweak grub.cfg to re-sort items there, decrease waiting time.
    After each serious update of Kubuntu (where new kernel gets installed), grub.cfg file get re-written. I have to do sorting exercise again.
    Also, Puppy is never found by update-grub, so I need to add record into grub.cfg manually. This step is rather annoying.
    Question: is there any way to keep records and order of them in grub.cfg during update? Or add new records to the top/bottom of grub.cfg, so I can re-arrange them later?
    http://linuxblog.darkduck.com

    #2
    Re: have to manually tweak Grub.cfg after each update

    In Grub2 you don't edit the grub.cfg file directly. This file is automatically created by the settings in the the /etc/default/grub and in the files in etc/grub.d when sudo update-grub is run. See this post for more info.
    http://kubuntuforums.net/forums/inde...opic=3106368.0

    Comment


      #3
      Re: have to manually tweak Grub.cfg after each update

      you shouldn't edit grub.cfg directly, you would probably want to read this:

      https://help.ubuntu.com/community/Grub2
      basically, you edit things in /etc/default/grub (various bootup options) and /etc/grub.d (custom boot entries)

      there are a variety of files that can be edited to do different things. I don't see how to customize the OS listing order, but if you can add the puppy entry to the
      /etc/grub.d/40_custom
      and it will added each time you run update-grub, or install an updated kernel.

      The only way I know to reduce the number of Ubuntu kernel entries is to uninstall any unused ones.

      BUT
      I just found this
      https://help.ubuntu.com/community/StartUpManager
      which can graphically do some tasks for you (but not all). I do not see an easy way to customize the actual order of the OS's in the grub window without disabling the os-prober and having 100% custom grub entries added to the 40_custom file

      Comment


        #4
        Re: have to manually tweak Grub.cfg after each update

        Originally posted by claydoh
        I do not see an easy way to customize the actual order of the OS's in the grub window without disabling the os-prober and having 100% custom grub entries added to the 40_custom file
        I read link in Detonate's post. Understand that I can manually add Puppy via 40_custom file. Looks OK for me.

        I also understand I cannot re-arrange the order of systems in grub.
        What I actually need is automatic booting of WinXP during system startup, unless I manually choose Linux system in grub menu. I do this now by setting WinXP as first in the list, then SET_DEFAULT = 0.
        As soon as update_grub changes grub.cfg, WinXP gets moved to the bottom of the list (os_prober section), and Kubuntu comes as first system -> boots automatically.
        Is there any sensible way to get this sorted?
        http://linuxblog.darkduck.com

        Comment


          #5
          Re: have to manually tweak Grub.cfg after each update

          yes, you can
          https://help.ubuntu.com/community/Gr...b%20%28file%29
          GRUB_DEFAULT=3 <<--- change this number to whatever entry you wish , the first being 0
          or
          GRUB_DEFAULT="windows os entry" <<--whatever the exact title is listed for windows (with the quotes)
          You can set this using StartupManager as well

          Comment


            #6
            Re: have to manually tweak Grub.cfg after each update

            StartupManager is a handy dandy little program.

            Comment


              #7
              Re: have to manually tweak Grub.cfg after each update

              Originally posted by darkduck
              I also understand I cannot re-arrange the order of systems in grub.
              Well...you can if you change the order of the scripts in /etc/grub.d, the scripts are run in numerical order when generating grub.cfg.

              claydoh's suggestion is usually better, though.

              Comment


                #8
                Re: have to manually tweak Grub.cfg after each update

                Claydoh, thanks for you GRUB_DEFAULT="Windows name" idea. It works!
                I also tried StartupManager. Not sure it is useful though... There is not much you can do actually with it.
                I also copied os-prober from 30 to 06, and added Puppy into 40.
                I now get all the systems I want, and in order I want. WinXP comes first with all Linuxes follow.

                Another point, which I absolutely forgot first time. As I said, I have both Ubuntu and Kubuntu. GRUB recognizes all of them as Ubuntu. So, I can only guess by partition ID which system is actually meant there. Is there any way to automatically name Kubuntu as Kubuntu and Ubuntu as Ubuntu?
                http://linuxblog.darkduck.com

                Comment


                  #9
                  Re: have to manually tweak Grub.cfg after each update

                  Originally posted by darkduck
                  Is there any way to automatically name Kubuntu as Kubuntu and Ubuntu as Ubuntu?
                  Automatically? No. All the *buntus are running on the same kernel - Ubuntu. Kubuntu just denotes the DE (Desktop Environment) being used - KDE.

                  One has to modify the Grub2 user config files.
                  Using Kubuntu Linux since March 23, 2007
                  "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                  Comment


                    #10
                    Re: have to manually tweak Grub.cfg after each update

                    Originally posted by Snowhog
                    One has to modify the Grub2 user config files.
                    Does it mean "edit the grub.cfg file directly"?
                    http://linuxblog.darkduck.com

                    Comment


                      #11
                      Re: have to manually tweak Grub.cfg after each update

                      No. The 'user' configuration files for Grub2. The ones in /etc/grub.d/ that kubicle already mentioned.
                      Using Kubuntu Linux since March 23, 2007
                      "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                      Comment


                        #12
                        Re: have to manually tweak Grub.cfg after each update

                        Ok, got it.
                        Did not find how to rename Ubuntu into Kubuntu, but made it another way...
                        In 10_linux changed into
                        title="$(gettext_quoted "%s, KDE with Linux %s")"
                        from
                        title="$(gettext_quoted "%s, with Linux %s")"
                        No such change in 30_os-prober.
                        That's enough for me. Now I can see where Kubuntu is.
                        http://linuxblog.darkduck.com

                        Comment


                          #13
                          Re: [SOLVED] have to manually tweak Grub.cfg after each update

                          Oh the ways of Linux!
                          Using Kubuntu Linux since March 23, 2007
                          "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                          Comment


                            #14
                            Re: [SOLVED] have to manually tweak Grub.cfg after each update

                            Researching something from a similar thread, I discovered the name given in the grub menu comes from /etc/lsb-release. Editing this file does indeed change the output of grub-update.

                            However, it also changes the menuentry in grub.cfg --class= to kubuntu also.

                            I cannot find any documentation as to what this variable does.

                            Please Read Me

                            Comment

                            Working...
                            X