Compiling Linux kernel trouble at mkinitramfs
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! |
Quote:
|
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. |
let's have a look at the /boot/grub/menu.lst and /etc/fstab from the hard-disk system. Toss in a "sudo fdisk -l" while you're at it.
|
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.
|
Yep, any liveCD ...
|
Menu.lst
Code:
# menu.lst - See: grub(8), info grub, update-grub(8) Fstab Code:
# /etc/fstab: static file system information. Code:
Disk /dev/sda: 500.1 GB, 500107862016 bytes |
All times are GMT -5. The time now is 10:24 PM. |