Page 2 of 16 FirstFirst 123412 ... LastLast
Results 11 to 20 of 156

Thread: How to: Create a Customized GRUB2 Screen that is Maintenance Free.

  1. #11
    Join Date
    Aug 2009
    Beans
    2,898
    Distro
    Ubuntu Development Release

    Re: How to: Create a Customized GRUB2 Screen that is Maintenance Free.

    Quote Originally Posted by SkulblakaSama View Post
    One more question, are the numbers the same? This is what I have;

    echo "Adding Ubuntu Lucid Lynx 10.04" >&2
    cat << EOF
    menuentry "Ubuntu Lucid Lynx 10.04" {
    set root=(hd0,5)
    linux /vmlinuz root=/dev/sda5 ro quiet splash
    initrd /initrd.img
    }
    EOF

    I couldn't find the "sda#" part, so I assumed both numbers have to be the same. Is that correct?
    As I mentioned in step 3 above, you can enter this in terminal sudo blkid and that will tell you what you need to know.
    Just look for the ext4 beside of it. Yes sda5 would be (hd0,5).
    Last edited by Cavsfan; August 2nd, 2010 at 11:39 PM. Reason: step 3 not 2 correction

  2. #12
    Join Date
    Aug 2010
    Beans
    40

    Wink Re: How to: Create a Customized GRUB2 Screen that is Maintenance Free.

    Quote Originally Posted by Cavsfan View Post
    As I mentioned in step 2 above, you can enter this in terminal sudo blkid and that will tell you what you need to know.
    Just look for the ext4 beside of it. Yes sda5 would be (hd0,5).
    Alright, I've finished your guide, now to reboot...

  3. #13
    Join Date
    Aug 2010
    Beans
    40

    Lightbulb Re: How to: Create a Customized GRUB2 Screen that is Maintenance Free.

    Alright everything seems in order. The background wallpaper, and now there are two new entries. "Linux Lucid" I need to verify the exact name, could you describe what those two entries are?

  4. #14
    Join Date
    Aug 2009
    Beans
    2,898
    Distro
    Ubuntu Development Release

    Re: How to: Create a Customized GRUB2 Screen that is Maintenance Free.

    Quote Originally Posted by SkulblakaSama View Post
    Alright everything seems in order. The background wallpaper, and now there are two new entries. "Linux Lucid" I need to verify the exact name, could you describe what those two entries are?
    They are what ever you put between the quotes, at least what is displayed.
    That part is whatever you want it to display, but everything else must be as is.
    Echo and menuentry are what displays and can be whatever you want.
    But the first one is Ubuntu (normal mode) and the 2nd one is Ubuntu (recovery mode).
    If you did not get the text that displays right, you can change it, just remember to
    enter sudo update-grub for the changes to stay. But the rest if you copied right and all went well, just be normal and recovery.
    You can test that if you want.
    And the next time a kernel is installed you can use sudo uname -a to verify that the kernel selected by the top option is the new one.
    I have to eat as the wife is calling, but I am glad you got this done.
    It is not so much of a hassle for strictly Ubuntu users, but even then the default line would change with every kernel update.
    but what you see now is what you will see 6 months from now.
    And anytime you want to see other kernels or memtest86, just do the opposite of what you did earlier.
    Thanks for trying it out and I hope that more people find it useful.
    The people that dual boot windows should find it very useful.

  5. #15
    Join Date
    Aug 2010
    Beans
    40

    Re: How to: Create a Customized GRUB2 Screen that is Maintenance Free.

    Quote Originally Posted by Cavsfan View Post
    They are what ever you put between the quotes, at least what is displayed.
    That part is whatever you want it to display, but everything else must be as is.
    Echo and menuentry are what displays and can be whatever you want.
    But the first one is Ubuntu (normal mode) and the 2nd one is Ubuntu (recovery mode).
    If you did not get the text that displays right, you can change it, just remember to
    enter sudo update-grub for the changes to stay. But the rest if you copied right and all went well, just be normal and recovery.
    You can test that if you want.
    And the next time a kernel is installed you can use sudo uname -a to verify that the kernel selected by the top option is the new one.
    I have to eat as the wife is calling, but I am glad you got this done.
    It is not so much of a hassle for strictly Ubuntu users, but even then the default line would change with every kernel update.
    but what you see now is what you will see 6 months from now.
    And anytime you want to see other kernels or memtest86, just do the opposite of what you did earlier.
    Thanks for trying it out and I hope that more people find it useful.
    The people that dual boot windows should find it very useful.
    Here is a visual for my situation. It's an attachment.
    Attached Images Attached Images

  6. #16
    Join Date
    Aug 2009
    Beans
    2,898
    Distro
    Ubuntu Development Release

    Re: How to: Create a Customized GRUB2 Screen that is Maintenance Free.

    Quote Originally Posted by SkulblakaSama View Post
    Here is a visual for my situation. It's an attachment.
    Do you dual boot Ubuntu with Windows 7 too?
    I thought you only had Ubuntu on your machine, but I could be mistaken.
    This picture is after you did all of the steps above correct?
    The custom entries in the picture show as the last 3 entries, when they are supposed to be the first 3 entries.

    Can you enter sudo grub-mkconfig in a terminal and post the output here please.
    Make sure you wrap the text with CODE (select all of the output and click on the # top right).

    Also, could you enter ls -l /etc/grub.d/ in a terminal and paste the output here also wrapped in CODE as mentioned above.

    This is what I am wanting to see: the 2 custom Ubuntu Entries first and if dual booting Windows 7 like I am that should appear 3rd.



    And I do not suggest starting off with just 2 or 3 entries. As I mentioned in step 6 of the tutorial, only after some time goes by and you
    are absolutely confident that it works as expected. Then you can make the other files non-executable so that they do not appear.
    Last edited by Cavsfan; August 3rd, 2010 at 03:48 PM. Reason: Added 1 requests for more info.

  7. #17
    Join Date
    Aug 2010
    Beans
    40

    Re: How to: Create a Customized GRUB2 Screen that is Maintenance Free.

    Quote Originally Posted by Cavsfan View Post
    Do you dual boot Ubuntu with Windows 7 too?
    I thought you only had Ubuntu on your machine, but I could be mistaken.
    This picture is after you did all of the steps above correct?
    The custom entries in the picture show as the last 3 entries, when they are supposed to be the first 3 entries.

    Can you enter sudo grub-mkconfig in a terminal and post the output here please.
    Make sure you wrap the text with CODE (select all of the output and click on the # top right).

    Also, could you enter ls -l /etc/grub.d/ in a terminal and paste the output here also wrapped in CODE as mentioned above.

    This is what I am wanting to see: the 2 custom Ubuntu Entries first and if dual booting Windows 7 like I am that should appear 3rd.



    And I do not suggest starting off with just 2 or 3 entries. As I mentioned in step 6 of the tutorial, only after some time goes by and you
    are absolutely confident that it works as expected. Then you can make the other files non-executable so that they do not appear.
    You're right about me duel booting into Windows 7. I have a reason to believe that I have added something to "gksu gedit /etc/grub.d/40_custom" that wasn't supposed to be there.

    Code:
    Generating grub.cfg ...
    #
    # DO NOT EDIT THIS FILE
    #
    # It is automatically generated by /usr/sbin/grub-mkconfig using templates
    # from /etc/grub.d and settings from /etc/default/grub
    #
    
    ### BEGIN /etc/grub.d/00_header ###
    if [ -s $prefix/grubenv ]; then
      load_env
    fi
    set default="0"
    if [ ${prev_saved_entry} ]; then
      set saved_entry=${prev_saved_entry}
      save_env saved_entry
      set prev_saved_entry=
      save_env prev_saved_entry
      set boot_once=true
    fi
    
    function savedefault {
      if [ -z ${boot_once} ]; then
        saved_entry=${chosen}
        save_env saved_entry
      fi
    }
    
    function recordfail {
      set recordfail=1
      if [ -n ${have_grubenv} ]; then if [ -z ${boot_once} ]; then save_env recordfail; fi; fi
    }
    insmod ext2
    set root='(hd0,5)'
    search --no-floppy --fs-uuid --set 1609e458-e91e-4866-bb71-65e544e681ae
    if loadfont /usr/share/grub/unicode.pf2 ; then
      set gfxmode=640x480
      set gfxpayload=keep
      insmod gfxterm
      insmod vbe
      if terminal_output gfxterm ; then true ; else
        # For backward compatibility with versions of terminal.mod that don't
        # understand terminal_output
        terminal gfxterm
      fi
    fi
    insmod ext2
    set root='(hd0,5)'
    search --no-floppy --fs-uuid --set 1609e458-e91e-4866-bb71-65e544e681ae
    set locale_dir=($root)/boot/grub/locale
    set lang=en
    insmod gettext
    if [ ${recordfail} = 1 ]; then
      set timeout=-1
    else
      set timeout=10
    fi
    ### END /etc/grub.d/00_header ###
    
    ### BEGIN /etc/grub.d/05_debian_theme ###
    Found background image: energy-fluke.jpg
    insmod ext2
    set root='(hd0,5)'
    search --no-floppy --fs-uuid --set 1609e458-e91e-4866-bb71-65e544e681ae
    insmod jpeg
    if background_image /usr/share/images/desktop-base/energy-fluke.jpg ; then
      set color_normal=white/black
      set color_highlight=magenta/black
    else
      set menu_color_normal=white/black
      set menu_color_highlight=black/light-gray
    fi
    ### END /etc/grub.d/05_debian_theme ###
    
    ### BEGIN /etc/grub.d/10_linux ###
    Found linux image: /boot/vmlinuz-2.6.32-24-generic
    Found initrd image: /boot/initrd.img-2.6.32-24-generic
    menuentry 'Ubuntu, with Linux 2.6.32-24-generic' --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        insmod ext2
        set root='(hd0,5)'
        search --no-floppy --fs-uuid --set 1609e458-e91e-4866-bb71-65e544e681ae
        linux    /boot/vmlinuz-2.6.32-24-generic root=UUID=1609e458-e91e-4866-bb71-65e544e681ae ro   quiet splash
        initrd    /boot/initrd.img-2.6.32-24-generic
    }
    menuentry 'Ubuntu, with Linux 2.6.32-24-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        insmod ext2
        set root='(hd0,5)'
        search --no-floppy --fs-uuid --set 1609e458-e91e-4866-bb71-65e544e681ae
        echo    'Loading Linux 2.6.32-24-generic ...'
        linux    /boot/vmlinuz-2.6.32-24-generic root=UUID=1609e458-e91e-4866-bb71-65e544e681ae ro single 
        echo    'Loading initial ramdisk ...'
        initrd    /boot/initrd.img-2.6.32-24-generic
    }
    ### END /etc/grub.d/10_linux ###
    
    ### BEGIN /etc/grub.d/20_memtest86+ ###
    Found memtest86+ image: /boot/memtest86+.bin
    menuentry "Memory test (memtest86+)" {
        insmod ext2
        set root='(hd0,5)'
        search --no-floppy --fs-uuid --set 1609e458-e91e-4866-bb71-65e544e681ae
        linux16    /boot/memtest86+.bin
    }
    menuentry "Memory test (memtest86+, serial console 115200)" {
        insmod ext2
        set root='(hd0,5)'
        search --no-floppy --fs-uuid --set 1609e458-e91e-4866-bb71-65e544e681ae
        linux16    /boot/memtest86+.bin console=ttyS0,115200n8
    }
    ### END /etc/grub.d/20_memtest86+ ###
    
    ### BEGIN /etc/grub.d/30_os-prober ###
    Found Windows 7 (loader) on /dev/sda1
    menuentry "Windows 7 (loader) (on /dev/sda1)" {
        insmod ntfs
        set root='(hd0,1)'
        search --no-floppy --fs-uuid --set 01cb2416e6305a00
        chainloader +1
    }
    ### END /etc/grub.d/30_os-prober ###
    
    ### 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.
    echo "Adding Ubuntu Lucid Lynx 10.04" >&2 
    cat << EOF
    menuentry "Ubuntu Lucid Lynx 10.04" {
        set root=(hd0,5)
            linux /vmlinuz root=/dev/sda5 ro quiet splash
            initrd /initrd.img
    }
    EOF
    echo "Ubuntu Lucid Lynx 10.04 (Recovery Mode)" >&2 
    cat << EOF
    menuentry "Ubuntu Lucid Lynx 10.04 (Recovery Mode)" {
        set root=(hd0,5)
            linux /vmlinuz root=/dev/sda5 ro single
            initrd /initrd.img
    }
    EOF
    echo "Windows 7 (loader)" >&2 
    cat << EOF
    menuentry "Windows 7 (loader) (on /dev/sda1)" {
        insmod ntfs
        set root='(hd0,1)'
        search --no-floppy --fs-uuid --set 01cb2416e6305a00
        chainloader +1
    }
    EOF
    ### END /etc/grub.d/40_custom ###
    done
    Code:
    total 40
    -rwxr-xr-x 1 root root 4466 2010-08-02 14:48 00_header
    -rwxr-xr-x 1 root root 1409 2010-08-02 17:57 05_debian_theme
    -rwxr-xr-x 1 root root 4594 2010-04-13 08:59 10_linux
    -rwxr-xr-x 1 root root  918 2010-03-23 04:37 20_memtest86+
    -rwxr-xr-x 1 root root 6605 2010-04-13 08:59 30_os-prober
    -rwxr-xr-x 1 root root  843 2010-08-02 17:34 40_custom
    -rw-r--r-- 1 root root  483 2010-04-13 08:59 README
    My apologies for the delay, I had to do something.
    Last edited by SkulblakaSama; August 3rd, 2010 at 06:45 PM.

  8. #18
    Join Date
    Aug 2009
    Beans
    2,898
    Distro
    Ubuntu Development Release

    Re: How to: Create a Customized GRUB2 Screen that is Maintenance Free.

    Quote Originally Posted by SkulblakaSama View Post
    My apologies for the delay, I had to do something.
    Oh, no problem. We all are busy from time to time. So, you do not have Windows 7 but, you put it into 40_custom as I said in the tut.
    No problem and I also know why the custom entries did not appear at the top like they should have. This is a simple fix.

    In the tutorial I mentioned to edit gksu gedit /etc/grub.d/40_custom and
    then save it as 06_custom. You saved 40_custom and because of the numbering of the files, it made the custom entries appear at the bottom.

    Here is a simple fix: enter gksu gedit /etc/grub.d/40_custom and take out the third entry about windows 7:

    Delete just these 8 lines:

    Code:
    echo "Windows 7 (loader)" >&2 
    cat << EOF
    menuentry "Windows 7 (loader) (on /dev/sda1)" {
        insmod ntfs
        set root='(hd0,1)'
        search --no-floppy --fs-uuid --set 01cb2416e6305a00
        chainloader +1
    }
    EOF
    And then click File > Save As and enter 06_custom

    Then enter (copy and paste) these 3 lines into a terminal
    Code:
    sudo chmod +x /etc/grub.d/06_custom  
    sudo chmod -x /etc/grub.d/40_custom
    sudo chmod -x /etc/grub.d/30_os-prober
    Enter sudo update-grub and reboot.

    Your 2 custom entries should now appear on top and you should not have to modify it when a kernel is installed as it will default to the top line
    (as long as you have GRUB_DEFAULT=0 in /etc/default/grub as mentioned in step 1 of the tutorial.

    Once you have done that enter gksu gedit /etc/grub.d/40_custom again and delete everything you added and save it. It should look exactly like this:
    Code:
    #!/bin/sh
    exec tail -n +3 $0
    # 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.
    And save it.
    Like Step 6 says in the tutorial, if you want you can make the memtest86 entries go away and the other kernel entries.
    But, I suggest you wait a while before doing this.

    Let me know if the first 2 entries are now the custom ones.
    Last edited by Cavsfan; August 3rd, 2010 at 07:35 PM.

  9. #19
    Join Date
    Aug 2010
    Beans
    40

    Re: How to: Create a Customized GRUB2 Screen that is Maintenance Free.

    Quote Originally Posted by Cavsfan View Post
    Your 2 custom entries should now appear on top and you should not have to modify it when a kernel is installed as it will default to the top line
    (as long as you have GRUB_DEFAULT=0 in /etc/default/grub as mentioned in step 1 of the tutorial.
    Instead of "GRUB_DEFAULT=0" don't I have to have "2"since I duel boot?

  10. #20
    Join Date
    Aug 2010
    Beans
    40

    Re: How to: Create a Customized GRUB2 Screen that is Maintenance Free.

    Quote Originally Posted by Cavsfan View Post
    Here is a simple fix: enter gksu gedit /etc/grub.d/40_custom and take out the third entry about windows 7:

    Delete just these 8 lines:

    Code:
    echo "Windows 7 (loader)" >&2 
    cat << EOF
    menuentry "Windows 7 (loader) (on /dev/sda1)" {
        insmod ntfs
        set root='(hd0,1)'
        search --no-floppy --fs-uuid --set 01cb2416e6305a00
        chainloader +1
    }
    EOF
    And then click File > Save As and enter 06_custom

    Then enter (copy and paste) these 3 lines into a terminal
    Code:
    sudo chmod +x /etc/grub.d/06_custom  
    sudo chmod -x /etc/grub.d/40_custom
    sudo chmod -x /etc/grub.d/30_os-prober
    Enter sudo update-grub and reboot.

    Your 2 custom entries should now appear on top and you should not have to modify it when a kernel is installed as it will default to the top line
    (as long as you have GRUB_DEFAULT=0 in /etc/default/grub as mentioned in step 1 of the tutorial.


    Let me know if the first 2 entries are now the custom ones.
    The two custom entries are on top, but my Windows 7 entry is gone, I don't think I should have deleted that...

Page 2 of 16 FirstFirst 123412 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •