From patchwork Sun Mar 17 22:37:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 228336 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id EFE8F2C00AE for ; Mon, 18 Mar 2013 09:37:47 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 3B01430F15; Sun, 17 Mar 2013 22:37:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BKNt84mko+cf; Sun, 17 Mar 2013 22:37:43 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 5882831042; Sun, 17 Mar 2013 22:37:42 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 95EAB8F74B for ; Sun, 17 Mar 2013 22:37:33 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 1C8CB8BEC6 for ; Sun, 17 Mar 2013 22:37:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Z-kP5KRzs56D for ; Sun, 17 Mar 2013 22:37:25 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by whitealder.osuosl.org (Postfix) with ESMTPS id CA8258B13D for ; Sun, 17 Mar 2013 22:37:24 +0000 (UTC) Received: by mail-wi0-f177.google.com with SMTP id hm14so1985705wib.10 for ; Sun, 17 Mar 2013 15:37:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:in-reply-to:references; bh=OWX9Qr4Sc95LSYFsFj2jTXAzm+VboGiourTS0KWtv7c=; b=xOgx7LJGpOGR/LRYxZ042p7HxvJcs7NJDcBDHhUZSVbKK89M7MZ012a2kkmoTUDqZL WEGDf7Htjgr9jncoFt0m95p8s1+mxIA8d/rqcvgTUj0j1QOY43U0j9cKr9pqWUATinhi X5FbbLLw2+aHhAZTrHijBs4TsSzY6Co5YBU/mJIqM2zxJ4p/YD8KKRgy4kT1379MxZIf u68ZQMENMWqfnwZlp2cDwMTGZ9ZZJTpnCPGSZ5HWO+cNLlm3EcLhhQ8ACtcCFV4r/dI2 uzRKMsPrWsDM9updadu5QhpGPNVW3I78hSwj69qUKo7qJQxOMoxS1sDM6RVOLg+p+KDG jLdw== X-Received: by 10.180.38.101 with SMTP id f5mr13008264wik.25.1363559843001; Sun, 17 Mar 2013 15:37:23 -0700 (PDT) Received: from localhost.localdomain (ks3095497.kimsufi.com. [94.23.60.27]) by mx.google.com with ESMTPS id bs6sm11636544wib.4.2013.03.17.15.37.21 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 17 Mar 2013 15:37:22 -0700 (PDT) From: "Yann E. MORIN" To: buildroot@busybox.net Date: Sun, 17 Mar 2013 23:37:09 +0100 Message-Id: <230719126eab0f42e98e89712be2d8dac03dc25c.1363559530.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: References: In-Reply-To: References: Cc: "Yann E. MORIN" Subject: [Buildroot] [PATCH 4/5] fs/ext2: add support for ext2 rev0 and rev1 X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 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-bounces@busybox.net Some bootloaders have a buggy ext2 support, and require ext2 rev1 instead of the traditional ext2 rev0 that genext2fs produces. tune2fs accepts only one '-O list' at a time, so we need to construct a list of -O options. Signed-off-by: "Yann E. MORIN" Cc: Arnout Vandecappelle Acked-by: Arnout Vandecappelle (Essensium/Mind) --- Changes v1->v2: - separate GEN/REV and use two environment variables (Arnout) - all are revision 1, except ext2r0 (Arnout) --- fs/ext2/Config.in | 20 +++++++++++++++++--- fs/ext2/ext2.mk | 3 ++- fs/ext2/genext2fs.sh | 12 +++++++++--- 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/fs/ext2/Config.in b/fs/ext2/Config.in index c8320e2..097242e 100644 --- a/fs/ext2/Config.in +++ b/fs/ext2/Config.in @@ -6,12 +6,20 @@ config BR2_TARGET_ROOTFS_EXT2 if BR2_TARGET_ROOTFS_EXT2 +config BR2_TARGET_ROOTFS_EXT2_2 + bool + choice bool "ext2/3/4 variant" - default BR2_TARGET_ROOTFS_EXT2_2 + default BR2_TARGET_ROOTFS_EXT2_2r0 -config BR2_TARGET_ROOTFS_EXT2_2 - bool "ext2" +config BR2_TARGET_ROOTFS_EXT2_2r0 + bool "ext2 (rev0)" + select BR2_TARGET_ROOTFS_EXT2_2 + +config BR2_TARGET_ROOTFS_EXT2_2r1 + bool "ext2 (rev1)" + select BR2_TARGET_ROOTFS_EXT2_2 config BR2_TARGET_ROOTFS_EXT2_3 bool "ext3" @@ -27,6 +35,12 @@ config BR2_TARGET_ROOTFS_EXT2_GEN default 3 if BR2_TARGET_ROOTFS_EXT2_3 default 4 if BR2_TARGET_ROOTFS_EXT2_4 +# All ext generations are revision 1, except ext2r0, which is revision 0 +config BR2_TARGET_ROOTFS_EXT2_REV + int + default 0 if BR2_TARGET_ROOTFS_EXT2_2r0 + default 1 if !BR2_TARGET_ROOTFS_EXT2_2r0 + config BR2_TARGET_ROOTFS_EXT2_BLOCKS int "size in blocks (leave at 0 for auto calculation)" default 0 diff --git a/fs/ext2/ext2.mk b/fs/ext2/ext2.mk index ffb7257..d74f31e 100644 --- a/fs/ext2/ext2.mk +++ b/fs/ext2/ext2.mk @@ -20,7 +20,8 @@ endif ROOTFS_EXT2_DEPENDENCIES = host-genext2fs host-e2fsprogs -EXT2_ENV = GEN=$(BR2_TARGET_ROOTFS_EXT2_GEN) +EXT2_ENV = GEN=$(BR2_TARGET_ROOTFS_EXT2_GEN) +EXT2_ENV += REV=$(BR2_TARGET_ROOTFS_EXT2_REV) define ROOTFS_EXT2_CMD PATH=$(TARGET_PATH) $(EXT2_ENV) fs/ext2/genext2fs.sh -d $(TARGET_DIR) $(EXT2_OPTS) $@ diff --git a/fs/ext2/genext2fs.sh b/fs/ext2/genext2fs.sh index c2049f5..76f454c 100755 --- a/fs/ext2/genext2fs.sh +++ b/fs/ext2/genext2fs.sh @@ -78,15 +78,21 @@ e2tunefsck() { } # Check we know what generation to generate -case "${GEN}" in - 2|3|4) +case "${GEN}:${REV}" in + 2:0|2:1|3:1|4:1) ;; *) - printf "%s: unknown ext generation to generate\n" "${0##*/}" >&2 + printf "%s: unknown ext generation '%s' and/or revision '%s'\n" \ + "${0##*/}" "${GEN}" "${REV}" >&2 exit 1 ;; esac +# Upgrade to rev1 if needed +if [ ${REV} -ge 1 ]; then + EXT_OPTS_O="${EXT_OPTS_O},filetype" +fi + # Add a journal for ext3 and above if [ ${GEN} -ge 3 ]; then EXT_OPTS="${EXT_OPTS} -j -J size=1"