Linux - KernelThis forum is for all discussion relating to the Linux kernel.
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.
I was following a guide from http://www.linuxforums.org/desktop/t...st_kernel.html which is probably pretty old but I got down to the part where it says about mkinitramfs -o initrd.img-2.6.24 2.6.24. I get an error that says:
cp: cannot stat '/etc/modprobe.conf' : no such file or directory.
I am trying to compile a 2.6.24 kernel from kernel.org. My other question is that if this isnt the way to go since I am seeing people installing with .deb files, how can I undo what I did, to go that way. I did reboot my computer to see if anything changed and my computer still boots fine to the current kernel which is 2.6.22 stock one from Ubuntu 7.10
I am in need of some major help. This isnt the first time I tried this I would really like to learn to compile my own kernel. Thank you very much in advance.
Depends what you are trying to achieve - do you want to "play" with the kernel, or do you want to "fix" a Ubuntu kernel.
If the former, probably Ubuntu isn't the place to start - too much gets in the way.
Try reading this for the "sanctioned" way to do it. Lot easier than it used to be.
Have a look at the link at the bottom of that page for how to bring in a kernel.org source tree - it's written for Dapper, but should be o.k. for you.
I don't have Ubuntu but if you can install the Ubuntu kernel source that may be a better starting point. The README file in the source should be the first thing to read. It will outline what you need to do. It should mostly be the same, but there may be slight differences.
You may be using a general tool (mkinitramfs) instead of one that is for Ubuntu. For example, look for a mkinitrd command. It may also look at the scripts in /etc/modprobe.d/ for example, which may be the cause of your particular problem. The mkinitramfs or mkinitrd programs will probably be bash or perl scripts that work with your distro's /etc/ files.
Well I wanted to try and create a kernel around my hardware to make it a little bit more agile. No need for legacy stuff that I dont need. With Ubuntu what would be the best tutorial. I tried one for feisty and some commands were missing. I did want to go a little further with my linux experimentation but I am thinking maybe that may not be the best thing for me yet.
If you run "make oldconfig" it will copy your old settings for the old kernel. From there you can tweak the settings as you want. You do want to become familiar with your Ubuntu system however, such as what files are used for the modprobe settings. I'm sure the Ubuntu wiki has a howto outlining compiling a kernel from source. Follow their instructions. Generic instructions might be different in what packages you need to install before you start and how to create the initrd file and update grub. On my system I have both. You could try creating an empty /etc/modprobe.conf file if your system doesn't have on. Maybe all of the needed entries are in files in /etc/modprobe.d/.
It is possible that the Ubuntu initrd file is a compressed cpio archives instead of a filesystem. Try to work off of a more recent howto. An Ubuntu howto would be better.
---
I just took a look at the web page you referred to. It is a recent HOWTO. If you found out what Ubuntu uses to create it's initrd file, you probably will do OK. You still need to edit your /boot/grub/menu.lst file to add an entry for the new kernel. Don't make it the default yet, and then you can boot up to your old kernel if there is a problem with the new one.
I was able to get past that. Basically what I did was use fakeroot make-kpkg --initrd --append-to-version=jn1 kernel_image kernel_headers and that made me end up with 2 .deb files which I used dpkg to install. It begins installing and comes up with the exact same error. So I then created a blank modprobe.conf and presto it installed correctly, but it doesn't boot. So then it sits and looks for a root device which I checked over in menu.lst and everything looks fine. I didn't happened to look over an Ubuntu guide yet, that's next.
Thank you so far for your help. I guess I am doing all of this work for nothing as I see a lot of threads about there is no reason for doing this unless you need to fix a problem. Well my thought was I would be doing good for my system removing things that I didn't need. Is there really anything to gain except for knowing how to do it when you may need it some day? Am I racking my brain for nothing?
I would never discourage anyone getting in and having a paddle around in the kernel. But as I said, Ubuntu probably isn't the best place to start - too many hoops to jump through.
For my kernel testing/patching I (now) prefer Arch. I used to use gentoo, but I've moved away from that for kernel maintenence. Slack is another option - easy to build kernels on.
Edit: perhaps I should also mention that I never use an initrd. If I'm going to the trouble to build a kernel, I do it for my kit. Why the hell would I bother with an initrd ... ???.
You would probably have better luck if you installed the kernel source for Ubuntu and followed an Ubuntu howto. My system (SuSE) uses "mkinitrd" to create the initrd file. Each distro will have a custom version to create the initrd file, and it is usually a bash or perl script. The initrd file might contain a startup script that the system expects you to be using. This would be the most painless way of compiling your own kernel. On some distros it may be easier using a stock kernel and module tools then on others.
You may have gotten it on your last attempt, but were too aggressive disabling modules and options. After the kernel fails to boot, you might try boot up in rescue mode and try reading the boot log from the last attempt.
If you haven't compiled a kernel before a starting point might be to install the source for the current running kernel, using "make oldconfig" to start with the old kernel settings, and make only modest config settings to begin with. See if that kernel/initrd boots.
I did use the old config, but I also started going through settings and turning things off that I felt I didn't need but I felt I was being very cautious because I would leave alone what I didn't know about. An example would be my NIC card. Its a 3com 905b which I believe they call a tornado. I didn't it on the list and I have problems with it every now and then so I left them all enabled. I could just go back to that step and do a make xconfig and just recompile from that point correct?
Also when you talk about booting from a rescue disk, do I need to since I can still boot my older kernel? I have my default set as the original untouched kernel. Also what logs would I look at? The more I think of this the more excited I feel about getting it to work because of these issues. I know that sounds geeky but ever since I started using linux about a year ago I have been really impressed and found it very fun to work with. Of course when I started it was a lot of compiling programs from source because I knew nothing else. Then I found apt-get which was a lot easier to say the least. I guess it never hurts to go back and keep refreshed on how to do that. Anyway thank you for your time and patience guys! Thats why I love this forum!
Edit: perhaps I should also mention that I never use an initrd. If I'm going to the trouble to build a kernel, I do it for my kit. Why the hell would I bother with an initrd ... ???.
Well now I guess I am faced with something I wish I never had to. Ubuntu released a kernel update today which I decided since it should know what its doing should not hurt anything. Well after a reboot I get nothing. Nothing meaning I see
searching for root device **+++++****+++++*
and then it tries to fsck which gets a 126 error. I cannot find anything on this. I cannot boot into any kernel. The good thing is the drive checks fine if I boot to a cd and fsck it. How can I possibly undo the kernel update or find out what caused my issue. I would like to not have to reformat the drive. I dont have data to be lost but settings and programs I installed. I do have an Ubuntu cd that I can boot to, to make changes. I will surely provide any info needed. Right now my pc is basically dead. Thanks in advance.
I will assume, because it would seem to make sense, that you want this from the working system. Since I can't boot into it I will be using a gutsy cd and opening menu.lst and fstab from my system, not from the cd. I just started work, its 0703est and I get off of work at 1500est. You should see this sometime after that. I don't have anything to do tonight that I am aware of so I will frequently be checking back.
# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.
## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default 10
## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 3
## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
hiddenmenu
# Pretty colours
#color cyan/blue white/blue
## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret
#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#
#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST
### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below
## DO NOT UNCOMMENT THEM, Just edit them to your needs
## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=4ab875ce-d2bb-4865-9682-f836d5564fb0 ro
## Setup crashdump menu entries
## e.g. crashdump=1
# crashdump=0
## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,0)
## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true
## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false
## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash
## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false
## Xen hypervisor options to use with the default Xen boot option
# xenhopt=
## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0
## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(recovery mode) single
## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all
## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true
## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false
## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false
## ## End Default Options ##
##title Ubuntu 7.10, kernel 2.6.24 Default
##root (hd0,0)
##kernel /boot/vmlinuz root=UUID=4ab875ce-d2bb-4865-9682-f836d5564fb0 ro quiet splash
##quiet
##title Ubuntu 7.10, kernel 2.6.24 Default (recovery mode)
##root (hd0,0)
##kernel /boot/vmlinuz root=UUID=4ab875ce-d2bb-4865-9682-f836d5564fb0 ro single
##title Ubuntu 7.10, kernel 2.6.24.old Previous
##root (hd0,0)
##kernel /boot/vmlinuz.old root=UUID=4ab875ce-d2bb-4865-9682-f836d5564fb0 ro quiet splash
##quiet
##title Ubuntu 7.10, kernel 2.6.24.old Previous (recovery mode)
##root (hd0,0)
##kernel /boot/vmlinuz.old root=UUID=4ab875ce-d2bb-4865-9682-f836d5564fb0 ro single
##title Ubuntu 7.10, kernel 2.6.24jn1
##root (hd0,0)
##kernel /boot/vmlinuz-2.6.24jn1 root=UUID=4ab875ce-d2bb-4865-9682-f836d5564fb0 ro quiet splash
##initrd /boot/initrd.img-2.6.24jn1
##quiet
##title Ubuntu 7.10, kernel 2.6.24jn1 (recovery mode)
##root (hd0,0)
##kernel /boot/vmlinuz-2.6.24jn1 root=UUID=4ab875ce-d2bb-4865-9682-f836d5564fb0 ro single
##initrd /boot/initrd.img-2.6.24jn1
##title Ubuntu 7.10, kernel 2.6.24.old
##root (hd0,0)
##kernel /boot/vmlinuz-2.6.24.old root=UUID=4ab875ce-d2bb-4865-9682-f836d5564fb0 ro quiet splash
##quiet
##title Ubuntu 7.10, kernel 2.6.24.old (recovery mode)
##root (hd0,0)
##kernel /boot/vmlinuz-2.6.24.old root=UUID=4ab875ce-d2bb-4865-9682-f836d5564fb0 ro single
##title Ubuntu 7.10, kernel 2.6.24
##root (hd0,0)
##kernel /boot/vmlinuz-2.6.24 root=UUID=4ab875ce-d2bb-4865-9682-f836d5564fb0 ro quiet splash
##quiet
##title Ubuntu 7.10, kernel 2.6.24 (recovery mode)
##root (hd0,0)
##kernel /boot/vmlinuz-2.6.24 root=UUID=4ab875ce-d2bb-4865-9682-f836d5564fb0 ro single
title Ubuntu 7.10, kernel 2.6.22-14-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=4ab875ce-d2bb-4865-9682-f836d5564fb0 ro quiet splash
initrd /boot/initrd.img-2.6.22-14-generic
quiet
title Ubuntu 7.10, kernel 2.6.22-14-generic (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=4ab875ce-d2bb-4865-9682-f836d5564fb0 ro single
initrd /boot/initrd.img-2.6.22-14-generic
title Ubuntu 7.10, memtest86+
root (hd0,0)
kernel /boot/memtest86+.bin
quiet
### END DEBIAN AUTOMAGIC KERNELS LIST
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000dffd3
Device Boot Start End Blocks Id System
/dev/sda1 1 60801 488384001 83 Linux
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000bd41d
Device Boot Start End Blocks Id System
/dev/sdb1 1 60801 488384001 83 Linux
Disk /dev/hda: 122.9 GB, 122942324736 bytes
255 heads, 63 sectors/track, 14946 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x3e7f7ee2
Device Boot Start End Blocks Id System
/dev/hda1 * 1 14314 114977173+ 83 Linux
/dev/hda2 14315 14946 5076540 82 Linux swap / Solaris
Disk /dev/hdb: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0004d2a8
Device Boot Start End Blocks Id System
/dev/hdb1 1 24321 195358401 83 Linux
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.