Page 13 of 16 FirstFirst ... 31112131415 ... LastLast
Results 121 to 130 of 156

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

  1. #121
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

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

    Quote Originally Posted by ChinaJustin View Post
    Ran into a problem when I ran ¨sudo update-grub¨. Here´s the outputHere is my current 06_custom file:

    Code:
    #!/bin/sh
    echo 1>&2 "Adding My Custom Menu"
    exec tail -n +4 $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.
    echo "Lubuntu Precise Pangolin 12.04" >&2 
    cat << EOF
    menuentry "Lubuntu Precise Pangolin 12.04" {
        set root=(hd0,msdos2)
            linux /vmlinuz root=/dev/sda2 ro quiet splash
            initrd /initrd.img
    }
    EOF
    echo "Lubuntu Precise Pangolin 12.04 (Recovery Mode)" >&2
    cat << EOF
    menuentry "Lubuntu Precise Pangolin 12.04 (Recovery Mode)" {
        set root=(hd0,msdos2)
            linux /vmlinuz root=/dev/sda2 ro single
            initrd /initrd.img
    }
    EOF
    echo "Windows XP" >&2 
    cat << EOF
    menuentry "Windows XP" {
        insmod ntfs
        set root='(hd0,msdos1)'
        search --no-floppy --fs-uuid --set 9AB84DC1B84D9C9F
        chainloader +1
    }
    EOF
    I haven´t rebooted yet, because I´m afraid of grub not liking the error and having issues. Ideas?
    I have edited your file and made the above changes:
    1. Only place the 'echo' command in the top section. Otherwise it's going to be input into the grub.cfg file.
    2. Changed the tail command to 4 since we are adding the 'echo' line to the top.
    3. Remove all CAT / EOF references. The way the GRUB scripts are set up, everything is output to grub.cfg so the CAT/EOF entries are not required.

    Here is the new file for you to try:
    #!/bin/sh
    echo 1>&2 "Adding Lubuntu & Windows XP 06 Custom Menu"
    exec tail -n +4 $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.

    menuentry "Lubuntu Precise Pangolin 12.04" {
    set root=(hd0,msdos2)
    linux /vmlinuz root=/dev/sda2 ro quiet splash
    initrd /initrd.img
    }

    menuentry "Lubuntu Precise Pangolin 12.04 (Recovery Mode)" {
    set root=(hd0,msdos2)
    linux /vmlinuz root=/dev/sda2 ro single
    initrd /initrd.img
    }

    menuentry "Windows XP" {
    insmod ntfs
    set root='(hd0,msdos1)'
    search --no-floppy --fs-uuid --set 9AB84DC1B84D9C9F
    chainloader +1
    }
    Back to Xorg...

    Retired.

  2. #122
    Join Date
    Aug 2009
    Beans
    Hidden!
    Distro
    Xubuntu

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

    Quote Originally Posted by drs305 View Post
    1. Only place the 'echo' command in the top section. Otherwise it's going to be input into the grub.cfg file.
    2. Changed the tail command to 4 since we are adding the 'echo' line to the top.
    3. Remove all CAT / EOF references. The way the GRUB scripts are set up, everything is output to grub.cfg so the CAT/EOF entries are not required.
    Thanks Drs305. So, is this new for Grub version 1.99 on Precise Pangolin 12.04?
    Put only one echo line at the top and drop the
    cat << EOF and
    EOF lines?
    I know the echo text is not displayed in the menu anyway.

    Is the change from +3 to +4 on the exec tail line also for Precise and grub2?
    Code:
    exec tail -n +4 $0
    I have not been able to find any documentation on exec tail other than seeing it being used with +4.

  3. #123
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

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

    Quote Originally Posted by Cavsfan View Post
    Thanks Drs305. So, is this new for Grub version 1.99 on Precise Pangolin 12.04?
    Put only one echo line at the top and drop the
    cat << EOF and
    EOF lines?
    I know the echo text is not displayed in the menu anyway.

    Is the change from +3 to +4 on the exec tail line also for Precise and grub2?
    Code:
    exec tail -n +4 $0
    I have not been able to find any documentation on exec tail other than seeing it being used with +4.
    I don't know if things changed late in 1.98 or later.

    The + number simply tells the script to start at that line as far as executing the script.

    exec is running the command tail, so if you "man tail" you will find the documentation about what is happening.
    Back to Xorg...

    Retired.

  4. #124
    Join Date
    Aug 2009
    Beans
    Hidden!
    Distro
    Xubuntu

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

    Quote Originally Posted by drs305 View Post
    I don't know if things changed late in 1.98 or later.

    The + number simply tells the script to start at that line as far as executing the script.

    exec is running the command tail, so if you "man tail" you will find the documentation about what is happening.
    Thanks for the info. I have been only on Lucid and was unaware about this. I'll update the How to with this info.

  5. #125
    Join Date
    Aug 2009
    Beans
    Hidden!
    Distro
    Xubuntu

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

    Updated this tutorial and added *Notes for Ubuntu versions that use Grub2 1.99 which started at Natty 11.04.

  6. #126
    Join Date
    Jun 2012
    Beans
    34

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

    @drs305 - Thanks for the update. I plugged that in my 06_custom, run update-grub again, and it worked fine. I´m about to restart my computer, see how it works. Once I get it customized, I´ll try and post a screenshot.

    I do have one follow up question, though. Being new to Linux/Ubuntu, and not a programmer (my one stint with programming was an ¨Intro to C++¨ class that was taught by a foreigner whose English was horrid), I do want to try and understand what some of the language is actually doing. I´ll take a look at the ¨man tail¨, but I was wondering about the EOF/CAT parts. I would imagine EOF means ¨End of File¨? What about CAT? Of course, this may not be the place to go into that, so any reference to another forum/link would be great.

  7. #127
    Join Date
    Jun 2012
    Beans
    34

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

    OK, just found another ¨error¨, but apparently it still worked out fine. When I tried copying the DejaVu font to the /boot/grub/ location, it gave me the following error:

    Code:
    Unknown gsub feature 0x63636d70 (ccmp)
    Unknown gsub feature 0x646c6967 (dlig)
    Unsupported substitution flag: 0x9
    Unsupported substitution flag: 0x9
    Unknown gsub feature 0x6c6f636c (locl)
    Unknown gsub feature 0x6c6f636c (locl)
    Unsupported substitution flag: 0x9
    Found on a Fedora forum, though, that it still should have created the file, and sure enough, it did. (Note: I actually copied the above from that forum, so the error codes aren´t EXACTLY what I got, but close enough) Not sure why it did this, but for anyone else with the problem, you can just

    Code:
    ls /boot/grub/DejaVuSansMono.pf2
    to make sure it worked.

  8. #128
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

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

    ChinaJustin,

    I'm not a programmer either. CAT merely directly the input to standard output until the EOF (end of file marker) is reached. I believe CAT originates from the word concatenate.

    In most GRUB scripts, the CAT/EOF convention is used to send certain portions of the output 'as is' into the grub.cfg file. For the 40_custom file, the GRUB developers designed the update to assume that everything* in the script was to be imported directly into the grub.cfg file. Since so much of the GRUB menu file is dynamically created as the various /etc/grub.d scripts are run, the 40_custom file was designed to bypass this and allow a means which was as close to directly typing into the grub.cfg as possible.

    The 'tail' command, the way it is written in 40_custom, merely tells GRUB to start at line X. Everything from line X to the end, excluding commented (#) lines, is sent to grub.cfg
    Back to Xorg...

    Retired.

  9. #129
    Join Date
    Aug 2009
    Beans
    Hidden!
    Distro
    Xubuntu

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

    Quote Originally Posted by ChinaJustin View Post
    OK, just found another ¨error¨, but apparently it still worked out fine. When I tried copying the DejaVu font to the /boot/grub/ location, it gave me the following error:

    Code:
    Unknown gsub feature 0x63636d70 (ccmp)
    Unknown gsub feature 0x646c6967 (dlig)
    Unsupported substitution flag: 0x9
    Unsupported substitution flag: 0x9
    Unknown gsub feature 0x6c6f636c (locl)
    Unknown gsub feature 0x6c6f636c (locl)
    Unsupported substitution flag: 0x9
    Found on a Fedora forum, though, that it still should have created the file, and sure enough, it did. (Note: I actually copied the above from that forum, so the error codes aren´t EXACTLY what I got, but close enough) Not sure why it did this, but for anyone else with the problem, you can just

    Code:
    ls /boot/grub/DejaVuSansMono.pf2
    to make sure it worked.
    ChinaJustin, I used to jump from one version to the next and when I went from Lucid to Maverick I got those same errors when creating the font.
    I thought I mentioned that. I'll add it if it is not there.
    But, noticed that it still worked. Not quite sure why it does that.
    I look forward to seeing your new Grub2 screen! Are you on Precise?
    Just curious.
    Thanks again drs305!

  10. #130
    Join Date
    Jun 2012
    Beans
    34

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

    OK, so I finally had to reboot my computer, and the font is HUGE! I know it's set at 24 in your instructions, but is that based on a high resolution? I need to go in and see what I can set mine to, and maybe that will help... but right now the menu is just a small rectangle, and I can't see ANY options! I'll try the resolution fix first, but then if I have to resize the font, do I need to delete it first, or will the new font size change overwrite it?

Page 13 of 16 FirstFirst ... 31112131415 ... 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
  •