2009-06-13 13:27:43

by Marco Stornelli

[permalink] [raw]
Subject: [PATCH 08/14] Pramfs: Makefile and Kconfig

From: Marco Stornelli <[email protected]>

Makefile and Kconfig.

Signed-off-by: Marco Stornelli <[email protected]>
---

diff -uprN linux-2.6.30-orig/fs/Kconfig linux-2.6.30/fs/Kconfig
--- linux-2.6.30-orig/fs/Kconfig 2009-06-10 05:05:27.000000000 +0200
+++ linux-2.6.30/fs/Kconfig 2009-06-13 10:01:41.000000000 +0200
@@ -13,7 +13,7 @@ source "fs/ext4/Kconfig"
config FS_XIP
# execute in place
bool
- depends on EXT2_FS_XIP
+ depends on EXT2_FS_XIP || PRAMFS_XIP
default y

source "fs/jbd/Kconfig"
@@ -176,6 +176,7 @@ source "fs/romfs/Kconfig"
source "fs/sysv/Kconfig"
source "fs/ufs/Kconfig"
source "fs/exofs/Kconfig"
+source "fs/pramfs/Kconfig"

config NILFS2_FS
tristate "NILFS2 file system support (EXPERIMENTAL)"
diff -uprN linux-2.6.30-orig/fs/Makefile linux-2.6.30/fs/Makefile
--- linux-2.6.30-orig/fs/Makefile 2009-06-10 05:05:27.000000000 +0200
+++ linux-2.6.30/fs/Makefile 2009-06-13 10:00:26.000000000 +0200
@@ -124,3 +124,5 @@ obj-$(CONFIG_OCFS2_FS) += ocfs2/
obj-$(CONFIG_BTRFS_FS) += btrfs/
obj-$(CONFIG_GFS2_FS) += gfs2/
obj-$(CONFIG_EXOFS_FS) += exofs/
+obj-$(CONFIG_PRAMFS) += pramfs/
+
diff -uprN linux-2.6.30-orig/fs/pramfs/Kconfig linux-2.6.30/fs/pramfs/Kconfig
--- linux-2.6.30-orig/fs/pramfs/Kconfig 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.30/fs/pramfs/Kconfig 2009-04-22 15:22:54.000000000 +0200
@@ -0,0 +1,51 @@
+config PRAMFS
+ tristate "Persistent and Protected RAM file system support"
+ select PRAMFS_NOWP if PRAMFS=m
+ help
+ If your system has a block of fast (comparable in access speed to
+ system memory) and non-volatile RAM and you wish to mount a
+ light-weight, full-featured, and space-efficient filesystem over it,
+ say Y here, and read <file:Documentation/filesystems/pramfs.txt>.
+
+ To compile this as a module, choose M here: the module will be
+ called pramfs.
+
+config PRAMFS_XIP
+ bool "Enable Execute-in-place in PRAMFS"
+ depends on PRAMFS
+ select PRAMFS_NOWP
+ help
+ Say Y here to enable xip feature of PRAMFS.
+
+config PRAMFS_NOWP
+ bool "Disable PRAMFS write protection"
+ depends on PRAMFS
+ default n
+ help
+ Say Y here to disable the write protect feature of PRAMFS.
+
+config ROOT_PRAMFS
+ bool "Root file system on PRAMFS"
+ depends on PRAMFS && !ROOT_NFS
+ help
+ Say Y if you have enabled PRAMFS, and you want to be
+ able to use PRAMFS as the root filesystem. To actually
+ have the kernel mount PRAMFS as a root file system, you
+ must also pass the command line parameter
+ "root=/dev/null rootflags=physaddr=0x********" to the kernel
+ (replace 0x******** with the physical address location of the
+ previously initialized PRAMFS memory to boot with).
+
+config PRAMFS_TEST
+ boolean
+ depends on PRAMFS
+ default n
+
+config TEST_MODULE
+ tristate "PRAMFS Test"
+ depends on PRAMFS && m && !PRAMFS_NOWP
+ select PRAMFS_TEST
+ default n
+ help
+ Say Y here to build a simple module to test the protection of
+ PRAMFS. The module will be called pramfs_test.ko.
diff -uprN linux-2.6.30-orig/fs/pramfs/Makefile linux-2.6.30/fs/pramfs/Makefile
--- linux-2.6.30-orig/fs/pramfs/Makefile 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.30/fs/pramfs/Makefile 2009-04-19 11:58:51.000000000 +0200
@@ -0,0 +1,13 @@
+#
+# Makefile for the linux pram-filesystem routines.
+#
+
+obj-$(CONFIG_PRAMFS) += pramfs.o
+obj-$(CONFIG_TEST_MODULE) += pramfs_test.o
+
+pramfs-objs := balloc.o dir.o file.o inode.o namei.o super.o symlink.o
+
+ifneq ($(CONFIG_PRAMFS_NOWP),y)
+pramfs-objs += wprotect.o
+endif
+pramfs-$(CONFIG_PRAMFS_XIP) += xip.o


2009-06-13 13:53:53

by Sam Ravnborg

[permalink] [raw]
Subject: Re: [PATCH 08/14] Pramfs: Makefile and Kconfig

> +
> +config PRAMFS_NOWP
> + bool "Disable PRAMFS write protection"
> + depends on PRAMFS
> + default n
> + help
> + Say Y here to disable the write protect feature of PRAMFS.
n is default so "default n" is not needed.
If you reverse the logic (and add a default y) then..

> +ifneq ($(CONFIG_PRAMFS_NOWP),y)
> +pramfs-objs += wprotect.o
> +endif
This is a trivial:
pramfs-$(PRAMFS_WRITE_PROTECT) += wprotect.o

(I renamed the option to something more descriptive - please do so in the abvoe).


> +++ linux-2.6.30/fs/pramfs/Makefile 2009-04-19 11:58:51.000000000 +0200
> @@ -0,0 +1,13 @@
> +#
> +# Makefile for the linux pram-filesystem routines.
> +#
> +
> +obj-$(CONFIG_PRAMFS) += pramfs.o
> +obj-$(CONFIG_TEST_MODULE) += pramfs_test.o
> +
> +pramfs-objs := balloc.o dir.o file.o inode.o namei.o super.o symlink.o

Use:
pramfs-y := balloc.o ...

This match usa later in this file.

> +
> +ifneq ($(CONFIG_PRAMFS_NOWP),y)
> +pramfs-objs += wprotect.o
> +endif
> +pramfs-$(CONFIG_PRAMFS_XIP) += xip.o


Sam

2009-06-13 14:02:15

by Daniel Walker

[permalink] [raw]
Subject: Re: [PATCH 08/14] Pramfs: Makefile and Kconfig

On Sat, 2009-06-13 at 15:22 +0200, Marco wrote:
> From: Marco Stornelli <[email protected]>
>
> Makefile and Kconfig.
>
> Signed-off-by: Marco Stornelli <[email protected]>
> ---
>

You should move this patch to 11 of 14, as I think that is the point
when the filesystem can actually be enabled and function. If this series
is only applied up to this patch you can get build failures if you
enabled PRAMFS, XIP, or any of the other features. Also breaking out the
individual features menuconfig options like XIP, and write protect, etc,
into their respective patches would be nice.

Daniel

2009-06-14 07:20:47

by Marco Stornelli

[permalink] [raw]
Subject: Re: [PATCH 08/14] Pramfs: Makefile and Kconfig

Sam Ravnborg wrote:
>> +
>> +config PRAMFS_NOWP
>> + bool "Disable PRAMFS write protection"
>> + depends on PRAMFS
>> + default n
>> + help
>> + Say Y here to disable the write protect feature of PRAMFS.
> n is default so "default n" is not needed.
> If you reverse the logic (and add a default y) then..
>
>> +ifneq ($(CONFIG_PRAMFS_NOWP),y)
>> +pramfs-objs += wprotect.o
>> +endif
> This is a trivial:
> pramfs-$(PRAMFS_WRITE_PROTECT) += wprotect.o
>
> (I renamed the option to something more descriptive - please do so in the abvoe).
>
>
>> +++ linux-2.6.30/fs/pramfs/Makefile 2009-04-19 11:58:51.000000000 +0200
>> @@ -0,0 +1,13 @@
>> +#
>> +# Makefile for the linux pram-filesystem routines.
>> +#
>> +
>> +obj-$(CONFIG_PRAMFS) += pramfs.o
>> +obj-$(CONFIG_TEST_MODULE) += pramfs_test.o
>> +
>> +pramfs-objs := balloc.o dir.o file.o inode.o namei.o super.o symlink.o
>
> Use:
> pramfs-y := balloc.o ...
>
> This match usa later in this file.
>
>> +
>> +ifneq ($(CONFIG_PRAMFS_NOWP),y)
>> +pramfs-objs += wprotect.o
>> +endif
>> +pramfs-$(CONFIG_PRAMFS_XIP) += xip.o
>
>
> Sam
>

Ok, thanks.

Marco

2009-06-14 07:21:00

by Marco Stornelli

[permalink] [raw]
Subject: Re: [PATCH 08/14] Pramfs: Makefile and Kconfig

Daniel Walker wrote:
> On Sat, 2009-06-13 at 15:22 +0200, Marco wrote:
>> From: Marco Stornelli <[email protected]>
>>
>> Makefile and Kconfig.
>>
>> Signed-off-by: Marco Stornelli <[email protected]>
>> ---
>>
>
> You should move this patch to 11 of 14, as I think that is the point
> when the filesystem can actually be enabled and function. If this series
> is only applied up to this patch you can get build failures if you
> enabled PRAMFS, XIP, or any of the other features. Also breaking out the
> individual features menuconfig options like XIP, and write protect, etc,
> into their respective patches would be nice.
>
> Daniel
>
>

Ok Daniel thanks for your comments. Actually I split the patches by
functionality because I think that for this series it's a little bit
complicated to follow a sequence so as not to have building failure but
I can try. I think the only part I can split is the XIP. I think there
will be a lot of comments so I'll wait for other comments before to
re-submit other patches.

Marco