diff options
author | Andy Whitcroft <apw@canonical.com> | 2008-11-27 19:12:07 +0000 |
---|---|---|
committer | John Rigby <john.rigby@linaro.org> | 2011-09-23 08:45:11 -0600 |
commit | e626bff346929de4c8c39a91618cbcc8f3382db3 (patch) | |
tree | ff86f92027bdebdbf9161f3ec580ce84d7b4b861 /fs | |
parent | 750d6de9854a20872f10e2e221d5cfd6e333fb3f (diff) |
UBUNTU: SAUCE: (no-up) version: Implement version_signature proc file.
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Acked-by: Tim Gardener <tim.gardner@canonical.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/proc/Makefile | 1 | ||||
-rw-r--r-- | fs/proc/version_signature.c | 31 |
2 files changed, 32 insertions, 0 deletions
diff --git a/fs/proc/Makefile b/fs/proc/Makefile index c1c72933592..cc68b63d572 100644 --- a/fs/proc/Makefile +++ b/fs/proc/Makefile @@ -28,3 +28,4 @@ proc-$(CONFIG_PROC_VMCORE) += vmcore.o proc-$(CONFIG_PROC_DEVICETREE) += proc_devtree.o proc-$(CONFIG_PRINTK) += kmsg.o proc-$(CONFIG_PROC_PAGE_MONITOR) += page.o +proc-y += version_signature.o diff --git a/fs/proc/version_signature.c b/fs/proc/version_signature.c new file mode 100644 index 00000000000..859fb6092a6 --- /dev/null +++ b/fs/proc/version_signature.c @@ -0,0 +1,31 @@ +#include <linux/fs.h> +#include <linux/init.h> +#include <linux/kernel.h> +#include <linux/proc_fs.h> +#include <linux/seq_file.h> +#include <linux/utsname.h> + +static int version_signature_proc_show(struct seq_file *m, void *v) +{ + seq_printf(m, "%s\n", CONFIG_VERSION_SIGNATURE); + return 0; +} + +static int version_signature_proc_open(struct inode *inode, struct file *file) +{ + return single_open(file, version_signature_proc_show, NULL); +} + +static const struct file_operations version_signature_proc_fops = { + .open = version_signature_proc_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; + +static int __init proc_version_signature_init(void) +{ + proc_create("version_signature", 0, NULL, &version_signature_proc_fops); + return 0; +} +module_init(proc_version_signature_init); |