moved sections

This commit is contained in:
2024-08-08 09:37:19 +02:00
parent bc09aadffb
commit b74236adaa
7 changed files with 9 additions and 21 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

@@ -1,82 +0,0 @@
@startuml
actor admin
participant "BIOS Node\n(legacy boot)" as bootnode
participant "QIP DHCP" as dhcp
participant "boot.psi.ch" as pxeserver
participant "sysdb.psi.ch" as sysdb
participant "repos.psi.ch" as reposerver
admin -> bootnode : boots up
hnote over bootnode
BIOS
endhnote
bootnode -> dhcp : DHCP request
dhcp -> bootnode : IP + PXE boot location
bootnode -> pxeserver : load PXE kernel tftp:/tftpboot/pxelinux.0
hnote over bootnode
PXE
endhnote
bootnode -> pxeserver : load PXE config tftp:/tftpboot/pxelinux.cfg/01-$MAC
note right
By manually setting a MAC or IP config the
boot menu can be customised or shortcut.
Most is managed by symlinks. There is the
undocumented "link-to-lxprod.py" script for
manually linking MAC to hostname and hostname
to "lxprod". At some places this is done the
opposite by linking hostname to MAC to "lxprod".
Having the **link to "lxprod" loads directly**
**the iPXE kernel "ipxe.lkrn"**, shortcutting
the manual selection below.
end note
bootnode -> pxeserver : load PXE config tftp:/tftpboot/pxelinux.cfg/$HEX-IP
bootnode -> pxeserver : load PXE config tftp:/tftpboot/pxelinux.cfg/default
note right
**Default selection is local boot**,
but also visible and manually selectable are
- Red Hat 7 Network Install
- Windows Network install
and many more which are hidden, but can
be selected from the prompt, some with
comments from 2013.
end note
admin -> bootnode : selects "Red Hat 7 Network Install"
bootnode -> pxeserver : load iPXE kernel tftp:/tftpboot/ipxe.lkrn
note right
https://git.psi.ch/linux-infra/ipxe-build
The following steps are by embed/pxe.ipxe
end note
hnote over bootnode
iPXE
endhnote
bootnode -> dhcp : DHCP request
dhcp -> bootnode : IP
bootnode -> sysdb : load iPXE menu http:/ipxe/v1/config?mac=$MAC
note right
Default selection by sydb boot
property "local" or "netboot",
later automatically starts the
installer configured in sysdb
attribute "ipxe_installer".
Manually selectable are all
Red Hat 7 versions and Red Hat 8
alpha test version to install,
Windows, a selection of tools
and "HP SPP".
endnote
bootnode -> reposerver : load initrd http:/iso/rhel-server-7.9-x86_64-dvd/images/pxeboot/initrd.img
bootnode -> reposerver : load kernel http:/iso/rhel-server-7.9-x86_64-dvd/images/pxeboot/vmlinuz
hnote over bootnode
Linux kernel
endhnote
bootnode -> reposerver : installation media http:/iso/rhel-server-7.9-x86_64-dvd/
bootnode -> sysdb : kickstart file http:/kickstart/v1/config?fqdn=$HOSTNAME&instrepo=rhel-server-7.9-x86_64-dvd
@enduml
Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

@@ -1,88 +0,0 @@
@startuml
actor admin
participant "UEFI Node" as bootnode
participant "QIP DHCP" as dhcp
participant "boot.psi.ch" as pxeserver
participant "sysdb.psi.ch" as sysdb
participant "repos.psi.ch" as reposerver
admin -> bootnode : boots up
hnote over bootnode
EFI
endhnote
bootnode -> dhcp : DHCP request
dhcp -> bootnode : IP + PXE boot location
bootnode -> pxeserver : load PXE kernel tftp:/tftpboot/shimx64.efi
bootnode -> pxeserver : load PXE kernel tftp:/tftpboot/grubx64.efi
hnote over bootnode
GRUB
endhnote
bootnode -> pxeserver : load PXE config tftp:/tftpboot/grub.cfg-01-$MAC
note right
By manually setting a MAC or IP config the
boot menu can be customised or shortcut.
end note
bootnode -> pxeserver : load PXE config tftp:/tftpboot/grub.cfg-$HEX-IP
bootnode -> pxeserver : load PXE config tftp:/tftpboot/grub.cfg
bootnode -> sysdb : load GRUB menu http:/grub/v1/config?mac=$MAC
note right
Default selection by sydb boot
property "local" or "netboot",
later automatically starts the
installer configured in sysdb
attribute "ipxe_installer".
Manually selectable are other
version of RHEL 7 and
"Windows and Tools Menus".
endnote
admin -> bootnode : selects "Windows and Tools Menus"
note left
Now the automatic installation kicks in,
but here we show the manual detour over iPXE.
end note
bootnode -> pxeserver : load iPXE kernel tftp:/tftpboot/ipxe.efi
note right
https://git.psi.ch/linux-infra/ipxe-build
The following steps are by embed/pxe.ipxe
end note
hnote over bootnode
iPXE
endhnote
bootnode -> dhcp : DHCP request
dhcp -> bootnode : IP
bootnode -> sysdb : load iPXE menu http:/ipxe/v1/config?mac=$MAC
note right
Default selection by sydb boot
property "local" or "netboot",
later automatically starts the
installer configured in sysdb
attribute "ipxe_installer".
Manually selectable are all
Red Hat 7 versions and Red Hat 8
alpha test version to install,
Windows, a selection of tools
and "HP SPP".
endnote
bootnode -> reposerver : load initrd http:/iso/rhel-server-7.9-x86_64-dvd/images/pxeboot/initrd.img
note left
Automatic installation in GRUB
directly jumps here without iPXE
end note
bootnode -> reposerver : load kernel http:/iso/rhel-server-7.9-x86_64-dvd/images/pxeboot/vmlinuz
hnote over bootnode
Linux kernel
endhnote
bootnode -> reposerver : installation media http:/iso/rhel-server-7.9-x86_64-dvd/
bootnode -> sysdb : kickstart file http:/kickstart/v1/config?fqdn=$HOSTNAME&instrepo=rhel-server-7.9-x86_64-dvd
@enduml
-116
View File
@@ -1,116 +0,0 @@
# PXE-booting with iPXE
## UEFI
iPXE supports UEFI and so do we. This requires the ``ipxe.efi`` boot image.
Instructions how to copy the necessary grub files to the tftp server:
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/installation_guide/chap-installation-server-setup#sect-network-boot-setup-uefi
(alternatively one can also copy the files from the /boot/efi/EFI/redhat/ directory of an installed system)
```
[root@ tmp]# cd /tmp
[root@ tmp]# curl -OL http://repos.psi.ch/rhel9/iso/rhel-baseos-9.1-x86_64-dvd/BaseOS/Packages/shim-x64-15.6-1.el9.x86_64.rpm
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 471k 100 471k 0 0 92.0M 0 --:--:-- --:--:-- --:--:-- 92.0M
[root@lx-repos-01 tmp]# curl -LO http://repos.psi.ch/rhel9/iso/rhel-baseos-9.1-x86_64-dvd/BaseOS/Packages/grub2-efi-x64-2.06-46.el9.x86_64.rpm
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1333k 100 1333k 0 0 8550k 0 --:--:-- --:--:-- --:--:-- 8550k
[root@ tmp]# rpm2cpio shim-x64-15.6-1.el9.x86_64.rpm | cpio -dimv
./boot/efi/EFI/BOOT/BOOTX64.EFI
./boot/efi/EFI/BOOT/fbx64.efi
./boot/efi/EFI/redhat/BOOTX64.CSV
./boot/efi/EFI/redhat/mmx64.efi
./boot/efi/EFI/redhat/shim.efi
./boot/efi/EFI/redhat/shimx64-redhat.efi
./boot/efi/EFI/redhat/shimx64.efi
9232 blocks
[root@ tmp]# rpm2cpio grub2-efi-x64-2.06-46.el9.x86_64.rpm | cpio -dimv
./boot/efi/EFI/redhat/grubx64.efi
./boot/grub2/fonts
./boot/grub2/fonts/unicode.pf2
./boot/grub2/grubenv
./boot/loader/entries
./etc/dnf/protected.d/grub2-efi-x64.conf
./etc/grub2-efi.cfg
./etc/grub2.cfg
9612 blocks
[root@ tmp]# ls boot/efi/EFI/redhat/
BOOTX64.CSV grubx64.efi mmx64.efi shim.efi shimx64.efi shimx64-redhat.efi
[root@ tmp]# ls -la boot/efi/EFI/redhat/
total 6088
drwxr-xr-x. 2 root root 122 Mar 1 16:16 .
drwxr-xr-x. 4 root root 32 Mar 1 16:16 ..
-rwx------. 1 root root 108 Jun 7 2022 BOOTX64.CSV
-rwx------. 1 root root 2524792 Aug 25 2022 grubx64.efi
-rwx------. 1 root root 856528 Jun 7 2022 mmx64.efi
-rwx------. 1 root root 946736 Jun 7 2022 shim.efi
-rwx------. 1 root root 946736 Jun 7 2022 shimx64.efi
-rwx------. 1 root root 938808 Jun 7 2022 shimx64-redhat.efi
[root@ tmp]#
```
## Process
When a system PXE boots, the DHCP server will boot either pxelinux in legacy
mode or grub on UEFI. It is still possible to load ipxe from either of these.
With the right option, the boot process is pointed to ``sysdb.psi.ch`` and one
of the following boot images:
- `ipxe.efi` for systems using UEFI
- `ipxe.lkrn` for all other systems
The system downloads the image and executes it.
The image contains a small iPXE script, which makes iPXE retrieve its actual
configuration from a web service running (usually) on `sysdb.psi.ch`.
Specifically, it queries the URL
`https://sysdb.psi.ch/ipxe/v1/config?mac=<MAC>`, where `<MAC>` is the MAC
address of the interface used by iPXE.
The web service on ``sysdb.psi.ch`` will generate the iPXE configuration on the
fly, depending on whether the system is supposed to be reinstalled and if so,
which distribution it is supposed to use. The menu offers other options as well,
e.g. an interactive iPXE shell and a memory test.
## Sequence Diagram of the UEFI Boot Process
![UEFI boot process](_static/uefi_boot.png)
## Sequence Diagram of the BIOS (Legacy) Boot Process
![Legacy boot process](_static/legacy_boot.png)
## Building the iPXE boot image
The steps for building an iPXE image are
1. Clone `git@git.psi.ch:linux-infra/ipxe-build.git`
2. Change into the new directory
3. Run the `refresh-ipxe.sh` script. This will check out the iPXE source code
mirror from `git.psi.ch`.
4. Run the `build.sh` script. This will use the named configurations in the
`ipxe-build` repository to compile two iPXE images: `src/bin/ipxe.lkrn`
(legacy boot) and `src/bin-x86_64-efi/ipxe.efi` (UEFI).
As described above, we use an iPXE boot image with an embedded script looking
roughly like the following
```
#!ipxe
dhcp && goto dhcp_succeeded
shell
#prompt for network info
:dhcp_succeeded
chain http://sysdb.psi.ch/ipxe/v1/config?mac=${netX/mac}
```
-11
View File
@@ -1,11 +0,0 @@
Kickstart
=========
The auto-generated Grub or iPXE configuration will, when installing RHEL, instruct
the RHEL installer to download the Kickstart configuration from
``https://sysdb.psi.ch/kickstart/v1/config?fqdn=<FQDN>&instrepo=<INSTREPO>``,
where ``<FQDN>`` is the FQDN of the host to be installed, and ``<INSTREPO>`` is
the installation repository to be used.
The web service will auto-generate the Kickstart configuration for the client
based on information in sysdb, e.g. the release to be installed.