Changes between Version 6 and Version 7 of buildroot


Ignore:
Timestamp:
11/08/2018 06:13:55 PM (11 months ago)
Author:
Tim Harvey
Comment:

added initrd section

Legend:

Unmodified
Added
Removed
Modified
  • buildroot

    v6 v7  
    11[[PageOutline]]
    22
    3 = Buildroot =
     3= Buildroot
    44A Linux kernel without a root filesystem (aka rootfs) is useless. There are many sources for root filesystems including complete Linux distributions like Ubuntu (often too big, or limited in arch availability), pre-built root filesystems from vendors (often too limited), root filesystems built manually with Busybox (still often too limited) and more. There are Embedded Linux build systems which try to be more flexible like !OpenEmbedded, Yocto, and OpenWrt but these tend to be not easy to understand or quick to setup. Buildroot tends to be a much more simplistic approach using standard makefiles, can produce a root filesystem in minutes, and has 1000+ userspace libs/apps available.
    55
    6 Using a buildroot rootfs is extremely useful for kernel development because you can build a rootfs small enough to embed it into the kernel via [#initramfs initramfs].
     6Using a buildroot rootfs is extremely useful for:
     7 * small fast booting self-contained systems (the default busybox rootfs is typically ~1.5MB)
     8 * kernel development (using [#initrd initrd] or [#initramfs initramfs] options
     9 * using its toolchain externally
    710
    811suggested tools to include for kernel development:
     
    2427 * see sections below on configuration tips for various platforms
    2528
     29For platform specific notes see below:
     30 * [#ventana Gateworks Ventana (imx6)]
     31 * [#newport Gateworks Newport (cn80xx)]
     32
    2633References:
    2734 * https://buildroot.org
     
    3037
    3138
     39[=#initrd]
     40== initrd (initial ramdisk)
     41The initial RAM disk (initrd) is an initial root file system that is mounted prior to when the real root file system is available. The initrd is bound to the kernel and loaded as part of the kernel boot procedure.
     42
     43An {{{initrd}}} is a 'cpio' image (an archive created with the Unix {{{cpio}}} tool) thus you need to have
     44BR2_TARGET_ROOTFS_CPIO enabled and optionally one of the compression formats supported by your kernel).
     45
     46If using U-Boot 'bootm' be sure to enable BR2_TARGET_ROOTFS_CPIO_UIMAGE which runs 'mkimage' on output/images/rootfs.cpio to create a 'uramdisk'.
     47
     48Example booting Linux kernel with device-tree and initrd using U-Boot 'bootm':
     49 * Bootloader:
     50{{{#!bash
     51setexpr fdt_addr $loadaddr
     52setexpr linux_addr $fdt_addr + 0x20000 # allow 128KB for FDT
     53setexpr rd_addr $linux_addr + 0x4000000 # allow 64MB for kernel
     54setenv bootargs "console=${console},${baudrate}"
     55setenv fsload tftpboot # for network load
     56$fsload $fdt_addr $fdt_file2 && $fsload $linux_addr uImage && $fsload $rd_addr uramdisk && bootm $linux_addr $rd_addr $fdt_addr
     57}}}
     58  - In the above example you can modify fsload to load for your storage interface, device, and filesystem (ie "setenv fsload 'fatload mmc 0:1'" for loading from fist mmc controller first partition fatfs filesystem)
     59
     60
    3261[=#initramfs]
    33 == initramfs ==
    34 Using buildroot to create a very small (typically ~1.5MiB) root filesystem that can be embeeded in a kernel via {{{initramfs}}} is very popular for kernel development.
     62== initramfs
     63The buildroot root filesystem can also be built statically into a kernel eliminating the need to have a separate kernel and ramdisk as in the [#initrd initrd] option above.
    3564
    3665To build a rootfs suitable for use as an initramfs:
     
    74103
    75104[=#busybox]
    76 == Busybox config ==
     105== Busybox config
    77106Busybox is used by default for all of the tools in the rootfs built by buildroot. If you want to alter the default configuration of busybox itself you can access it via {{{make menuconfig}}}:
    78107 * Target packages -> !BusyBox -> !BusyBox configuration file to use
     
    81110
    82111[=#newport]
    83 == Newport (CN80XX/CN81XX) ==
     112== Newport (CN80XX)
    84113The following details pertain to buildroot 2017.11 although newer versions will likely be similar if not the same.
    85114
     
    117146
    118147[=#ventana]
    119 == Ventana (IMX6) ==
     148== Ventana (IMX6)
    120149The following details pertain to buildroot 2017.08 although newer versions will likely be similar if not the same.
    121150