[SOLVED] why can't i eliminate the initrd.gz and boot
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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
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.
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.
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
Quote:
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
Quote:
device drivers
section and the
Quote:
file system
section that are needed to boot the kernel without needing an initrd.gz.
Last edited by colorpurple21859; 11-09-2012 at 02:24 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 (http://www.slackware.com/~alien/tool...d_generator.sh)
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:
from: CONFIG_USB_HID=m
to: CONFIG_USB_HID=y
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!
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...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.