This repository contains the instructions on how to generate and install the Platform Key (PK), Key Exchange Key (KEK) and Signature Database (DB) to enable the Secure Boot functionality in Steam Deck.
By default, the Steam Deck does not contain the keys needed for SecureBoot. It is missing the PK, KEK and DB keys. Without these keys, the SecureBoot functionality cannot be enabled.
I've also posted this on the Valve Steam Deck Community Forum under Feature Requests. View the discussion here.
If you like my work please show support by subscribing to my YouTube channel @10MinuteSteamDeckGamer.
I'm just passionate about Linux, Windows, how stuff works, and playing retro and modern video games on my Steam Deck!
Monetary donations are also encouraged if you find this project helpful. Your donation inspires me to continue research on the Steam Deck! Clover script, 70Hz mod, SteamOS microSD, Secure Boot, etc.
Scan the QR code or click the image below to visit my donation page.
- Do this at your own risk!
- If you lose the keys then you can't revert back to disable Secure Boot. Save the keys / USB flash drive in a safe place!
- USB flash drive. This will contain the installer / Linux ISO.
- Another USB flash drive. This will be the target where Linux will be installed.
- USB C dock / hub, mouse and keyboard.
- sbctl to generate and install the needed keys.
- some basic knowledge on how to install a Linux distro (Fedora / Ubuntu etc etc).
- Download your favorite Linux distro and save it to your desktop / laptop. (I used Fedora on my environment)
- Use ventoy or rufus to burn the ISO to a USB flash drive. (I already have a microsd that is formatted for ventoy, so I just copy / paste the Fedora Linux ISO)
- Connect everything to the USB C hub / dock - Steam Deck, keyboard, mouse, flash drive that contains the Linux ISO, flash drive that will be the target for the Linux install
- While the Steam Deck is powered off, press VOLDOWN and POWER button at the same time to access the boot device menu.
- Use the DPAD / keyboard to select the flash drive that contains the Linux ISO and press ENTER.
- Wait for the Linux ISO to load and then install Linux to the target flash drive.
- Shutdown the Steam Deck once Linux is installed to the other flash drive.
- Disconnect the flash drive that contains the Linux ISO as we dont need this anymore.
- While the Steam Deck is powered off, press VOLDOWN and POWER button at the same time to access the boot device menu.
- Use the DPAD / keyboard to select the flash drive where Linux is installed and press ENTER.
Instructions - compiling sbctl (this instructions are for Fedora, it will be similar for other Linux distro)
-
Open terminal.
-
Install needed dependencies for sbctl.
-
Clone the sbctl repository.
git clone https://github.com/Foxboron/sbctl.git
-
Compile and install the sbctl package. This will take a few minutes.
cd sbctl
sudo make install
-
Open terminal.
-
Check the sbctl status. (Mine will show a little bit different as I have already installed sbctl and have generated keys)
sbctl status
What does this mean?
Installed - this will show installed if sbctl has already generated keys in /usr/share/secureboot
Owner GUID - random GUID for key signing and setting up the owner of the keys
Setup Mode - default is Enabled. Enabled means Secure Boot is not active and it is waiting for keys to be installed.
Secure Boot - default is Disabled. Disabled means there are no keys active and Secure Boot is set to disabled state.
-
Generate the PK, KEK and db keys.
sbctl create-keys
-
Enroll the generated keys.
sudo chattr -i /sys/firmware/efi/efivars/{PK,KEK,db}*
sudo sbctl enroll-keys -m (This adds the Microsoft Production PCA cert in the db, and the Microsoft UEFI CA cert in the db. It does not add the MS KEK CA cert)
-
Check again the sbctl status. This will now show that Setup Mode is disabled because the keys are already present.
sbctl status
What does this mean?
Installed - this will show installed if sbctl has already generated keys in /usr/share/secureboot
Owner GUID - random GUID for key signing and setting up the owner of the keys
Setup Mode - this now shows DISABLED. It means that the keys needed for Secure Boot has been installed and active.
Secure Boot - this will still show DISABLED. Reboot for the changes to take effect.
Vendor keys - this now shows we are using microsoft keys in the signature database (db).
-
Open terminal.
-
Query the PK, KEK and db to make sure it is installed and available.
mokutil --pk
mokutil --kek
mokutil --db
-
If everything looks good then the next step is to sign the EFI loader and kernel or else you won't be able to boot any OS!
THIS STEP IS VERY IMPORTANT!!! If you don't sign your EFI loader and kernel then you won't be able to boot to Windows or Linux!!!
-
Open terminal.
-
Query sbctl the status of EFI entries. This will show not signed. (but for me I've already signed several EFI entries)
sudo sbctl verify
What does this mean?
BOOTIA32.EFI this is for Windows (32bit? I signed it anyway just to be sure)
BOOTX64.EFI this is for Windows
vmlinuz-5.14.10-300.fc35.x86_64 this is the Linux kernel I am using
-
Sign the EFI and kernel using sbctl.
sudo sbctl sign -s /boot/efi/EFI/BOOT/BOOTX64.EFI (This is optional since the Microsoft Production PCA and Microsoft UEFI CA is already added in the db)
sudo sbctl sign -s /boot/efi/EFI/BOOT/BOOTIA32.EFI (This is optional since the Microsoft Production PCA and Microsoft UEFI CA is already added in the db)
sudo sbctl sign -s /boot//vmlinuz-5.14.10-300.fc35.x86_64 (This is optional since the Microsoft Production PCA and Microsoft UEFI CA is already added in the db)
-
If no error, reboot to Windows and SecureBoot status will now show Enabled!
-
Open terminal.
-
Install efitools.
sudo dnf install efitools
-
Delete the PK, KEK and db.
sudo chattr -i /sys/firmware/efi/efivars/{PK,KEK,db}*
sudo efi-updatevar -d 0 -k /usr/share/secureboot/keys/PK/PK.key PK
sudo efi-updatevar -d 0 -k /usr/share/secureboot/keys/KEK/KEK.key KEK
sudo efi-updatevar -d 0 -k /usr/share/secureboot/keys/db/db.key db (you might need to do this twice to clear the microsoft vendor keys)
-
Check the sbctl status. This is now back to the default settings.
sbctl status
-
Use mokutil to query the PK, KEK and DB make sure they don't exist.
-
Reboot and Secure Boot will be disabled and back to factory defaults - no PK, KEK and db keys.
When Secure Boot is enabled it needs that EFI entries are signed. What this means is that unless you sign SteamOS / SteamOS recovery image or refind (if you dual boot) then those items won't boot. Same for Batocera and other Linux distros. Follow the instructions on how to sign the EFI entries.
GPU firmware is signed using MS certificate. Even after using the public MS KEK and db keys I am still getting a key mismatch in Device Manager and the AMD APU drivers won't activate. Workaround is to disable driver signing. On Linux this is not an issue. I've signed the Batocera EFI loader and kernel, and the GPU works in there (tested by playing a PS2 game)
In Windows 11 the Vanguard anti-cheat still complains about Secure Boot, even if it is active and enabled. Most probably Vanguard does thorough checking of the keys installed and complains when self generated keys etc etc are in use?!?