Skip to contentSkip to conversation

configs/raspberrypi*: update them to use genimage

PATCH New Gustavo Zacarias 2 participants 2 messages Dec 31, 2015 Broadcom BCM2711/BCM2835 Arm architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configs/raspberrypi*: update them to use genimage

Update the raspberrypi and raspberrypi2 configs to use genimage directly to build the image.
Update the documentation to reflect this, and drop the volatile rootfs option since it doesn't make much sense and it's not easily integrated with the genimage configurations.

---
 board/raspberrypi/genimage-raspberrypi.cfg  |  31 ++++++++
 board/raspberrypi/genimage-raspberrypi2.cfg |  30 ++++++++
 board/raspberrypi/post-image.sh             |  22 ++++++
 board/raspberrypi/readme.txt                | 110 +++++-----------------------
 configs/raspberrypi2_defconfig              |  11 +++
 configs/raspberrypi_defconfig               |  11 +++
 6 files changed, 122 insertions(+), 93 deletions(-)
 create mode 100644 board/raspberrypi/genimage-raspberrypi.cfg
 create mode 100644 board/raspberrypi/genimage-raspberrypi2.cfg
 create mode 100755 board/raspberrypi/post-image.sh
board/raspberrypi/genimage-raspberrypi.cfg new file +31 -0
new file mode 100644
index 0000000..45be4d0
@@ -0,0 +1,31 @@
+image boot.vfat {
+  vfat {
+    files = {
+      "bcm2708-rpi-b.dtb",
+      "bcm2708-rpi-b-plus.dtb",
+      "rpi-firmware/bootcode.bin",
+      "rpi-firmware/cmdline.txt",
+      "rpi-firmware/config.txt",
+      "rpi-firmware/fixup.dat",
+      "rpi-firmware/start.elf",
+      "kernel-marked/zImage"
+    }
+  }
+  size = 32M
+}
+
+image sdcard.img {
+  hdimage {
+  }
+
+  partition boot {
+    partition-type = 0xC
+    bootable = "true"
+    image = "boot.vfat"
+  }
+
+  partition rootfs {
+    partition-type = 0x83
+    image = "rootfs.ext4"
+  }
+}
board/raspberrypi/genimage-raspberrypi2.cfg new file +30 -0
new file mode 100644
index 0000000..443c821
@@ -0,0 +1,30 @@
+image boot.vfat {
+  vfat {
+    files = {
+      "bcm2709-rpi-2-b.dtb",
+      "rpi-firmware/bootcode.bin",
+      "rpi-firmware/cmdline.txt",
+      "rpi-firmware/config.txt",
+      "rpi-firmware/fixup.dat",
+      "rpi-firmware/start.elf",
+      "kernel-marked/zImage"
+    }
+  }
+  size = 32M
+}
+
+image sdcard.img {
+  hdimage {
+  }
+
+  partition boot {
+    partition-type = 0xC
+    bootable = "true"
+    image = "boot.vfat"
+  }
+
+  partition rootfs {
+    partition-type = 0x83
+    image = "rootfs.ext4"
+  }
+}
board/raspberrypi/post-image.sh new file +22 -0
new file mode 100755
index 0000000..73ffd65
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+BOARD_DIR="$(dirname $0)"
+BOARD_NAME="$(basename ${BOARD_DIR})"
+GENIMAGE_CFG="${BOARD_DIR}/genimage-${BOARD_NAME}.cfg"
+GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
+
+# Mark the kernel as DT-enabled
+mkdir -p "${BINARIES_DIR}/kernel-marked"
+${HOST_DIR}/usr/bin/mkknlimg "${BINARIES_DIR}/zImage" \
+	"${BINARIES_DIR}/kernel-marked/zImage"
+
+rm -rf "${GENIMAGE_TMP}"
+
+genimage                           \
+	--rootpath "${TARGET_DIR}"     \
+	--tmppath "${GENIMAGE_TMP}"    \
+	--inputpath "${BINARIES_DIR}"  \
+	--outputpath "${BINARIES_DIR}" \
+	--config "${GENIMAGE_CFG}"
+
+exit $?
board/raspberrypi/readme.txt +17 -93

147 lines not on this page · raw message

configs/raspberrypi2_defconfig +11 -0
index 7e49f0c..0d0c6d0 100644
@@ -26,3 +26,14 @@ BR2_LINUX_KERNEL_INTREE_DTS_NAME="bcm2709-rpi-2-b"
 
 BR2_PACKAGE_RPI_FIRMWARE=y
 # BR2_PACKAGE_RPI_FIRMWARE_INSTALL_DTB_OVERLAYS is not set
+
+# Required tools to create the SD image
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
+
+# Filesystem / image
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+# BR2_TARGET_ROOTFS_TAR is not set
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/raspberrypi2/post-image.sh"
configs/raspberrypi_defconfig +11 -0
index 2d47058..76edc6b 100644
@@ -25,3 +25,14 @@ BR2_LINUX_KERNEL_INTREE_DTS_NAME="bcm2708-rpi-b bcm2708-rpi-b-plus"
 
 BR2_PACKAGE_RPI_FIRMWARE=y
 # BR2_PACKAGE_RPI_FIRMWARE_INSTALL_DTB_OVERLAYS is not set
+
+# Required tools to create the SD image
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
+
+# Filesystem / image
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+# BR2_TARGET_ROOTFS_TAR is not set
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/raspberrypi/post-image.sh"
Signature · 1 line
2.4.10
#1 lore raw

PATCH 1/1 configs/raspberrypi*: update them to use genimage

Dear Gustavo Zacarias,

Quoted 7 lines · Gustavo Zacarias

Update the raspberrypi and raspberrypi2 configs to use genimage directly to build the image.
Update the documentation to reflect this, and drop the volatile rootfs option since it doesn't make much sense and it's not easily integrated with the genimage configurations.

Quoted 11 lines
---
 board/raspberrypi/genimage-raspberrypi.cfg  |  31 ++++++++
 board/raspberrypi/genimage-raspberrypi2.cfg |  30 ++++++++
 board/raspberrypi/post-image.sh             |  22 ++++++
 board/raspberrypi/readme.txt                | 110 +++++-----------------------
 configs/raspberrypi2_defconfig              |  11 +++
 configs/raspberrypi_defconfig               |  11 +++
 6 files changed, 122 insertions(+), 93 deletions(-)
 create mode 100644 board/raspberrypi/genimage-raspberrypi.cfg
 create mode 100644 board/raspberrypi/genimage-raspberrypi2.cfg
 create mode 100755 board/raspberrypi/post-image.sh

Applied, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com