From patchwork Thu Mar 7 22:04:42 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: 225982 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 1F89F2C0377 for ; Fri, 8 Mar 2013 09:06:51 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 994028CD26; Thu, 7 Mar 2013 22:06:48 +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 DQDAJm-uN46j; Thu, 7 Mar 2013 22:06:36 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 0C7B68CDB5; Thu, 7 Mar 2013 22:05:56 +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 6BEDF8F753 for ; Thu, 7 Mar 2013 22:05:24 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 70DD58C949 for ; Thu, 7 Mar 2013 22:05:16 +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 bxsa62knCcet for ; Thu, 7 Mar 2013 22:05:05 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by whitealder.osuosl.org (Postfix) with ESMTPS id BE7218C341 for ; Thu, 7 Mar 2013 22:05:00 +0000 (UTC) Received: by mail-wi0-f178.google.com with SMTP id hq4so622673wib.17 for ; Thu, 07 Mar 2013 14:04:58 -0800 (PST) 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=PJNLtag34QPaZuyrWvSPHS7z1WQC94V0xyTm1XljU/Q=; b=ubE/1eNFwd2B2SCDdre5plzPLBEBpIQN4nvY9HxFvFTF4LoyfPQjsTk70JBLPKOKfg rlZctWd3gT3pBs2wBDPHFWT4K1HzF04GKwLW2SvhFHzw/ps9akR0G5rfIQV+TOSnSzXa 6opRj5wUD3egRpfrd0u5l3ZfWP6oObX2a1ix5b5/I0LOUqhLdlV+kD+YMqRH0PziRTLy 6eklfD6eA4DcnuijisYJ3fhjAbSyLRWx++CC5sSL3gK/2BN5bl46R1UIVD0k3Q39Mipn ZAJzl7SbfEk0QTzw8EQXXPwVGt9tfmcAbtl7Ypl5hsdi1EC/3Gg058/gfSj/f5aRDsEV hZoQ== X-Received: by 10.180.78.168 with SMTP id c8mr28017376wix.27.1362693898898; Thu, 07 Mar 2013 14:04:58 -0800 (PST) Received: from localhost.localdomain (ARennes-555-1-167-217.w2-2.abo.wanadoo.fr. [2.2.22.217]) by mx.google.com with ESMTPS id bj9sm35969125wib.4.2013.03.07.14.04.57 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 07 Mar 2013 14:04:58 -0800 (PST) From: "Yann E. MORIN" To: buildroot@busybox.net Date: Thu, 7 Mar 2013 23:04:42 +0100 Message-Id: <31898da643046864f71fe6c6b553cc4bd00f0897.1362693453.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 5/6] 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 57acad7..b383020 100644 --- a/fs/ext2/ext2.mk +++ b/fs/ext2/ext2.mk @@ -23,7 +23,8 @@ ifeq ($(BR2_PACKAGE_HOST_E2FSPROGS),y) ROOTFS_EXT2_DEPENDENCIES = host-e2fsprogs endif -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 0790729..c466bc2 100755 --- a/fs/ext2/genext2fs.sh +++ b/fs/ext2/genext2fs.sh @@ -75,15 +75,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"