How to prepare new SD card for iMX6 sabre lite board for running linux

androidFan picture androidFan · Nov 4, 2014 · Viewed 8k times · Source

I recently bought i.MX6 Sabrelite board and I'm learning kernel cross compilation and board bring-up.

The u-boot is already there in flash and it is configured to load the kernel from SD card. I tried some prebuilt images and the board boots successfully after flashing these images on SD card using dd.

Now, I want to learn how to prepare this whole SD card with kernel and rootfs.

I am able to build the uImage of kernel using following step mentioned here : http://boundarydevices.com/cross-compile-i-mx6-kernel-using-ltib-toolchain/

~/$ git clone git://github.com/boundarydevices/linux-imx6.git
~/$ cd linux-imx6
~/linux-imx6$ export PATH=/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/:$PATH
~/linux-imx6$ export ARCH=arm
~/linux-imx6$ export CROSS_COMPILE=arm-none-linux-gnueabi-
~/linux-imx6$ git checkout origin/boundary-imx-3.0.35_1.1.0 \
        -b boundary-imx-3.0.35_1.1.0
~/linux-imx6$ make nitrogen6x_defconfig
~/linux-imx6$ make uImage modules

Now, the issues are:

  1. How do I create rootfs ?

  2. How do I partition the SD card ?

Answer

yegorich picture yegorich · Nov 5, 2014

Take a look at Buildroot. It will take care of cross-compiler, kernel, bootloader and rootfs.

BR already provides i.MX6 Sabrelite target. Execute following steps:

git clone http://git.buildroot.net/git/buildroot.git
cd buildroot
make freescale_imx6dlsabresd_defconfig

As for SD card partitioning look at this resources:

https://community.freescale.com/docs/DOC-95017

But basically you'll need a FAT partition for bootloader and another one for rootfs, ext4 for example.