Page 21 of 24 FirstFirst ... 111920212223 ... LastLast
Results 201 to 210 of 236

Thread: Grub 2 Title Tweaks Thread

  1. #201
    Join Date
    May 2010
    Beans
    18

    Re: Grub 2 Title Tweaks Thread

    Ladies and gentleman... I proudly present: My selfmade Grub1.98-bootloader - including title-hack:



    Since my programming knowledge is extremely low, I just designed a proper background-image fitting into the ugly menu. Now the title is a bit small and the menu-entries are still too high - but I think the rest is okay. Is there at least a way to include empty menu-entries at the top? In grub1 this was no problem.

  2. #202
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Grub 2 Title Tweaks Thread

    Nice looking screen.

    You can move the visible entries down a bit by adding blank menuentries. I've added 2 in the example.

    menuentry ' ' --class ubuntu --class gnu-linux --class gnu --class os {
    insmod ext2
    }

    menuentry ' ' --class ubuntuX --class gnu-linux --class gnu --class os {
    insmod ext2
    }
    Explanation:
    The menuentries appear to need at least one command line or an error message will be generated and grub.cfg won't be updated. I've added 'insmod ext2' but others can be used as well.

    These menuentries should be added to /etc/grub.d/09_custom so they appear before any other sections in the grub.cfg file. This will cause the blanks to be added at the top of the menu. You can create other gaps between menus (10, 30 for instance) by creating additiona X9_custsom files.

    You can make the custom file by copying the /etc/grub.d/40_custom file, renaming it to 09_custom. Make it executable so it will be included when "update-grub" is run.

    Don't forget to update the default # or title in /etc/default/grub so the proper menuentry is designated the default.
    Back to Xorg...

    Retired.

  3. #203
    Join Date
    May 2010
    Beans
    1

    Re: Grub 2 Title Tweaks Thread

    That's what I was looking for. Cool you answered so fast. Is there also a way to automatically indent entrys by some number of spaces? E.g. every line beginning with 10 spaces? In grub1 "sub-menus" became common this way. They indented all lines and drew an ascii-rectangle around -> submenu in the bootloader.

    I'm still tweaking around at my background-picture and have trouble getting proper png's. Sometimes they work - sometimes they don't. I actually never change the settings when exporting them. Somebody knows grubs png-limitation?

  4. #204
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Grub 2 Title Tweaks Thread

    Quote Originally Posted by dc_wmj View Post
    That's what I was looking for. Cool you answered so fast. Is there also a way to automatically indent entrys by some number of spaces? E.g. every line beginning with 10 spaces? In grub1 "sub-menus" became common this way. They indented all lines and drew an ascii-rectangle around -> submenu in the bootloader.

    I'm still tweaking around at my background-picture and have trouble getting proper png's. Sometimes they work - sometimes they don't. I actually never change the settings when exporting them. Somebody knows grubs png-limitation?
    You can hack the indentation by adding spaces in the title - it's crude but it works if you are using a custom menu.

    If you want to incorporate it into the automatic menu generation it would be possible to hack the scripts to add before the title. I'd have to poke around a bit but am sure I could figure it out. Just let me know.

    For now, on a custom menu (or in grub.cfg until overwritten) you would just make the menuentry title:
    Code:
    "    Ubuntu....."
    rather than
    "Ubuntu"
    Added: I always forget we now have Grub Customizer, which easily allows manual title changes. See the link in my signature line. You could manually add the spaces there.

    I wrote a guide about Grub 1.99 backgrounds that might help you a bit in your tweaking.
    Grub 2 Drop-In Backgrounds & Font Selection

    As far as the PNG images, make sure they are RGB, non-indexed. If you use GIMP, you can check/change via Image > Mode menu selection.
    Last edited by drs305; January 28th, 2012 at 08:13 PM.
    Back to Xorg...

    Retired.

  5. #205
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Grub 2 Title Tweaks Thread

    I checked the Grub 2 scripts. To alter the Grub 2 menuentries for your main Ubuntu OS, you would edit the /etc/grub.d/10_linux script:

    Code:
    sudo cp /etc/grub/10_linux /etc/grub.d/10_linux.bak
    sudo cp /etc/grub/30_os-prober /etc/grub.d/30_os-prober.bak
    gksu gedit +85 /etc/grub.d/10_linux & gksu gedit +184 /etc/grub.d/30_os-prober &
    The first command makes a backup.
    The second commands opens 10_linux near the line you need to edit. I may have modified the scripts so your line numbers may be lower. I'm using Grub 1.99.

    In the example below, I've changed the main entry but left the Recovery option unchanged so you can see the difference. You would most likely want to change both.

    Code:
      if ${recovery} ; then
        title="$(gettext_quoted "%s, with Linux %s (recovery mode)")"
      else
        title="     $(gettext_quoted "%s, with Linux %s")"
      fi
    Save the file and update-grub.

    I don't have Windows loaded on my current machine, but I think these are the lines you would alter in 30_os-prober and add spaces immediately before $LONGNAME:
    Code:
          found_other_os=1
          cat << EOF
    menuentry "${LONGNAME} (on ${DEVICE})" --class windows --class os {
    EOF
    Several 'agains':
    Save and update-grub.
    I can't verify it since I have no Windows entries, so if it doesn't work, let me know.
    Grub Customizer can manually edit the title if this doesn't work.

    If the scripts are updated you will need to make the changes to the scripts again, but they shouldn't change too often.
    Last edited by drs305; January 28th, 2012 at 08:15 PM.
    Back to Xorg...

    Retired.

  6. #206
    Join Date
    Mar 2005
    Location
    UK
    Beans
    562

    Re: Grub 2 Title Tweaks Thread

    Thank you drs305 for all your hard work on this thread and Grub2.

    There is an error in the os-prober scripts that fails to proberly detect other linux systems that use grub legacy.

    This detection error has also been migrated into the burg bootloader.
    Here is an extract from my /boot/grub/grub.cfg to show the problem:


    cat /boot/grub/brub.cfg
    --snip--

    menuentry "PCLinuxOS 2011 (on /dev/sdb9)" --class gnu-linux --class gnu --class os {
    insmod part_msdos
    insmod ext2
    set root='(hd1,msdos9)'
    search --no-floppy --fs-uuid --set=root 8dc93899-0533-4c01-a990-7105cf6052c2
    linux /boot/vmlinuz BOOT_IMAGE=PCLinuxOS_2011 root=/dev/sdb1 splash vga=794
    initrd /boot/initrd.img
    }

    menuentry "PCLinuxOS 2011 (on /dev/sda10)" --class gnu-linux --class gnu --class os {
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos10)'
    search --no-floppy --fs-uuid --set=root bda8695c-bbb7-4eec-89c7-0e2f7ca94cd0
    linux /boot/vmlinuz BOOT_IMAGE=PCLinuxOS_2011 root=/dev/sdb1 splash vga=794
    initrd (hd1,0)/boot/initrd.img
    }
    menuentry "Ubuntu Oneric (on /dev/sda10)" --class gnu-linux --class gnu --class os {
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos10)'
    search --no-floppy --fs-uuid --set=root bda8695c-bbb7-4eec-89c7-0e2f7ca94cd0
    linux /boot/vmlinuz root=/dev/sda8 ro splash vga=0x0324
    initrd (hd0,7)/boot/initrd.img
    }
    menuentry "Suse 11.4 (on /dev/sda10)" --class gnu-linux --class gnu --class os {
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos10)'
    search --no-floppy --fs-uuid --set=root bda8695c-bbb7-4eec-89c7-0e2f7ca94cd0
    linux /boot/vmlinuz-2.6.37.6-0.7-desktop root=/dev/disk/by-id/ata-WDC_WD5001AALS-00J7B0_WD-WMATV7661868-part10 splash=silent quiet showopts vga=0x31a
    initrd /boot/initrd-2.6.37.6-0.7-desktop
    }
    --snip--

    In short I have 8 distributions installed across 2 hard drives including
    FreeBSD.
    Grub2 os-prober never picks up FreeBSD but worst still, see the highlighted
    entry in red, for PCLinux.

    Partition (hd1,0) cannot exist in Grub2, as partition counting starts at 1.

    The result, 2 bootable operating systems, the rest failed to properly detect.

    My solution is to disable os-prober and manually create custom scripts.

    In actual fact, I choose to use grub-legacy as its much easier and a single configuration file and its easier to theme and change fonts, etc as well.

    However if work continues on grub2 and burg then I will be forced into using grub2.

    I decided to try burg, but again Ubuntu,linux 3.0.0 on /dev/sdx
    as a name drives me crazy, I prefer shorter names.

    Your guides are compatible with burg, /etc/defaults/grub being equivalent to /etc/defaults/burg and scripts in burg are at /etc/burg.d/

    There are slight differences in burg for the Icon that preceds the title:
    example /etc/burg/40_script below:

    #!/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.
    menuentry "PCLinuxOS 2011" --class pclinuxos --class os {
    insmod ext2
    insmod part_msdos
    insmod ext2
    set root='(hd1,msdos1)'
    search --no-floppy --fs-uuid --set=root 09513d2f-941d-49eb-bc32-0dfe134bedb9
    linux /boot/vmlinuz BOOT_IMAGE=PCLinuxOS_2011 root=/dev/sdb1 splash vga=794
    initrd (hd1,1)/boot/initrd.img
    }


    The --class pclinuxos creates an icon for the menu entry in Burg.
    Hope this helps someone, or please move the thread if you dont think it is appropriate here.
    Regards h8k

  7. #207
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Grub 2 Title Tweaks Thread

    Quote Originally Posted by hal8000 View Post
    There is an error in the os-prober scripts that fails to proberly detect other linux systems that use grub legacy.
    ...

    This detection error has also been migrated into the burg bootloader.
    The --class pclinuxos creates an icon for the menu entry in Burg.
    Hope this helps someone, or please move the thread if you dont think it is appropriate here.
    Regards h8k
    Thanks for sharing that information. I don't think BURG is being actively developed any longer but I know a lot of users still take advantage of it's theming capabilities.

    I'd suggest you file a bug report but the Grub2 devs don't seem to spend much time trying to rectify Grub legacy issues any longer. Your approach of making custom menus is at least a good workaround.
    Back to Xorg...

    Retired.

  8. #208
    Join Date
    Mar 2005
    Location
    UK
    Beans
    562

    Re: Grub 2 Title Tweaks Thread

    Thank you DRS, will post a bug report.

    I have also found that by disabling os-prober in Grub2 or Burg and manually creating custom scripts in /etc/grub.d/ or /etc/burg.d/ the bootloader appears almost instantly.

    When os-prober has been used, /bott/grub/grub.cfg is much larger and think the delay (of about 1/2 second) is due to grub.cfg being parsed.

  9. #209
    Join Date
    Feb 2007
    Location
    The Netherlands
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Grub 2 Title Tweaks Thread

    I cannot seem to hide my bootmenu in Ubuntu 12.04.

    This method used to work in Ubuntu 10.04, and it seems to be still valid when you look at the code, but I can't get it (not) to work anymore.

    I want to see only my other OSses only when I hold 'shift'.

    Quote Originally Posted by drs305 View Post
    11. HIDING THE MENU ON MULTI-OS SYSTEMS
    By design, Grub 2 allows hiding the menu only on single-OS systems. This is established in the /etc/grub.d/30_os-prober file. For users with multiple OS's on their machines, hiding the menu can be accomplished by altering the scripts. There are two ways to accomplish the task. The first edits only one file and eliminates a conditional; the second edits two files and adds a conditional, but is a bit more 'elegant'.

    Shown are the applicable sections. Changes are highlighted in bold red. The lines between the altered lines have been omitted.
    • Method 1. Remove a conditional from /etc/grub.d/30_os-prober.
      For both Grub 1.97~beta (Karmic) and 1.98 (Lucid & later), the first line to edit is the same. It appears at approximately line 25-30 of /etc/grub.d/30_os-prober in both versions.

      The second change is to place a # symbol at the end of the conditional. There are many if statements, and it's important to find the correct nested fi.

      In Karmic, the nested fi comes just before the "GRUB_DISABLE_PROBER" section. If Lucid and later, it preceeds the "() adjust timeout" section.
      Karmic (Grub 1.97~beta):

      Lucid & later (Grub 1.98+):

    • Method 2. Add a conditional.
      This procedure modifies both /etc/grub.d/30_os-prober and /etc/default/grub. Open both with:
      Code:
      gksu gedit /etc/default/grub /etc/grub.d/30_os-prober
      Add this line to /etc/default/grub:

      Change this line in /etc/grub.d/30_os-prober, approximately line 25-30,
      From this:

      To this:
    Tiny rewrite, someone?
    📻 Amp.lol. No bloat, just radio. 🤘

  10. #210
    Join Date
    May 2008
    Location
    near Milan, Italy
    Beans
    35
    Distro
    Ubuntu

    Re: Grub 2 Title Tweaks Thread

    I cannot seem to hide my bootmenu in Ubuntu 12.04.

    This method used to work in Ubuntu 10.04, and it seems to be still valid when you look at the code, but I can't get it (not) to work anymore.

    I want to see only my other OSses only when I hold 'shift'.
    Just BUMPING Redsandro's request ;P

Page 21 of 24 FirstFirst ... 111920212223 ... LastLast

Tags for this Thread

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
  •