aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorAndy Whitcroft <apw@canonical.com>2008-11-27 19:12:07 +0000
committerJohn Rigby <john.rigby@linaro.org>2011-11-16 14:21:47 -0700
commit64865717d8ef9461205f3645e047f006c17e4bd2 (patch)
treec1c80d3c3d6b455dfbbbb0da43e246fb86288c9a /fs
parent982e4027dfa347f290c31c6ac9b2d38831363207 (diff)
downloadlinux-linaro-precise-64865717d8ef9461205f3645e047f006c17e4bd2.tar.gz
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/Makefile1
-rw-r--r--fs/proc/version_signature.c31
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);