From patchwork Sat Apr 16 15:23:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ezequiel Garcia X-Patchwork-Id: 611365 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 3qnJ8j4H3Lz9t4h for ; Sun, 17 Apr 2016 01:23:49 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=vanguardiasur-com-ar.20150623.gappssmtp.com header.i=@vanguardiasur-com-ar.20150623.gappssmtp.com header.b=OIAgG8od; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id D432689D93; Sat, 16 Apr 2016 15:23:48 +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 8Z8naI0jIjvn; Sat, 16 Apr 2016 15:23:44 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 4184B87E4E; Sat, 16 Apr 2016 15:23:42 +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 7C1391C0E66 for ; Sat, 16 Apr 2016 15:23:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 75AB287C89 for ; Sat, 16 Apr 2016 15:23:41 +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 tSI9YmcdVCC2 for ; Sat, 16 Apr 2016 15:23:40 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qg0-f44.google.com (mail-qg0-f44.google.com [209.85.192.44]) by whitealder.osuosl.org (Postfix) with ESMTPS id 0CE0C86E31 for ; Sat, 16 Apr 2016 15:23:40 +0000 (UTC) Received: by mail-qg0-f44.google.com with SMTP id f52so96177483qga.3 for ; Sat, 16 Apr 2016 08:23:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vanguardiasur-com-ar.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xV8OMtKgzMDXSFCJw120rVtwmpY56/Kms75qT6+XDqc=; b=OIAgG8odMz618KK5t5uLmr1JUXP3Tw2rAmTFgtZ3m8VugWnJb1aRtRdDVBJpEUojvD qNN4TkrzQjdK/j7YN0woLyHPBmWMxzL+BKCrTipai4EwWffCozG+X0lWZZN/APcduLLl OexIaTKZJOcheALiNtarz7CRxSYKrqV5cqXLzBStufgLTbsH6dIns6zYmDrq4OP271JX gzchUzuev2vltNds9bYmEjiYuPhu7ktyU81bM6zZd567FW4P/GCDGWYm8E63EA6+7iGk 6Gl2FgoQuK8TdZdtcmmM+zj0g97KoaHbj50X4w1qrwooNrpEGMR3VFnSt5l0VT59Uy6o uZnQ== 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=xV8OMtKgzMDXSFCJw120rVtwmpY56/Kms75qT6+XDqc=; b=Hnc8HcVfoU5i8n2nhuNe+COye4n1gFeDvCn17xN5tm+malEenmNSKw8/TiaBUy/4zi 61+W4ueCpJAwMoznaHUbA1NY7IVgoAy+VaE3ZWGVbT+40Qpm5vTx4Xx9YEkZqv+mYr48 mhwaFxoYBowZN9A8c8OTfauR7LMVCS235us47mDGgNO5F9YJ2XcCbQ4B4f/S6K3Nrl8D 5b4Rn/gO1zE9OdeY09aG6DyVE1H+P0q7T4IvIhTYEWcCMVA0El5kJSdIvzSUFWtNTCpQ sBc14TJ+vwT2U1NfhI4XIkMfxzW/IiCdD+/NgpWliLfuppQNOy5wA8F3NmMzoEw+jqrV x/tA== X-Gm-Message-State: AOPr4FXTQNeHGlPu99gDupCDHlS0n3H6nWCC2bPib6lcWE8/x8xxMw0Jdf77AU6RpeuwHg== X-Received: by 10.140.99.48 with SMTP id p45mr32413183qge.34.1460820219227; Sat, 16 Apr 2016 08:23:39 -0700 (PDT) Received: from localhost.localdomain ([190.2.108.156]) by smtp.gmail.com with ESMTPSA id v30sm16342435qge.41.2016.04.16.08.23.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 16 Apr 2016 08:23:38 -0700 (PDT) From: Ezequiel Garcia To: Date: Sat, 16 Apr 2016 12:23:20 -0300 Message-Id: <1460820203-6080-2-git-send-email-ezequiel@vanguardiasur.com.ar> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1460820203-6080-1-git-send-email-ezequiel@vanguardiasur.com.ar> References: <1460820203-6080-1-git-send-email-ezequiel@vanguardiasur.com.ar> Subject: [Buildroot] [PATCH v3 1/4] board/minnowboard: Rework to generate SD card 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" Let's rework the board and config files to use genimage to generate the SD card image directly. Signed-off-by: Ezequiel Garcia --- Changes from v1: * host-mtools is needed too, as noted by Peter. --- board/minnowboard/genimage.cfg | 34 ++++++++++++++++++++++++++++++++++ board/minnowboard/post-image.sh | 13 +++++++++++++ board/minnowboard/readme.txt | 39 ++++++++++++--------------------------- configs/minnowboard_defconfig | 9 +++++++++ 4 files changed, 68 insertions(+), 27 deletions(-) create mode 100644 board/minnowboard/genimage.cfg create mode 100755 board/minnowboard/post-image.sh diff --git a/board/minnowboard/genimage.cfg b/board/minnowboard/genimage.cfg new file mode 100644 index 000000000000..6cf787430752 --- /dev/null +++ b/board/minnowboard/genimage.cfg @@ -0,0 +1,34 @@ +# Create an image of the efi partition +image efi-part.vfat { + vfat { + file startup.nsh { + image = "efi-part/startup.nsh" + } + file EFI { + image = "efi-part/EFI" + } + file bzImage { + image = "bzImage" + } + } + size=10M +} + +# Create the sdcard image, pulling in +# * the image created by buildroot +# * the efi-partition created above +image sdcard.img { + hdimage { + } + + partition boot { + partition-type = 0xEF + image = "efi-part.vfat" + } + + partition rootfs { + partition-type = 0x83 + image = "rootfs.ext4" + size = 512M + } +} diff --git a/board/minnowboard/post-image.sh b/board/minnowboard/post-image.sh new file mode 100755 index 000000000000..428baa5e5599 --- /dev/null +++ b/board/minnowboard/post-image.sh @@ -0,0 +1,13 @@ +#!/bin/sh -e + +GENIMAGE_CFG="board/minnowboard/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/board/minnowboard/readme.txt b/board/minnowboard/readme.txt index 62ffa92e0b83..3a24fdc162b8 100644 --- a/board/minnowboard/readme.txt +++ b/board/minnowboard/readme.txt @@ -1,40 +1,25 @@ -Prepare the SD card for the Minnow Board +How to get started with the MinnowBoard ======================================== - 1. Partition the SD card with a GPT partition table +1. Build - sudo cgdisk /dev/mmcblk0 + Apply the defconfig: - Create two partitions: + $ make minnowboard_defconfig - a) First partition of a few dozens of megabytes, which will be - used to store the bootloader and the kernel image. Type must - be EF00 (EFI partition). + Add any additional packages required and build: - b) Second partition of any size, which will be used to store the - root filesystem. Type must be 8300 (Linux filesystem) + $ make - 2. Prepare the boot partition +2. Write the SD card - We will format it, mount it, copy the EFI data generated by - Buildroot, and the kernel image. + The build process will create a SD card image in output/images. + Write the image to an mSD card, insert into the MinnowBoard + and power the board on. - sudo mkfs.vfat -F 32 -n boot /dev/mmcblk0p1 - sudo mount /dev/mmcblk0p1 /mnt - sudo cp -a output/images/efi-part/* /mnt/ - sudo cp output/images/bzImage /mnt/ - sudo umount /mnt + $ dd if=output/images/sdcard.img of=/dev/mmcblk0; sync - 3. Prepare the root partition - - We will format it, mount it, and extract the root filesystem. - - sudo mkfs.ext3 -L root /dev/mmcblk0p2 - sudo mount /dev/mmcblk0p2 /mnt - sudo tar -C /mnt -xf output/images/rootfs.tar - sudo umount /mnt - - 4. Enjoy +3. Enjoy Additional information about this board can be found at http://www.minnowboard.org/. diff --git a/configs/minnowboard_defconfig b/configs/minnowboard_defconfig index 3091957f35dc..25c63ccbeead 100644 --- a/configs/minnowboard_defconfig +++ b/configs/minnowboard_defconfig @@ -5,9 +5,13 @@ BR2_x86_atom=y # Misc BR2_TARGET_GENERIC_GETTY_PORT="ttyPCH0" BR2_ROOTFS_POST_BUILD_SCRIPT="board/minnowboard/post-build.sh" +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/minnowboard/post-image.sh" # Linux headers same as kernel, a 3.8 series BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_8=y +BR2_PACKAGE_HOST_DOSFSTOOLS=y +BR2_PACKAGE_HOST_GENIMAGE=y +BR2_PACKAGE_HOST_MTOOLS=y # Linux kernel BR2_LINUX_KERNEL=y @@ -20,3 +24,8 @@ BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/minnowboard/linux-3.8.config" # Bootloader BR2_TARGET_GRUB2=y BR2_TARGET_GRUB2_I386_EFI=y + +# Filesystem image +BR2_TARGET_ROOTFS_EXT2=y +BR2_TARGET_ROOTFS_EXT2_4=y +# BR2_TARGET_ROOTFS_TAR is not set