aboutsummaryrefslogtreecommitdiff
path: root/fs/proc
diff options
context:
space:
mode:
authorAndy Whitcroft <apw@canonical.com>2008-11-27 19:12:07 +0000
committerLeann Ogasawara <leann.ogasawara@canonical.com>2010-08-11 07:38:46 -0700
commit6975b2dda976592705c0ed538766a31ab27f9b8d (patch)
treec0656d49780acb0e14cb003bf15ee04c50eee86e /fs/proc
parent426a89da1ccd64e52fe04e1668edbd4830ce74b3 (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/proc')
-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 11a7b5c6815..0918037c5a1 100644
--- a/fs/proc/Makefile
+++ b/fs/proc/Makefile
@@ -26,3 +26,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);