LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   grub on the slackware installer (http://www.linuxquestions.org/questions/slackware-14/grub-on-the-slackware-installer-4175455070/)

blackv1rus 03-21-2013 07:42 PM

grub on the slackware installer
 
Hi guys.

is there some one that already tried it??

what I want:

edit the Slackware installer and use grub instead of lilo, I'm just curious about the possibilities.

could someone lead me to at least a manual that is related to my needs?

thanks

Richard Cranium 03-21-2013 08:46 PM

A manual for what, exactly?

slackass 03-21-2013 09:13 PM

No real need for a manual.
Install Slack without Lilo.
Boot from dvd.
Install grub leg from 32bit /extra to a separate (very small) ext2 partition.
Run:
grubconfig

Edit/Note:
If you have trouble making the grub partition bootable, SuperGrubDisk will fix it from a gui most of the time.
http://sourceforge.net/projects/supe...ce=recommended

blackv1rus 03-21-2013 09:46 PM

Thanks! do you think it will work? Sorry for my lack of explanation.

I want to make the Slackware installer use grub instead of lilo from the start up (before I install my distro), or if not possible, how I could make it configurable at the installation process, i don't know where to look for it...

for example: when you boot backtrack 5, grub starts, and then you can choose whatever kernel you want. this is more my idea, i just don't know where to start working on it, and where i could get more information about this possibility, tried Google but they give a bunch of links showing how to configure and install grub after the system is installed.

TobiSGD 03-21-2013 10:00 PM

You don't need Grub just to start different kernels, Lilo is perfectly capable of that.
More info here:
http://docs.slackware.com/slackbook:booting?s[]=lilo
https://wiki.archlinux.org/index.php/Lilo

blackv1rus 03-21-2013 10:10 PM

Yes I know that, but could I also have a default installer that starts straight up with grub without breaking things?

Thanks by the way

Didier Spaier 03-22-2013 03:22 AM

If you do that it won't stay a "default" installer ;)

FYI the installer is not a single file that you could edit. It is a cpio archive called initrd.img in the the /isolinux directory of a Slackware tree.

If you want to look inside it you can unpack it for instance with following commands, typed as root:
Code:

mkdir -p /tmp/initrd
(cd /tmp/initrd
gunzip -cd /path/to/isolinux/initrd.img | \
cpio -i -d -H newc --no-absolute-filenames
)

Then have look at /tmp/initrd/usr/lib/setup/SeTconfig, lines #94 - 110. You will see that in fact this script executes (freshly installed) scripts in the new Slackware installation in /var/log/setup.

So actually there is nothing to change in the installer itself. You would just(!) modify grub's package so it spits an appropriate script in that directory at time of installation (you could look how lilo's package does that to get a clue there, see what's inside /source/a/lilo for that). Of course that will work only if grub is installed.

Good luck.

PS Kudos to Pat for this smart design of the installer, which makes such changes possible without having to modify it :hattip:

PS2 of course what slackass proposed you is *a lot* simpler...

blackv1rus 03-22-2013 06:58 AM

Quote:

Originally Posted by Didier Spaier (Post 4916413)
If you do that it won't stay a "default" installer ;)

FYI the installer is not a single file that you could edit. It is a cpio archive called initrd.img in the the /isolinux directory of a Slackware tree.

If you want to look inside it you can unpack it for instance with following commands, typed as root:
Code:

mkdir -p /tmp/initrd
(cd /tmp/initrd
gunzip -cd /path/to/isolinux/initrd.img | \
cpio -i -d -H newc --no-absolute-filenames
)

Then have look at /tmp/initrd/usr/lib/setup/SeTconfig, lines #94 - 110. You will see that in fact this script executes (freshly installed) scripts in the new Slackware installation in /var/log/setup.

So actually there is nothing to change in the installer itself. You would just(!) modify grub's package so it spits an appropriate script in that directory at time of installation (you could look how lilo's package does that to get a clue there, see what's inside /source/a/lilo for that). Of course that will work only if grub is installed.

Good luck.

PS Kudos to Pat for this smart design of the installer, which makes such changes possible without having to modify it :hattip:

PS2 of course what slackass proposed you is *a lot* simpler...

Thanks!! this information was a pretty good start for what I was looking for

Didier Spaier 03-22-2013 03:02 PM

I'm glad you found this information useful.

Now, you'll have to decide what you will (propose the user to) do in case both lilo and grub packages are installed ;)

blackv1rus 03-23-2013 04:38 AM

Quote:

Originally Posted by Didier Spaier (Post 4916711)
I'm glad you found this information useful.

Now, you'll have to decide what you will (propose the user to) do in case both lilo and grub packages are installed ;)

It is more a experiment thing for the moment, then if the results goes as expected I will move to the next step.

Erik_FL 03-23-2013 09:36 PM

If you boot a Slackware setup DVD, what starts the Slackware installer (kernel and initrd) is ISOLINUX not LILO. You should be able to boot the same kernel and initrd files using GRUB.

The kernels are on the DVD in "kernels/huge.s/bzImage" and "kernels/hugesmp.s/bzImage". The initrd (RAM file-system) is in "isolinux/initrd.img".

Look at the file "isolinux/isolinux.cfg" for the exact boot menu entries. You will have to translate those menu entries to the correct information for the GRUB menu.

If you are actually going to install Slackware, you also need the rest of the Slackware files from the DVD.

Changing what boot loader is installed during setup is more complicated. To do that you have to change the file "/usr/lib/setup/setup" in the "initrd.img". It will be necessary to extract the files from "initrd.img" and then re-create "initrd.img". You have to add the boot loader's files to the Slackware installation files if they aren't already there. GRUB Legacy is already a Slackware package included with the installation files.

Edit: It looks like you don't have to change the "initrd.img". Thanks for the great explanation, Didier!

blackv1rus 03-25-2013 07:48 AM

Quote:

Originally Posted by Erik_FL (Post 4917476)
Changing what boot loader is installed during setup is more complicated.

This is exactly what I want to do.

Many thanks Didier and Erik_FL for the very explanatory reply.

blackv1rus 03-25-2013 07:58 AM

Quote:

Originally Posted by Didier Spaier (Post 4916711)
I'm glad you found this information useful.

Now, you'll have to decide what you will (propose the user to) do in case both lilo and grub packages are installed ;)

Actually I want to replace lilo with grub, and see what looks like. :D

mreff555 03-25-2013 08:27 AM

When you install skip lilo and make a boot disk. Use the boot disk to boot your system and install grub.

http://slackbuilds.org/repository/13.1/system/grub2/

Haven't tried it yet. but I'm assuming it works.

In my case I already had Grub on the MBR from another distro on another partition. In that case all you have to do is load up the other partition, add a slack entry to /etc/grub.d and update grub. I'd personally prefer lilo over grub just because the syntax is much more simple. Eventually I'll switch back.

blackv1rus 03-25-2013 08:53 AM

Quote:

Originally Posted by mreff555 (Post 4918340)
When you install skip lilo and make a boot disk. Use the boot disk to boot your system and install grub.

http://slackbuilds.org/repository/13.1/system/grub2/

Haven't tried it yet. but I'm assuming it works.

In my case I already had Grub on the MBR from another distro on another partition. In that case all you have to do is load up the other partition, add a slack entry to /etc/grub.d and update grub. I'd personally prefer lilo over grub just because the syntax is much more simple. Eventually I'll switch back.

But suppose I wanted the user to be able to choose what to do during the installation, like it happens when you get to the boot loader screen on installer. then I have to find out where it is among these scripts, consequently edit it to grub syntaxes.


All times are GMT -5. The time now is 09:08 AM.