xref: /linux/Documentation/filesystems/efivarfs.rst (revision 621cde16e49b3ecf7d59a8106a20aaebfb4a59a9)
106dedb45SMauro Carvalho Chehab.. SPDX-License-Identifier: GPL-2.0
206dedb45SMauro Carvalho Chehab
306dedb45SMauro Carvalho Chehab=======================================
406dedb45SMauro Carvalho Chehabefivarfs - a (U)EFI variable filesystem
506dedb45SMauro Carvalho Chehab=======================================
606dedb45SMauro Carvalho Chehab
706dedb45SMauro Carvalho ChehabThe efivarfs filesystem was created to address the shortcomings of
806dedb45SMauro Carvalho Chehabusing entries in sysfs to maintain EFI variables. The old sysfs EFI
906dedb45SMauro Carvalho Chehabvariables code only supported variables of up to 1024 bytes. This
1006dedb45SMauro Carvalho Chehablimitation existed in version 0.99 of the EFI specification, but was
1106dedb45SMauro Carvalho Chehabremoved before any full releases. Since variables can now be larger
1206dedb45SMauro Carvalho Chehabthan a single page, sysfs isn't the best interface for this.
1306dedb45SMauro Carvalho Chehab
1406dedb45SMauro Carvalho ChehabVariables can be created, deleted and modified with the efivarfs
1506dedb45SMauro Carvalho Chehabfilesystem.
1606dedb45SMauro Carvalho Chehab
1706dedb45SMauro Carvalho Chehabefivarfs is typically mounted like this::
1806dedb45SMauro Carvalho Chehab
1906dedb45SMauro Carvalho Chehab	mount -t efivarfs none /sys/firmware/efi/efivars
2006dedb45SMauro Carvalho Chehab
2106dedb45SMauro Carvalho ChehabDue to the presence of numerous firmware bugs where removing non-standard
2206dedb45SMauro Carvalho ChehabUEFI variables causes the system firmware to fail to POST, efivarfs
2306dedb45SMauro Carvalho Chehabfiles that are not well-known standardized variables are created
2406dedb45SMauro Carvalho Chehabas immutable files.  This doesn't prevent removal - "chattr -i" will work -
2506dedb45SMauro Carvalho Chehabbut it does prevent this kind of failure from being accomplished
2606dedb45SMauro Carvalho Chehabaccidentally.
272dcc51b3SFlavio Suligoi
282dcc51b3SFlavio Suligoi.. warning ::
292dcc51b3SFlavio Suligoi      When a content of an UEFI variable in /sys/firmware/efi/efivars is
302dcc51b3SFlavio Suligoi      displayed, for example using "hexdump", pay attention that the first
312dcc51b3SFlavio Suligoi      4 bytes of the output represent the UEFI variable attributes,
322dcc51b3SFlavio Suligoi      in little-endian format.
332dcc51b3SFlavio Suligoi
342dcc51b3SFlavio Suligoi      Practically the output of each efivar is composed of:
352dcc51b3SFlavio Suligoi
362dcc51b3SFlavio Suligoi          +-----------------------------------+
372dcc51b3SFlavio Suligoi          |4_bytes_of_attributes + efivar_data|
382dcc51b3SFlavio Suligoi          +-----------------------------------+
392dcc51b3SFlavio Suligoi
402dcc51b3SFlavio Suligoi*See also:*
412dcc51b3SFlavio Suligoi
422dcc51b3SFlavio Suligoi- Documentation/admin-guide/acpi/ssdt-overlays.rst
43*5b625181STim Schumacher- Documentation/ABI/removed/sysfs-firmware-efi-vars
44