deepin15 5 建立核心原始碼樹

2021-08-16 15:27:06 字數 2733 閱讀 7825

系統環境: deepin-15.5-amd64

deepin在安裝系統時,已經有有核心原始碼樹可直接使用:

# cd /lib/modules/4.9.0-deepin13-amd64/build
根據網上其他部落格的整理,在自己電腦上按照如下步驟,重新完成新的原始碼樹建立,步驟如下。

下面主要介紹重新建立新的原始碼樹的過程

1.檢視當前執行的核心版本

skyeworld@skyeworld-pc:~/desktop$ uname -r

4.9.0-deepin13-amd64

2.查詢可用的原始碼包

skyeworld@skyeworld-pc:~/desktop$ sudo apt-cache search linux-source

[sudo] skyeworld 的密碼:

linux-source - linux kernel source (meta-package)

linux-source-4.1 - linux kernel source for version 4.1 with debian patches

linux-source-4.11 - linux kernel source for version 4.11 with debian patches

linux-source-4.2 - linux kernel source for version 4.2 with debian patches

linux-source-4.3 - linux kernel source for version 4.3 with debian patches

linux-source-4.4 - linux kernel source for version 4.4 with debian patches

linux-source-4.4-deepin - linux kernel source for version 4.4-deepin with debian patches

linux-source-4.5 - linux kernel source for version 4.5 with debian patches

linux-source-4.6 - linux kernel source for version 4.6 with debian patches

linux-source-4.7 - linux kernel source for version 4.7 with debian patches

linux-source-4.8 - linux kernel source for version 4.8 with debian patches

linux-source-4.9 - linux kernel source for version 4.9 with debian patches

linux-source-deepin - linux kernel source (meta-package)

skyeworld@skyeworld-pc:~/desktop$ sudo apt-get install linux-source-4.9

linux-source-4.1 linux-source-4.3 linux-source-4.5 linux-source-4.8

linux-source-4.11 linux-source-4.4 linux-source-4.6 linux-source-4.9

linux-source-4.2 linux-source-4.4-deepin linux-source-4.7

4.解壓

cd  /usr/src

sudo tar -jvxf linux-source-4.9.tar.xz

5.編譯核心

cd linux-source-4.9/

sudo make oldconfig /*會給出提示,乙隻回車就行了,具體什麼設定暫未了解 */

sudo make bzimage /* 執行時間較長 ,慢慢等待,執行完成後,執行完成後,會在目錄中多乙個vxlinux檔案 */

6.編譯模組

sudo make modules /* 執行時間較長,請慢慢等待*/
7. 安裝模組

sudo make modules_install
hello.c原始碼如下

makefile原始碼如下

hello模組裝載域解除安裝

裝載:insmod hello.ko

檢視是否裝載:lsmod |grep hello.ko

檢視列印:dmesg/* deepin 訊息不會在控制台列印,需要使用dmesg命令檢視最後輸出*/

解除安裝:rmmod hello.ko

Openssl建立SSL雙向認證連線原始碼

include stdio.h include string.h include openssl ssl.h include openssl bio.h include openssl err.h pragma comment lib,ws2 32.lib pragma comment lib,li...

Openssl建立SSL雙向認證連線原始碼

include stdio.h include string.h include openssl ssl.h include openssl bio.h include openssl err.h pragma comment lib,ws2 32.lib pragma comment lib,li...

linux核心原始碼閱讀(一)從何處閱讀原始碼

像linux核心這樣龐大而複雜的程式看起來確實讓人望而生畏,它象乙個很大的球,沒有起點和終點。在讀源 的過程中,你會遇到這樣的情況,當讀到核心的某一部分時又會涉及到其它更多的檔案,當返回到原來的地方想繼續往下讀時,又忘了原來讀的內容。在internet上,很多人為此付出了很大的努力,製作出了源 導航...