How to compile and install Linux-kernel(4.18.0) and U-Boot(2017.11)

How to compile and install Linux-kernel(4.18.0)

1.Choose linux kernel
    (1)sudo apt-cache search linux-source
    (2)sudo apt-get install linux-source-4.18.0(default path:/usr/src)
   
2.Install necessary software
    (1)sudo apt-get install libncurses-dev
    (2)sudo apt-get install libncurses5-dev
    (3)sudo apt-get install flex
    (4)sudo apt-get install openssl libssl-dev
    (5)sudo apt-get install libelf-dev
  
3.compile linux kernel
    (1)sudo tar -jxv -f linux-source-4.18.0.tar.bz2
    (2)sudo cp /boot/config-4.15.0-45-generic .config
    (3)sudo make menuconfig(default configuration)
    (4)sudo make -j4 (reduce the compile time)
    (5)sudo make modules_install
    (6)sudo make install
    (7)sudo reboot
   
4.check the startup logs(printk)
    (1)sudo apt install util-linux
    (2)dmesg >eric_debug

4.1 Supplyment:

 On my ubuntu20.04,I want to use my own kernel, so I need to change and update grub

sudo vim /etc/default/grub

sudo update-grub

useful link:  

https://blog.csdn.net/weixin_35347870/article/details/116648436?utm_medium=distribute.pc_relevant.none-task-blog-baidujs_title-0&spm=1001.2101.3001.4242

https://www.cnblogs.com/open-skill/p/8295234.html

Tips for Windows connect the Linux paltform
1.install ssh server
    sudo apt-get update
    sudo apt-get install openssh-server
    /etc/init.d/ssh start

2.Install putty on windwos paltform
    host name: IP address(Linux paltform)
 
3.slove the connection problem
    sudo apt install vim
    sudo vim /etc/ssh/sshd_config
        ClientAliveInterval 0 -> ClientAliveInterval 60
        TCPKeepAlive yes(turn on)

How to compile U-Boot

(1)Error happpened
compile the U-Boot("samsung -- Exynos5250 --armv7")
 sudo make smdk5250_defconfig  
 sudo make ARCH=arm  all

Error log:
 CC      lib/asm-offsets.s
 cc1: error: bad value (‘armv5’) for ‘-march=’ switch
 cc1: note: valid arguments to ‘-march=’ switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 bonnell atom silvermont slm knl x86-64 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 btver1 btver2
 Kbuild:43: recipe for target 'lib/asm-offsets.s' failed

(2)Install arm-linux-gnueabi
 sudo apt-get install gcc-arm-linux-gnueabi

(3)compile the U-Boot("samsung -- Exynos5250 --armv7")
 sudo make smdk5250_defconfig  
 sudo make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- all

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值