Page 87 of 94 FirstFirst ... 37778586878889 ... LastLast
Results 861 to 870 of 931

Thread: Grub 2 Basics

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

    Re: Grub 2 Basics

    Quote Originally Posted by Scripting22 View Post
    Okay, so far I did exactly what you said but when I rebooted my laptop I ended up in de GRUB commandline instead of the menu.

    Maybe this is caused by the fact that I've made alterations to the sequence of menu entries. Maybe this has caused to change the run the scripts in a different order?

    I solved the problem by using the solution mentioned in my first post. Unfortunately the solution by using a submenu doesn't create the desired effect.

    Now I will password protect the different menu entries in the second grub.cfg so I will furthermore protect my Linux distributions.
    Glad you were able to restore your system.

    If you still aren't happy with your result and want me to experiement with the submenu for your machine - attach a copy of your grub.cfg file I will check it to see what happened, or at least provide a working solution.
    GRUB2

    Retired.

  2. #862
    Join Date
    Feb 2010
    Beans
    21

    Re: Grub 2 Basics

    Quote Originally Posted by drs305 View Post
    Glad you were able to restore your system.

    If you still aren't happy with your result and want me to experiement with the submenu for your machine - attach a copy of your grub.cfg file I will check it to see what happened, or at least provide a working solution.
    Thxn for offering me to look at another solution with the submenu but I think first I want to give another alternative a try. After yesterday I came to the conclusion that if I want to solve this permanent and in a good fashion I will have to add my changes to the scripts in /etc/grub.d/ so if any updates will be installed (of images or grub), my changes will resist.

    The first part of my plan is to edit the command "update-grub" which is a synoniem of "grub-mkconfig -o /boot/grub/grub.cfg" to "grub-mkconfig -o /boot/grub/othergrub.cfg". The normal grub.cfg will then remain always the same and any changes due to manual or automatic updates will be written to othergrub.cfg. The problem right now is I can't find the command "update-grub". Could you help me with this?

    The second part is to include some rules or script in /etc/grub.d so at any time there will only be displayed three menu entries namely "Windows 7", "Kubuntu" and "Backtrack" in the right order. How to do this I'm not quite sure, but I think I will figure it out in time.

    An important reason for using script instead of manual alterations to othergrub.cfg is that menu entries are also password protected through the use of scripts. This reason and the fact that my configuration will be gone the first time update-grub is run has convinced me to use only the scripts.

    Maybe the two different grub configuration files could be decreased to one by the use of a submenu, but on this moment I'm not able to envision how this would work. If you can explain me how it would work, and it saves boot time then I would surely give it a try.

    I also would like to start with a clean configuration of grub. Before I started, I didn't backup the orginal files and by the use of grub-customizer I can't find back al changes in de scripts. Do you know how I could accomplish this?

    So far I would really like to thank you for all the effort!

    Edit: I found the update-grub script in /usr/lib/grub-legacy, and looked at it. But I don't have any clue where is determined that the output is written to grub.cfg.
    Last edited by Scripting22; April 11th, 2012 at 06:27 PM.

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

    Re: Grub 2 Basics

    Quote Originally Posted by Scripting22 View Post
    Thxn for offering me to look at another solution with the submenu but I think first I want to give another alternative a try. After yesterday I came to the conclusion that if I want to solve this permanent and in a good fashion I will have to add my changes to the scripts in /etc/grub.d/ so if any updates will be installed (of images or grub), my changes will resist.

    The first part of my plan is to edit the command "update-grub" which is a synoniem of "grub-mkconfig -o /boot/grub/grub.cfg" to "grub-mkconfig -o /boot/grub/othergrub.cfg". The normal grub.cfg will then remain always the same and any changes due to manual or automatic updates will be written to othergrub.cfg. The problem right now is I can't find the command "update-grub". Could you help me with this?

    The second part is to include some rules or script in /etc/grub.d so at any time there will only be displayed three menu entries namely "Windows 7", "Kubuntu" and "Backtrack" in the right order. How to do this I'm not quite sure, but I think I will figure it out in time.

    An important reason for using script instead of manual alterations to othergrub.cfg is that menu entries are also password protected through the use of scripts. This reason and the fact that my configuration will be gone the first time update-grub is run has convinced me to use only the scripts.

    Maybe the two different grub configuration files could be decreased to one by the use of a submenu, but on this moment I'm not able to envision how this would work. If you can explain me how it would work, and it saves boot time then I would surely give it a try.

    I also would like to start with a clean configuration of grub. Before I started, I didn't backup the orginal files and by the use of grub-customizer I can't find back al changes in de scripts. Do you know how I could accomplish this?

    So far I would really like to thank you for all the effort!
    1. The update-grub command is located in /usr/sbin/update-grub. You can find the location of a command by running "which <command>". Example: which update-grub

    I don't know if this is what you had in mind, but you can reconfigure a command to run what you want it to run using 'dpkg-divert'. Without going into great detail, you could either set 'update-grub' not to run or have it run another command when called by a system update.

    Code:
    sudo dpkg-divert --rename --add /usr/sbin/update-grub  # changes name to update-grub.distrib
    sudo ln -s /bin/true /usr/sbin/update-grub # runs /bin/true as update-grub so no errors generated
    The above more or less 'disables' update-grub, but you could also point it to another command.

    2. When Grub 2 first came out there was almost no documentation and few known tweaks. Before G2 apps were developed, I wrote a guide on how to tweak the Grub menu (hide partitions, rename things, etc). There are now much easier ways to do most of these things, but the guide remains and may provide you some insight on how to do what you want if the existing apps don't work.
    http://ubuntuforums.org/showthread.php?t=1287602
    Caution: It's pretty geeky and should be avoided if possible.

    3. I don't think anything you do is going to decrease boot times, since you are going to have to invoke a delay if you really want to display the grub menu rather than have it boot...

    I'll try explaining the submenu concept again. If the entire 10_linux section is embedded within a submenu, all you would see would be the submenu title and you would have to click on the submenu title to 'expose' its contents (i.e. your real menu). To make the submenu title invisible, you would make it's title a single or multiple spaces with nothing else. Thus it would technically be displayed but you wouldn't see anything because the title is blank.

    You would either set the timeout to -1 to force the user to make a selection, or you could set the default to use an entry in the submenu. The format for setting a default entry in a submenu is docemented in the guide I wrote about it:
    Grub 1.99 Submenus

    4. You could use the title tweaks thread to figure out how to insert the correct structure whenever update-grub is executed. An easier way would be to create a custom menu with everything you want and then disable 10,20,30 scripts in /etc/grub.d by removing the executable bit from those files.

    With just your 40_custom file, the grub.cfg file would consist of all the administrative stuff needed by grub, and only your custom menus. You can design the custom menu so it always boots the current kernel and doesn't need updating after a kernel update.

    5. The easiest way I've found to return grub to the defaults is to purge and reinstall it. It takes only a minute - just make sure you have a reliable Internet connection before starting:
    Code:
    sudo apt-get purge grub-common # Removes grub-pc, grub-common, and one or more supporting Grub 2 packages.
    sudo apt-get install grub-pc # Reinstalls all the required packages.
    When reinstalling, use the spacebar to select the drive (not the partition) and the TAB key to navigate to/from the OK selection.

    It might be good to make copies of your existing /etc/default/grub file and /etc/grub.d and /boot/grub folders in case you want to refer to them later.
    GRUB2

    Retired.

  4. #864
    Join Date
    Aug 2009
    Location
    USA
    Beans
    3,979
    Distro
    Ubuntu Development Release

    Re: Grub 2 Basics

    drs305, would my tutorial be suited to what Scripting22 is trying to do? Not trying to hog the spotlight, just asking.
    Check Java Version | Install Java via WEB UPD8 PPA
    Creating a Custom Maintenance Free GRUB2 Screen Community Wiki
    Intel Core2 Quad CPU Q9550 @ 2.84Ghz. 4.0GB DDR2 RAM, NVIDIA Geforce 9800 GT

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

    Re: Grub 2 Basics

    Quote Originally Posted by Cavsfan View Post
    drs305, would my tutorial be suited to what Scripting22 is trying to do? Not trying to hog the spotlight, just asking.
    The more the merrier! I was going to point him to your excellent guide if he decided to go the 'custom' route.

    @ Scripting22

    Here's the link:
    How to: Create a Customized GRUB2 Screen that is Maintenance Free.
    GRUB2

    Retired.

  6. #866
    Join Date
    Feb 2010
    Beans
    21

    Re: Grub 2 Basics

    Quote Originally Posted by drs305 View Post
    The more the merrier! I was going to point him to your excellent guide if he decided to go the 'custom' route.

    @ Scripting22

    Here's the link:
    How to: Create a Customized GRUB2 Screen that is Maintenance Free.
    @drs305: Okay thanks for your extensive answer. I will give the options listed this evening and tomorrow a try. It could take a while untill I get back to this.

    @Cavsfan: tutorial/guide is bookmarked. Thanks for input.

  7. #867
    Join Date
    Aug 2009
    Location
    USA
    Beans
    3,979
    Distro
    Ubuntu Development Release

    Re: Grub 2 Basics

    Quote Originally Posted by Scripting22 View Post
    @drs305: Okay thanks for your extensive answer. I will give the options listed this evening and tomorrow a try. It could take a while untill I get back to this.

    @Cavsfan: tutorial/guide is bookmarked. Thanks for input.

    Glad I could help. It's pretty extensive but, straight forward. There are many examples of what your screen will look like.
    My current screen is toward the end of the thread.
    Thanks drs305.
    Check Java Version | Install Java via WEB UPD8 PPA
    Creating a Custom Maintenance Free GRUB2 Screen Community Wiki
    Intel Core2 Quad CPU Q9550 @ 2.84Ghz. 4.0GB DDR2 RAM, NVIDIA Geforce 9800 GT

  8. #868
    Join Date
    Feb 2010
    Beans
    21

    Re: Grub 2 Basics

    Quote Originally Posted by drs305 View Post
    The more the merrier! I was going to point him to your excellent guide if he decided to go the 'custom' route.

    @ Scripting22

    Here's the link:
    How to: Create a Customized GRUB2 Screen that is Maintenance Free.
    Allright, the last few days I've been working hard to get GRUB working like I wanted to. First of all I created a custom file with my own menu entries, so after this step I had only the menu entries I wanted, in the right order with the right names.

    After this I tried to exclude the first grub.cfg file (which only redirects), by introducing a submenu. The submenu was fairly hidden, but the background image didn't pop up like I wanted to. I did remember you said GRUB isn't designed to work that way. I accepted that, and reintroduced the first grub.cfg file which points to the "othergrub.cfg" file.

    After altering the script of "update-grub" to write output directly to /boot/grub/othergrub.cfg everything was in place and working the way I want it.

    The last part existed of protecting two of the three menu entries and here came the trouble. First I created a encrypted password and second I added two lines in the 00_header file the same as mentioned in the guide of you. But when I ran the update-grub command I get back:

    Code:
    Generating grub.cfg ...
    /etc/grub.d/00_header: 21: password_pbkdf2: not found
    I've already tried to remove the lines and make another script file named 01_user_pass, but this makes no difference only the linenumber differs. I also tried a non-encrypted password but this gave me exactly the same result. I suspect I've to save the password somewhere else in the system so some kind of matching can take place? Your guide doesn't mention anything like this. Hope you can help me out with this last configuration problem.

  9. #869
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Grub 2 Basics

    Quote Originally Posted by Scripting22 View Post

    The last part existed of protecting two of the three menu entries and here came the trouble. First I created a encrypted password and second I added two lines in the 00_header file the same as mentioned in the guide of you. But when I ran the update-grub command I get back:

    Code:
    Generating grub.cfg ...
    /etc/grub.d/00_header: 21: password_pbkdf2: not found
    I've already tried to remove the lines and make another script file named 01_user_pass, but this makes no difference only the linenumber differs. I also tried a non-encrypted password but this gave me exactly the same result. I suspect I've to save the password somewhere else in the system so some kind of matching can take place? Your guide doesn't mention anything like this. Hope you can help me out with this last configuration problem.
    I'm currently on a business trip and don't have access to my testing machine. You might take at look at the 'source' documentation to see if there is anything there:
    http://www.gnu.org/software/grub/man.../Security.html

    You might check to make sure you have the password modules in /boot/grub (I have password.mod, password_pbkdf2.mod and and pbkdf2.mod). The error message you quote seems a bit odd. It sounds like there is a reference in 00_header regarding the module. From memory, other than setting the username and password in 00_header I don't recall any mention of the actual modules. You use the command grub-mkpasswd-pbkdf2 to create the password but then only the password code goes into the grub files in the format described in the first post of the password guide.

    When I used encrypted passwords one thing I had to ensure was that when copying/pasting was that there were no spaces/line breaks. Since the encrypted password was very long it always spanned several lines in my terminal.
    Last edited by drs305; April 13th, 2012 at 11:48 PM.
    GRUB2

    Retired.

  10. #870
    Join Date
    Feb 2010
    Beans
    21

    Re: Grub 2 Basics

    Checked for the modules but they were there, so that couldn't be the problem. After this I tried a few things with the lines which adds users and (encrypted) passwords. Surprisingly it made a difference when I added the lines to 00_header with the lines:

    Code:
    cat << EOF
    set superusers="monkey"
    password_pbkdf2 monkey grub.pbkdf2.sha512.10000.XXXXXXXXXXXXXXXXX
    EOF
    Instead of:

    Code:
    set superusers="monkey"
    password_pbkdf2 monkey grub.pbkdf2.sha512.10000.XXXXXXXXXXXXXXXXX
    In the guide however it's said that when a custom (not-standard) script is used these lines (cat << EOF, EOF) should not be added because these scritps are added automaticly to grub.cfg (in my case othergrub.cfg).

    Anyway, problem is solved and everything is working. Special thanks to drs305 for all the help he gave to archieve this.

Page 87 of 94 FirstFirst ... 37778586878889 ... 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
  •