From 8d53fb61b542ad151c4f63901cca4858e3996a1f Mon Sep 17 00:00:00 2001 From: Silvino Silva Date: Sat, 17 Sep 2016 03:01:16 +0100 Subject: core linux revision --- core/linux.html | 93 ++++++++++++++++++++++++++++++--------------------------- 1 file changed, 49 insertions(+), 44 deletions(-) (limited to 'core') diff --git a/core/linux.html b/core/linux.html index dc7f7f1..c2c8452 100644 --- a/core/linux.html +++ b/core/linux.html @@ -2,75 +2,74 @@ - 3. Kernel Linux + 2.3. Kernel Linux - Systools Index -

3.6. Kernel Linux

+ Core OS Index +

2.3. Kernel Linux

-

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

+

Linux is a monolith kernel, a big one ! Visit + Linux Libre + and + Linux Non-Libre pages for more links + and information.

-

This instructions are done - with active chroot - and inside chroot;

+

2.3.1. Port Linux Libre

-
-       # chroot $CHROOT /bin/bash
-       
- -

3.6.1. Port Linux Libre

- -

This will install linux-libre port - and dracut;

+

Collection c9-ports have linux-libre port with default crux + configuration, this port depends on dracut and grub but is not + required to install them. To build and install this port using + prt-get;

         $ prt-get depinst linux-libre
         
-

3.6.2. Manual Install

+

2.3.2. Manual Install

-

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

+

Download Linux Source from + linux libre, + or using the port system;

-        $ pkgmk -do
+        $ cd /usr/ports/c9-ports/linux-libre
+        $ sudo -u pkgmk pkgmk -do
         
-

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

+

Crux iso comes with config that is used in this port, is + a good starting point to personalize according to your needs;

-
-        cp ../linux-4.5.5.defconfig .config
-        $ make oldefconfig
+        $ mkdir ~/kernel
+        $ cd ~/kernel
+        $ cp /usr/ports/c9-ports/linux-libre/linux-4.1.32.defconfig .
+        $ cp /usr/ports/distfiles/linux-libre-4.1.32-gnu.tar.xz .
+        $ tar xf linux-libre-4.1.32-gnu.tar.xz
+        $ cp linux-4.1.32.defconfig linux-4.1.32/.config
         
-

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

-        $ unzip kernel_gcc_patch-master.zip
+        $ cp /usr/ports/distfiles/enable_additional_cpu_optimizations_for_gcc_v4.9%2B_kernel_v3.15%2B.patch cpu_optimizations.patch
         
-        $ cd ~/linux-4.5.5/
-        $ patch -p1 < ../kernel_gcc_patch-master/enable_additional_cpu_optimizations_fo
-        r_gcc_v4.9+_kernel_v3.15+.patch
+        $ cd ~/linux-4.1.32/
+        $ patch -p1 < ../cpu_optimizations.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).
+        Hunk #1 succeeded at 85 with fuzz 1 (offset -9 lines).
         patching file arch/x86/Makefile_32.cpu
+        $
         
-

Gresecurity

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

Read Gresecurity.

Configure kernel according to your current kernel - hardware support run;

+ hardware support;

         $ make localmodconfig
@@ -78,26 +77,32 @@
 
         

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;

+ to be built in the kernel.

+ +

To get information about your hardware, + for example information about which graphic + module (driver) is in use as root run;

         # lspci -nnk | grep -i vga -A3 | grep 'in use'
         Kernel driver in use: i915
-        #
         
+

Before start compiling check configuration;

+ +
+        $ make nconfig
+        
-        $ cd ~/linux-4.5.5/
+        $ cd ~/linux-4.1.32/
         $ 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
+        $ sudo cp arch/x86/boot/bzImage /boot/vmlinuz-4.1.32
+        $ sudo cp System.map /boot/System.map-4.1.32
         
-

3.6.3. Manual Remove

+

2.3.3. Manual Remove

         $ sudo rm -r /lib/modules/4.5.5-gnu
@@ -105,7 +110,7 @@
         $ sudo rm /boot/System.map-4.5.5
         
- Systools Index + Core OS Index

This is part of the c9-doc Manual. Copyright (C) 2016 Silvino Silva. -- cgit 1.4.1-2-gfad0