Skip to contentSkip to conversation

efi: split efisubsystem from efivars

PATCH In review Tom Gundersen 2 participants 2 messages Feb 26, 2013 – Mar 1, 2013 1 message not in the archive EFI

lore
Share & tools
lore
#0 lore raw

PATCH v5 1/1 efi: split efisubsystem from efivars

This registers /sys/firmware/efi/{,systab,efivars/} whenever EFI is enabled and the system is booted with EFI.

This allows
*) userspace to check for the existence of /sys/firmware/efi as a way
to determine whether or it is running on an EFI system.
*) 'mount -t efivarfs none /sys/firmware/efi/efivars' without manually
loading any modules.

v5: remove unnecessary #ifdef's
v4: rebase on top of the chainsaw branch:
- split into efi.c and vars.c
- move systab from vars.c to efi.c
- address checkpatch warnings
v3: rebase on top of new efi_enabled()
v2: only create /sys/firmware/efi/efivars if the module is being compiled,
and move extern's to efi.h

Cc Matt Fleming <[email protected]>
Cc Kay Sievers <[email protected]>
Cc Jeremy Kerr <[email protected]>
Cc Matthew Garrett <[email protected]>
Cc Chun-Yi Lee <jlee-IBi9RG/[email protected]>
Cc Andy Whitcroft <[email protected]>
Cc Tobias Powalowski <tpowa-fd97jBR+K/[email protected]>
---
 drivers/firmware/Makefile     |   1 -
 drivers/firmware/efi/Makefile |   2 +
 drivers/firmware/efi/efi.c    | 105 +++++
 drivers/firmware/efi/vars.c   | 858 +++++++++++++++++++++++++++++++++++++
 drivers/firmware/efivars.c    | 955 ------------------------------------------
 include/linux/efi.h           |   2 +
 6 files changed, 967 insertions(+), 956 deletions(-)
 create mode 100644 drivers/firmware/efi/efi.c
 create mode 100644 drivers/firmware/efi/vars.c
 delete mode 100644 drivers/firmware/efivars.c
drivers/firmware/Makefile +0 -1
index 31bf68c..299fad6 100644
@@ -4,7 +4,6 @@
 obj-$(CONFIG_DMI)		+= dmi_scan.o
 obj-$(CONFIG_DMI_SYSFS)		+= dmi-sysfs.o
 obj-$(CONFIG_EDD)		+= edd.o
-obj-$(CONFIG_EFI_VARS)		+= efivars.o
 obj-$(CONFIG_EFI_PCDP)		+= pcdp.o
 obj-$(CONFIG_DELL_RBU)          += dell_rbu.o
 obj-$(CONFIG_DCDBAS)		+= dcdbas.o
drivers/firmware/efi/Makefile +2 -0
index ef5066f..42af8d5 100644
@@ -1,6 +1,8 @@
 #
 # Makefile for linux kernel
 #
+obj-y					+= efi.o
+obj-$(CONFIG_EFI_VARS)			+= vars.o
 obj-$(CONFIG_EFI_VARS_SYSFS)		+= sysfs.o
 obj-$(CONFIG_EFI_VARS_PSTORE)		+= pstore.o
 obj-$(CONFIG_EFI_VARS_GENERIC_OPS)	+= generic-ops.o
drivers/firmware/efi/efi.c new file +105 -0

105 lines not on this page · raw message

drivers/firmware/efi/vars.c new file +858 -0

858 lines not on this page · raw message

drivers/firmware/efivars.c deleted +0 -955

955 lines not on this page · raw message

include/linux/efi.h +2 -0
index b81928b..58b3cae 100644
@@ -742,6 +742,8 @@ utf16_strlen(efi_char16_t *s)
 	return utf16_strnlen(s, ~0UL);
 }
 
+extern struct kobject *efi_kobj;
+
 #ifdef CONFIG_EFI_VARS
 /*
  * Return the number of bytes is the length of this string
Signature · 1 line
1.8.1.4

A message that is not in the archive (sent off-list or not yet received): 1361904220-1248-1-git-send-email-teg-B22kvLQNl6c@public.gmane.org

#2 lore raw
Quoted 26 lines · Tom Gundersen

This registers /sys/firmware/efi/{,systab,efivars/} whenever EFI is enabled and the system is booted with EFI.

This allows
*) userspace to check for the existence of /sys/firmware/efi as a way
to determine whether or it is running on an EFI system.
*) 'mount -t efivarfs none /sys/firmware/efi/efivars' without manually
loading any modules.

v5: remove unnecessary #ifdef's
v4: rebase on top of the chainsaw branch:
- split into efi.c and vars.c
- move systab from vars.c to efi.c
- address checkpatch warnings
v3: rebase on top of new efi_enabled()
v2: only create /sys/firmware/efi/efivars if the module is being compiled,
and move extern's to efi.h

Cc Matt Fleming <[email protected]>
Cc Kay Sievers <[email protected]>
Cc Jeremy Kerr <[email protected]>
Cc Matthew Garrett <[email protected]>
Cc Chun-Yi Lee <jlee-IBi9RG/[email protected]>
Cc Andy Whitcroft <[email protected]>
Cc Tobias Powalowski <tpowa-fd97jBR+K/[email protected]>
Quoted 11 lines
---
 drivers/firmware/Makefile     |   1 -
 drivers/firmware/efi/Makefile |   2 +
 drivers/firmware/efi/efi.c    | 105 +++++
 drivers/firmware/efi/vars.c   | 858 +++++++++++++++++++++++++++++++++++++
 drivers/firmware/efivars.c    | 955 ------------------------------------------
 include/linux/efi.h           |   2 +
 6 files changed, 967 insertions(+), 956 deletions(-)
 create mode 100644 drivers/firmware/efi/efi.c
 create mode 100644 drivers/firmware/efi/vars.c
 delete mode 100644 drivers/firmware/efivars.c

Thanks Tom, I've picked this up. I need to respin this branch against Linus' because there were some efivars change this merge window.