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

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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章