Inserting the script update-grub on Mageia 3 with grub 2.00

This forum is dedicated to testing early releases and cauldron : Howtos, tips, tricks and user global feedback and thoughts...

Helpful tip :
For bugs tracking we use : https://bugs.mageia.org = The Mageia Bug Tracker
In this bug tracker you'll find already reported bugs and you'll be able to report those you have found....

Inserting the script update-grub on Mageia 3 with grub 2.00

Postby Creto » Dec 22nd, '12, 16:00

Hi all,

Inserting easily update-grub script on Mageia 3 with GRUB 2:00

Code: Select all
# kwrite /etc/bashrc


Você terá um arquivo como abaixo:

Code: Select all
    # /etc/bashrc

    # System wide functions and aliases
    # Environment stuff goes in /etc/profile

    # It's NOT good idea to change this file unless you know what you
    # are doing. Much better way is to create custom.sh shell script in
    # /etc/profile.d/ to make custom changes to environment. This will
    # prevent need for merging in future updates.

    # By default, we want this to get set.
    # Even for non-interactive, non-login shells.
    if [ "`id -gn`" = "`id -un`" -a `id -u` -gt 99 ]; then
       umask 002
    else
       umask 022
    fi

    # are we an interactive shell?
    if [ "$PS1" ]; then
        case $TERM in
       xterm*)
            # Inelegant fix for MGA #1623.
            PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:$(perl -le '\''use Cwd; print Cwd::getcwd() =~ s#\A\Q$ENV{HOME}\E(?=/|\z)#~#r'\'')"; echo -ne "\007"'
           ;;
       screen)
           PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:$(perl -le '\''use Cwd; print Cwd::getcwd() =~ s#\A\Q$ENV{HOME}\E(?=/|\z)#~#r'\'')"; echo -ne "\033\\"'
           ;;
       *)
           ;;
        esac
        [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "
        # You might want to have e.g. tty in prompt (e.g. more virtual machines)
        # and console windows
        # If you want to do so, just add e.g.
        # if [ "$PS1" ]; then
        #   PS1="[\u@\h:\l \W]\\$ "
        # fi
        # to your custom modification shell script in /etc/profile.d/ directory
       
        if [ -z "$loginsh" ]; then # We're not a login shell
       # Not all scripts in profile.d are compatible with other shells
       # TODO: make the scripts compatible or check the running shell by
       # themselves.
       if [ -n "${BASH_VERSION}${KSH_VERSION}${ZSH_VERSION}" ]; then
                for i in /etc/profile.d/*.sh; do
               if [ -r $i ]; then
                   . $i
               fi
           done
           unset i
       fi
        fi
    fi

    unset loginsh


In the end it well below "fi" insert the following line:

Code: Select all
alias update-grub='grub2-mkconfig -o /boot/grub2/grub.cfg'


Note: After inserting the line hit enter to get a blank line.

The final file should look like as shown below:

Code: Select all
fi
alias update-grub='grub2-mkconfig -o /boot/grub2/grub.cfg'

unset loginsh


Save and close

Okay, now just restart your system and do the test, recalling as 'root'

Test Result:

Code: Select all
[magomageia@localhost ~]$ su -
Senha:
[root@localhost ~]# update-grub
Generating grub.cfg ...
Found theme: /boot/grub2/themes/maggy/theme.txt
Found linux image: /boot/vmlinuz-desktop586
Found initrd image: /boot/initrd-desktop586.img
Found linux image: /boot/vmlinuz-3.7.1-desktop586-1.mga3
Found initrd image: /boot/initrd-3.7.1-desktop586-1.mga3.img
Found linux image: /boot/vmlinuz-3.7.0-desktop586-1.mga3
Found initrd image: /boot/initrd-3.7.0-desktop586-1.mga3.img
No volume groups found
done
[root@localhost ~]#


I hope I've been helpful to this community in some way.

Source: Fórum Mageia Brasil

T+ = Bye
Creto
 
Posts: 119
Joined: Mar 9th, '12, 19:11
Location: Pará - Brasil

Re: Inserting the script update-grub on Mageia 3 with grub 2

Postby leuhmanu » Dec 27th, '12, 01:05

this is already in the package, not as a command but it's called for every kernel updates http://svnweb.mageia.org/packages/cauld ... iew=markup
Help the bugsquad !
User avatar
leuhmanu
 
Posts: 71
Joined: Mar 16th, '11, 00:21
Location: Alsace, France

Re: Inserting the script update-grub on Mageia 3 with grub 2

Postby Creto » Dec 31st, '12, 23:17

Hi leuhmanu

The command is run that way but yes:

Code: Select all
grub2-mkconfig -o /boot/grub2/grub.cfg


And the ease mentioned in the topic here is to run or type in terminal only:

Code: Select all
update-grub


As in distros using Grub the two longer users are accustomed to effecting the control in this way, for example using Ubuntu:

Code: Select all
sudo update-grub


Or in Debian logging in as root in the terminal and:

Code: Select all
# update-grub


That is the update-grub is a script for the command:

Code: Select all
grub2-mkconfig -o /boot/grub2/grub.cfg


Will managed to make me understand this time?

T+ = Bye
Creto
 
Posts: 119
Joined: Mar 9th, '12, 19:11
Location: Pará - Brasil

Re: Inserting the script update-grub on Mageia 3 with grub 2

Postby gohlip » Jan 1st, '13, 08:36

Creto, nice. (because I was surprised I couldn't 'update-grub')
I'll share how I do it though.
I just put in the alias entry at .bashrc
Cheers.
ps: to use it right away without logout/shutdown, ". .bashrc"
Why do we live? To prove not everything in nature has a purpose.
gohlip
 
Posts: 573
Joined: Jul 9th, '12, 10:50

Re: Inserting the script update-grub on Mageia 3 with grub 2

Postby barjac » Feb 25th, '13, 22:30

As there seems to be a demand, there is now update-grub & update-grub2 (both commands do the same) in Cauldron (from grub2-2.00-33.mga3 onwards).

It may be used as root or regular user (regular user will be asked for root password).
Add this icon to your KDE desktop - save as "About.desktop" http://pastebin.com/raw.php?i=X10X1Ype
User avatar
barjac
 
Posts: 193
Joined: Apr 4th, '11, 10:26
Location: Rossendale UK

Re: Inserting the script update-grub on Mageia 3 with grub 2

Postby PauloCreto » Oct 1st, '16, 15:10

Thank you for bringing the GRUB 2 for Mageia 6 and also the command update-grub

Facilitating the use, as I predicted from the Mageia 3, i was a magician then?
:lol: :lol:

Best regards,
Paulo Creto

T+
User avatar
PauloCreto
 
Posts: 13
Joined: Sep 15th, '16, 23:39
Location: São Caetano de Odivelas, Pará, Brasil

Re: Inserting the script update-grub on Mageia 3 with grub 2

Postby doktor5000 » Oct 2nd, '16, 17:08

Uhmm, the last reply here from Barry was over three and a half years ago, we already had that with mga3 ...
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18052
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany


Return to Testing : Alpha, Beta, RC and Cauldron

Who is online

Users browsing this forum: No registered users and 1 guest

cron