Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

HOWTO: Install Grub Customizer in Debian Wheezy

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Post Reply
Message
Author
User avatar
NFT5
df -h | grep > 20TiB
df -h | grep > 20TiB
Posts: 598
Joined: 2014-10-10 11:38
Location: Canberra, Australia
Has thanked: 10 times
Been thanked: 43 times

HOWTO: Install Grub Customizer in Debian Wheezy

#1 Post by NFT5 »

Evening All.

First post here and a HowTo already? Quick explanation - I'm an XP refugee but over the last couple of years have been playing with various Linux distros as an alternative for use both at home and at work where I have 3 and 4 machines networked, respectively. This forum has been of particular use to me over this time so I thought I'd actually register and try to return some of what I've gained here.

No doubt there would have been easier ways for a Linux novice but the purity of Debian appealed to me so in April this year the changeover began. Home was no problem with just a straight switch to Wheezy but work has been something of an exercise with one machine running nothing else but a dedicated proprietary application on XP (which it can now do forever since it's now isolated from the outside world). The other challenge was/is an MS Access database application that I've developed over quite some years and which very effectively is the core to running the business. So, initially there was a need to dual boot all machines. Simple enough, but on mine I'm running XP still, Debian in a stable configuration plus another instance of Debian which is where I do any testing/development. That instance is periodically wiped and reinstalled fresh as I undo my mistakes and start again. Each time I reinstall, though, Grub reorders the menu priorities placing the testing installation at the top of the menu as the default, which is not what I want.

So, I have a need to reconfigure Grub regularly and in one of my forays into Ubuntu I came across Grub Customizer which is a very handy GUI utility to quickly and easily reconfigure Grub, but from the stable installation of Debian. The problem, of course, is that Grub Customizer was developed for Ubuntu and isn't in the Debian repository. So, how to install this without breaking Debian? Numerous Google searches showed that I wasn't the only one in this situation but none of the (very few) solutions that I came across actually worked for me. Eventually, however, I did find a solution and the purpose of this post is to document that here where others might find it and avoid the frustrations and mistakes that I made.

Now I do realise that installing Grub Customizer isn't the pure Debian way. For the purists I'm not recommending this if you're not happy with the concept, but for many an OS is the means to an end, a tool that we use to do what we have to do. If you fall into this category then I hope the following is useful. Oh, and I don't lay any claim to having developed this. It was in a ReadMe file in one of my failed installations. Google has a much better chance of finding it here, though.

One thing. You MUST run Step 3 as root, sudo is not sufficient.

If you are not using Ubuntu (or one of its derivates) you cannot use the ppa to install Grub Customizer. To install it anyway, you have to download and compile the sources. All the following lines starting with $ are shell commands - open a terminal and execute them (but don't copy the $ ;-) )!

Make sure your grub2 contains the grub-mkconfig script (included since version 1.97).

# step one: Install these packages:

* cmake
* g++ OR gcc-c++
* libgtkmm-3.0-dev OR gtkmm30-devel [when using the gtk-2 version you need libgtkmm-2.4-dev OR gtkmm24-devel]
* gettext
* libssl-dev OR openssl-devel
* libarchive-dev OR libarchive-devel

(The package names may be different, depending on the distribution they are using on)

# step two: download the sources:

download the tar.gz-package here: https://launchpad.net/grub-customizer/+download
…and extract its contents.

# step three: compile the sources:

Go into the source directory extracted from the tar.gz file, then run

$ cmake . && make

If you get a cmake version error, try to set the "cmake_minimum_required" value to your installed version - I only written down the lowest tested version, so older versions may be compatible too.

# step four: install some (optional) runtime dependencies:

* hwinfo

# step five: install Grub Customizer

$ sudo make install

Then you can start Grub Customizer using the menu or by running `gksu grub-customizer` / `sudo grub-customizer`
The following was not required on my system (may apply to other distributions).
On some distributions, this may fail ("bootloader not found"), because some of the commands / directories doesn't exist on the expected names. Please make sure, these commands are accessible:

grub-mkconfig
grub-install

and these pathes/files:

/etc/grub.d
/boot/grub
/boot/grub/grub.cfg
/etc/default/grub

If not, there may be alternative commands/pathes, if Grub2 is installed. Please try to find them out and create a config file at /etc/grub-customizer/grub.cfg containing this content (the values of this example are valid on fedora 16 - change them, if they are different):

MKCONFIG_CMD=grub2-mkconfig
INSTALL_CMD=grub2-install
MKFONT_CMD=grub2-mkfont
CFG_DIR=/etc/grub.d
OUTPUT_DIR=/boot/grub2
OUTPUT_FILE=/boot/grub2/grub.cfg
SETTINGS_FILE=/etc/default/grub
DEVICEMAP_FILE="/boot/grub2/device.map"
MKDEVICEMAP_CMD="grub2-mkdevicemap --device-map=/dev/stdout"
Enjoy.

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 72 times

Re: HOWTO: Install Grub Customizer in Debian Wheezy

#2 Post by stevepusser »

Or we have Wheezy-compatible packages, built against the Debian libraries, in the MEPIS community repositories:

Code: Select all

http://main.mepis-deb.org/mepiscr/testrepo/pool/test/g/grub-customizer/
Seriously, people have asked us for loads of stuff...
MX Linux packager and developer

User avatar
llivv
Posts: 5340
Joined: 2007-02-14 18:10
Location: cold storage

Re: HOWTO: Install Grub Customizer in Debian Wheezy

#3 Post by llivv »

NFT5 wrote:Evening All.
Each time I reinstall, though, Grub reorders the menu priorities placing the testing installation at the top of the menu as the default, which is not what I want.

So, I have a need to reconfigure Grub regularly and in one of my forays into Ubuntu I came across Grub Customizer which is a very handy GUI utility to quickly and easily reconfigure Grub, but from the stable installation of Debian. The problem, of course, is that Grub Customizer was developed for Ubuntu and isn't in the Debian repository. .
Grub can be a painful until one gets used to it.
Put, there are a few ways around what I'll assume your issue is about. I'll assume cause I'm not sure what you need to install grub on a second partition is, or if your grub controlling partition is your experimental install.
So, with that in mind you can work around the issue by installing grub on your working partition and not installing grub on your experimental partition when you reinstall.
Or install grub to the partition you are reinstalling to then update grub from your controlling partition, instead of reinstalling grub to the MBR or efi locations of the disk when reinstalling.
You could also run debootstrap and rebuild you experimental install from the ground up. A few practice runs using debootstrap and you should be good to go on reinstalls.
Or you can ( although the file recommends not to ), backup your grub.cfg file, than manually edit the boot order within the file,

But, compiling from source is a good exercise too, if that's what you're into.
In memory of Ian Ashley Murdock (1973 - 2015) founder of the Debian project.

User avatar
NFT5
df -h | grep > 20TiB
df -h | grep > 20TiB
Posts: 598
Joined: 2014-10-10 11:38
Location: Canberra, Australia
Has thanked: 10 times
Been thanked: 43 times

Re: HOWTO: Install Grub Customizer in Debian Wheezy

#4 Post by NFT5 »

stevepusser wrote:Or we have Wheezy-compatible packages, built against the Debian libraries, in the MEPIS community repositories:
.
Amazing! Didn't come across that in more searches than I can remember.
llivv wrote:Put, there are a few ways around what I'll assume your issue is about......
4 physical drives:
sda: 160GB HDD - holds the Home directories for each installation in separate partitions
sdb: 120GB SSD - holds the Win XP plus Debian stable OS plus my experimental OS installation, each in separate partitions
sdc and sdd: Large HDDs which just hold data.

GRUB is installed on sdb which is first drive loaded by BIOS.

The issue has been that my experimental installations change the GRUB menu and order. I wanted an easy way to change this back so that my stable OS is first and default so loads without further input from me. Acknowledge the other alternatives you outlined and I have modified the grub.cfg file in the past but, as you say, not recommended. The Debian world is one of choices and sometimes there is no "right" choice.

Appreciate the input and comments though.

Post Reply