theread.me/_posts/2021-11-06-linux-contribution.md

46 lines
1.3 KiB
Markdown
Raw Normal View History

2021-11-06 13:09:29 +00:00
---
layout: post
title: "My first contribution to Linux Kernel: Step by step"
date: 2021-11-06 00:00:00
permalink: first-linux-contribution/
categories: programming
author: Mahdi
2021-11-06 22:31:58 +00:00
published: false
2021-11-06 13:09:29 +00:00
---
November 6th:
Create a virtual machine for Archlinux on my macOS using QEMU:
- [Download the Archlinux iso image](https://archlinux.org/download/)
- Create a qemu disk:
{% highlight bash %}
2021-11-06 21:25:20 +00:00
qemu-img create disk.img 15G
2021-11-06 13:09:29 +00:00
{% endhighlight %}
- Start the machine and [install Archlinux](https://wiki.archlinux.org/title/Installation_guide)
{% highlight bash %}
2021-11-06 20:40:19 +00:00
qemu-system-x86_64 -cdrom archlinux-2021.11.01-x86_64.iso -boot order=d -drive format=raw,file=disk.img -m 8G
2021-11-06 13:09:29 +00:00
{% endhighlight %}
2021-11-06 20:40:19 +00:00
- Start the machine after installing
{% highlight bash %}
qemu-system-x86_64 -drive format=raw,file=disk.img -m 2G
{% endhighlight %}
- Install dependencies:
{% highlight bash %}
pacman -S gcc git make
{% endhighlight %}
- Clone linux:
{% highlight bash %}
git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
{% endhighlight %}
2021-11-08 20:24:48 +00:00
- Install necessary dependencies
{% highlight bash %}
pacman -S flex base-devel xmlto kmod inetutils bc libelf git cpio perl tar xz
{% endhighlight %}
- Generate a configuration file
{% highlight bash %}
make nconfig
{% endhighlight %}
- Make!
{% highlight bash %}
make
{% endhighlight %}