• We should now be fully online following an overnight outage. Apologies for any inconvenience, we do not expect there to be any further issues.

apt-get new kernel?

smp

Diamond Member
Dec 6, 2000
5,215
0
76
I understand you can do a kernel upgrade easily with apt .. I just can't find information how. Most of the info I've found on google talks about apt-getting the source and then building a .deb .. i think.

I thought it was as easy as apt-get install kernel 2.4.$$$ and then editing lilo.conf???
I just need to upgrade the kernel I have on my woody install so I have netfilter stuff, will I need to recompile classically or can I do this quick and easy with apt?


I want my fast food faster :)
 

smp

Diamond Member
Dec 6, 2000
5,215
0
76
Originally posted by: BingBongWongFooey
It is that easy. apt-cache search kernel-image. Lots of them.

So ... what about configuration? I don't want ot bust the box either. I just installed it.
I need netfilter stuff, are the kernel images ... well, whatever .. here goes.
 

smp

Diamond Member
Dec 6, 2000
5,215
0
76
heh

okay now i need to figure out what an initrd kernel image is. I installed the system off of the lordsutch netinstall ISO .. so not sure which type of kernel it uses.
I'm googling, but if anyone can explain this, please do :)

You are attempting to install an initrd kernel image (version 2.4.18-1-386)
This will not work unless you have configured your boot loader to use
initrd. (An initrd image is a kernel image that expects to use an INITial
Ram Disk to mount a minimal root file system into RAM and use that for
booting).
As a reminder, in order to configure lilo, you need to
add an 'initrd=/initrd.img' to the image=/vmlinuz
stanza of your /etc/lilo.conf
I repeat, You need to configure your boot loader. If you have already done
so, and you wish to get rid of this message, please put
`do_initrd = Yes'
in /etc/kernel-img.conf. Note that this is optional, but if you do not,
you'll contitnue to see this message whenever you install a kernel
image using initrd.
Do you want to stop now? [Y/n]
 

smp

Diamond Member
Dec 6, 2000
5,215
0
76
is this right?

image=/vmlinuz
label=Linux
read-only
# restricted
# alias=1
initrd=/initrd.img

I added the last line.. ?

is that correct? Anything else i'm supposed to do?
Please help . thank you.
 

Barnaby W. Füi

Elite Member
Aug 14, 2001
12,343
0
0
Here's some of the parts of my lilo.conf for my debian kernels:

image=/boot/vmlinuz-2.4.22-1-386
label=2.4.22-386
append="hdc=ide-scsi"
initrd=/boot/initrd.img-2.4.22-1-386
read-only

image=/boot/vmlinuz-2.6.0-test1-1-386
label=2.6.0-test1
append="hdc=ide-scsi"
initrd=/boot/initrd.img-2.6.0-test1-1-386
read-only

image=/boot/vmlinuz-2.4.21-3-k7-smp
label=2.4.21-k7-smp
append="hdc=ide-scsi"
initrd=/boot/initrd.img-2.4.21-3-k7-smp
read-only

image=/boot/vmlinuz-2.4.20-3-k7-smp
label=2.4.20-k7-smp
append="hdc=ide-scsi"
initrd=/boot/initrd.img-2.4.20-3-k7-smp
read-only
 

smp

Diamond Member
Dec 6, 2000
5,215
0
76
okay

# Boot up Linux by default.
#
default=Linux
image=/vmlinuz
initrd=/boot/initrd.img-2.4.18-1-386
label=Linux
read-only
# restricted
# alias=1

Okay .. I now have a symlink in /boot to initrd
am I okay??
I ran lilo
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Heres everything that any user wants to or needs to know about making a custom kernel in Debian using the dpkg/apt-get tools


Also check out the other docs on the website. It's a combination of newbie centric and Debian centric. Answered a lot of questions about debian I had myself.

edit:

I am almost never quite satisfied with the kernel that comes with any distro, plus I usually need the newest sources to get the best drivers for my hardware.

Also check out dselect.

Initrd is a root filing system that is temperarally used at boot time.

What it does is that the boot loader starts up, loads the kernel and initrd into memory. The initrd is completely ram-based filing system that is used to load modules and do some hardware detection (depends on how it's set up) in order to prepare the kernel to begin using the real root.

For instance you have scsi device that needs a module, or you have a remote NFS root and need to load a networking module in order to access. So then it loads it into memory to be used by the kernel.

After the initrd is finished with loading the nessicary drivers, it mounts the real root file system read only, then they kernel switches to the new "real" root, and then unmounts the initrd file system, then continues on just like any normal non-initrd boot up.

Very usefull for creating a custom kernel that will work on the widest range of hardware possible, but not be gigantic and unstable. Most distros use them nowadays. I've created a couple myself for different weird things....
(lilo doesn't realy care were the initrd or vmlinuz realy is.. just as long as it can find them to load up into the MBR, grub is a bit more picky.)
 

smp

Diamond Member
Dec 6, 2000
5,215
0
76
Okay, everything worked :)
Thanks for the help bingbong and thanks for the info Drag .. much appreciated.

bingbong .. you still making php art?

edit: oh yeah, one more question. How do I know what configuration parameters and modules are part of the kernel that i apt-got?
 

Barnaby W. Füi

Elite Member
Aug 14, 2001
12,343
0
0
Originally posted by: smp

bingbong .. you still making php art?
Nah I don't even do any php anymore, but the old stuff is still up on http://incise.org .

edit: oh yeah, one more question. How do I know what configuration parameters and modules are part of the kernel that i apt-got?

Good question.. I dunno. Generally everything and the kitchen sink is compiled in as a module.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Well for the modules you can go and look in the /lib/modules folder. Usually you can figure out what they are for buy looking at the names and their locations.

In the kernel sources their is usually some documentation for the module parameters, but there realy aren't any standards that I understand.

If you want the easiest thing to do install kudzu (standard backend created for Redhat's anconda stuff). It's used by knoppix to configure everything on boot up and I believe it is aviable in the normal sid repositories.

You can run that from the command line and it will set up most your hardware for you and record it into the /etc/modutils/kudzu file for inclusion in your automaticly generated /etc/modules.conf file.

Then the stuff that it misses should be easy to deal with.

There is also a dectection package (I think that's what it is called) that's also avaible that can do a similar thing.
 

cleverhandle

Diamond Member
Dec 17, 2001
3,566
3
81
Originally posted by: smp
edit: oh yeah, one more question. How do I know what configuration parameters and modules are part of the kernel that i apt-got?
In 2.6 and some 2.4 kernels there's an option to make the full kernel configuration available via proc - the info will be found in the /proc/ikconfig directory. Some distros also include the original .config file under /boot, renamed appropriately (like /boot/config-2.4.21-i686).

I don't have a Debian box with a prebuilt kernel to check if either of those apply to you. If neither of them do, you could probably find a config file in arch/i386/conf in the kernel sources. But as BBWF said, you can pretty much assume that the config chooses "module" for every possible option apart from the really basic ones.

Also, as Drag kind of implied, the /initrd is supposed to empty. The initrd works by doing a "pivot_root" - switching / between two mounted filesystems. That means that, just after the pivot, the initrd's files have be mounted somewhere. That somewhere is /initrd, which is unmounted soon after.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Ah... that makes sense with the /initrd

Oh in debian the .config's are in /boot (at least for my custom ones)