Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
B3 Umstellung auf SecureBoot
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Deutsche Dokumentation
View previous topic :: View next topic  
Author Message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4159
Location: Bavaria

PostPosted: Tue May 12, 2020 10:22 am    Post subject: B3 Umstellung auf SecureBoot Reply with quote

Edit 2020-08-19:
@charles17 told me he linked this post from https://wiki.gentoo.org/wiki/EFI_stub_kernel#Optional:_Secure_boot
Therefore I translated it in english (with google translator because of my poor school english) and you will find the translated text in the next post of this thread.



(Dieser Post ist Teil einer Installation-Anleitung. Falls nicht schon geschehen lies bitte: Installation Guide for Paranoid Dummies)


B.3 Umstellung auf SecureBoot

Voraussetzung ist ein Stub-Kernel ! Diesen musst Du vorher nach der Anleitung in B.2 gemacht haben.

Achtung: Diese Anleitung ist nicht geeignet, wenn Du Dual-Boot mit Windows willst !
Edit 2021-08-29: Dual-Boot mit Windows ist möglich, wenn die vorhandenen Schlüssel mit Deinen eigenen vereint werden . Ich habe das nicht selbst getestet, es soll jedoch funktionieren. Hier ist die Beschreibung von @dasPaul: https://forums.gentoo.org/viewtopic-p-8652037.html#8652037


Folgende Links haben mir geholfen (habe ich numeriert, weil ich später darauf zu sprechen komme):
[1] http://www.rodsbooks.com/efi-bootloaders/controlling-sb.html
[2] https://wiki.gentoo.org/wiki/User:Sakaki/Sakaki%27s_EFI_Install_Guide/Configuring_Secure_Boot_under_OpenRC
(Allerdings benutzt Salaki da ein selbstgeschriebenes build-script für den Kernel, welches ich nicht brauchen kann. Dafür fehlten dann die nötigen Befehle. Hier hat [1] weitergeholfen.)

1. Den Kernel signieren

Dies war dank [1] sehr einfach, weil ich dort sein Skript rauskopiert habe und mir alle Schlüssel automatisiert erstellen habe lassen. Einzig die Gültigkeitsdauer der Schlüssel habe ich von 3650 Tagen (das sind ca. 10 Jahre) auf 9999 Tagen (das sind ca. 27 Jahre) geändert. Alles was jetzt kommt musst Du als root machen. Als erstes brauchst Du noch die "efitools", danach kannst Du von hier oder von [1] kopieren.
Code:
# emerge -pvD efitools
# mkdir -p -m 0600 /etc/MY/efikeys
# cd /etc/MY/efikeys
# nano mkkeys.sh
===>
#!/bin/bash
# Copyright (c) 2015 by Roderick W. Smith
# Licensed under the terms of the GPL v3

echo -n "Enter a Common Name to embed in the keys: "
read NAME

openssl req -new -x509 -newkey rsa:2048 -subj "/CN=$NAME PK/" -keyout PK.key \
        -out PK.crt -days 9999 -nodes -sha256
openssl req -new -x509 -newkey rsa:2048 -subj "/CN=$NAME KEK/" -keyout KEK.key \
        -out KEK.crt -days 9999 -nodes -sha256
openssl req -new -x509 -newkey rsa:2048 -subj "/CN=$NAME DB/" -keyout DB.key \
        -out DB.crt -days 9999 -nodes -sha256
openssl x509 -in PK.crt -out PK.cer -outform DER
openssl x509 -in KEK.crt -out KEK.cer -outform DER
openssl x509 -in DB.crt -out DB.cer -outform DER

GUID=`python -c 'import uuid; print(str(uuid.uuid1()))'`
echo $GUID > myGUID.txt

cert-to-efi-sig-list -g $GUID PK.crt PK.esl
cert-to-efi-sig-list -g $GUID KEK.crt KEK.esl
cert-to-efi-sig-list -g $GUID DB.crt DB.esl
rm -f noPK.esl
touch noPK.esl

sign-efi-sig-list -t "$(date --date='1 second' +'%Y-%m-%d %H:%M:%S')" \
                  -k PK.key -c PK.crt PK PK.esl PK.auth
sign-efi-sig-list -t "$(date --date='1 second' +'%Y-%m-%d %H:%M:%S')" \
                  -k PK.key -c PK.crt PK noPK.esl noPK.auth
sign-efi-sig-list -t "$(date --date='1 second' +'%Y-%m-%d %H:%M:%S')" \
                  -k PK.key -c PK.crt KEK KEK.esl KEK.auth
sign-efi-sig-list -t "$(date --date='1 second' +'%Y-%m-%d %H:%M:%S')" \
                  -k KEK.key -c KEK.crt db DB.esl DB.auth

chmod 0600 *.key

echo ""
echo ""
echo "For use with KeyTool, copy the *.auth and *.esl files to a FAT USB"
echo "flash drive or to your EFI System Partition (ESP)."
echo "For use with most UEFIs' built-in key managers, copy the *.cer files."
echo ""

und danach natürlich noch ausführbar gemacht und ausgeführt:
Code:
# chmod +x mkkeys.sh
# ./mkkeys.sh

Ich habe bei mir als Common Name "MY SECURE BOOT KEYS" eingegeben. Aber jeder andere Unsinn geht genauso (sollte vielleicht nicht zu lang werden - who knows). Jetzt den vorhandenen Stub-Kernel von /boot/EFI/Boot/ mit diesem Befehl signieren und zurück nach /boot/EFI/Boot kopieren (also den unsignierten damit überschreiben):
Code:
# mount /boot
# sbsign --key DB.key --cert DB.crt --output bzImage.efi /boot/EFI/Boot/bzImage.efi
# cp bzImage.efi /boot/EFI/Boot/.


2. Die alten Keys sichern
Hier hat mir [2] geholfen. Ich habe von dort kopiert. Du kannst von hier kopieren:
Code:
# cd ..
# mkdir oldefikeys
# cd oldefikeys
# efi-readvar -v PK -o old_PK.esl
# efi-readvar -v KEK -o old_KEK.esl
# efi-readvar -v db -o old_db.esl
# efi-readvar -v dbx -o old_dbx.esl


3. Das BIOS überreden SecureBoot zu machen
Erstmal die neuen Schlüssel in das EFI-Verzeichnis der ESP-Partition kopieren. Ich mache das, damit diese jetzt gleich über den UEFI-BIOS Menupunkt "Lade Schlüssel von Festplatte" übernommen werden können. In anderen Anleitungen wird dies über den Befehl "efi-updatevar" gemacht. Dies funktioniert aber nicht bei allen Mainboards; manche übernehmen die neuen Schlüssel nicht OHNE Dir einen Fehler zu melden. Deswegen ist die manuelle Übernahme im BIOS die sicherste Methode (sollte bei allen mainboards funktionieren).
Code:
# cd /etc/MY/efikeys
# cp -v *.{auth,cer,crt,esl} /boot/EFI/.
'DB.auth' -> '/boot/EFI/./DB.auth'
'KEK.auth' -> '/boot/EFI/./KEK.auth'
'noPK.auth' -> '/boot/EFI/./noPK.auth'
'PK.auth' -> '/boot/EFI/./PK.auth'
'DB.cer' -> '/boot/EFI/./DB.cer'
'KEK.cer' -> '/boot/EFI/./KEK.cer'
'PK.cer' -> '/boot/EFI/./PK.cer'
'DB.crt' -> '/boot/EFI/./DB.crt'
'KEK.crt' -> '/boot/EFI/./KEK.crt'
'PK.crt' -> '/boot/EFI/./PK.crt'
'DB.esl' -> '/boot/EFI/./DB.esl'
'KEK.esl' -> '/boot/EFI/./KEK.esl'
'noPK.esl' -> '/boot/EFI/./noPK.esl'
'PK.esl' -> '/boot/EFI/./PK.esl'

Mache jetzt einen Reboot und gehe gleich in Dein BIOS. Bei mir geht das mit "ENTF" oder "F12". Jetzt kommt wirklich die große BIOS-Suche. Wo und wie lösche ich die alten Keys und aktiviere die neuen. Bei meinem Gigabyte hatte ich erstmal nirgends eine Auswahl für Secure-Boot. Diese Auswahl erschien erst, als ich "CSM Support" auf "disable" stellte. Danach erschien darunter ein neuer Menu-Punkt "Secure Boot". Dort habe ich die alten Keys gelöscht und die neuen Schlüssel von "/EFI/" geladen. Die Reihenfolge ist "PK", "KEK" und dann "db". "dbx" habe ich ausgelassen, da ich ja keine Zertifikate habe, die ich zurückrufen will. Lies Dir vorher unbedingt mal [1] und [2] durch (wenigstens überfliegen). Danach alles im BIOS sichern und verlassen. Der Augenblick der Wahrheit ...

4. Überprüfen und Aufräumen
Mein Startbildschirm (BIOS Boot-Logo) zeigte mir erstmalig unter dem Logo eine zusätzliche Zeile an:
"EFI Stub: UEFI Secure Boot is enabled"

Sofort in die /var/log/messages reingeschaut und siehe da:
Code:
Mar 14 00:57:07 big kernel: [    0.003681] Secure boot enabled

Eine andere Abfrage zeigt auch die 1 für Secure Boot an:
Code:
# od --address-radix=n --format=u1 /sys/firmware/efi/efivars/SecureBoot-8be4df61-93ca-11d2-aa0d-00e098032b8c
   6   0   0   0   1

Und zuletzt noch
Code:
# efi-readvar
Variable PK, length 851
PK: List 0, type X509
    Signature 0, size 823, owner 79a99678-6581-11ea-b4d3-1c1b0d93463e
        Subject:
            CN=MY SECURE BOOT KEYS PK
        Issuer:
            CN=MY SECURE BOOT KEYS PK
Variable KEK, length 853
KEK: List 0, type X509
    Signature 0, size 825, owner 79a99678-6581-11ea-b4d3-1c1b0d93463e
        Subject:
            CN=MY SECURE BOOT KEYS KEK
        Issuer:
            CN=MY SECURE BOOT KEYS KEK
Variable db, length 851
db: List 0, type X509
    Signature 0, size 823, owner 79a99678-6581-11ea-b4d3-1c1b0d93463e
        Subject:
            CN=MY SECURE BOOT KEYS DB
        Issuer:
            CN=MY SECURE BOOT KEYS DB
Variable dbx has no entries
Variable MokList has no entries

Also jetzt alles noch SICHERN und Aufräumen: Alle Schlüssel die in /etc liegen auf einen Stick kopieren und in den Tresor damit. Löschen solltest Du sie aber nicht um später den nächsten neuen Kernel signieren zu können. Dafür lösche die in /boot/EFI/.
Code:
# mount /boot/
# cd /boot/EFI/
# lal
insgesamt 68
drwxr-xr-x 4 root root 4096 14. Mär 00:39 .
drwxr-xr-x 4 root root 4096  1. Jan 1970  ..
drwxr-xr-x 2 root root 4096 13. Mär 20:58 Boot
-rwxr-xr-x 1 root root 2102 14. Mär 00:39 DB.auth
-rwxr-xr-x 1 root root  807 14. Mär 00:39 DB.cer
-rwxr-xr-x 1 root root 1147 14. Mär 00:39 DB.crt
-rwxr-xr-x 1 root root  851 14. Mär 00:39 DB.esl
drwxr-xr-x 2 root root 4096 11. Feb 2017  gentoo
-rwxr-xr-x 1 root root 2101 14. Mär 00:39 KEK.auth
-rwxr-xr-x 1 root root  809 14. Mär 00:39 KEK.cer
-rwxr-xr-x 1 root root 1151 14. Mär 00:39 KEK.crt
-rwxr-xr-x 1 root root  853 14. Mär 00:39 KEK.esl
-rwxr-xr-x 1 root root 1248 14. Mär 00:39 noPK.auth
-rwxr-xr-x 1 root root    0 14. Mär 00:39 noPK.esl
-rwxr-xr-x 1 root root 2099 14. Mär 00:39 PK.auth
-rwxr-xr-x 1 root root  807 14. Mär 00:39 PK.cer
-rwxr-xr-x 1 root root 1147 14. Mär 00:39 PK.crt
-rwxr-xr-x 1 root root  851 14. Mär 00:39 PK.esl
EFI # rm *
rm: das Entfernen von 'Boot' ist nicht möglich: Ist ein Verzeichnis
rm: das Entfernen von 'gentoo' ist nicht möglich: Ist ein Verzeichnis


Zuletzt habe ich noch mein Cheat Sheet angepasst (endgültige Version). Der sbsign übernimmt dabei auch gleichzeitig das kopieren nach /boot/EFI/Boot:
Code:
Neue Kernel-Version:
--------------------
# emerge -1uvDp gentoo-sources
# mount /boot
# cd /usr/src/linux-X.Y.Z-gentoo
# cp /usr/src/linux/.config .
# make oldconfig
# make -j 8
# sbsign --key /etc/MY/efikeys/DB.key --cert /etc/MY/efikeys/DB.crt --output /boot/EFI/Boot/bzImage.efi arch/x86/boot/bzImage
(# make modules_install)
# cp .config /etc/MY/config-X-Y-Z
# eselect kernel list
# eselect kernel set
# umount /boot

Änderung der Konfiguration des bestehenden Kernels:
---------------------------------------------------
# mount /boot
# cd /usr/src/linux
# make menuconfig
# make -j 8
# sbsign --key /etc/MY/efikeys/DB.key --cert /etc/MY/efikeys/DB.crt --output /boot/EFI/Boot/bzImage.efi arch/x86/boot/bzImage
(# make modules_install)
# cp .config /etc/MY/config-X-Y-Z-revA
# umount /boot

Nach erfolgreichem Boot eines neuen Kernels:
--------------------------------------------
# mount /boot
# cd /usr/src/linux
# make install
# grub-mkconfig -o /boot/grub/grub.cfg
# umount /boot


5. Natürlich schützt Dich das überhaupt nicht, wenn Du das BIOS nicht per Passwort schützt

... aber das brauche ich Dir wohl nicht mehr zu sagen. Genausowenig muss ich Dir noch sagen, dass Du natürlich SecureBoot im BIOS wieder disabeln musst, falls Du mal in die Verlegenheit kommst, einen vorherigen Kernel mit Grub starten zu müssen. Ja, man könnte auch den Grub signieren, aber dazu bin ich einfach zu faul. Ich muß ja eh ins BIOS um die Boot-Reihenfole zu ändern. Außerdem musste ich bis jetzt noch nie über Grub starten ... neuer Kernel war immer gut. :-)


Last edited by pietinger on Mon Sep 27, 2021 8:51 am; edited 7 times in total
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4159
Location: Bavaria

PostPosted: Wed Aug 19, 2020 1:07 pm    Post subject: Reply with quote

(This post is part of a german installation guide. If not already done please read: https://forums.gentoo.org/viewtopic-t-1112798.html Installation Guide for Paranoid Dummies)



B.3 Changeover to SecureBoot

A stub kernel is required! You must have done this beforehand according to the instructions in B.2.

Warning: These instructions are not suitable if you want to dual-boot with Windows!
Edit 2021-08-29: Dual boot with Windows is possible if the existing keys are combined with your own. I haven't tested this myself, but it should work. Here is @dasPaul's description: https://forums.gentoo.org/viewtopic-p-8652037.html#8652037


The following links helped me (I numbered them because I will talk about them later):
[1] http://www.rodsbooks.com/efi-bootloaders/controlling-sb.html
[2] https://wiki.gentoo.org/wiki/User:Sakaki/Sakaki%27s_EFI_Install_Guide/Configuring_Secure_Boot_under_OpenRC
(However, Salaki uses a self-written build script for the kernel, which I cannot use. The necessary commands were then missing. Here [1] helped.)

1. Sign the kernel

This was very easy thanks to [1], because I copied his script out there and had all the keys generated automatically. I only changed the period of validity of the keys from 3650 days (that's about 10 years) to 9999 days (that's about 27 years). Everything that comes next you have to do as root. First you need the "efitools", then you can copy from here or from [1].
Code:
# emerge -pvD efitools
# mkdir -p -m 0600 /etc/MY/efikeys
# cd /etc/MY/efikeys
# nano mkkeys.sh
===>
#!/bin/bash
# Copyright (c) 2015 by Roderick W. Smith
# Licensed under the terms of the GPL v3

echo -n "Enter a Common Name to embed in the keys: "
read NAME

openssl req -new -x509 -newkey rsa:2048 -subj "/CN=$NAME PK/" -keyout PK.key \
        -out PK.crt -days 9999 -nodes -sha256
openssl req -new -x509 -newkey rsa:2048 -subj "/CN=$NAME KEK/" -keyout KEK.key \
        -out KEK.crt -days 9999 -nodes -sha256
openssl req -new -x509 -newkey rsa:2048 -subj "/CN=$NAME DB/" -keyout DB.key \
        -out DB.crt -days 9999 -nodes -sha256
openssl x509 -in PK.crt -out PK.cer -outform DER
openssl x509 -in KEK.crt -out KEK.cer -outform DER
openssl x509 -in DB.crt -out DB.cer -outform DER

GUID=`python -c 'import uuid; print(str(uuid.uuid1()))'`
echo $GUID > myGUID.txt

cert-to-efi-sig-list -g $GUID PK.crt PK.esl
cert-to-efi-sig-list -g $GUID KEK.crt KEK.esl
cert-to-efi-sig-list -g $GUID DB.crt DB.esl
rm -f noPK.esl
touch noPK.esl

sign-efi-sig-list -t "$(date --date='1 second' +'%Y-%m-%d %H:%M:%S')" \
                  -k PK.key -c PK.crt PK PK.esl PK.auth
sign-efi-sig-list -t "$(date --date='1 second' +'%Y-%m-%d %H:%M:%S')" \
                  -k PK.key -c PK.crt PK noPK.esl noPK.auth
sign-efi-sig-list -t "$(date --date='1 second' +'%Y-%m-%d %H:%M:%S')" \
                  -k PK.key -c PK.crt KEK KEK.esl KEK.auth
sign-efi-sig-list -t "$(date --date='1 second' +'%Y-%m-%d %H:%M:%S')" \
                  -k KEK.key -c KEK.crt db DB.esl DB.auth

chmod 0600 *.key

echo ""
echo ""
echo "For use with KeyTool, copy the *.auth and *.esl files to a FAT USB"
echo "flash drive or to your EFI System Partition (ESP)."
echo "For use with most UEFIs' built-in key managers, copy the *.cer files."
echo ""

and then of course made executable and executed::
Code:
# chmod +x mkkeys.sh
# ./mkkeys.sh

I entered "MY SECURE BOOT KEYS" as the common name. But all other nonsense works the same way (shouldn't be too long - who knows). Now sign the existing stub kernel from /boot/EFI/Boot/ with this command and copy it back to /boot/EFI/Boot (overwriting the unsigned one):
Code:
# mount /boot
# sbsign --key DB.key --cert DB.crt --output bzImage.efi /boot/EFI/Boot/bzImage.efi
# cp bzImage.efi /boot/EFI/Boot/.


2. Save the old keys
[2] helped me here. I copied from there. You can copy from here:
Code:
# cd ..
# mkdir oldefikeys
# cd oldefikeys
# efi-readvar -v PK -o old_PK.esl
# efi-readvar -v KEK -o old_KEK.esl
# efi-readvar -v db -o old_db.esl
# efi-readvar -v dbx -o old_dbx.esl


3. Convince the BIOS to do SecureBoot
First copy the new keys into the EFI directory of the ESP partition. I do this so that they can now be taken over via the UEFI BIOS menu item "Load key from hard drive". In other instructions this is done using the "efi-updatevar" command. However, this does not work with all mainboards; some do not adopt the new key WITHOUT reporting an error to you. Therefore manual transfer in the BIOS is the safest method (should work with all mainboards).
Code:
# cd /etc/MY/efikeys
# cp -v *.{auth,cer,crt,esl} /boot/EFI/.
'DB.auth' -> '/boot/EFI/./DB.auth'
'KEK.auth' -> '/boot/EFI/./KEK.auth'
'noPK.auth' -> '/boot/EFI/./noPK.auth'
'PK.auth' -> '/boot/EFI/./PK.auth'
'DB.cer' -> '/boot/EFI/./DB.cer'
'KEK.cer' -> '/boot/EFI/./KEK.cer'
'PK.cer' -> '/boot/EFI/./PK.cer'
'DB.crt' -> '/boot/EFI/./DB.crt'
'KEK.crt' -> '/boot/EFI/./KEK.crt'
'PK.crt' -> '/boot/EFI/./PK.crt'
'DB.esl' -> '/boot/EFI/./DB.esl'
'KEK.esl' -> '/boot/EFI/./KEK.esl'
'noPK.esl' -> '/boot/EFI/./noPK.esl'
'PK.esl' -> '/boot/EFI/./PK.esl'

Now do a reboot and go straight to your BIOS. For me this works with "DEL" or "F12". Now comes the big BIOS search. Where and how do I delete the old keys and activate the new ones. With my Gigabyte I didn't have a choice for Secure Boot anywhere. This selection only appeared when I set "CSM Support" to "disable". Then a new menu item "Secure Boot" appeared underneath. There I deleted the old keys and loaded the new keys from "/EFI/". The order is "PK", "KEK" and then "db". I left out "dbx" because I don't have any certificates that I want to revoke. Be sure to read through [1] and [2] beforehand (at least skim through). Then save everything in the BIOS and exit. The moment of truth ...

4. Check and clean up

My start screen (BIOS boot logo) showed me an additional line under the logo for the first time:
"EFI Stub: UEFI Secure Boot is enabled"

Immediately looked into the / var / log / messages and lo and behold:
Code:
Mar 14 00:57:07 big kernel: [    0.003681] Secure boot enabled

Another query also shows the 1 for Secure Boot:
Code:
# od --address-radix=n --format=u1 /sys/firmware/efi/efivars/SecureBoot-8be4df61-93ca-11d2-aa0d-00e098032b8c
   6   0   0   0   1

And finally:
Code:
# efi-readvar
Variable PK, length 851
PK: List 0, type X509
    Signature 0, size 823, owner 79a99678-6581-11ea-b4d3-1c1b0d93463e
        Subject:
            CN=MY SECURE BOOT KEYS PK
        Issuer:
            CN=MY SECURE BOOT KEYS PK
Variable KEK, length 853
KEK: List 0, type X509
    Signature 0, size 825, owner 79a99678-6581-11ea-b4d3-1c1b0d93463e
        Subject:
            CN=MY SECURE BOOT KEYS KEK
        Issuer:
            CN=MY SECURE BOOT KEYS KEK
Variable db, length 851
db: List 0, type X509
    Signature 0, size 823, owner 79a99678-6581-11ea-b4d3-1c1b0d93463e
        Subject:
            CN=MY SECURE BOOT KEYS DB
        Issuer:
            CN=MY SECURE BOOT KEYS DB
Variable dbx has no entries
Variable MokList has no entries

So now SAVE everything and tidy up: Copy all keys that are in /etc onto a stick and put them in the safe. But you shouldn't delete them in order to be able to sign the next new kernel later. Then delete in /boot/EFI/:
Code:
# mount /boot/
# cd /boot/EFI/
# lal
insgesamt 68
drwxr-xr-x 4 root root 4096 14. Mär 00:39 .
drwxr-xr-x 4 root root 4096  1. Jan 1970  ..
drwxr-xr-x 2 root root 4096 13. Mär 20:58 Boot
-rwxr-xr-x 1 root root 2102 14. Mär 00:39 DB.auth
-rwxr-xr-x 1 root root  807 14. Mär 00:39 DB.cer
-rwxr-xr-x 1 root root 1147 14. Mär 00:39 DB.crt
-rwxr-xr-x 1 root root  851 14. Mär 00:39 DB.esl
drwxr-xr-x 2 root root 4096 11. Feb 2017  gentoo
-rwxr-xr-x 1 root root 2101 14. Mär 00:39 KEK.auth
-rwxr-xr-x 1 root root  809 14. Mär 00:39 KEK.cer
-rwxr-xr-x 1 root root 1151 14. Mär 00:39 KEK.crt
-rwxr-xr-x 1 root root  853 14. Mär 00:39 KEK.esl
-rwxr-xr-x 1 root root 1248 14. Mär 00:39 noPK.auth
-rwxr-xr-x 1 root root    0 14. Mär 00:39 noPK.esl
-rwxr-xr-x 1 root root 2099 14. Mär 00:39 PK.auth
-rwxr-xr-x 1 root root  807 14. Mär 00:39 PK.cer
-rwxr-xr-x 1 root root 1147 14. Mär 00:39 PK.crt
-rwxr-xr-x 1 root root  851 14. Mär 00:39 PK.esl
EFI # rm *
rm: das Entfernen von 'Boot' ist nicht möglich: Ist ein Verzeichnis
rm: das Entfernen von 'gentoo' ist nicht möglich: Ist ein Verzeichnis


Finally I adjusted my cheat sheet (final version). The sbsign also takes care of copying to /boot/EFI/Boot:
Code:
New Kernel-Version:
--------------------
# emerge -1uvDp gentoo-sources
# mount /boot
# cd /usr/src/linux-X.Y.Z-gentoo
# cp /usr/src/linux/.config .
# make oldconfig
# make -j 8
# sbsign --key /etc/MY/efikeys/DB.key --cert /etc/MY/efikeys/DB.crt --output /boot/EFI/Boot/bzImage.efi arch/x86/boot/bzImage
(# make modules_install)
# cp .config /etc/MY/config-X-Y-Z
# eselect kernel list
# eselect kernel set
# umount /boot

Changing the configuration of the existing kernel:
---------------------------------------------------
# mount /boot
# cd /usr/src/linux
# make menuconfig
# make -j 8
# sbsign --key /etc/MY/efikeys/DB.key --cert /etc/MY/efikeys/DB.crt --output /boot/EFI/Boot/bzImage.efi arch/x86/boot/bzImage
(# make modules_install)
# cp .config /etc/MY/config-X-Y-Z-revA
# umount /boot

After successfully booting a new kernel:
--------------------------------------------
# mount /boot
# cd /usr/src/linux
# make install
# grub-mkconfig -o /boot/grub/grub.cfg
# umount /boot


5. Of course that doesn't protect you at all if you don't protect the BIOS with a password

... but I don't need to tell you anymore. Nor do I have to tell you that of course you have to disable SecureBoot in the BIOS again if you ever get embarrassed about having to start a previous kernel with Grub. Yes, you could also sign the grub, but I'm just too lazy for that. I have to go into the BIOS anyway to change the boot order. Also, I've never had to start from Grub before ... the new kernel was always good. :-)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Deutsche Dokumentation All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum