From patchwork Wed May 25 20:16:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 626452 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rFNq0387zz9sdn for ; Thu, 26 May 2016 06:17:00 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=CBWEYC01; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id F3F9533E51; Wed, 25 May 2016 20:16:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nhxy3G3lOpKT; Wed, 25 May 2016 20:16:57 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 6A8C733F5B; Wed, 25 May 2016 20:16:57 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 2E5991C10F5 for ; Wed, 25 May 2016 20:16:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 4FA99C1340 for ; Wed, 25 May 2016 20:16:29 +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 EaTovtN8UA60 for ; Wed, 25 May 2016 20:16:28 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-yw0-f196.google.com (mail-yw0-f196.google.com [209.85.161.196]) by fraxinus.osuosl.org (Postfix) with ESMTPS id B294DC1271 for ; Wed, 25 May 2016 20:16:28 +0000 (UTC) Received: by mail-yw0-f196.google.com with SMTP id n16so8440525ywd.2 for ; Wed, 25 May 2016 13:16:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6ftT0LkyEs7uP6ZADwEYPq8eZ3+tyvOpAExRVIn3em0=; b=CBWEYC017JIRhFGrM4yqte5IxmF9UOHvL/6GjZQFkYITDU0ARSNjEDsbdNZD94m9Hk hjckYoUdhT21fsr8SzuX/aWYvDN83PACO+DQrar2ywZLyqYqgu+CUFe6U66WEDZ2AZVt KVISkCptDlp0+GYpJDly+PtKg8PjVwm4NuXshBolxpkee9R+Td4mAJIVaGjSfbWeV0N1 7+zS6Fl9wL7cbOLBT0LzfNkAb5SivSKRLtilG1xCR8aV0+OjSlG0XP5ALEnH9Aa+AhNp AocxLD9TzeyncR4QYo8nv/+LrbxEXhc1pX9NqgIdNJWfligIluIiyK3Wp7FPqW2qmL7K XDrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6ftT0LkyEs7uP6ZADwEYPq8eZ3+tyvOpAExRVIn3em0=; b=aDIUebym4p5S45WtNxphq7L6h3t0Qt7jINkfRKs0LJba3kl1vygQyCtAYxpWhMoFDk tyFXQNTA3DpRDJY2vv2eaT6xQM9jWh27tAiuXG6dNQK255FpldsIOHkpo7lMLxUDjHrc OYLfQGpyiciDpQ+Y//ZDe5DqoSsfkTBFHjO+MF2VPojzEl82Q1b/A3F8s+Trq79Ud53A P0fIxou0QIY0EkqrE8eCQClb2fc6CvSRMkkbThRHCLCBEhkp/Q756PcShO0xWImieb4N dDC07JfydZ7kZX9a3Cx+ADkUdz7Ym+unEnJBNiQoMGkhpPBS0R+pWGenmnZSJiIGsMeF X2hg== X-Gm-Message-State: ALyK8tIaf3Sj3TcLwnxJC569IjLYin86355TydN6IewxbZIGg0iES9EcCmugN9t1SSSz6w== X-Received: by 10.37.204.86 with SMTP id l83mr3653312ybf.126.1464207387428; Wed, 25 May 2016 13:16:27 -0700 (PDT) Received: from localhost.localdomain ([179.159.167.56]) by smtp.gmail.com with ESMTPSA id l185sm320989ywb.24.2016.05.25.13.16.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 May 2016 13:16:26 -0700 (PDT) From: Fabio Estevam To: thomas.petazzoni@free-electrons.com Date: Wed, 25 May 2016 17:16:08 -0300 Message-Id: <1464207368-22532-3-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1464207368-22532-1-git-send-email-festevam@gmail.com> References: <1464207368-22532-1-git-send-email-festevam@gmail.com> Cc: Fabio Estevam , buildroot@buildroot.org Subject: [Buildroot] [PATCH 3/3] imx53loco: Use common script for generating sdcard image 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: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Use the common script used by other i.mx boards to generate the sdcard image. Signed-off-by: Fabio Estevam --- board/freescale/imx53loco/create-boot-sd.sh | 1 - board/freescale/imx53loco/genimage.cfg | 42 +++++++++++++++++++++++++++++ board/freescale/imx53loco/post-image.sh | 16 +++++++++++ configs/mx53loco_defconfig | 6 +++++ 4 files changed, 64 insertions(+), 1 deletion(-) delete mode 120000 board/freescale/imx53loco/create-boot-sd.sh create mode 100644 board/freescale/imx53loco/genimage.cfg create mode 100644 board/freescale/imx53loco/post-image.sh diff --git a/board/freescale/imx53loco/create-boot-sd.sh b/board/freescale/imx53loco/create-boot-sd.sh deleted file mode 120000 index d45d639..0000000 --- a/board/freescale/imx53loco/create-boot-sd.sh +++ /dev/null @@ -1 +0,0 @@ -../create-boot-sd.sh \ No newline at end of file diff --git a/board/freescale/imx53loco/genimage.cfg b/board/freescale/imx53loco/genimage.cfg new file mode 100644 index 0000000..b56c168 --- /dev/null +++ b/board/freescale/imx53loco/genimage.cfg @@ -0,0 +1,42 @@ +# Minimal microSD card image for the Freescale's i.MX53 QSB board +# +# We mimic the .sdcard Freescale's image format for i.MX53: +# * the microSD card must have 1 kB free space at the beginning, +# * U-Boot is dumped as is, +# * a FAT partition at offset 8 MB is containing zImage and dtbs, +# * a single root filesystem partition is required (Ext4 in this case). +# + +image boot.vfat { + vfat { + files = { + "imx53-qsb.dtb", + "imx53-qsrb.dtb", + "zImage" + } + } + size = 16M +} + +image sdcard.img { + hdimage { + } + + partition u-boot { + in-partition-table = "no" + image = "u-boot.imx" + offset = 1024 + } + + partition boot { + partition-type = 0xC + bootable = "true" + image = "boot.vfat" + offset = 8M + } + + partition rootfs { + partition-type = 0x83 + image = "rootfs.ext4" + } +} diff --git a/board/freescale/imx53loco/post-image.sh b/board/freescale/imx53loco/post-image.sh new file mode 100644 index 0000000..8757355 --- /dev/null +++ b/board/freescale/imx53loco/post-image.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +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}" + +exit $? diff --git a/configs/mx53loco_defconfig b/configs/mx53loco_defconfig index e461f7a..b62172c 100644 --- a/configs/mx53loco_defconfig +++ b/configs/mx53loco_defconfig @@ -11,7 +11,13 @@ BR2_TARGET_GENERIC_GETTY_PORT="ttymxc0" # patches BR2_GLOBAL_PATCH_DIR="board/freescale/imx53loco/patches/" +# required tools to create the SD card image +BR2_PACKAGE_HOST_DOSFSTOOLS=y +BR2_PACKAGE_HOST_GENIMAGE=y +BR2_PACKAGE_HOST_MTOOLS=y + # Filesystem +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/imx53loco/post-image.sh" BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_4=y