summaryrefslogtreecommitdiffstats
path: root/md/writeup/compile_linux_kernel.md
diff options
context:
space:
mode:
Diffstat (limited to 'md/writeup/compile_linux_kernel.md')
-rw-r--r--md/writeup/compile_linux_kernel.md22
1 files changed, 11 insertions, 11 deletions
diff --git a/md/writeup/compile_linux_kernel.md b/md/writeup/compile_linux_kernel.md
index a373caf..2724736 100644
--- a/md/writeup/compile_linux_kernel.md
+++ b/md/writeup/compile_linux_kernel.md
@@ -8,7 +8,7 @@ To get main repo kernel
Default kernel is located here
-```
+```sh
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
```
@@ -34,7 +34,7 @@ Easyes way startup config is just to get whatever you running now. If you hw wor
with current distro then use current kernel config its is stored in procfs _/proc/config.gz_.
Lets go to our kernel repo and do
-```
+```sh
zcat /proc/config.gz > .config
```
now you are ready to compile kernel that will work at begining
@@ -51,19 +51,19 @@ And you will able to run your stuff only with staticly compiled kernel without l
List all loaded modules
-```
+```sh
lsmod
```
See all conntected USB devices
-```
+```sh
lsusb
```
See all PCI devices and modules that they are using
-```
+```sh
lspci -k
```
@@ -72,14 +72,14 @@ This bare minimum of command that you whant to run to start modifing your kernel
## Compiling
Run to configure kernel
-```
+```sh
make menuconfig
```
config is saved in _.config_ file. And now we are ready to
compile our first kernel
-```
+```sh
make
```
@@ -91,19 +91,19 @@ It depends from distro to distro expected way how to install new/fresh/clean ker
Install modules. They all will go /lib/modules/`your kernel version`
-```
+```sh
make modules_install
```
Compy compiled kernel to boot directory
-```
+```sh
cp -v arch/x86_64/boot/bzImage /boot/vmlinuz-linux318
```
Create initram image
-```
+```sh
mkinitcpio -k <kernelversion> -g /boot/initramfs-<file name>.img
```
@@ -125,7 +125,7 @@ https://grsecurity.net/
Latest patches could be downloaded from https://grsecurity.net/download.php#test
Apply patch
-```
+```sh
cd linux-4.7.10
patch -p1 < ../grsecurity-3.1-4.7.10-201610222037.patch
```