diff options
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); |