From patchwork Wed Sep 27 23:32:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 114384 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp61620qgf; Wed, 27 Sep 2017 16:34:06 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCjgK33k+Hww8DaPPMt+n8Ualnt2H2NTe8x6b2IfUEzFkt7AVpIRBHauPjfGpeOou1tzpLi X-Received: by 10.159.252.11 with SMTP id n11mr2487799pls.18.1506555245995; Wed, 27 Sep 2017 16:34:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506555245; cv=none; d=google.com; s=arc-20160816; b=MFGw0ri228QTsgRjnb371mmT8rrKnpLnI4/zv+EfBPZAmIzyvYoWpqFI25h6Ut36Gt q8YDYyVMugMgF22uPAAU6tgz3NQwlFVfyyuZWB9ONvmJ37pMQ9D//yJ5WWSxvJPuaCRM f4L72WSES1jHTl9MGG18Kx2ipjmXSjyLvg+GaDt+V9bmLT622XzIdKxe9/lZeZxXPoPt wdU+glFouT0E3jMSCN8s93EeVAYO81KChscbpaJx5CXZNrFy44wfdZSEO9aLXgm+7kbh Z8ybuKrqsFGbZHYwhwEq7NMtUG+upL3Slt6Fvdc3rArFTAw5RsoxP6uRYdPYiKtHaiT5 U45A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=XY/5p/pFXe6mEqJTQNcF255ewV2V2SFbENTZi0o14Qk=; b=iB8/+TecKHoNRv7WbLh/0u/mwvz7NiubeNMepzvc3Z8L68Pa3Sv0exK/+D5lXill4a SjDHZXxk38XQff3sexb0wAJ7WUMLqjFefJwcayKWJxEFa7YZ1nUgs6IX50HnznvZgvfe Z8sBfJytuaFFp+pZhfCNW2eGwe1wrp2Svp5XmPxfQp81WuVeexxTR90e7IJluc8eqMHk RjJZm1CO8/TKoPkpzUGuYk5++bAhVVeC4gpI1ms1KWlVo+JkxpzPhKE4JGE+2/8MYsXZ qCNjvXktmtH9DEjGZ+GWtkElRC1C9UfBiAAkhMYtRIqTFSxHniPb1xbRkuVZRP52p9tC hLgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pobox.com header.s=sasl header.b=C6ApFkkg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y187si104444pgb.132.2017.09.27.16.34.05; Wed, 27 Sep 2017 16:34:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@pobox.com header.s=sasl header.b=C6ApFkkg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752578AbdI0XdV (ORCPT + 26 others); Wed, 27 Sep 2017 19:33:21 -0400 Received: from pb-smtp1.pobox.com ([64.147.108.70]:51906 "EHLO sasl.smtp.pobox.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752375AbdI0Xcb (ORCPT ); Wed, 27 Sep 2017 19:32:31 -0400 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 124D499558; Wed, 27 Sep 2017 19:32:31 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:date:message-id:in-reply-to:references; s=sasl; bh=J09e yu5zqSU2SgX8vLT3VCXRDsE=; b=C6ApFkkg/goiDvyhvH/prRSl9z/dokm0xL9F kVrWIkms/njdF6T5S3DsLqjBMK3F2zgBJgAAhcUdHZU0m2aHns4epNnvdVIvQHc8 qLcFXmcK9CeJ6HwkOMFxA3nSqtfMh2Mpkx8T9z6LR8R8zoYS/tiHoEudSW0Cxst/ Ox0QOjc= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 082DA99557; Wed, 27 Sep 2017 19:32:31 -0400 (EDT) Received: from yoda.home (unknown [137.175.234.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 64D3799553; Wed, 27 Sep 2017 19:32:30 -0400 (EDT) Received: from xanadu.home (xanadu.home [192.168.2.2]) by yoda.home (Postfix) with ESMTP id 419CB2DA0695; Wed, 27 Sep 2017 19:32:29 -0400 (EDT) From: Nicolas Pitre To: Alexander Viro , linux-mm@kvack.org Cc: linux-fsdevel@vger.kernel.org, linux-embedded@vger.kernel.org, linux-kernel@vger.kernel.org, Chris Brandt Subject: [PATCH v4 5/5] cramfs: rehabilitate it Date: Wed, 27 Sep 2017 19:32:24 -0400 Message-Id: <20170927233224.31676-6-nicolas.pitre@linaro.org> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20170927233224.31676-1-nicolas.pitre@linaro.org> References: <20170927233224.31676-1-nicolas.pitre@linaro.org> X-Pobox-Relay-ID: 2143FCB2-A3DC-11E7-89C8-FE4B1A68708C-78420484!pb-smtp1.pobox.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Update documentation, pointer to latest tools, appoint myself as maintainer. Given it's been unloved for so long, I don't expect anyone will protest. Signed-off-by: Nicolas Pitre Tested-by: Chris Brandt --- Documentation/filesystems/cramfs.txt | 42 ++++++++++++++++++++++++++++++++++++ MAINTAINERS | 4 ++-- fs/cramfs/Kconfig | 9 +++++--- 3 files changed, 50 insertions(+), 5 deletions(-) -- 2.9.5 diff --git a/Documentation/filesystems/cramfs.txt b/Documentation/filesystems/cramfs.txt index 4006298f67..8875d306bc 100644 --- a/Documentation/filesystems/cramfs.txt +++ b/Documentation/filesystems/cramfs.txt @@ -45,6 +45,48 @@ you can just change the #define in mkcramfs.c, so long as you don't mind the filesystem becoming unreadable to future kernels. +Memory Mapped cramfs image +-------------------------- + +The CRAMFS_PHYSMEM Kconfig option adds support for loading data directly +from a physical linear memory range (usually non volatile memory like Flash) +to cramfs instead of going through the block device layer. This saves some +memory since no intermediate buffering is necessary to hold the data before +decompressing. + +And when data blocks are kept uncompressed and properly aligned, they will +automatically be mapped directly into user space whenever possible providing +eXecute-In-Place (XIP) from ROM of read-only segments. Data segments mapped +read-write (hence they have to be copied to RAM) may still be compressed in +the cramfs image in the same file along with non compressed read-only +segments. Both MMU and no-MMU systems are supported. This is particularly +handy for tiny embedded systems with very tight memory constraints. + +The filesystem type for this feature is "cramfs_physmem" to distinguish it +from the block device (or MTD) based access. The location of the cramfs +image in memory is system dependent. You must know the proper physical +address where the cramfs image is located and specify it using the +physaddr=0x******** mount option (for example, if the physical address +of the cramfs image is 0x80100000, the following command would mount it +on /mnt: + +$ mount -t cramfs_physmem -o physaddr=0x80100000 none /mnt + +To boot such an image as the root filesystem, the following kernel +commandline parameters must be provided: + + "rootfstype=cramfs_physmem rootflags=physaddr=0x80100000" + + +Tools +----- + +A version of mkcramfs that can take advantage of the latest capabilities +described above can be found here: + +https://github.com/npitre/cramfs-tools + + For /usr/share/magic -------------------- diff --git a/MAINTAINERS b/MAINTAINERS index 1c3feffb1c..f00aec6a66 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3612,8 +3612,8 @@ F: drivers/cpuidle/* F: include/linux/cpuidle.h CRAMFS FILESYSTEM -W: http://sourceforge.net/projects/cramfs/ -S: Orphan / Obsolete +M: Nicolas Pitre +S: Maintained F: Documentation/filesystems/cramfs.txt F: fs/cramfs/ diff --git a/fs/cramfs/Kconfig b/fs/cramfs/Kconfig index 306549be25..374d52e029 100644 --- a/fs/cramfs/Kconfig +++ b/fs/cramfs/Kconfig @@ -1,5 +1,5 @@ config CRAMFS - tristate "Compressed ROM file system support (cramfs) (OBSOLETE)" + tristate "Compressed ROM file system support (cramfs)" select ZLIB_INFLATE help Saying Y here includes support for CramFs (Compressed ROM File @@ -15,8 +15,11 @@ config CRAMFS cramfs. Note that the root file system (the one containing the directory /) cannot be compiled as a module. - This filesystem is obsoleted by SquashFS, which is much better - in terms of performance and features. + This filesystem is limited in capabilities and performance on + purpose to remain small and low on RAM usage. It is most suitable + for small embedded systems. For a more capable compressed filesystem + you should look at SquashFS which is much better in terms of + performance and features. If unsure, say N.