LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   Red Hat custom Kernel compilation mini-How-To for Red Hat 8-9 (https://www.linuxquestions.org/questions/red-hat-31/red-hat-custom-kernel-compilation-mini-how-to-for-red-hat-8-9-a-91503/)

Thetargos 03-09-2004 02:10 AM

In the front page should be a faily easy to understand explanation, but in general terms you simply de-compress the patch into a directory (it may even be /usr/src), you cd into your kernel's source directory (in this case /usr/src/linux-2.6.3) and patch with:
Code:

$ su
password:
# patch -p1 -i ../patch-2.6.4-rc2

This example is if you unpacked the patch to /usr/src, otherwise you will have to state the whole path to the patch after the -i flag (-i /path/to/patch/patch.file)

xbaez 03-11-2004 04:33 PM

Thanks for your help!!! ;)

My new kernel is working now

However I have two questions

1) can I tell the new kernel what modules to load at startup?
for instance I wouldn't like the kernel to load SCSI modules that I don't use at the moment, but I may need them sometime

2) has anybody used a custom image in the GRUB boot loader?
What type of image should go in this field?

splashimage=XXXX

Regards

Xavier

Thetargos 03-11-2004 04:45 PM

For question number 1, use the files modules.conf (kernel 2.4) and modprobe.conf (kernel 2.6) for controlling the modules loaded at boot time. Not always works the way you expect them to, so you better man modprobe.conf, man modprobe, man modules.conf, man depmod.

Fot the second you need to create an image with a custom palette set to 15 colors. You may use the GIMP for that: Open up the image you want, right click on it, image-->mode-->indexing (or alt+i) and select a 15 color palette, save the image as .xpm, compress it with gzip (gzip <file>.xpm) copy that to /boot/grub/ and just change the name under splashimage=/boot/grub/<file>.xpm.gz in /etc/grub.conf :D

comprookie2000 03-13-2004 04:23 PM

For kernels 2.6.x you will need to include support for your root partition (/) file system into the kernel and not as a separate module. If you are using the ext3 file system you will need at the very least ext2fs support compiled directly into the kernel, otherwise you'll prolly get an error regarding VFS not being able to mount the root partition. Also, if you use other FS than ext2/3, then you will have to replace the grub entry root=LABEL=/ (or something similar) to your actual disk partition (e.g. root=/dev/hda2) in order for the kernel to appropriately boot.
Help,how do I do this,thanks david

comprookie2000 03-13-2004 04:46 PM

creating root device
Mounting root filesystem
moutn: error 6 mounting ext2
pivot root: pivot_root (/sysroot/, /sysroot/initrd) failed: 2
umount /initrd/proc failed: 2
freeing unused kernel memory: 153k freed
kernel panic: no init found. Try passing init= option to kernel
This is what I get,thanks david

Thetargos 03-14-2004 01:50 AM

Sorry for the delayed answer.

Ok, you include the support for your FS when you configure the kernel, you simply choose [y] instead of [m] to compile that into the kernel. To change the actual device and the kernel looks for mounting when booting you should do so in the file located at /boot/grub/grub.conf, or trhough it's symlink in /etc (/etc/grub.conf) using your favourite text editor as root.

comprookie2000 03-14-2004 03:56 PM

Thanks,I looked in the /boot/grub/grub.conf and I have 2 other kernels 2.4.xxx and they are the same as the 2.6.4,I'm pretty new so mayby that I need to look some where else.In this forum under general for building how to they talk about how you have to do something to get kernel to see the file system but as you can tell then I get lost.thanks david

comprookie2000 03-14-2004 04:07 PM

kernel-2.6.4-1.270.i686.rpm Is this the package I need for the kernel to see the ext 3 file system?

Thetargos 03-14-2004 04:10 PM

Quote:

Originally posted by comprookie2000
Thanks,I looked in the /boot/grub/grub.conf and I have 2 other kernels 2.4.xxx and they are the same as the 2.6.4,I'm pretty new so mayby that I need to look some where else.In this forum under general for building how to they talk about how you have to do something to get kernel to see the file system but as you can tell then I get lost.thanks david
It's really not that complicated, here's an excerpt of my grub.conf file:

Code:

#title Fedora Core (2.4.22-1.2174.nptl)
#root (hd0,0)
#        kernel /vmlinuz-2.4.22-1.2174.nptl ro root=LABEL=/ vga=792 rhgb
#        initrd /initrd-2.4.22-1.2174.nptl.img


title Fedora Core (2.6.4)
root (hd0,0)
        kernel /vmlinuz-2.6.4 ro root=/dev/hda2 #vga=792 rhgb
        initrd /initrd-2.6.4.img

title Winbugs gaming
map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd1,0)
        chainloader +1
        makeactive

Note the commented out kernel (the Fedora official kernel). It uses the default RH/Fedora grub format (except for the added vga= option). You should make the root= argument point to the HDD partition your root directory (/) is. In my case is /dev/hda2, but in yours may be different.

Thetargos 03-14-2004 04:16 PM

Quote:

Originally posted by comprookie2000
kernel-2.6.4-1.270.i686.rpm Is this the package I need for the kernel to see the ext 3 file system?
In order for any 2.6.x kernel to see the root partition file system, it must be compiled with support for it built in. Otherwise the kernel will complaint. Also you have to have an initrd (or Initial RAM Disk) for RH/Fedora. If that RPM package is from RH/Fedora, it most probably already includes support for ext3. Good luck!

comprookie2000 03-14-2004 04:42 PM

Thanks,I tried like you said and now says error 19 mounting Ext3
no init found try passing init=options to kernel?I'll try that rpm but I think I needed to do this befor and there might be no saving this kernel,thanks again david

xbaez 03-14-2004 04:49 PM

For the splashimage, I found out that you can save it directly in GIMP in the xpm.gz format. So you don't need to gzip it later. However I have a question about images:

Can anybody write a small script which randomly (or in a secuence) replaces the splashimage file (let's say /boot/grub/images/default.xpm.gz) every time the system closes?

Then in every boot I'll be able to change my initial image. Something like displaying multiple images in KDE desktop

Regards

Xavier

xbaez 03-14-2004 04:52 PM

comprookie 2000:

if you are reciving this error:
kernel panic: no init found. Try passing init= option to kernel

It's because the 'make install' command wasn't successfull. When it is successfull, it should automatically update your Lilo/Grub config files and add a link to your vmlinuz and initrd file

xbaez 03-14-2004 04:55 PM

I have a SUSE Professional 8.2 installation

I edited the /etc/inittab file, and commented a line that said the system to use a script to load/unload services in the rcx.d subdirectories.

How can I edit the file again, so that the system can boot-up properly?

I tried starting the Rescue system from the SuSE CD1, I mounted my local system (dev/hda3) and made the proper changes. However those changes seem to stay in the PC memory, therefore when I boot up I receive messages similar to these:

user: xxxx
FileSystem is read only

In other words, the whole system gets mounted as read-only, that's being happening since I commented that line

Thetargos 03-14-2004 06:08 PM

Quote:

Originally posted by xbaez
I have a SUSE Professional 8.2 installation

I edited the /etc/inittab file, and commented a line that said the system to use a script to load/unload services in the rcx.d subdirectories.

How can I edit the file again, so that the system can boot-up properly?

I tried starting the Rescue system from the SuSE CD1, I mounted my local system (dev/hda3) and made the proper changes. However those changes seem to stay in the PC memory, therefore when I boot up I receive messages similar to these:

user: xxxx
FileSystem is read only

In other words, the whole system gets mounted as read-only, that's being happening since I commented that line

Anotherway could be if you boot in rescue mode (with the CD) but when prompted don't ask the installer to search for your install. That way, you may simply make a mount point (something like /mnt/rescue_edit) or something, mount your root partition, locate the file, edit it, and save it.


All times are GMT -5. The time now is 09:24 AM.