Yocto Build Linux

From Variscite Wiki
Revision as of 11:27, 3 May 2017 by Admin (talk | contribs) (Created page with "{{PageHeader|Yocto Build Linux from source code}} {{DocImage|category1=Yocto|category2={{#var:HARDWARE_NAME|DART-6UL}}}} __toc__ = Toolchain installation for out of Yocto buil...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Yocto Build Linux from source code

Toolchain installation for out of Yocto builds

To install the toolchain, follow DART-6UL Yocto Morty Toolchain installation.

Build Linux out of Yocto tree

Get the Linux source code:

$ cd ~/var-fslc-yocto
$ git clone https://github.com/varigit/linux-2.6-imx.git 
$ git checkout -b imx-rel_imx_4.1.15_2.0.0_ga-var01 origin/imx-rel_imx_4.1.15_2.0.0_ga-var01

Build the Linux kernel:

$ source /opt/fsl-imx-x11/4.1.15-2.0.1/environment-setup-cortexa7hf-neon-poky-linux-gnueabi
$ cd ~/var-fslc-yocto/linux-2.6-imx/
$ make mrproper
$ make imx6ul-var-dart_defconfig
Build everything:
$ make -j4
Build zImage only:
$ make -j4 zImage
Build modules only:
$ make -j4 modules
Build device trees only:
$ make -j4 dtbs

Build only the device tree for DART-6UL with eMMC and WiFi: $ make -j4 imx6ul-var-dart-emmc_wifi.dtb

Build only the device tree for DART-6UL with eMMC and SD card: $ make -j4 imx6ul-var-dart-sd_emmc.dtb

Build only the device tree for DART-6UL with NAND flash and WiFi: $ make -j4 imx6ul-var-dart-nand_wifi.dtb

Build only the device tree for DART-6UL with NAND flash and SD card: $ make -j4 imx6ul-var-dart-sd_nand.dtb

Build only the device tree for DART-6ULL with eMMC and WiFi: $ make -j4 imx6ull-var-dart-emmc_wifi.dtb

Build only the device tree for DART-6ULL with eMMC and SD card: $ make -j4 imx6ull-var-dart-sd_emmc.dtb

Build only the device tree for DART-6ULL with NAND flash and WiFi: $ make -j4 imx6ull-var-dart-nand_wifi.dtb

Build only the device tree for DART-6ULL with NAND flash and SD card: $ make -j4 imx6ull-var-dart-sd_nand.dtb

Notes:
- If you replace the kernel image (zImage) on your system, you also need to reinstall the kernel modules, and vice versa.
- If you just want to make a change in the device tree, you can compile and replace it without replacing the kernel image and modules.

Install the built kernel on an SD card

Copy the zImage and device trees to the SD card boot partition, and install the modules in the SD card rootfs partition.
Assuming the boot partition is mounted on /media/BOOT-DART-6UL and the rootfs partition is mounted on /media/rootfs:

Install the kernel image and modules:
$ cp arch/arm/boot/zImage /media/BOOT-DART-6UL
$ sudo make ARCH=arm modules_install INSTALL_MOD_PATH=/media/rootfs
Install the device trees:
$ cp arch/arm/boot/dts/*var*.dtb /media/BOOT-DART-6UL

Note:
If you are using our Recovery SD card, and you want the NAND flash/eMMC installation to update as well as the SD card boot itself, you need to also update the /opt/images/Yocto directory.