国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

Linux 內(nèi)核編程開發(fā)環(huán)境

2020-11-24 12:07 作者:開源開發(fā)者  | 我要投稿

apt-get clean && apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y?

reboot

uname -r 已經(jīng)升級了

apt-get install gcc

apt-get install make

apt-get install -y linux-headers-$(uname -r) 內(nèi)核頭文件

sudo apt-get install linux-kbuild-5.7 編譯內(nèi)核模塊

apt-get install build-essential 建立deb包依賴

編譯內(nèi)核模塊不要使用sudo make?

使用make即可

Makefile obj文件名一定要與源文件名一致


KaliLinuxKernelProgrammer.c

#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>

/* 入口函數(shù) */
static int init(void)
{
? ?printk(KERN_ALERT "init\n");
? ? ? ?return 0;
}

/* 退出函數(shù) */
static void exit(void)
{
? ?printk(KERN_ALERT "exit\n");
}

/* 注冊 */
module_init(init);
module_exit(exit);




Makefile

KERNEL_VER = $(shell uname -r)
?
# the file to compile
obj-m += KaliLinuxKernelProgrammer.o

# specify flags for the module compilation
EXTRA_CFLAGS = -g -O0

build: kernel_modules

kernel_modules:
? ? ? ?make -C /lib/modules/$(KERNEL_VER)/build M=$(PWD) modules
clean:
? ? ? ?make -C /lib/modules/$(KERNEL_VER)/build M=$(PWD) clean



編譯內(nèi)核

sudo apt-get install linux-source-5.7 內(nèi)核源碼包 會有壓縮文件

sudo apt-get install libssl-dev

sudo apt-get install gcc libncurses5-dev build-essential kernel-package libssl-dev kernel-source-** libc6-dev tk8.* fakeroot bin86

make[1]: *** No rule to make target 'debian/certs/benh@debian.org.cert.pem', needed by 'certs/x509_certificate_list'

打開.config文件并注釋掉這一行

#CONFIG_SYSTEM_TRUSTED_KEYS="debian/certs/benh@debian.org.cert.pem"

sudo?? make? oldconfig??

sudo? make?

sudo? make? zImage

sudo make? modules?

sudo? make? modules_install

/lib/modules/xxxx

sudo make install? ? ? ?該命令的作用是將.config,vmlinuz,initrd.img,System.map文件到/boot/目錄、更新grub。默認啟動新內(nèi)核

reboot

uname -a


sudo insmod


lsmod | grep “xxx”


dmesg| tail -n 20


sudo rmmod


如何刪除內(nèi)核:

查看當(dāng)前安裝的內(nèi)核

dpkg --get-selections | grep linux

列表中含image 部分是已經(jīng)安裝過的內(nèi)核

執(zhí)行apt-get remove linux-image-****-generic

或者

sudo apt-get purge linux-image-****-generic

(移除后啟動選項中還會有卸載的內(nèi)核選項)

update-grub? 更新grub這樣在系統(tǒng)啟動的時候就不會有卸載掉的內(nèi)核了這樣就徹底的卸載了

問題

dpkg --get-selections|grep linux

有時候這個命令找不到剛才安裝的內(nèi)核

這個時候用一下方法

刪除boot下面和要刪除的內(nèi)核版本相關(guān)的文件 rm –rf rm -f *3.19.8*

刪除/usr/src/目錄下的內(nèi)核源碼

update-grub 更新grub



Linux 內(nèi)核編程開發(fā)環(huán)境的評論 (共 條)

分享到微博請遵守國家法律
榆中县| 乡宁县| 宾川县| 潼关县| 清徐县| 双柏县| 通州区| 山东| 铁岭县| 桦南县| 泸水县| 岳普湖县| 屯留县| 新乡县| 夹江县| 内丘县| 晋城| 阳山县| 定西市| 乐清市| 遂昌县| 巢湖市| 武冈市| 福州市| 永兴县| 民勤县| 香港| 武强县| 界首市| 昌都县| 忻城县| 长乐市| 塔河县| 辽源市| 小金县| 锡林浩特市| 太原市| 景宁| 株洲市| 泗洪县| 通河县|