From patchwork Fri Sep 13 16:38:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 274808 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from casper.infradead.org (unknown [IPv6:2001:770:15f::2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id BB0402C0111 for ; Sat, 14 Sep 2013 02:39:21 +1000 (EST) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VKWOS-0007WQ-9F; Fri, 13 Sep 2013 16:38:52 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VKWON-0000pr-NL; Fri, 13 Sep 2013 16:38:47 +0000 Received: from mail-ea0-x22b.google.com ([2a00:1450:4013:c01::22b]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VKWOK-0000oa-Gc for linux-mtd@lists.infradead.org; Fri, 13 Sep 2013 16:38:45 +0000 Received: by mail-ea0-f171.google.com with SMTP id n15so705232ead.30 for ; Fri, 13 Sep 2013 09:38:21 -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:mime-version:content-type :content-transfer-encoding; bh=E5uRVD7Fc3KPl/Dqn7wrsMb0XuXgNtGiQm29vzz7fuU=; b=xYEAW6Ma+m/lyjZbdI3dXsjIqv5l1IXk8YJvF/X+7EdaGQaR668wpI4tclJwwwbag8 2jSZofFISProbnitAFQpmvrQatPsxSb66xh4++iw7kagoZggb47KiNJt6G8BuP6lmmT0 WMPA4GnKGsRB/DTA713mWuFV9Lg58KBzw69UBZ8SpEBnAU/f/Xr+Y4c/ZruX92jjp/oh LAKWNqyOVA5X3k5ZDD+G+Mz3onQXf9z+QOFGseWHEz89uhgN7VhEnOr/XoLHao4qTiFQ xguvRFwmG/P8I2H2jjhsSu7c2NahWwSRWESXq1fsVYjv9ifCpVEzkYW9TOt2157YY7Yi j42Q== X-Received: by 10.15.98.194 with SMTP id bj42mr18955690eeb.12.1379090301681; Fri, 13 Sep 2013 09:38:21 -0700 (PDT) Received: from linux-samsung700g7a.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by mx.google.com with ESMTPSA id r48sm16305899eev.14.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 09:38:21 -0700 (PDT) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: linux-mtd@lists.infradead.org, Artem Bityutskiy , David Woodhouse Subject: [PATCH] mtd: bcm47xxpart: detect Squashfs partition Date: Fri, 13 Sep 2013 18:38:17 +0200 Message-Id: <1379090297-2880-1-git-send-email-zajec5@gmail.com> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130913_123844_694244_65B021BC X-CRM114-Status: GOOD ( 10.69 ) X-Spam-Score: -1.8 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (zajec5[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (zajec5[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Hauke Mehrtens , =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Rafał Miłecki --- drivers/mtd/bcm47xxpart.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/mtd/bcm47xxpart.c b/drivers/mtd/bcm47xxpart.c index 9279a91..96f821a 100644 --- a/drivers/mtd/bcm47xxpart.c +++ b/drivers/mtd/bcm47xxpart.c @@ -32,6 +32,7 @@ #define ML_MAGIC1 0x39685a42 #define ML_MAGIC2 0x26594131 #define TRX_MAGIC 0x30524448 +#define SQSH_MAGIC 0x71736873 /* shsq */ struct trx_header { uint32_t magic; @@ -167,6 +168,13 @@ static int bcm47xxpart_parse(struct mtd_info *master, offset = rounddown(offset + trx->length, blocksize); continue; } + + /* Squashfs */ + if (buf[0x000 / 4] == SQSH_MAGIC) { + bcm47xxpart_add_part(&parts[curr_part++], "rootfs", + offset, 0); + continue; + } } /* Look for NVRAM at the end of the last block. */