LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Mandriva (https://www.linuxquestions.org/questions/mandriva-30/)
-   -   Devious Howto install a Vanilla Kernel onto a Mandriva 2008.0 (https://www.linuxquestions.org/questions/mandriva-30/devious-howto-install-a-vanilla-kernel-onto-a-mandriva-2008-0-a-624354/)

aus9 02-27-2008 09:02 PM

Devious Howto install a Vanilla Kernel onto a Mandriva 2008.0
 
For Mandriva users only.

Devious Howto install a Vanilla Kernel onto a Mandriva 2008.0

Why devious? Well I am not a K guru. So do at your own risk. Please post any questions in the kernel forum. Altho I am posting my config, please be aware that it is designed for my hw and I install Mdv on only XFS filesystem partitions and so have no ext2/3/JFS/Reiser support. I still use modules and an initrd. Assume all commands are with root powers, I use su but you could use su- or sudo. I use menuconfig. The vanilla version I am working on is 2.6.24.2. My deviations from the Kernel rebuild guide are due to the changing kernels and we are using Mdv 2008 which is no longer a x386 design but a x586.



Credit

Kernel Rebuild Guide by Kwan Lowe
http://www.digitalhermit.com/linux/K...ild-HOWTO.html

Copyright and License
This document, Kernel Build HOWTO, is copyrighted (c) 2004 by Kwan L. Lowe. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is available at http://www.gnu.org/copyleft/fdl.html .

Linux is a registered trademark of Linus Torvalds.



Begin

Ensure you have the necessary files but as I do not use certain things...my list is, at time of writing, up-to-date for Mdv 2008.0 ...i586 ....= 32 bit edition. I have updated versions in the top list and min ones for the lower list.

FILE Updated VERSION HOWTO CHECK
Gnu C 4.2.2 20071128 # gcc --version
Gnu make 3.81 # make --version
binutils 2.17.50.0.12 # ld -v
util-linux 2.13 # fdformat --version
module-init-tools 3.3-pre11 # depmod -V
xfsprogs 2.9.3 # xfs_db -V
procps 3.2.7 # ps --version
libncurses-devel 5.6-1.20070901.3mdv2008.0 # thru MCC Mandriva Control Center
ncurses 5.6-1.20070901.3mdv2008.0 # thru MCC Mandriva Control Center

Optional ......I use and recommend these files for sensors and mail watch etc.
lm_sensors 2.10.4-2mdv2008.0 # thru MCC Mandriva Control Center
gkrellm 2..3.0-1mdv2008.0 # thru MCC Mandriva Control Center



NOT NEEDED BY ME BUT MAYBE BY YOU
min version
e2fsprogs 1.29 # tune2fs
jfsutils 1.1.3 # fsck.jfs -V
reiserfsprogs 3.6.3 # reiserfsck -V 2>&1|grep reiserfsprogs
pcmcia-cs 3.1.21 # cardmgr -V
quota-tools 3.09 # quota -V
PPP 2.4.0 # pppd --version
isdn4k-utils 3.1pre1 # isdnctrl 2>&1|grep version
nfs-utils 1.0.5 # showmount --version
oprofile 0.5.3 # oprofiled --version





Downloads and unpack

D/load bz2 kernel file from www.kernel.org or a good mirror.

eg
http://h1.ripway.com/aus9/Folder%20Name/nodek.png

d/load patches needed to take to 2.6.24.2
http://h1.ripway.com/aus9/Folder%20Name/nodep1.png
http://h1.ripway.com/aus9/Folder%20Name/nodep2.png

unpack Kernel with
Code:

tar jxvf linux-2.6.A.B.tar.bz2
d/load any patches ....the first time you d/load the kernel, you do not d/load any patches. But when there is a higher number, you d/load the patches to allow your kernel to be taken back to linux-2.6.A.0 and then the latest patch to take you to ....B. If this is your first d/load and you are getting the most recent linux vanilla, jump to Research.




PATCHING.

If you had 2.6.24.1 and you want to update to .2 then you need to d/load 2 patches
patch-2.6.24.1 and patch-2.6.24.2 but they will also be in bz2 format, so unpack them with similar command to the linux one above.

The original folder you unpacked before was called /linux-2.6.24.1
move both patches into that folder using Konqueror. Now lets patch.
Code:

cd /pathto/linux-2.6.24.1
(Reverse the patch back to 2.6.24.0 with)
patch -p1 -R < patch-2.6.24.1
(patch kernel to latest with)
patch -p1 < patch-2.6.24.2
cd ..
(get out of that folder then rename it with Konqueror ending with .2 or manually its
mv linux-2.6.24.1 linux-2.6.24.2



RESEARCH

Using your motherboard documents, your invoice and the output of lspci and lsmod, also check kdeinfo, MCC hw section,......you need to know exactly what drivers are needed to run your hw. eg My ethernet was a module called r8169

I am going to continue to use an initial ram disk image, so do not compile your sata drive into the kernel but leave it as a module. You will need to study the /Documentation folder to research your sata drive, but MCC hw section names the module.
http://h1.ripway.com/aus9/Folder%20Name/mcc-sata.png

By checking kde info for sections IRQ, IO, PCI, Snd and USB you should be able to see most drivers for not only your basic hardware, but things that relate to sensors, if you have previously installed it.
http://h1.ripway.com/aus9/Folder%20Name/info-snd.png
http://h1.ripway.com/aus9/Folder%20Name/it87.png

Old kernel builds needs a sym link from .../include/asm-i386 to .../include/asm. New Kernels seem to know I have opted out of 64 bit so has a link from /asm-x86 instead.

If you build your kernel as 64 bit then consider checking symbolic link from asm-ia64 please.

Mandriva did the sym linking all by its self....but feel free to check it it matches your design build.



BUILD THE VANILLA

Before we build the kernel we have this unpacked kernel folder somewhere.....and the recommendation is not to move it under /usr/src/ but to leave it somewhere else. So first, break any symbolic link from /usr/src/linux to where ever by deleting that file..../usr/src/linux.
Its easy with Konqueor in su mode....if you have no Kmenu for admin File Manager add an icon for Konqueror on the desktop and (for RH person) Rh click > properites > Application tab > Advanced Options > choose "run as diff user" make it root.


My vanilla is under /a = non FHS format = naughty. Where ever it is, I symbolically link like this
Code:

ln -s /a/secret/linux-2.6.24.2 /usr/src/linux
cd /usr/src/linux/linux-2.6.24.2/    (takes you to the true unpacked path under /a)

Or use Konqueror in root mode to do the linking.
at /usr/src/ press F10 and create folder linux then go to real kernel and drag it to /usr/src/linux and choose option link
http://h1.ripway.com/aus9/Folder%20Name/link.png

Next command is issued to delete any old links to your old kernel.
Code:

make mrproper
If mrproper returns this error "make: *** No rule to make target `mrproper'. Stop" Then you have not sym linked to the real unpacked kernel folder correctly.

Mrproper cleans up some links from old builds for a clean start. However, while you are in tuning mode, I suggest you run i2c drivers as modules the first time, you do not run make mrproper again. mrproper is to be used on each patch or each major d/load not on each tuning of the same kernel, ok?

I use make menuconfig which needs ncurses and dependencies before you can continue.

If you press enter to get into a sub-menu, you can exit by pressing the ESCape key twice quickly.

Lets get in there.
Code:

make menuconfig
I am now going to give some of the key settings, not all as you can look at my config file.
http://h1.ripway.com/aus9/Folder%20N...6.24.2vanilla4

Y to compile in, M to module, N for none. You can use lower case.

If unsure Press H for help and read the text.
----------------------------------------------------------------------------
GENERAL SETUP
Prompt for dev
swap
initial ram disk
------------------------------------------------------------------------------
Y to ENABLE LOADABLE MOD SUPPORT
in sub menu..choose all but 3rd and 4th
--------------------------------------------------------------------------------------
Y to ENABLE THE BLOCK LAYER
in sub menu - choose first 3
----------------------------------------------------------------------------------
PROCESSOR TYPE AND FEATURES
in sub menu, I use virtualbox, so it does not need paravirtualized support
choosing my Athlon 64 does not automatically compile a 64 bit kernel
Pre-emption to normal desktop
Timer to 1000 Hz
---------------------------------------------------------------------------------------------
POWER MANAGEMENT
sub-menu suspend to ram etc....save the planet and turn off please.
----------------------------------------------------------------------------------------------------
BUS OPTIONS
sub-menus be careful here, I have a pci system no isa. Nor does my motherboard have pci express video slots.
------------------------------------------------------------------------------------------------------------
EXECUTABLE FILE FORMATS
Y to top and bottom options in sub menu
--------------------------------------------------------------------------------------------------------------
NETWORKING
SUB 1 Y to support
sub 2 NETWORKING OPTIONS
Heaps to check here. Know your hardware.Most of the other sub menus I have disabled.
-------------------------------------------------------------------------------------------------------------
DEVICE DRIVERS
Sub-menu for Parallel port I have disabled as I have the motherboard connectors but not the devices.
sub-menu for Block devices
I have a floppy so this is where to enable
I check Iso images so need loopback support
Y to ATA...support
sub-menus is where you find the IDE/ATAPI cdburners/roms and floppy (again)
It also contained one of my chipsets...these chipsets are mainly to do with DMA stuff.

Sub-menu SCSI DEVICE SUPPORT
N to raid.....save the planet buy one drive please.
Y to sub-menu scsi dev support
M for scsi disk to help initrd creation
M for SATA to help initrd creation.
sub-menu M for my sata driver (via)
.....these settings allow Mandriva/Kernel build scripts to create the initrd.

N to Raid and LVM
Y to Network Device support
sub-menu this is where you will find your ethernet device so for me,
Y to Ethernet 1000 and its sub-menu is Y for my driver r8169

Y for I2c support...sub-menu make most modules for probing with command sensors-detect on reboot.
Later on I re-config to enable only the settings I want.

Y to Hw Monitoring support...sub-menu is where my CPU is but if unsure make them modules and check on reboot.

sub-menu Graphics Support...sub-menu to that is where you will find AGP video slots

Sound
sub-menu Y to Sound card support
Y to most sub-menu lower down....
and in sub-menu...PCI devices is where I say Y to my soundcard chipset.
and N to OSS

Y to USB support
sub-menu Y to host side
sub-menu Y to USB device fs
sub-menu Y to EHCI (usb2)
sub-menu Y to UHCI if usb on via chipsets
sub-menu Y to USB mass storage....your memory sticks may also need others but mine do not.

-----------------------------------------------------------------------------------------------
FIRMWARE DRIVERS
none
-------------------------------------------
FILE SYSTEMS
Watch out, I have Mdv installed on XFS partitions so I have no to ext2/3/JFS/Reiserfs
Y to XFS....if I did not I could not boot.
sub-menu CD-ROM...say Y to all sub-menus
sub-menu DOS...say Y to all you need take care if you are dual booting to XP or Vista you may need NTFS if they are in your fstab file.

sub-menu Pseudo...say Y to most

sub-menu Native Language support
If English is only language its
Y to 437, 850, ascii, 8859-1, 8859-15, Utf-8
--------------------------------------------------------------------
INSTRUMENTATION SUPPORT
I need none
-----------------------------------------
KERNEL HACKING
Say Y to debug but I don't actually run it....I am too good??
------------------------------------------------------------
SECURITY OPTIONS
Say Y to most if relevant
I adopt slighlty devious security options that I have promised not to reveal. I know nothing.....and it shows eh?
-----------------------------------------------------------------------------------------------------------------
Y to CRYPTOGRAPHICt
I actually use a few of these....MD5, CRC, SHA1 no harm in leaving most in.
----------------------------------------------------------------------------
LIBRARY ROUTINES
The default allows CRC32 which is normal.
-------------------------------------------------------------------------------------------------

Now at main menu....save your settings with an unique name like vanilla1 vanilla2 etc.
Next is tricky...repeat the save but call new file .config

Then exit and run
Code:

make && make modules && make modules_install && make install
Now reboot and grub will already have a new K menu item for you.

Tip, in GENERAL SETUP, second line down, each config change, I also change the kernel local version name to match what my config is called. Hence, Vanilla4 means it took me 4 goes to get a decent kernel. Not perfect but decent.

ON REBOOT
Instead of running a debugger, I check my logs and if ok, I run full hardware tests.

TIP
keep an old dmesg log and old syslog and run xxdiff. Do not be surprised if your log shows changes when you have made your ethernet and sound module to inbuilt. The same applies to MCC hw info changing from module showing to no module info
http://h1.ripway.com/aus9/Folder%20Name/mod-unknown.png


These should include:
sound
printer
usb sticks
burn to dvdrw or cdrw (to save my precious cdr stocks) and
check a data cd opens
play a movie
play a mp3
usb mp3 player connects and plays and writes
Open and see KDE info and control ctr stuff ok
Open a shell and su to root to check ok
check floppy mounts
check commercial audio cd plays
copy data between partitions
Internet works ..external firewall...www.pcflank.com works
mount a iso image.....with
Code:

mount -o loop /path to/file.iso /mnt/disk....or create a new directory
2) Rebuild your Nvidia kernel driver from the nvidia site, and as I use VirtualBox, I re-install that RPM as it taints the kernel as well.

3) Keep your old kernel for a week or so in case you have missed something

4) TIP take an image of your partition (s) with partimage...and burn to a dvdrw

Micro420 02-27-2008 09:46 PM

good stuff. This should probably go into the TUTORIALS section

aus9 02-28-2008 02:39 AM

NO pls....I do not want to have this viewed by non-believers.

Mdv users only is why I said it at the top.....and tutorial implies some kind of K guru stauts which I am clearly not....I should know my own weaknesses

I have only 2 heh heh

aus9 02-28-2008 02:41 AM

BTW I should edit to say I use Vbox static rpm from their site and not Mdv rpm and ditto I use Nvidia tarball and not Mdv's nvidia style rpms.


All times are GMT -5. The time now is 01:27 AM.