-
Notifications
You must be signed in to change notification settings - Fork 1
/
2022-11-24-u7411-up-and-running.txt
118 lines (93 loc) · 5.16 KB
/
2022-11-24-u7411-up-and-running.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
Getting Fujitsu U7411 up and running: Network Boot
Earlier this year, the Genode team met the challenge to bring our OS to
recent Intel Gen11 hardware, more precisely we faced the task to fully
enable the Fujitsu LIFEBOOK U7411. But first things first:
[https://genodians.org/valerius/2019-03-12-remote-booting-of-x86-machines-with-pxe-and-intel-amt - How to prepare the notebook for remote booting]
without sufficient legacy BIOS support?
As described in the
[https://genodians.org/valerius/2019-03-12-remote-booting-of-x86-machines-with-pxe-and-intel-amt - article],
the standard x86 development setup is a lubricated combination of integrated
PXE network boot via Pulsar and Intel ME/AMT. While the latter appeared to
work reasonably well on the U7411, PXE boot was not an option as the BIOS
manifested as UEFI-only, which left me at a loss what to do. Also, my
initial desperate (and quite inexperienced) experiments to replace Pulsar by
[https://ipxe.org/ - iPXE] failed gloriously for several reasons (as I
learned later).
Next, I had the idea to replace Pulsar by Grub2 with an integrated
efinet driver as we already use Grub to boot our ISO and disk images and it
could be quite cool to reduce the Zoo of tools required. The work led to a
series of acceptable developments in
[https://github.com/genodelabs/genode/issues/4429 - Github issue #4429] but
I believe that Grub efinet is a blind end for the following reasons. First,
it takes ages for the U7411 UEFI to initialize networking, which is a time
lost during each build-test cycle. Further, it seems almost impossible to
identify the right time frame to connect to AMT Serial-over-LAN - either the
connection just gets stuck when trying too early or the boot already entered
the next stage when connecting too late. In both cases, valuable boot
messages are lost especially while debugging the early stages like Bender or
NOVA. Finally, all attempts to alleviate the negative effects did not lead
to robust behavior.
Eventually, I directed my attention back to iPXE, gathered available
experiences with this boot option from the community, and developed a
reliable solution that works delightfully not only on U7411 but also on
older and more recent devices too. As a bonus the network transport protocol
can be switched from TFTP to HTTP, which decreases boot times with large
images significantly. In the following I describe the required steps to
switch to iPXE network boot.
Prepare iPXE boot image
-----------------------
The sources for iPXE can be cloned from the upstream Git repository.
! git clone https://github.com/ipxe/ipxe.git
Next, edit an embedded boot script to configure the boot loader and, thus,
bypass any network/PXE configuration of the local network. The script
_src/genode.ipxe_ should contain the following commands for a development
machine with IP address 10.0.2.55.
! #!ipxe
!
! dhcp || goto failed
! chain http://10.0.2.55:2209/boot.cfg || goto failed
!
! :failed
! echo Booting failed, dropping to shell
! shell
You may replace _ipxe/boot.cfg_ in the URL by _ipxe-${mac:hexhyp}/boot.cfg_
to distinguish multiple test machines booting from the same host.
'${mac:hexhyp}' is then replaced on boot by the MAC address of the NIC,
e.g., 02-00-00-00-00-01. The boot-loader image can now be built in
_<ipxe.git>/src_ and written to a USB thumb drive _/dev/sdb_ like follows.
! make bin-x86_64-efi/ipxe.usb EMBED=genode.ipxe
! sudo dd if=bin-x86_64-efi/ipxe.usb of=/dev/sdb bs=8M conv=fsync
I decided to boot the test target from a USB thumb drive to skip UEFI
network initialization but it's also possible to
[https://ipxe.org/howto/chainloading#uefi - chainload an iPXE image]
generated by the following command.
! make bin-x86_64-efi/ipxe.efi EMBED=genode.ipxe
Preparing first boot
--------------------
You may have noticed that the boot script shamelessly expects an HTTP
server listening on your development machine's port 2209. This requirement
can easily be fulfilled by installing the _lighttpd_ package of your Linux
distribution. Don't bother with global configuration or automatic startup of
lighttpd, this task is solved by the following Genode 'RUN_OPT' declarations
in _etc/build.conf_ of your Genode build directory on each test cycle.
! RUN_OPT += --include load/ipxe
! RUN_OPT += --load-ipxe-base-dir /tftpboot
! RUN_OPT += --load-ipxe-boot-dir /ipxe
! RUN_OPT += --load-ipxe-lighttpd
! RUN_OPT += --load-ipxe-lighttpd-port 2209
Additionally, instruct the run tool to generate UEFI images.
! RUN_OPT += --include image/uefi
If your test machine shows a SYSLINUX boot prompt and stops on startup, you
may have to adapt your BIOS boot settings to _UEFI only_ and _no CSM support_.
We experienced this on Lenovo X250/X260 notebooks.
Run it
------
In case you're running Sculpt OS on your development machine, you need to
configure the NIC router to forward port 2209 to your development VM.
! <domain name="uplink">
! <tcp-forward port="2209" domain="default" to="10.0.2.2"/>
! </domain>
Any Genode run script can now be tested on the test machine as usual. I did
that for the U7411, which gave me quite some insights and surprises, but
that's for another story.
| amt booting debugging howto intel linux platform sculpt tooling uefi x86