Uuuuuuurgent help!!!!!

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Brahim Salem

Uuuuuuurgent help!!!!!

Post by Brahim Salem »

Following this thread http://forums.linuxmint.com/viewtopic.php?f=46&t=104683 Imessed up my grub and when I run

Code: Select all

sudo update-grub
I get

Code: Select all

mint@mint-Inspiron-N5040 ~ $     sudo update-grub
[sudo] password for mint: 
Generating grub.cfg ...
Found background image: background.png
Found linux image: /boot/vmlinuz-3.5.0-17-generic
Found initrd image: /boot/initrd.img-3.5.0-17-generic
Found memtest86+ image: /boot/memtest86+.bin
Found Linux Mint 14 Nadia (14) on /dev/sda5
/etc/grub.d/50_mint_theme: 1: /etc/grub.d/50_mint_theme: mint#!/bin/bash: not found
/etc/grub.d/50_mint_theme: 3: /etc/grub.d/50_mint_theme: source: not found
/etc/grub.d/50_mint_theme: 18: /etc/grub.d/50_mint_theme: is_path_readable_by_grub: not found
done
mint@mint-Inspiron-N5040 ~ 
I have important work to do now what should I do to fix this????? :shock: :shock: :shock: :shock: :shock:
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
kc1di
Level 18
Level 18
Posts: 8147
Joined: Mon Sep 08, 2008 8:44 pm
Location: Maine USA

Re: Uuuuuuurgent help!!!!!

Post by kc1di »

I would download and run boot-repair from here:
https://help.ubuntu.com/community/Boot-Repair

follow the instructions on the page
Easy tips : https://easylinuxtipsproject.blogspot.com/ Pjotr's Great Linux projects page.
Linux Mint Installation Guide: http://linuxmint-installation-guide.rea ... en/latest/
Registered Linux User #462608
caribriz

Re: Uuuuuuurgent help!!!!!

Post by caribriz »

From this thread:
http://forums.linuxmint.com/viewtopic.p ... 09#p693374

dagon is right:
that file shouldn't have

Code: Select all

mint#!/bin/bash -e
at the beginning of it - it should be

Code: Select all

#!/bin/bash -e
Open /etc/grub.d/06_mint_theme as root.
Copy/paste the original 06_mint_theme file you have been sent.
Save it.
Then sudo update-grub.
Reboot.

I have just followed my own instructions in that thread - which was for Mint 13 Cinnamon,
applying them to an install of Mint 14 Cinnamon (32-bit).

What I did:

Copied an image (as root) from /home/username/Pictures - linuxmint-splashscreen2.png to /boot/grub

Opened (as root) /etc/grub.d/06_mint_theme
Changed the file to look exactly like this - anybody else, of course, would subsitute their own image name in place of linuxmint-splashscreen2.

Code: Select all

#!/bin/bash -e

source /usr/lib/grub/grub-mkconfig_lib

set_mono_theme()
{
  cat << EOF
set menu_color_normal=white/black
set menu_color_highlight=white/light-gray
EOF
}

# check for usable backgrounds
use_bg=true
if [ "$GRUB_TERMINAL_OUTPUT" = "gfxterm" ] ; then
#  for i in {/boot/grub,/usr/share/images/desktop-base}/linuxmint.{png,tga} ; do
   for i in {/boot/grub,/usr/share/images/desktop-base}/linuxmint-splashscreen2.{png,tga} ; do
    if is_path_readable_by_grub $i ; then 
      bg=$i
      case ${bg} in
        *.png)		reader=png ;;
        *.tga)		reader=tga ;;
        *.jpg|*.jpeg)	reader=jpeg ;;
      esac
      if test -e /boot/grub/${reader}.mod ; then
        echo "Found Debian background: `basename ${bg}`" >&2
        #use_bg=true
        break
      fi
    fi
  done
fi

# set the background if possible
#if ${use_bg} ; then
#  prepare_grub_to_access_device `${grub_probe} --target=device ${bg}`
#  cat << EOF
#insmod ${reader}
#if background_image `make_system_path_relative_to_its_root ${bg}` ; then
#  set color_normal=white/black
#  set color_highlight=white/light-gray
#else
#EOF
#fi

# otherwise, set a monochromatic theme for Ubuntu
#if ${use_bg} ; then
#  set_mono_theme | sed -e "s/^/  /g"
#  echo "fi"
#else
set_mono_theme
#fi   
Saved the file.

Open a terminal:

Code: Select all

sudo update-grub
Reboot.

It worked exactly as expected with my grub2 splashscreen image displayed.

Note: I hadn't actually done this prior to today for Mint 14 Cinnamon. I had done it for previous Mint installs, but I just hadn't bothered to do it for Mint 14 Cinnamon until now. But as I said, it worked perfectly.


In the original thread, the section I put in beginning with:
So that section of the file should then look like this - with your image name substituted of course:

is exactly the same as what I have just used today.

Note: I have amended the original "how to" post for clarity. See here:
http://forums.linuxmint.com/viewtopic.p ... d8#p591616
Brahim Salem

Re: Uuuuuuurgent help!!!!!

Post by Brahim Salem »

Thanks for your help :D :D But I have done exactly the same but when I run

Code: Select all

sudo update-grub
I get this error:

Code: Select all

mint@mint-Inspiron-N5040 ~ $     sudo update-grub
[sudo] password for mint: 
Generating grub.cfg ...
Found background image: linuxmint-splashscreen2.png
Found linux image: /boot/vmlinuz-3.5.0-17-generic
Found initrd image: /boot/initrd.img-3.5.0-17-generic
Found memtest86+ image: /boot/memtest86+.bin
Found Linux Mint 14 Nadia (14) on /dev/sda5
/etc/grub.d/50_mint_theme: 1: /etc/grub.d/50_mint_theme: mint#!/bin/bash: not found
/etc/grub.d/50_mint_theme: 3: /etc/grub.d/50_mint_theme: source: not found
/etc/grub.d/50_mint_theme: 18: /etc/grub.d/50_mint_theme: is_path_readable_by_grub: not found
done
mint@mint-Inspiron-N5040 ~ $ 
caribriz

Re: Uuuuuuurgent help!!!!!

Post by caribriz »

Can you open a terminal and enter:

Code: Select all

cat /etc/grub.d/06_mint_theme
Copy and paste and resulting text here.
Brahim Salem

Re: Uuuuuuurgent help!!!!!

Post by Brahim Salem »

I have copied it from your post and it looks like this:

Code: Select all

mint@mint-Inspiron-N5040 ~ $     cat /etc/grub.d/06_mint_theme
#!/bin/bash -e

source /usr/lib/grub/grub-mkconfig_lib

set_mono_theme()
{
  cat << EOF
set menu_color_normal=white/black
set menu_color_highlight=white/light-gray
EOF
}

# check for usable backgrounds
use_bg=true
if [ "$GRUB_TERMINAL_OUTPUT" = "gfxterm" ] ; then
#  for i in {/boot/grub,/usr/share/images/desktop-base}/linuxmint.{png,tga} ; do
   for i in {/boot/grub,/usr/share/images/desktop-base}/linuxmint-splashscreen2.{png,tga} ; do
    if is_path_readable_by_grub $i ; then
      bg=$i
      case ${bg} in
        *.png)      reader=png ;;
        *.tga)      reader=tga ;;
        *.jpg|*.jpeg)   reader=jpeg ;;
      esac
      if test -e /boot/grub/${reader}.mod ; then
        echo "Found Debian background: `basename ${bg}`" >&2
        #use_bg=true
        break
      fi
    fi
  done
fi

# set the background if possible
#if ${use_bg} ; then
#  prepare_grub_to_access_device `${grub_probe} --target=device ${bg}`
#  cat << EOF
#insmod ${reader}
#if background_image `make_system_path_relative_to_its_root ${bg}` ; then
#  set color_normal=white/black
#  set color_highlight=white/light-gray
#else
#EOF
#fi

# otherwise, set a monochromatic theme for Ubuntu
#if ${use_bg} ; then
#  set_mono_theme | sed -e "s/^/  /g"
#  echo "fi"
#else
set_mono_theme
#fi  
Brahim Salem

Re: Uuuuuuurgent help!!!!!

Post by Brahim Salem »

PS I'm using burg for now for fear of a failed boot if I reboot my PC :(
caribriz

Re: Uuuuuuurgent help!!!!!

Post by caribriz »

PS I'm using burg for now for fear of a failed boot if I reboot my PC :(
Maybe a good idea - also backing up everything else would also be advisable.

I just noticed in the other thread - in this post:
http://forums.linuxmint.com/viewtopic.p ... 83#p693409

You say:
I saved it and run sudo update-grub

and got:

Code: Select all

mint@mint-Inspiron-N5040 ~ $     sudo update-grub
    [sudo] password for mint:
    Generating grub.cfg ...
    Found background image: background.png
    Found linux image: /boot/vmlinuz-3.5.0-17-generic
    Found initrd image: /boot/initrd.img-3.5.0-17-generic
    Found memtest86+ image: /boot/memtest86+.bin
    Found Linux Mint 14 Nadia (14) on /dev/sda5
    /etc/grub.d/50_mint_theme: 1: /etc/grub.d/50_mint_theme: mint#!/bin/bash: not found
    /etc/grub.d/50_mint_theme: 3: /etc/grub.d/50_mint_theme: source: not found
    /etc/grub.d/50_mint_theme: 18: /etc/grub.d/50_mint_theme: is_path_readable_by_grub: not found
    done
    mint@mint-Inspiron-N5040 ~ 
It's saying in those lines:
/etc/grub.d/50_mint_theme: mint#!/bin/bash: not found

It should be
06_mint_theme

Can you post what files are in your /etc/grub.d folder?
Brahim Salem

Re: Uuuuuuurgent help!!!!!

Post by Brahim Salem »

Image
caribriz

Re: Uuuuuuurgent help!!!!!

Post by caribriz »

This is mine - no 50_mint_theme file.
I don't have this file in my grub.d
grub.d folder.png
Can you open a terminal, enter
cat /etc/grub.d/50_mint_theme
and post the results?

PS. The above screenshot is from LM13 Cinnamon - which I'm on at the moment.
I'll switch to LM14 Cinnamon.

This is LM14 Cinnamon's grub.d folder - it's contents are different from yours - but still no 50_mint-theme:
LM14 Cinnamon grub.d folder.png
Brahim Salem

Re: Uuuuuuurgent help!!!!!

Post by Brahim Salem »

Amazing!! :roll: :roll: When I run

Code: Select all

cat /etc/grub.d/50_mint_theme
I get:

Code: Select all

mint@mint-Inspiron-N5040 ~ $ cat /etc/grub.d/50_mint_theme
mint#!/bin/bash -e

source /usr/lib/grub/grub-mkconfig_lib

set_mono_theme()
{
  cat << EOF
set menu_color_normal=white/black
set menu_color_highlight=white/light-gray
EOF
}

# check for usable backgrounds
use_bg=true
if [ "$GRUB_TERMINAL_OUTPUT" = "gfxterm" ] ; then
#  for i in {/boot/grub,/usr/share/images/desktop-base}/linuxmint.{png,tga} ; do
   for i in {/boot/grub,/usr/share/images/desktop-base}/linuxmint-splashscreen2.{png,tga,jpg} ; do
    if is_path_readable_by_grub $i ; then
     bg=$i
     case ${bg} in
        *.png)      reader=png ;;
        *.tga)      reader=tga ;;
       *.jpg|*.jpeg)   reader=jpeg ;;
      esac
     if test -e /boot/grub/${reader}.mod ; then
        echo "Found Debian background: `basename ${bg}`" >&2
        #use_bg=true
        break
      fi
    fi
 done
fi


# set the background if possible
#if ${use_bg} ; then
#  prepare_grub_to_access_device `${grub_probe} --target=device ${bg}`
#  cat << EOF
#insmod ${reader}
#if background_image `make_system_path_relative_to_its_root ${bg}` ; then
#  set color_normal=white/black
#  set color_highlight=white/light-gray
#else
#EOF
#fi

# otherwise, set a monochromatic theme for Ubuntu
#if ${use_bg} ; then
#  set_mono_theme | sed -e "s/^/  /g"
#  echo "fi"
#else
set_mono_theme
#fi
caribriz

Re: Uuuuuuurgent help!!!!!

Post by caribriz »

I guess that's the problem.
As far as I can see, that file is identical to 06_mint_theme, except for the word "mint" at the beginning of the line.

You must have somehow put it in the file when you were trying to replace it, and *somehow* ended up with the additional file
named 50_mint_theme.

If it were me, I would just delete that file - 50_mint_theme (as root).
Make sure you have an appropriate image in /boot/grub titled linuxmint-splashscreen2.png
Then run sudo update-grub.

Edit: I have no experience of using burg. You might have to disable it ????? before you do the above. I don't know.

But I'm not you. Do it at your own risk.
If you're happy using burg - well use that.
Brahim Salem

Re: Uuuuuuurgent help!!!!!

Post by Brahim Salem »

I don't remember doing anything like that but I think something wicked happened!! I like burg but I have created a this new splash screen and grub background http://forums.linuxmint.com/viewtopic.php?f=25&t=127015 that I want to test :( :(
caribriz

Re: Uuuuuuurgent help!!!!!

Post by caribriz »

It seems an unhappy accident occurred.

We've pinpointed the problem - and now it's up to you as to how you proceed.
Maybe make a complete backup image before you mess around with it further? I would do that. :wink:
Good luck.
Brahim Salem

Re: Uuuuuuurgent help!!!!!

Post by Brahim Salem »

Thanks for your help! I think I will delete that file and see what will happen :D :D
Brahim Salem

Re: Uuuuuuurgent help!!!!!

Post by Brahim Salem »

Thanks that solved the problem. I have deleted that /etc/grub.d/50_mint_theme file and I don't get that error msg anymore but I don't know whether it's safe to reinstall grub and replace burg. How can I test grub without reboot?
caribriz

Re: Uuuuuuurgent help!!!!!

Post by caribriz »

Brahim wrote:.... but I don't know whether it's safe to reinstall grub and replace burg. How can I test grub without reboot?
Sorry, I have no idea. :(
Locked

Return to “Installation & Boot”