Cherry Zheng

Compiling File system with buildroot(MYZR-IMX6-EK200)

Discussion created by Cherry Zheng on May 21, 2018

Host Platform: UBUNTU14.04
Hardware PlatformMYZR MY-IMX6-EK200
Compiler:      gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz
buildroot version:buildroot-2017.02.5.tar.bz2

1. Decompression
$ mkdir ~/IMX6/
$ tar xvf ~/IMX6/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz

$ mkdir ~/buildroot
$ cd ~/buildroot
$ tar jxvf  buildroot-2017.02.5.tar.bz2
$ cd buildroot-2017.02.5/

2. Configuration
$ make imx6q-sabresd_defconfig
$ make menuconfig

Use of external compilers gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz
Toolchain--->
set up Toolchain type as External toolchain
Toolchain as Custom toolchain
Toolchain path为/home/linyn/IMX6/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/
choose【*】Toolchain has C++ support?

Main attention: External toolchain kernel headers series (3.1.x)Set this option, select the kernel version number of the compile tool, file


   ~/IMX6/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/arm-linux-gnueabihf/libc/usr/include/linux/version.h
    Hold the version number (each compile tool has this file in decimal), and you can see what the version number is by converting it to hexadecimal, as my version.h is


   #define LINUX_VERSION_CODE 196865
    #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
  The 196609 version of hexadecimal is 0x30101, and that version number is 3.01.01which is 3.0.1, so choose 3.1.x here. See picture "configuration 1"



System configuration--->
(myzr) System hostname  Set up host name
/dev management (Dynamic using devtmpfs + mdev)   kernel configuration support medv,system also configured mdev
Run a getty (login prompt) after boot --->
(ttymxc0) TTY port               set up log in serial port
         Baudrate (115200)  --->      

Not compile kernel
Kernel--->
[] Linux Kernel  uncheck

Not compile U-BOOT
Bootloaders --->
[] U-Boot          uncheck

$ make -j4              //Compiled with 4 threads
Result produce output/images/rootfs.tar
Look at the picture "result 1" and "result 2" (result 2 is not compile kernel report error, ignore it).


Finally revise rootfs
vim etc/issue 
Welcome to MY-IMX6-EK200

vim etc/profile

if [ "$PS1" ]; then
        if [ "`id -u`" -eq 0 ]; then
         export PS1='\u@\h:\w\# '
        else
         export PS1='\u@\h:\w\$ '
        fi
fi

Finally compressing burn in, log in with root, default no password


VFS: Mounted root (ext3 filesystem) on device 179:2.
devtmpfs: mounted
Freeing unused kernel memory: 396K (809c6000 - 80a29000)
Starting logging: OK
Starting mdev...
Initializing random number generator... random: dd urandom read with 47 bits of entropy available
done.
Starting network: OK
Welcome to MY-IMX6-EK200
myzr login: root
root@myzr:~# 
root@myzr:~# 
root@myzr:~# ls
root@myzr:~# ls /
bin         lib         lost+found  opt         run         tmp
dev         lib32       media       proc        sbin        usr
etc         linuxrc     mnt         root        sys         var
Look at the picture "Log in"

 

If you would like to know more about our products, please visit our website www.myzr.com.cn or email to enquiry@myzr.com.cn.

 

Outcomes