NotePublic/Software/Development/System/Linux/Kernel/Linux_下搭建驱动开发环境.md

34 lines
619 B
Markdown

# Linux 下搭建驱动开发环境
## 升级
```bash
# Ubuntu
sudo apt update
sudo apt upgrade
# Manjaro
sudo pacman -Syu
```
## 安装基础软件包
```bash
# Ubuntu
sudo apt install build-essential kernel-package kernek-source libncurses5-dev libssl-dev libelf-dev
```
## 安装内核源码
```bash
# Ubuntu
sudo apt install linux-source-$(uname -r)
# Manjaro
uname -r
sudo pacman -Ss linux-headers
sudo pacman -S linux<kernel version>-headers
```
## 重启
由于升级时可能升级了内核,需要重启一次才能生效,否则 uname 返回值会与实际不符,以及导致其他奇怪问题。