Systools Index

3.6. Kernel Linux

Linux is a monolith kernel, a big one !!!.

This instructions are done with active chroot and inside chroot;

       # chroot $CHROOT /bin/bash
       

3.6.1. Port Linux Libre

This will install linux-libre port and dracut;

        $ prt-get depinst linux-libre
        

3.6.2. Manual Install

Download Linux Source from linux libre, this ensure that kernel is free of blobs.

        $ pkgmk -do
        

Crux iso comes with config that you can use as a starting point.


        cp ../linux-4.5.5.defconfig .config
        $ make oldefconfig
        

If you like graysky2 kernel_gcc_patch (download master) that adds more cpu options (FLAGS native)

        $ unzip kernel_gcc_patch-master.zip
        
        $ cd ~/linux-4.5.5/
        $ patch -p1 < ../kernel_gcc_patch-master/enable_additional_cpu_optimizations_fo
        r_gcc_v4.9+_kernel_v3.15+.patch
        patching file arch/x86/include/asm/module.h
        patching file arch/x86/Kconfig.cpu
        patching file arch/x86/Makefile
        Hunk #1 succeeded at 85 (offset -7 lines).
        patching file arch/x86/Makefile_32.cpu
        

Gresecurity

        patch -p1 < $SRC/grsecurity-3.1-4.5.5-201605291201.patch
        

Configure kernel according to your current kernel hardware support run;

        $ make localmodconfig
        

This will disable all unloaded modules, you can use localyesconfig mark all loaded to be built in the kernel. This example get information about which graphic module (driver) is in use;

        # lspci -nnk | grep -i vga -A3 | grep 'in use'
        Kernel driver in use: i915
        #
        
        $ cd ~/linux-4.5.5/
        $ make -j $(nproc) all
        $ sudo make modules_install
        $ sudo cp arch/x86/boot/bzImage /boot/vmlinuz-4.5.5
        $ sudo cp System.map /boot/System.map-4.5.5
        

3.6.3. Manual Remove

        $ sudo rm -r /lib/modules/4.5.5-gnu
        $ sudo rm /boot/vmlinuz-4.5.5
        $ sudo rm /boot/System.map-4.5.5
        
Systools Index

This is part of the c9-doc Manual. Copyright (C) 2016 Silvino Silva. See the file Gnu Free Documentation License for copying conditions.