Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
C1 Rescue Boot von USB-Stick (evtl. IMA Measure)
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: 4000
Location: Bavaria

PostPosted: Sat Oct 31, 2020 2:38 pm    Post subject: C1 Rescue Boot von USB-Stick (evtl. IMA Measure) Reply with quote

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


Diese Anleitung benötigt einen Stub-Kernel wie in B.2 beschrieben !


C.1 Rescue Boot von USB-Stick (evtl. IMA Measure)


Wir könnten für C.3 und C.4 einen bootfähigen USB-Stick benötigen - außerdem ist ein Rescue Boot-Stick nie verkehrt ;-)

Diesen erstellen wir jetzt vorab und prüfen auch gleich, ob dieser auch wirklich bootet. Wenn wir den exakt gleichen Kernel (den wir bereits haben) auf diesen Stick kopieren, können wir evtl. gar nicht überprüfen, ob auch wirklich von diesem gebootet wurde. Mir ist das passiert ! Ich habe mich nämlich beim File-Namen "bootx64.efi" vertippt und versehentlich einen "bootx46.efi" rüberkopiert. Das Ergebnis war: UEFI versuchte vom Stick zu booten, hat nichts gefunden und bootete meinen Kernel von der SSD (weil dieser in der Boot-Reihenfolge halt dann an zweiter Stelle war). Das ging so schnell, dass ich es nicht einmal gemerkt habe. (Absolut unwichtige Details findest Du in: https://forums.gentoo.org/viewtopic-t-1122182-highlight-.html).

Wir werden also testen, ob wir wirklich von diesem gebootet haben. Dazu werden wir den jetzigen Kernel minimal ändern indem wir in der bestehenden Kernel Command Line den Parameter "loglevel=8" hinzufügen:
Code:
Processor type and features  --->
 [*] Built-in kernel command line
 (root=PARTUUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx ro loglevel=8) Built-in kernel command string

Bevor wir unseren Kernel auf den Stick kopieren können, müssen wir diesen vorbereiten:
Code:
- connect your USB stick
# lsblk
! check if /dev/sdb is really your stick; (probably it is /dev/sdc or /sdd if you have more than one hd or ssd; then use this instead of sdb1 in the next command)
# parted -a optimal /dev/sdb
> mklabel gpt
> unit mib
> mkpart primary 1 128
> name 1 usbboot
! setting "boot on" is important to get the ESP flag for this partition, so UEFI can find the kernel in it
> set 1 boot on
> q
# mkfs.fat -F 32 /dev/sdb1

(Natürlich kannst Du den übrigen Speicher des Sticks partitionieren und verwenden wie Du willst.)

Jetzt der zweite Teil:
Code:
# mkdir -p /mnt/stick
! again: check if sdb1 is correct for you
# mount -t vfat /dev/sdb1 /mnt/stick
# mkdir -p /mnt/stick/EFI/BOOT
# cd /usr/src/linux
# make menuconfig
! add parameter "loglevel=8" as described above
# make
! If you have done B.3 SecureBoot use this to copy your kernel
# sbsign --key /etc/MY/efikeys/DB.key --cert /etc/MY/efikeys/DB.crt --output /mnt/stick/EFI/BOOT/bootx64.efi arch/x86/boot/bzImage
(! OR - without SecureBoot - use this to copy)
(# cp arch/x86/boot/bzImage /mnt/stick/EFI/BOOT/bootx64.efi)
# umount /mnt/stick

Um von diesem Stick zu booten, musst Du natürlich noch beim Systemstart Deine Lieblings-Tastenkombination drücken um im BIOS die Boot-Reihenfolge temporär zu ändern. Nachdem Du nun von diesen Stick gestartet hast prüfe mit dmesg Dein Systemlog:
Code:
# dmesg | grep -i command
[    0.000000] Command line:
[    0.026354] Kernel command line: root=PARTUUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx ro loglevel=8

Edit: ... oder:
Code:
# cat /proc/cmdline

Sollte der neue Parameter fehlen, weißt Du dass etwas schief gelaufen ist ...

Vorerst dient Dir dieser Stick nur als Rescue-Stick. Später können wir ihn auch für IMA Measurement verwenden (ist aber kein Muss).
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