From patchwork Mon Apr 4 08:52:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ludovic.desroches@atmel.com X-Patchwork-Id: 605763 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 3qdm2m6n0cz9sBM for ; Mon, 4 Apr 2016 18:52:32 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 333BE88C86; Mon, 4 Apr 2016 08:52:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id O9BcO4n8UWdw; Mon, 4 Apr 2016 08:52:29 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 755AC88C90; Mon, 4 Apr 2016 08:52:29 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id E78381C11DF for ; Mon, 4 Apr 2016 08:52:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id E395A897E3 for ; Mon, 4 Apr 2016 08:52:27 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UM3oKohS6Phq for ; Mon, 4 Apr 2016 08:52:27 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from eusmtp01.atmel.com (eusmtp01.atmel.com [212.144.249.242]) by whitealder.osuosl.org (Postfix) with ESMTPS id DCAF688CC0 for ; Mon, 4 Apr 2016 08:52:26 +0000 (UTC) Received: from ibiza.corp.atmel.com (10.161.101.13) by eusmtp01.atmel.com (10.161.101.30) with Microsoft SMTP Server id 14.3.235.1; Mon, 4 Apr 2016 10:52:23 +0200 From: Ludovic Desroches To: Date: Mon, 4 Apr 2016 10:52:44 +0200 Message-ID: <1459759965-14073-4-git-send-email-ludovic.desroches@atmel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1459759965-14073-1-git-send-email-ludovic.desroches@atmel.com> References: <1459759965-14073-1-git-send-email-ludovic.desroches@atmel.com> MIME-Version: 1.0 Cc: alexandre.belloni@free-electrons.com, nicolas.ferre@atmel.com Subject: [Buildroot] [PATCH v2 3/4] configs: atmel: add sama5d3 xplained sd card image generation X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Use genimage to generate a sd card with a fat partition (at91bootstrap, u-boot, kernel, dtbs) and an ext4 partition (rootfs). Signed-off-by: Ludovic Desroches --- board/atmel/sama5d3_xplained_mmc/genimage.cfg | 33 ++++++++++++++++++++++++++ board/atmel/sama5d3_xplained_mmc/post-image.sh | 14 +++++++++++ configs/atmel_sama5d3_xplained_mmc_defconfig | 6 +++++ 3 files changed, 53 insertions(+) create mode 100644 board/atmel/sama5d3_xplained_mmc/genimage.cfg create mode 100755 board/atmel/sama5d3_xplained_mmc/post-image.sh diff --git a/board/atmel/sama5d3_xplained_mmc/genimage.cfg b/board/atmel/sama5d3_xplained_mmc/genimage.cfg new file mode 100644 index 0000000..32df453 --- /dev/null +++ b/board/atmel/sama5d3_xplained_mmc/genimage.cfg @@ -0,0 +1,33 @@ +# Image for SD card boot on Atmel SAMA5D3 Xplained boards +# +image boot.vfat { + vfat { + files = { + "zImage", + "at91-sama5d3_xplained.dtb", + "at91-sama5d3_xplained_pda4.dtb", + "at91-sama5d3_xplained_pda7.dtb", + "at91-sama5d3_xplained_pda7b.dtb", + "boot.bin", + "u-boot.bin" + } + } + size = 16M +} + +image sdcard.img { + hdimage { + } + + partition boot { + partition-type = 0xC + bootable = "true" + image = "boot.vfat" + } + + partition rootfs { + partition-type = 0x83 + image = "rootfs.ext4" + size = 512M + } +} diff --git a/board/atmel/sama5d3_xplained_mmc/post-image.sh b/board/atmel/sama5d3_xplained_mmc/post-image.sh new file mode 100755 index 0000000..359b4c9 --- /dev/null +++ b/board/atmel/sama5d3_xplained_mmc/post-image.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +BOARD_DIR="$(dirname $0)" +GENIMAGE_CFG="${BOARD_DIR}/genimage.cfg" +GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp" + +rm -rf "${GENIMAGE_TMP}" + +genimage \ + --rootpath "${TARGET_DIR}" \ + --tmppath "${GENIMAGE_TMP}" \ + --inputpath "${BINARIES_DIR}" \ + --outputpath "${BINARIES_DIR}" \ + --config "${GENIMAGE_CFG}" diff --git a/configs/atmel_sama5d3_xplained_mmc_defconfig b/configs/atmel_sama5d3_xplained_mmc_defconfig index 2fb1fa4..c8d92bd 100644 --- a/configs/atmel_sama5d3_xplained_mmc_defconfig +++ b/configs/atmel_sama5d3_xplained_mmc_defconfig @@ -3,6 +3,7 @@ BR2_cortex_a5=y BR2_ARM_ENABLE_VFP=y BR2_ARM_INSTRUCTIONS_THUMB2=y BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_1=y +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/atmel/sama5d3_xplained_mmc/post-image.sh" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/linux4sam/linux-at91.git" @@ -11,6 +12,8 @@ BR2_LINUX_KERNEL_DEFCONFIG="sama5" BR2_LINUX_KERNEL_ZIMAGE=y BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="at91-sama5d3_xplained at91-sama5d3_xplained_pda4 at91-sama5d3_xplained_pda7 at91-sama5d3_xplained_pda7b" +BR2_TARGET_ROOTFS_EXT2=y +BR2_TARGET_ROOTFS_EXT2_4=y BR2_TARGET_AT91BOOTSTRAP3=y BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_GIT=y BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_REPO_URL="https://github.com/linux4sam/at91bootstrap.git" @@ -22,3 +25,6 @@ BR2_TARGET_UBOOT_CUSTOM_GIT=y BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://github.com/linux4sam/u-boot-at91.git" BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="linux4sam_5.2" BR2_TARGET_UBOOT_BOARD_DEFCONFIG="sama5d3_xplained_mmc" +BR2_PACKAGE_HOST_DOSFSTOOLS=y +BR2_PACKAGE_HOST_GENIMAGE=y +BR2_PACKAGE_HOST_MTOOLS=y