From 94e429f914be777770cf8094d728008a5efcf6ff Mon Sep 17 00:00:00 2001 From: Silvino Silva Date: Mon, 22 Aug 2016 21:41:57 +0100 Subject: added all core files --- core/linux.html | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 core/linux.html (limited to 'core/linux.html') diff --git a/core/linux.html b/core/linux.html new file mode 100644 index 0000000..8a77980 --- /dev/null +++ b/core/linux.html @@ -0,0 +1,116 @@ + + + + + 3. Kernel Linux + + + + 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 SysDoc Manual. +Copyright (C) 2016 +Silvino Silva. +See the file Gnu Free Documentation License +for copying conditions.

+ + + -- cgit 1.4.1-2-gfad0