@@ -325,6 +325,22 @@ static __init int efivar_ssdt_load(void)
static inline int efivar_ssdt_load(void) { return 0; }
#endif
+#ifdef CONFIG_PROC_FS
+static struct proc_dir_entry *proc_efi;
+static int __init efi_proc_init(void)
+{
+ proc_efi = proc_mkdir("efi", NULL);
+ if (!proc_efi) {
+ pr_err("/proc/efi: Cannot create /proc/efi directory.\n");
+ return 1;
+ }
+
+ return 0;
+}
+#else
+static inline int efi_proc_init(void) { return 0; }
+#endif /* CONFIG_PROC_FS */
+
/*
* We register the efi subsystem with the firmware subsystem and the
* efivars subsystem with the efi subsystem, if the system was booted with
@@ -381,6 +397,12 @@ static int __init efisubsys_init(void)
goto err_remove_group;
}
+ error = efi_proc_init();
+ if (error) {
+ sysfs_remove_mount_point(efi_kobj, "efivars");
+ goto err_remove_group;
+ }
+
return 0;
err_remove_group: