# efivar ツールを使用して UEFI 環境変数を管理する

efivarツールは不揮発性のファームウェアストレージに保存されたUEFI環境変数を管理します。これらの変数を使用してUEFIファームウェアとその環境を構成します。

efivarはUEFIファームウェアに格納されているキーと値のペアです。ブート構成、システム状態、その他の重要なパラメーターに関する設定を保持します。efivarはブートエントリーとファームウェア設定を管理し、システムの正常な起動と構成の維持を実現します。

UEFI環境変数を操作するには、以下のコマンドを使用します。

efivar [-n name] [-f file] [-p] [-w]
    Copy to clipboard

コマンドのオプション：

-n name: Specify the name of the UEFI variable.
    -f file: Load or save variable contents from a file.
    -p: Print the value of the specified UEFI variable.
    -w: Write to the specified UEFI variable.
    Copy to clipboard

## OsIndications 変数の更新

OsIndications 変数を更新し、EFI 変数の値を検証するには、以下の手順に従います。

1. `04 00 00 00 00 00 00 00` という特定のバイト列を含む `data.hex` ファイルを作成します。

echo -e -n "\x4\x0\x0\x0\x0\x0\x0\x0" > data.hex
        Copy to clipboard
2. `data.hex` の内容を `8be4df61-93ca-11d2-aa0d-00e098032b8c-OsIndications` というEFI変数に書き込みます。

efivar -n 8be4df61-93ca-11d2-aa0d-00e098032b8c-OsIndications -f data.hex -w
        Copy to clipboard
3. `8be4df61-93ca-11d2-aa0d-00e098032b8c-OsIndications` というEFI変数の値を検証するには、以下のコマンドを実行します。

efivar -n 8be4df61-93ca-11d2-aa0d-00e098032b8c-OsIndications -p
        Copy to clipboard

    上記のコマンドの出力：

GUID: 8be4df61-93ca-11d2-aa0d-00e098032b8c
        Name: "OsIndications"
        Attributes:
              Non-Volatile
              Boot Service Access
              Runtime Service Access
        Value:
        00000000  04 00 00 00 00 00 00 00
        Copy to clipboard

詳細については、[efivarのマニュアル](https://man.freebsd.org/cgi/man.cgi?query=efivar&amp;sektion=8) を参照してください。

Last Published: Dec 23, 2025

[Previous Topic
SDカードからLinuxオペレーティングシステムを起動する](https://docs.qualcomm.com/bundle/publicresource/80-70020-27JA/topics/boot_linux_operating_system_from_sdcard.md) [Next Topic
ユーザーによるカスタマイズ](https://docs.qualcomm.com/bundle/publicresource/80-70020-27JA/topics/user_customizations.md)