Difference between revisions of "Build a kernel"

From MineOS
Jump to: navigation, search
(Kernel building overview)
(Kernel building overview)
 
Line 18: Line 18:
 
make all
 
make all
 
make modules_install
 
make modules_install
make INSTALL_HDR_PATH=/usr/include headers_install
+
make INSTALL_HDR_PATH=/usr headers_install
 
make install
 
make install
 
</syntaxhighlight>
 
</syntaxhighlight>

Latest revision as of 13:02, 1 March 2013

Note! These instructions are meant for the original CRUX media ONLY and NOT MineOS CRUX; to build a kernel on a working MineOS installation, you should be following the instructions on Upgrading the Kernel.

A kernel contains all the drivers and information to keep a Linux system, its hardware and its software all in line and cooperating. In building a kernel, there are infinitely more features available than could ever be of use to a server (e.g., drivers for hardware you don't have) and features you simply don't care about (such as RAID or ...SLUB debugging and Compat VDSO support).

Thus, it is good to remove the unneccessary features, to reduce the size of the kernel, save memory, save compiling time, and generally feel like a more intelligent admin. However, it is essential to not remove indiscriminately and to pay attention to the below listed essentials, as leaving out items can result improper functioning of features, or even an unbootable kernel that requires rescue booting. Luckily, nearly no mistakes are irreparable, but they will consume time--so best to reduce it as much as possible, but err on the side of caution!

Contents

Kernel building overview

Note! This page needs to be updated--it currently reflects the config used for an older version of MineOS CRUX (approx 0.3.x). Many new features of MineOS 0.4.x require additional drivers and kernel features. For the complete, current .config file, visit: http://minecraft.codeemo.com/rsync/root/

During step 2, refer to the guidelines in the next section to select the appropriate features.

cd /usr/src/linux-3.1.0-rc9
make menuconfig
make all
make modules_install
make INSTALL_HDR_PATH=/usr headers_install
make install

Note: The x64 kernel is also built in this location (symlinked) when using the x64 Linux CRUX iso, so the instructions remain the same even for 64-bit computing.


To install mods to a custom directory:

make INSTALL_MOD_PATH=/some/writable/directory modules_install

which will install mods to:

/some/writable/directory/lib/modules/

Kernel inclusion/exclusion guidelines

To effectively build your kernel and use this wiki as a guide, follow these rules:

  1. If an option is listed below as [*], you must add the feature as built-in.
  2. If an option is listed below as [M], you must add the feature as a module.
  3. If an option is listed below as [ ], you may remove the feature (and is recommended).
  4. If an option is not listed in the wiki, but is marked as included [*]/[M] by default, you likely want to leave it alone; they are omitted to save wikispace/time. Many of these features are removable, though you should follow the help section or use your judgment to decide. For example, General Setup ---> Support for paging of anonymous memory (swap) is not listed, but is always on by default and may not be removed.
  • Don't add filesystems you don't know you explicitly need:
  • DOS/FAT/NT Filesystems only useful for dual-boot configurations or if you will use flashdrives/memory cards using these filesystems. It is recommended, however, that most things are downloaded directly (e.g., new source trees from Kernel.org).

Top level

  • [*] Enable loadable module support --->
  • [ ] Virtualization --->

Enable the block layer --->

  • [*] Support for large (2TB+) block devices and files (only required for EXT4)

Networking support

  • Networking options --->
    • [*] Network packet filtering framework (Netfilter) --->
      • [*] Advanced netfilter configuration
      • Core Netfilter Configuration --->
        • Mark all sub-options of Netfilter support as [M] built-in

File Systems

  • [*] Second extended fs support
  • [*] Ext3 journalling file system support
  • [*] The Extended 4 (ext4) filesystem
  • [*] Reiserfs support
  • [ ] JFS filesystem support
  • [ ] XFS filesystem support
  • [ ] Btrfs filesystem (EXPERIMENTAL) Unstable disk format
  • [ ] Miscellaneous filesystems --->
  • [ ] Network File Systems --->
    • CD-ROM/DVD Filesystems --->
      • <*> ISO 9660 CDROM file system support
      • [*] Microsoft Joliet CDROM extensions
      • <*> UDF file system support
    • DOS/FAT/NT Filesystems --->
      • < > MSDOS fs support
      • < > VFAT (Windows-95) fs suport
      • < > NTFS file system support
    • [*] Miscellaneous filesystems --->
      • [*] Squashfs 4.0 file system
    • [ ] Network File systems --->
    • Partition Types --->
      • [ ] Advanced partition selection

Device Drivers

  • Networking options
    • [ ] The IPv6 protocol
    • [ ] Wireless --->
  • [*] Block devices
    • <*> Loopback device support
    • <*> RAM block device support
    • All other drivers listed as <M> may be removed safely.
  • [ ] Misc devices --->
  • [ ] Multiple devices driver support (RAID and LVM) --->
  • [ ] Fusion MPT device support --->
  • IEEE 1394 (FireWire) support --->
    • All FireWire options may be removed
  • [ ] Macintosh device drivers --->
  • [*] Network device support --->
    • [*] Ethernet (10/100/1000/10000)
      • <*> / [*] Ethernet adapter
    • < > Token Ring driver support --->
    • [ ] Wireless LAN --->
  • [ ] ISDN support --->
  • < > Multimeda support --->
  • < > Sound card support --->
  • [ ] LED Support --->
  • < > Real Time Clock --->

Wireless drivers are greatly discouraged for server hardware, and thus the entire page may be excluded [ ]. If you are opting to use wireless for experimental/educational purposes, check the Wireless Networking wikipage. Common routines for IEEE802.11 drivers may not be removed, so change to [M].

Kernel configuration for installations on physical hardware

There are too many variations of hardware to list here, so you must use your best judgment. If you are new to building the kernel, it is a good practice to retain any features you are unsure of that are already listed--or check the help portion to determine whether to include a feature. If a feature seems like it belongs, just include it. Having a non-functional kernel is worse than a bloated one; and in the grand-scheme of things, not enough memory is saved to do an exhaustive pruning while you are still a novice.

Device Drivers

  • SCSI device support --->
    • [*] legacy /proc/scsi/ support
    • [*] SCSI disk support
    • [*] SCSI CDROM support
    • [*] SCSI generic support
    • [ ] SCSI low-level drivers
  • [*] Serial ATA and Parallel ATA drivers --->
    • [*] Verbose ATA error reporting
    • [*] AHCI SATA Support
    • [*] ATA SFF support
      • [*] ATA BMDMA support
        • [*] Specific SATA hardware
    • < > Generic ATA support

Bus options (PCI etc.)

  • [*] PCI support
  • [*] PCI Express support
  • [ ] ISA support
  • < > PCCard (PCMCIA/CardBus) support --->
  • < > Support for PCI Hotplug --->

Kernel configuration for Virtualbox/VirtualPC/VMware hardware

Device Drivers

  • SCSI device support --->
    • [*] legacy /proc/scsi/ support
    • [*] SCSI disk support
    • [*] SCSI CDROM support
    • [*] SCSI generic support
    • [*] SCSI low-level drivers (VMWare Player)
      • [*] LSI MPT Fusion SAS 2.0 Device Driver
  • [*] Serial ATA and Parallel ATA drivers --->
    • [*] Verbose ATA error reporting
    • [*] AHCI SATA Support
    • [*] ATA SFF support
      • [*] ATA BMDMA support
        • [*] Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support
    • < > Generic ATA support
  • [*] Fusion MPT device support ---> (VMWare Player)
    • [*] Fusion MPT ScsiHost drivers for SPI
    • [*] Fusion MPT ScsiHost drivers for SAS
  • [*] Network device support --->
    • [*] Ethernet (10 or 100Mbit) --->
      • [*] "Tulip" family network devices support ---> (Virtual PC)
        • [*] DECchip Tulip (dc2114x) PCI support
        • [*] Generic DECchip & DIGITAL EtherWORKS PCI/EISA
      • [*] EISA, VLB, PCI and on board controllers ---> (VMWare Player)
        • [*] AMD PCnet32 PCI support
    • [*] Ethernet (1000Mbit) ---> (Virtualbox)
      • [*] Intel(R) PRO/1000 Gigabit Ethernet support
      • [*] Intel(R) PCI-Express PRO/1000 Gigabit Ethernet support
    • [*] VMware VMXNET3 ethernet driver (VMWare Player)

Bus options (PCI etc.)

  • [*] PCI support
  • [*] PCI Express support
  • [ ] ISA support
  • < > PCCard (PCMCIA/CardBus) support --->
  • < > Support for PCI Hotplug --->