Changes between Version 57 and Version 58 of buildroot


Ignore:
Timestamp:
03/16/2024 12:08:59 AM (8 months ago)
Author:
Tim Harvey
Comment:

updated venice buildroot examples: move to a 6.6 kernel and by default keep the ramdisk external to the kernel to make it more flexible

Legend:

Unmodified
Added
Removed
Modified
  • buildroot

    v57 v58  
    250250[=#venice]
    251251== Venice (IMX8M)
    252 The following details pertain to buildroot 2023.02 although newer versions will likely be similar if not the same.
    253 
    254 The Venice product family is based on the i.MX8MM, i.MX8MN, and i.MX8MP SoCs which have 4x Cortex-A53 CPU cores. Therefore the 'BR2_aarch64' is really the only important configuration which produces binaries executable on arm64 CPU's.
     252The following details pertain to buildroot 2024.02 although newer versions will likely be similar if not the same.
     253
     254The Venice product family is based on the i.MX8MM, i.MX8MN, and i.MX8MP SoCs which have 4x Cortex-A53 CPU cores. Therefore the 'BR2_aarch64' is really the only important configuration to produces binaries executable on arm64 CPU's.
    255255
    256256To build a root filesystem only:
    257257{{{#!bash
    258 cat << EOF > configs/venice_minimal_defconfig
     258cat << EOF > configs/arm64_minimal_rootfs_defconfig
    259259# arm64 arch
    260260BR2_aarch64=y
    261261# filesystem options
     262BR2_TARGET_ROOTFS_CPIO=y
     263BR2_TARGET_ROOTFS_CPIO_XZ=y
     264BR2_TARGET_ROOTFS_EXT2=y
     265BR2_TARGET_ROOTFS_EXT2_XZ=y
    262266BR2_TARGET_ROOTFS_TAR_XZ=y
    263267EOF
    264 make venice_minimal_defconfig
     268make arm64_minimal_rootfs_defconfig
    265269make -j8
    266270}}}
    267271
    268 This builds output/images/root.tar.xz consisting of a ~1.7MiB root filesystem (when uncompressed) in 5 to 10 minutes of building on a typical Linux desktop.
    269 
    270 If you also want buildroot to build a Gateworks v5.4.45 kernel with a minimal kernel config and a self-contained minimal root filesystem you would use the following:
     272This builds a ~1.3MiB output/images/{root.tar,rootfs.cpio,rootfs.ext2}.xz consisting of a ~3.6MiB root filesystem (when uncompressed) in a couple of minutes of building on a typical Linux desktop.
     273
     274If you also want buildroot to build a kernel with a minimal kernel config as well as the minimal root filesystem you could use the following:
    271275{{{#!bash
    272276cat << EOF > configs/venice_kernel_defconfig
     
    274278BR2_aarch64=y
    275279# kernel
     280BR2_KERNEL_HEADERS_6_6=y
    276281BR2_LINUX_KERNEL=y
    277 BR2_KERNEL_HEADERS_6_1=y
    278282BR2_LINUX_KERNEL_CUSTOM_GIT=y
    279283BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/Gateworks/linux-venice.git"
    280 BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="v6.1.11-venice"
     284BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="v6.6.8-venice"
    281285BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
    282 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="venice_minimal_kernel_6.1_defconfig"
     286BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="venice_minimal_kernel_6.6_defconfig"
    283287# filesystem options
    284 BR2_TARGET_ROOTFS_INITRAMFS=y
     288BR2_TARGET_ROOTFS_CPIO=y
     289BR2_TARGET_ROOTFS_CPIO_XZ=y
     290BR2_TARGET_ROOTFS_EXT2=y
     291BR2_TARGET_ROOTFS_EXT2_XZ=y
    285292BR2_TARGET_ROOTFS_TAR_XZ=y
    286293EOF
     294
    287295# fetch minimal kernel config for venice
    288 wget http://dev.gateworks.com/buildroot/venice/minimal/venice_minimal_kernel_6.1_defconfig
     296wget http://dev.gateworks.com/buildroot/venice/minimal/venice_minimal_kernel_6.6_defconfig
     297
     298# build
    289299make venice_kernel_defconfig
    290300make -j8
    291 cp output/build/linux-v6.1.11-venice/arch/arm64/boot/dts/freescale/imx8m*venice*dtb output/images/ # manually copy venice DTB's to output dir
    292 }}}
    293 
    294 This produces a ~10MB output/images/Image in 10 to 15 minutes of building on a typical Linux desktop. This is a kernel Image containing the root filesystem in a ramdisk. This is a really easy way to get a read-only minimal Linux image that boots fast and does not access flash storage.
    295 
    296 Perhaps an even more useful image would contain tools for provisioning a FLASH emmc device:
     301
     302# copy venice DTB's to output dir (buildroot does not do this for you)
     303cp output/build/linux-v6.6.8-venice/arch/arm64/boot/dts/freescale/imx8m*venice*dtb output/images/
     304}}}
     305
     306This builds a ~1.3MiB output/images/{root.tar,rootfs.cpio,rootfs.ext2}.xz consisting of a ~3.6MiB root filesystem (when uncompressed) and a ~15MiB kernel Image and dtbs in a couple of minutes of building on a typical Linux desktop. This is a kernel Image, dtbs, and separate ramdisk based rootfs. This is a really easy way to get a read-only minimal Linux image that boots fast and does not access flash storage.
     307
     308Perhaps an even more useful image would contain a basic tools for provisioning a FLASH emmc device:
    297309{{{#!bash
    298310cat << EOF > configs/venice_example_defconfig
     
    302314BR2_TOOLCHAIN_BUILDROOT_CXX=y
    303315# kernel
     316BR2_KERNEL_HEADERS_6_6=y
    304317BR2_LINUX_KERNEL=y
    305 BR2_KERNEL_HEADERS_6_1=y
    306318BR2_LINUX_KERNEL_CUSTOM_GIT=y
    307319BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/Gateworks/linux-venice.git"
    308 BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="v6.1.11-venice"
     320BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="v6.6.8-venice"
    309321BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
    310 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="venice_minimal_kernel_6.1_defconfig"
     322BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="venice_minimal_kernel_6.6_defconfig"
    311323# extra utils needed for basic testing and provisioning emmc
    312324BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
    313325BR2_PACKAGE_PV=y
    314326BR2_PACKAGE_STRESS=y
     327BR2_PACKAGE_AUTOFS=y
    315328BR2_PACKAGE_E2FSPROGS=y
    316329BR2_PACKAGE_E2FSPROGS_RESIZE2FS=y
     330BR2_PACKAGE_CRYPTSETUP=y
    317331BR2_PACKAGE_EVTEST=y
    318 BR2_PACKAGE_GPTFDISK=y
    319 BR2_PACKAGE_GPTFDISK_SGDISK=y
    320332BR2_PACKAGE_I2C_TOOLS=y
    321333BR2_PACKAGE_MEMTESTER=y
     
    327339BR2_PACKAGE_LIBUSB=y
    328340BR2_PACKAGE_TCPDUMP=y
     341BR2_PACKAGE_WGET=y
    329342BR2_PACKAGE_SCREEN=y
    330343BR2_PACKAGE_COREUTILS=y
    331344BR2_PACKAGE_TAR=y
     345BR2_PACKAGE_TPM2_ABRMD=y
     346BR2_PACKAGE_TPM2_TOOLS=y
    332347BR2_PACKAGE_UTIL_LINUX_BINARIES=y
    333348# filesystem options
    334 
     349BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
     350BR2_TARGET_ROOTFS_CPIO=y
    335351BR2_TARGET_ROOTFS_CPIO_XZ=y
    336 BR2_TARGET_ROOTFS_INITRAMFS=y
     352BR2_TARGET_ROOTFS_EXT2=y
     353BR2_TARGET_ROOTFS_EXT2_XZ=y
    337354BR2_TARGET_ROOTFS_TAR_XZ=y
    338355EOF
     
    340357# fetch minimal kernel config
    341358wget http://dev.gateworks.com/buildroot/venice/minimal/venice_minimal_kernel_6.1_defconfig
     359
     360# build
    342361make venice_example_defconfig
    343362make -j8
    344 cp output/build/linux-v6.1.11-venice/arch/arm64/boot/dts/freescale/imx8m*venice*dtb output/images/ # manually copy venice DTB's to output dir
    345 }}}
    346  * Note you can easily add your own files and scripts to this image by setting BR2_ROOTFS_OVERLAY to a directory or directories where your files are
    347 
    348 This produces a ~15MiB output/images/Image in 10 to 15 minutes of building on a typical Linux desktop. This is a kernel Image containing the root filesystem in a ramdisk. This is a really easy way to get a read-only minimal Linux image that boots fast and has the tools necessary to create a partition table and filesystems
     363
     364# copy venice DTB's to output dir (buildroot does not do this for you)
     365cp output/build/linux-v6.6.8-venice/arch/arm64/boot/dts/freescale/imx8m*venice*dtb output/images/
     366}}}
     367
     368This builds a ~12MiB output/images/{root.tar,rootfs.cpio,rootfs.ext2}.xz consisting of a ~57MiB root filesystem (when uncompressed) and a ~15MiB kernel Image and dtbs in a couple of minutes of building on a typical Linux desktop. This is a kernel Image, dtbs, and separate ramdisk based rootfs.
     369
     370You can easily add your own files and scripts to the rootfs image by setting BR2_ROOTFS_OVERLAY to a directory or directories where your files are.
     371
     372Additionally you could enable BR2_TARGET_ROOTFS_INITRAMFS to link the rootfs into the kernel itself resulting in a larger kernel with no need to load a separate ramdisk.
    349373
    350374If you need to add back or modify kernel features you can do so with:
     
    354378# save and update the defconfig once you are happy with it
    355379make linux-savedefconfig linux-update-defconfig
    356 }}}
    357 
    358 You can boot a Kernel+ramdisk via U-Boot like this:
     380# probably a good idea to remove the build kernel to force it to build again if you made changes
     381rm -rf output/build/linux-
     382# and rebuild
     383make -j8
     384# copy venice DTB's to output dir (buildroot does not do this for you)
     385cp output/build/linux-v6.6.8-venice/arch/arm64/boot/dts/freescale/imx8m*venice*dtb output/images/
     386}}}
     387
     388You can boot a Kernel+dtb+ramdisk via U-Boot like this:
    359389 * load from network tftpserver
    360390{{{#!bash
    361391setenv fsload tftpboot
    362 run loadfdt && tftpboot $kernel_addr_r Image && booti $kernel_addr_r - $fdt_addr_r
    363 }}}
     392run loadfdt && tftpboot $kernel_addr_r Image && tftpboot $ramdisk_addr_r && booti $kernel_addr_r $ramdisk_addr_r:$filesize $fdt_addr_r
     393}}}
     394  - Note that the ramdisk argument needs the ramdisk size so be sure to load that last as tftpboot/load will set filesize to the thing it loaded
    364395 * load from microSD with ext/fat filesystem
    365396{{{#!bash
     
    375406
    376407A prebuilt image can be found [http://dev.gateworks.com/buildroot/venice/minimal here] which contains an image built from the above venice_example_defconfig
    377  - Gateworks Venice Linux 6.1 kernel
    378  - glibc with wide-char, locale, and g++ support
     408 - Gateworks Venice Linux 6.6 kernel
     409 - glibc with wide-char, locale, and c++ support
    379410 - screen (BR2_PACKAGE_SCREEN)
    380411 - pciutils (BR2_PACKAGE_PCIUTILS)
     
    386417 - parted/gdisk/sgdisk disk partitioning tools
    387418 - ext filesystem support mkfs/resize2fs (BR2_PACKAGE_E2FSPROGS_RESIZE2FS)
     419 - cryptsetup (BR2_PACKAGE_CRYPTSETUP) for using dm-crypt with LUKS for disk encryption
    388420 - u-boot image creation tools (mkimage/fw_setenv/fw_printenv)
    389421