diff options
author | Andy Whitcroft <apw@canonical.com> | 2008-11-27 19:12:07 +0000 |
---|---|---|
committer | John Rigby <john.rigby@linaro.org> | 2011-08-21 21:28:09 -0600 |
commit | d0ec33dbc8d44a0b6fb360a231ae223453347a37 (patch) | |
tree | 6bdcbcdbd70b652c8f006bfe9b95b4a3121f8f11 /fs | |
parent | 54e2079240f76b225736d2d8d1309d1d7ecf7bbc (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); |