skimppimppin along! NEWS   FORUM   DOWNLOAD   LINKS    
HOME ACCOUNT PRIVATE MESSAGE  
Login
Username:

Password:


Lost Password?

Register now!

Main Menu

Search

skimpydog.com Forum Index
   No Distro Specific
   Kernel Building

Browsing this Thread:   1 Anonymous Users

 

  Bottom    Previous Topic    Next Topic
  •  Rate Thread
      Rate this Thread
      Excellent
      Good
      Average
      Bad
      Terrible
Poster Thread
Kernel Building
#1
Webmaster
Joined: 2007/6/10
From Dallas, TX
Posts: 79
Level : 7
HP : 0 / 170
MP : 26 / 8767
EXP : 83
Group:
Webmasters
Registered Users
Offline
Building the Linux Kernel is really quite simple - IF you have a decent auto-generated configuration to start with.

What I mean by that, is simply this:

You can build your kernel by hand, and often things will fail until you have your kernel 100% how you want it - that is working with your hardware, how you want it 100%.

Keep in mind you will have to configure things for iptables/ipfw, network, video performance, audio, hard disks (RAID, SCSI) etc... until you have what you want in a working manner. Stable..

A few key pointers I have learned are like this, If you have a .config, or anything like that in /usr/src/kernel(linux)-{whatever}.x.x-x, you can use for your new kernel builds.

This can become a bit more difficult than this, but for that you MUST read up on the specific hardware you are attempting to configure, and from there you may need to stay on top of drivers after you rebuild your kernel.

This is very common for video cards whereas you will have to reinstall your video drivers after rebuilding your kernel.

______________________________


So, if you cd to /etc/src/kernel-XXX you can see your source files for your kernel.

If you do not have these crucial files, you will need to install the kernel source.

##################

A note about kernel building:

You ultimately build the kernel you are wanting to run - a kernel that works stably with your hardware, and preferably boots quickly (that's if you can help it - some drivers take a moment to load, or fail to load). With that in mind, if the source of the kernel you have available to you is all you have available, then that is your new kernel version until you decide to upgrade {or downgrade}.

You should be able to port your kernel between operating systems (Linux variants if you use the Linux kernel) if you build things properly, and actually use your .config that you ultimately build with any of the kernel releases from kernel.org when you build your kernel.


_____________________________________

The configuration

I will advise to build your kernel starting off with a newer kernel that has been auto-generated.

If you run gentoo, you can actually use the "genkernel all" command to generate a kernel for you, then you can customize things.

You can load your kernel configuration into "make menuconfig" once you locate the initial .config file which is normally located at /usr/src/kernel(linux|symlink)/.config.

If this is the same directory for the source you are building from, it should automatically load, if you do not trust this, or wish to change the location for the build you want to configure, scroll all of the way down, and choose, "Load an Alternate Configuration File", such as:
cd /usr/src/linux
make menuconfig

 Linux Kernel v2.6.19-gentoo-r5 Configuration
 ──────────────────────────────────────────────────────────────────────────────
  ┌────────────────────── Linux Kernel Configuration ───────────────────────┐
  │  Arrow keys navigate the menu.  <Enter> selects submenus --->.          │
  │  Highlighted letters are hotkeys.  Pressing <Y> includes, <N> excludes, │
  │  <M> modularizes features.  Press <Esc><Esc> to exit, <?> for Help, </> │
  │  for Search.  Legend: [*] built-in  [ ] excluded  <M> module  < >       │
  │ ┌────^(-)─────────────────────────────────────────────────────────────┐ │
  │ │        Device Drivers  --->                                         │ │
  │ │        File systems  --->                                           │ │
  │ │        Instrumentation Support  --->                                │ │
  │ │        Kernel hacking  --->                                         │ │
  │ │        Security options  --->                                       │ │
  │ │        Cryptographic options  --->                                  │ │
  │ │        Library routines  --->                                       │ │
  │ │    ---                                                              │ │
  │ │        Load an Alternate Configuration File                         │ │
  │ │        Save an Alternate Configuration File                         │ │
  │ └─────────────────────────────────────────────────────────────────────┘ │
  ├─────────────────────────────────────────────────────────────────────────┤
  │                    <Select>    < Exit >    < Help >                     │
  └─────────────────────────────────────────────────────────────────────────┘


As I previously stated, you will want to configure your kernel to meet your specific needs.

If you want ntfs support (if you have a dual boot, or if you have a NTFS drive (partition)), add this as a module, not built into the kernel; such as:
while in make menuconfig
Choose:
File systems  --->

Scroll Down until you see:
DOS/FAT/NT Filesystems  --->

Build in NTFS support as a module:
 Linux Kernel v2.6.19-gentoo-r5 Configuration
 ──────────────────────────────────────────────────────────────────────────────
  ┌──────────────────────── DOS/FAT/NT Filesystems ─────────────────────────┐
  │  Arrow keys navigate the menu.  <Enter> selects submenus --->.          │
  │  Highlighted letters are hotkeys.  Pressing <Y> includes, <N> excludes, │
  │  <M> modularizes features.  Press <Esc><Esc> to exit, <?> for Help, </> │
  │  for Search.  Legend: [*] built-in  [ ] excluded  <M> module  < >       │
  │ ┌─────────────────────────────────────────────────────────────────────┐ │
  │ │    <M> MSDOS fs support                                             │ │
  │ │    <M> VFAT (Windows-95) fs support                                 │ │
  │ │    (437) Default codepage for FAT                                   │ │
  │ │    (iso8859-1) Default iocharset for FAT                            │ │
  │ │    <M> NTFS file system support                                     │ │
  │ │    [*]   NTFS debugging support                                     │ │
  │ │    [*]   NTFS write support                                         │ │
  │ │                                                                     │ │
  │ │                                                                     │ │
  │ │                                                                     │ │
  │ └─────────────────────────────────────────────────────────────────────┘ │
  ├─────────────────────────────────────────────────────────────────────────┤
  │                    <Select>    < Exit >    < Help >                     │
  └─────────────────────────────────────────────────────────────────────────┘



Setup anything else you may need, Video Card, network cards, wifi cards, HAM Radio if you are licensed for it and have the equipment, or make yourself a vending machine out of a Linux box - and save your configuration.
 Linux Kernel v2.6.19-gentoo-r5 Configuration
 ──────────────────────────────────────────────────────────────────────────────







          ┌──────────────────────────────────────────────────────────┐
          │  Do you wish to save your new kernel configuration?      │
          │  <ESC><ESC> to continue.                                 │
          ├──────────────────────────────────────────────────────────┤
          │                   < Yes >      <  No  >                  │
          └──────────────────────────────────────────────────────────┘



Then build the kernel.

The Build

Building is really quite simple, but it can take a lot of time.
-- You must be in the kernel source directory first
make
make modules
make install
make modules_install


or you can run this as one string:
make ; make modules ; make install ; make modules_install


Check to make sure your grub is up to date (pointing to the correct kernel, and you have the proper arguments to boot):
vi /boot/grub/grub.conf

The following will be customized for your specific layout! This is what I use on a machine:
timeout 30
default 2
fallback 1
splashimage=/boot/grub/splash.xpm.gz

title Gentoo Linux
kernel (hd0,0)/boot/kernel-genkernel-x86-2.6.19-gentoo-r5 root=/dev/hda4

title GenKernel Linux
kernel (hd0,0)/boot/kernel-genkernel-x86-2.6.19-gentoo-r5.1 root=dev/ram0 init=linuxrc ramdisk=8192 real_root=/dev/hda4 vga=791 splash=silent
initrd (hd0,0)/boot/initramfs-genkernel-x86-2.6.19-gentoo-r5

title Windows
rootnoverify (hd0,2)
chainloader +1




After you have verified things are going to work (drive locations, and grub (or lilo) is configured to boot the new kernel), you should be good to go.
Posted on: 2009/1/28 22:29
Create PDF from Post Print
Top
Subject Poster Date
     Re: Kernel Building skimpydog 2010/1/19 19:41
       Re: Kernel Building skimpydog 2011/2/10 20:10
 Top   Previous Topic   Next Topic

 


 You cannot start a new topic.
 You can view topic.
 You cannot reply to posts.
 You cannot edit your posts.
 You cannot delete your posts.
 You cannot add new polls.
 You cannot vote in polls.
 You cannot attach files to posts.
 You cannot post without approval.
Links