[Buildroot] [PATCH 4/5] board/beaglebone: add a genimage config

Vivien Didelot vivien.didelot at savoirfairelinux.com
Tue Mar 17 22:51:58 UTC 2015


This patch adds a "genimage.cfg" genimage config file for the BeagleBone
(classic and black). The final generated "sdcard.img" image is ready to
use and contains the setup explained in the board readme.txt file: a
bootable vfat partition with the kernel, bootloader and DTB files, and
an ext2 rootfs partition.

The defconfig and readme file have been slightly changed to enable this
feature.

Tested on a BeagleBone Black.

Signed-off-by: Vivien Didelot <vivien.didelot at savoirfairelinux.com>
---
 board/beaglebone/genimage.cfg | 30 ++++++++++++++++++++++++++++++
 board/beaglebone/readme.txt   |  4 ++++
 configs/beaglebone_defconfig  |  3 +++
 3 files changed, 37 insertions(+)
 create mode 100644 board/beaglebone/genimage.cfg

diff --git a/board/beaglebone/genimage.cfg b/board/beaglebone/genimage.cfg
new file mode 100644
index 0000000..91ed021
--- /dev/null
+++ b/board/beaglebone/genimage.cfg
@@ -0,0 +1,30 @@
+image boot.vfat {
+  vfat {
+    files = {
+      "am335x-boneblack.dtb",
+      "am335x-bone.dtb",
+      "MLO",
+      "u-boot.img",
+      "uEnv.txt",
+      "zImage"
+    }
+  }
+  size = 10M
+}
+
+image sdcard.img {
+  hdimage {
+  }
+
+  partition boot {
+    partition-type = 0xC
+    bootable = "true"
+    image = "boot.vfat"
+  }
+
+  partition rootfs {
+    partition-type = 0x83
+    image = "rootfs.ext2"
+    size = 512M
+  }
+}
diff --git a/board/beaglebone/readme.txt b/board/beaglebone/readme.txt
index c6d0aa0..80a27f9 100644
--- a/board/beaglebone/readme.txt
+++ b/board/beaglebone/readme.txt
@@ -5,6 +5,9 @@ Intro
 To be able to use BeagleBone board with the images generated by
 Buildroot, you have prepare the SDCard.
 
+Note: Buildroot already prepared an "sdcard.img" in the output/images/
+directory, but this document explains how to do it manually.
+
 How to build it
 ===============
 
@@ -41,6 +44,7 @@ and second where you will write rootfs.
 
 Copy the files to boot partition
 
+  $ cd output/images/
   $ cp MLO u-boot.img zImage uEnv.txt *.dtb /media/zzzzz
 
 where /media/zzzzz is the mount point
diff --git a/configs/beaglebone_defconfig b/configs/beaglebone_defconfig
index ddb583c..052c794 100644
--- a/configs/beaglebone_defconfig
+++ b/configs/beaglebone_defconfig
@@ -40,3 +40,6 @@ BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/beaglebone/linux-3.12.config"
 BR2_LINUX_KERNEL_ZIMAGE=y
 BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="am335x-bone am335x-boneblack"
+
+# image generation
+BR2_TARGET_MEDIA_GENIMAGE_CFG="board/beaglebone/genimage.cfg"
-- 
2.3.3



More information about the buildroot mailing list