Results 1 to 3 of 3

Thread: Grub2 syntax errors with 40_custom entries

  1. #1
    Join Date
    Mar 2010
    Location
    George, South Africa
    Beans
    26
    Distro
    Ubuntu

    Arrow Grub2 syntax errors with 40_custom entries

    Hello,

    After successfully installing a remastersys backup of Kubuntu 12.04, I disabled the os prober and added the entries I require in /etc/grub.d 40_custom as below:-
    Code:
    #!/bin/sh
    echo "Adding 40_custom menu entries." >&2
    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.
    
    cat << EOF
    menuentry "Kubuntu 12.04 Symlink Boot" {
         linux /vmlinuz root=UUID=10b378dc-f796-429e-8d00-f54da50649d7 ro quiet splash $vt_handoff
        initrd /initrd.img
    }
    EOF 
     
    cat << EOF
    menuentry "Scientific linux 6.3" {
        set root=(hd1,5)
        chainloader +1    
    }
    EOF


    Now, despite everything booting from the grub menu, everytime I run sudo update-grub there are syntax errors and a grub.cfg.new file is added.
    If I remove the entries in 40_custom there are no more errors when running update-grub.
    What could be the cause ? Should I ignore this as the grub menu and booting the kernels is fine ?

    Edit: There are 2 Kubuntu 12.04,s now - I intend to upgrade the symlinked one to 12.10 later.
    Last edited by moon_raker; November 24th, 2012 at 11:54 AM.

  2. #2
    Join Date
    Nov 2009
    Location
    Segur De Calafell, Spain
    Beans
    11,660
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Grub2 syntax errors with 40_custom entries

    Is the UUID of the symlinked partition correct?

    Also, you might try it with root=/dev/sdXY instead of root=UUID=....

    And I would edit the 40_custom directly, not through a script, to make sure the editing is done correctly. You might have a reason to use a script.
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 12.04 LTS 64bit & Windows 7 Ultimate 64bit

  3. #3
    Join Date
    Mar 2010
    Location
    George, South Africa
    Beans
    26
    Distro
    Ubuntu

    Re: Grub2 syntax errors with 40_custom entries

    Quote Originally Posted by darkod View Post
    Is the UUID of the symlinked partition correct?

    Also, you might try it with root=/dev/sdXY instead of root=UUID=....

    And I would edit the 40_custom directly, not through a script, to make sure the editing is done correctly. You might have a reason to use a script.
    Solved. I simply needed to remove the cat << EOF and EOF lines. Grub 1.99> doesn't like those lines.

    (I also changed the +3 in the exec tail line to +4 - don't know whether that was necessary but assume it might have something to do with the Previous versions entry in grub.cfg).

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
  •