You are not logged in.

#1 2012-09-27 00:52:05

pogeymanz
Member
Registered: 2008-03-11
Posts: 1,020

Can't get custom kernel to boot without initramfs

After following some tips from google, I compiled in the ahci, sd_mod, ehci_hcd, and ext4 modules into the kernel. I though this would be enough to boot, but the kernel panics, unable to mount the root device.

How can I figure out what I'm missing?

I tried appending break=postmount to the kernel line in GRUB and then doing an lsmod, but it only listed the above modules and their dependencies.

Offline

#2 2012-09-27 01:20:21

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Can't get custom kernel to boot without initramfs

If you compiled your own kernel with those modules specifically compiled, why would you expect to see them loaded as modules? Sounds like you either didn't actually compile them in, or you're not actually booting off that kernel.

Offline

#3 2012-09-27 11:57:20

pogeymanz
Member
Registered: 2008-03-11
Posts: 1,020

Re: Can't get custom kernel to boot without initramfs

Good point...

Let me reboot and see if they still show up as modules or if that was only before I compiled them in, and then I'll check back in.

Offline

#4 2012-09-27 14:52:42

pogeymanz
Member
Registered: 2008-03-11
Posts: 1,020

Re: Can't get custom kernel to boot without initramfs

Well, after rebooting (with the initramfs) and doing lsmod after logging in, it shows ext4, ahci, sd_mod, etc. So that means they are loaded as modules and not compiled into the kernel?

I used menuconfig and set those modules to <*>...

Offline

#5 2012-09-27 20:06:39

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Can't get custom kernel to boot without initramfs

Does uname -r show you your own kernel?

Offline

#6 2012-09-27 20:58:52

sitquietly
Member
From: On the Wolf River
Registered: 2010-07-12
Posts: 219

Re: Can't get custom kernel to boot without initramfs

pogeymanz wrote:

After following some tips from google, I compiled in the ahci, sd_mod, ehci_hcd, and ext4 modules into the kernel. I though this would be enough to boot, but the kernel panics, unable to mount the root device.

How can I figure out what I'm missing?

I'm booting Arch with my custom compiled pf kernel with no initramfs, everything needed is in the kernel:  I really enjoy a very fast boot and avoid some breakage with the constantly changing initscripts/systemd.  Right now I can't boot my standard arch kernel with initramfs, my last update killed the bootup process.  My custom module-less kernel boots fine.

You say the kernel panics, but what is the last message it gives you? 

The best help in configuring the kernel that I have found is the Linux Sea chapter on Configuring a Linux Kernel.  You will need to know your hardware and it isn't too difficult -- read that chapter.  I did not try to use an Archlinux pkgbuild for making my custom kernel.  Doing it the Gentoo way works better. In fact I get my patched kernel source from Gentoo, pf-sources-3.4.6 or ck-sources-3.5.4. Get your patched kernel sources (e.g. into /usr/src) and run the standard "make menuconfig; make; make modules_install; mount /boot; cp arch/x86/boot/bzImage /boot/kernel-3.x.y; vim /boot/grub/grub.cfg <add an entry to boot the new kernel>

Good luck.  A minimal custom kernel is a thing of joy.

Offline

#7 2012-09-27 22:42:58

pogeymanz
Member
Registered: 2008-03-11
Posts: 1,020

Re: Can't get custom kernel to boot without initramfs

Okay, WTF. I just looked at the config.gz for this kernel and it looks like a default set of options.

I'm building linux-ck from AUR with yaourt. So I wonder if the PKGBUILD is screwing it up, or if I'm too stupid to effectively use nconfig...

I might go the non-Arch way of building the kernel and see if that makes it better.

Offline

#8 2012-09-27 23:00:53

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Can't get custom kernel to boot without initramfs

sitquietly wrote:

avoid some breakage with the constantly changing initscripts/systemd.  Right now I can't boot my standard arch kernel with initramfs, my last update killed the bootup process.  My custom module-less kernel boots fine.

Bugs go to the bug tracker. FUD goes to /dev/null.

pogeymanz wrote:

So I wonder if the PKGBUILD is screwing it up

No idea why the PKGBUILD would be at fault for this when it's running the same commands you would run yourself to build the image...

Offline

#9 2012-09-27 23:41:05

pogeymanz
Member
Registered: 2008-03-11
Posts: 1,020

Re: Can't get custom kernel to boot without initramfs

falconindy wrote:
pogeymanz wrote:

So I wonder if the PKGBUILD is screwing it up

No idea why the PKGBUILD would be at fault for this when it's running the same commands you would run yourself to build the image...

I guess. It's a pretty complicated PKGBUILD. I haven't dived in and tried to figure out where it's going wrong, but nconfig is definitely not writing a new config.

Offline

#10 2012-09-28 06:49:12

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: Can't get custom kernel to boot without initramfs

This is probably unrelated, but i couldn't get a custom linux-ck kernel to boot standalone either a few weeks ago:

https://bbs.archlinux.org/viewtopic.php?id=148219

This was using localyesconfig though, which is obviously less reliable, and i hadn't checked after compilation if the modules had actually been built into the kernel.


ᶘ ᵒᴥᵒᶅ

Offline

#11 2012-09-28 08:16:48

opensrcrox
Member
Registered: 2012-08-10
Posts: 32

Re: Can't get custom kernel to boot without initramfs

If you have Qt installed, why not give xconfig a shot? You can easily verify your config status.
Just go to the kernel src directory, and  "make xconfig".
You can easily search for config options , etc.

Clicking the checkboxes toggles state (built-in, module, not-selected ).
A check would indicate built-in.
A dot would indicate module.

If you save the config, it will be in the current directory .... so if you want to use makepkg,  you have to copy the config to the PKGBUILD directory, update the md5sum array in the PKGBUILD, etc.

Good luck smile

Offline

#12 2012-09-28 12:01:05

pogeymanz
Member
Registered: 2008-03-11
Posts: 1,020

Re: Can't get custom kernel to boot without initramfs

Well, the nconfig thing did save the correct config to a file when I asked it too. So I just copied that config into the build directory and stopped the PKGBUILD from overwriting it. Then it built correctly.

So, I booted now, without the initramfs! The only thing that's off is I got some errors about not being able to mount as ext2 or ext3 because of "incompatibilities" while it was booting... Which makes sense to me because all my partitions are ext4.

It did boot, though and everything seems to be working fine, but I wonder how to get rid of those messages.

Offline

#13 2012-09-28 13:18:56

opensrcrox
Member
Registered: 2012-08-10
Posts: 32

Re: Can't get custom kernel to boot without initramfs

Glad you got it working.
Add rootfstype=ext4 to your kernel cmdline options ( i.e. to your syslinux or grub2 config file section as appropriate.)
Reboot and check out the messages ....

Offline

Board footer

Powered by FluxBB