]> git.proxmox.com Git - efi-boot-shim.git/blame - testplan.txt
Fix format strings for 32-bit builds
[efi-boot-shim.git] / testplan.txt
CommitLineData
ac356a0e
PJ
1How to test a new shim build for RHEL/fedora:
2
31) build pesign-test-app, and sign it with the appropriate key
42) build shim with the appropriate key built in
53) install pesign-test-app and shim-unsigned on the test machine
64) make a lockdown.efi for "Red Hat Test Certificate" and put it in \EFI\test
7 mkdir /boot/efi/EFI/test/
8 wget http://pjones.fedorapeople.org/shim/LockDown-rhtest.efi
9 mv LockDown-rhtest.efi /boot/efi/EFI/test/lockdown.efi
105) sign shim with RHTC and put it in \EFI\test:
11 pesign -i /usr/share/shim/shim.efi -o /boot/efi/EFI/test/shim.efi \
12 -s -c "Red Hat Test Certificate"
136) put pesign-test-app-signed.efi in \EFI\test as grubx64.efi
14 cp /usr/share/pesign-test-app-0.4/pesign-test-app-signed.efi \
aa818fe6 15 /boot/efi/EFI/test/grubx64.efi
a0bb7822
PJ
167) sign a copy of grubx64.efi with RHTC and iput it in \EFI\test\ . Also
17 leave an unsigned copy there:
18 pesign -i /boot/efi/EFI/redhat/grubx64.efi \
19 -o /boot/efi/EFI/test/grubx64-unsigned.efi \
20 -r -u 0
21 pesign -i /boot/efi/EFI/test/grubx64-unsigned.efi \
22 -o /boot/efi/EFI/test/grub.efi \
23 -s -c "Red Hat Test Certificate"
ac356a0e
PJ
248) sign a copy of mokmanager with RHTC and put it in \EFI\test:
25 pesign -i /usr/share/shim/MokManager.efi \
a0bb7822 26 -o /boot/efi/EFI/test/MokManager.efi -s \
ac356a0e
PJ
27 -c "Red Hat Test Certificate"
289) copy grub.cfg to our test directory:
29 cp /boot/efi/EFI/redhat/grub.cfg /boot/efi/EFI/test/grub.cfg
a6c726fc 3010) *move* \EFI\redhat\BOOT.CSV to \EFI\test
ac356a0e
PJ
31 rm -rf /boot/efi/EFI/BOOT/
32 mkdir /boot/efi/EFI/BOOT/
a0bb7822
PJ
33 mv /boot/efi/EFI/redhat/BOOT.CSV /boot/efi/EFI/test/BOOT.CSV
3411) sign a copy of fallback.efi and put it in \EFI\BOOT\fallback.efi
ac356a0e
PJ
35 pesign -i /usr/share/shim/fallback.efi \
36 -o /boot/efi/EFI/BOOT/fallback.efi \
37 -s -c "Red Hat Test Certificate"
3812) put shim.efi there as well
39 cp /boot/efi/EFI/test/shim.efi /boot/efi/EFI/BOOT/BOOTX64.EFI
4013) enroll the current kernel's certificate with mokutil:
aa818fe6
PJ
41 # this should be a /different/ cert than the one signing pesign-test-app.
42 # for instance use a RHEL cert for p-t-a and a fedora cert+kernel here.
43 mokutil --import ~/fedora-ca.cer
ac356a0e
PJ
4414) put machine in setup mode
4515) boot to the UEFI shell
4616) run lockdown.efi from #4:
47 fs0:\EFI\test\lockdown.efi
4817) enable secure boot verification
4918) verify it can't run other binaries:
a2e66ece 50 fs0:\EFI\test\grubx64.efi
ac356a0e
PJ
51 result should be an error, probably similar to:
52 "fs0:\...\grubx64.efi is not recognized as an internal or external command"
a2e66ece
PJ
5319) in the EFI shell, run fs0:\EFI\test\shim.efi
5420) you should see MokManager. Enroll the certificate you added in #13, and
ac356a0e 55 the system will reboot.
a2e66ece 5621) reboot to the UEFI shell and run fs0:\EFI\test\shim.efi
ac356a0e
PJ
57 result: "This is a test application that should be completely safe."
58 If you get the expected result, shim can run things signed by its internal
59 key ring. Check a box someplace that says it can do that.
a2e66ece 6022) from the EFI shell, copy grub to grubx64.efi:
a0bb7822 61 cp \EFI\test\grub.efi \EFI\test\grubx64.efi
a2e66ece 6223) in the EFI shell, run fs0:\EFI\test\shim.efi
ac356a0e
PJ
63 result: this should start grub, which will let you boot a kernel
64 If grub starts, it means shim can run things signed by a key in the system's
65 db. Check a box someplace that says it can do that.
66 If the kernel boots, it means shim can run things from Mok. Check a box
67 someplace that says it can do that.
a2e66ece 6824) remove all boot entries and the BootOrder variable:
ac356a0e
PJ
69 [root@uefi ~]# cd /sys/firmware/efi/efivars/
70 [root@uefi efivars]# rm -vf Boot[0123456789]* BootOrder-*
71 removed ‘Boot0000-8be4df61-93ca-11d2-aa0d-00e098032b8c’
72 removed ‘Boot0001-8be4df61-93ca-11d2-aa0d-00e098032b8c’
73 removed ‘Boot0002-8be4df61-93ca-11d2-aa0d-00e098032b8c’
74 removed ‘Boot2001-8be4df61-93ca-11d2-aa0d-00e098032b8c’
75 removed ‘BootOrder-8be4df61-93ca-11d2-aa0d-00e098032b8c’
a6c726fc 76 [root@uefi efivars]#
a2e66ece
PJ
7725) reboot
7826) the system should run \EFI\BOOT\BOOTX64.EFI . If it doesn't, you may just
ac356a0e
PJ
79 have an old machine. In that case, go to the EFI shell and run:
80 fs0:\EFI\BOOT\BOOTX64.EFI
81 If this works, you should see a bit of output very quickly and then the same
82 thing as #24. This means shim recognized it was in \EFI\BOOT and ran
83 fallback.efi, which worked.
a2e66ece 8427) copy the unsigned grub into place and reboot:
a0bb7822 85 cp /boot/efi/EFI/test/grubx64-unsigned.efi /boot/efi/EFI/test/grubx64.efi
a2e66ece 8628) reboot again.
a0bb7822 87 result: shim should refuse to load grub.