-   Slackware (
-   -   why can't i eliminate the initrd.gz and boot (

mitusf 11-09-2012 08:39 AM

why can't i eliminate the initrd.gz and boot
In order to make hibernation work, withoput LVM setup, i thought, before reading the slackware wiki documentation, that i need an initrd.gz file. So i have made one. Then i read the wiki doc and saw that actually it isn't necessary on a non-LVM system, only the swap resume-specification in lilo is necessary. So i eliminated it from the lilo.conf and expected everything to work fine. But then i couldn't boot anymore. Why is that?

willysr 11-09-2012 08:47 AM

i think you boot into a generic kernel which requires an initrd to work

mitusf 11-09-2012 09:04 AM

So, only the huge kernel dosn't need initrd, right? It's true that before i (was) used with the huge kernel that i suddenly forced two changes : initrd and generic. If i would've tried generic then only, i would've run into another problem, but looks like thinking in perspective helps you preventing errors :)


BCarey 11-09-2012 12:46 PM

You could also build your own kernel based on the -generic kernel but including whatever modules you need in your initrd.


mitusf 11-09-2012 01:04 PM

Yes, but this requires to read some documentation first. This is a task i have never done before.

Stephen Morgan 11-09-2012 01:11 PM

Building a custom kernel isn't as scary as it sounds, if you can make an initrd you can probably do it without too much trouble. The only change you need to make to the config for the generic kernel is to build your filesystem into the kernel itself, rather than as a module as it is in the default kernel. Well, probably, you system might be different, but that seems to be the most common setup.

mitusf 11-09-2012 02:17 PM

I think i'll try. The only scary part was that menu selection with lot's of unknown parts. If you have some well explained document i'll be glad to have it. Or probably i'll search into slackware wiki, which btw seems a very good initiative, imo.

colorpurple21859 11-09-2012 03:18 PM

When you first start compiling your own kernel it is a trial and error learning process. One thing I would suggest is in the general setup select

Local version - append to kernel release
and put something there that will differentiate your kernel from the stock kernels. After you have compiled your new kernel copy it to /boot with your local version appended to the end of the kernel name to differenate it form the other kernels in /boot. Then create an entry for your new kernel in /etc/lilo.conf rerun lilo. That way if anything goes wrong your still have the default kernels to fall back on. If you are going to use the generic-config file the most you will have to change, besides what I have already suggested, will be a few drivers in the

device drivers
section and the

file system
section that are needed to boot the kernel without needing an initrd.gz.

mitusf 11-09-2012 03:42 PM

I understand. Thanks. I think i'll try one of this days, with the newest stable 3.6.6 version and with some help from this page

beder 11-09-2012 06:14 PM

I just this days finally successfully built my own kernel WITHOUT an initrd (I always used one before), after 10+ years of lazily compiling using the easy path

Here is how I did it...
I've lately been using AlienBob's script to build the initrd (
What it does is create the command to create the initrd needed for your machine, based on the current loaded modules
So all I had to do was look at the modules it was loading up, and select them on the kernel config (I found it easier to find them by going vim .config than through make xconfig) and make them be compiled in the kernel instead of as modules

For example, my initrd was generated as follows for kernel 3.6.2 (I'm now on 3.6.6):
mkinitrd -c -k 3.6.2-smp-362-felipe -f ext4 -r /dev/sda3 -m usbhid:ehci-hcd:uhci-hcd:mbcache:jbd2:ext4 -u -o /boot/initrd-custom-362-felipe.gz

So what are the modules I need? well, usbhid, ehci-hcd, uhci-hcd, mbcache, jbd2 and ext4!
So I went looking for them on my .config and found each one of them, and marked them as 'y' instead of as 'm', as follows:

Do it for each one of the modules, and voilá! It actually worked and I now boot without an initrd :-)
Oh yeah and I used the .config from /testing as a base

Now that's off course just the first step; after you manage to do that for yourself, you can start messing with disabling completely all the modules you don't need to save up on compile time for the kernel!

It's a fun ride I tell you

mitusf 11-10-2012 05:53 AM

Thanks a lot beder. I have just one question: how did you use the .config from testing? specified it to make using -f flag i suppose? I assume also there is a testing directory in 3.6.6 kernel...

mitusf 11-10-2012 08:09 AM

Aha, now i've found out what you meant. The .config from /testing under the Slackware repository.

beder 11-10-2012 09:30 AM

Yes exactly, from the /testing repository from Slackware

You can use it by doing make oldconfig, and then you can edit it as you wish

Good luck!

All times are GMT -5. The time now is 06:39 PM.