Last active
September 9, 2019 15:03
-
-
Save chenchun/8ca3438e67266729cd76 to your computer and use it in GitHub Desktop.
play with different kernel verison #cmake
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tar -xvf linux-3.8.4.tar | |
make menuconfig 选择编译哪个driver | |
make localmodconfig # | |
make -j8 #使用8个CPU编译 | |
make modules_install | |
make install | |
debian 修改开机启动文件 | |
boot | |
vi /boot/grub/grub.cfg | |
terminal_output gfxterm | |
if [ "${recordfail}" = 1 ] ; then | |
# set timeout=-1 | |
set timeout_style=menu | |
set timeout=3 | |
else | |
if [ x$feature_timeout_style = xy ] ; then | |
set timeout_style=menu | |
set timeout=3 | |
# Fallback normal timeout code in case the timeout_style feature is | |
# unavailable. | |
else | |
set timeout_style=menu | |
set timeout=3 | |
#set timeout=0 | |
fi | |
fi | |
delete a installed kernel version | |
rm /boot/System.map-4.3.0 | |
rm /boot/vmlinuz-4.3.0 | |
rm -r /lib/modules/4.3.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.8) | |
project(linux C) | |
include_directories(include | |
"include/uapi" | |
"arch/x86/include" | |
"arch/x86/include/uapi") | |
add_definitions(-D__KERNEL__ -DDEBUG) | |
file(GLOB_RECURSE ALL_FILES | |
"drivers/net/*.h" | |
"drivers/net/*.c" | |
) | |
add_executable(linux ${ALL_FILES}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.8) | |
project(linux C) | |
include_directories(include) | |
file(GLOB_RECURSE ALL_FILES | |
"*.h" | |
"*.c" | |
) | |
add_executable(linux ${ALL_FILES}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
change kernel args | |
https://askubuntu.com/questions/19486/how-do-i-add-a-kernel-boot-parameter?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa | |
sudo vi /etc/default/grub | |
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash foo=bar" | |
sudo update-grub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment