Skip to content

Commit 6fad17d

Browse files
authored
Implement experimental PXE boot provisioning server (#452)
1 parent 1f38e52 commit 6fad17d

File tree

238 files changed

+12520
-598
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

238 files changed

+12520
-598
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
launchSettings.json
22
*.csproj.user
3-
TestResults/
3+
TestResults/
4+
UET/Lib/Container/rkm-initrd-builder/static
5+
UET/Lib/Container/rkm-initrd-builder/storage/

UET/Directory.Packages.props

Lines changed: 111 additions & 111 deletions
Large diffs are not rendered by default.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
static/
2+
static-old/
3+
BuildAndCopy.ps1
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
param([switch] $SkipDotNet, [switch] $OnlyDotNet)
2+
3+
if (!$SkipDotNet) {
4+
Push-Location $PSScriptRoot\..\..\..\uet
5+
try {
6+
dotnet publish -c Release -r linux-x64
7+
if ($LastExitCode -ne 0) { exit $LastExitCode }
8+
dotnet publish -c Release -r win-x64
9+
if ($LastExitCode -ne 0) { exit $LastExitCode }
10+
11+
Copy-Item -Force ".\bin\Release\net9.0\linux-x64\publish\uet" "$PSScriptRoot\static"
12+
Copy-Item -Force ".\bin\Release\net9.0\win-x64\publish\uet.exe" "$PSScriptRoot\static"
13+
} finally {
14+
Pop-Location
15+
}
16+
}
17+
18+
if ($OnlyDotNet) {
19+
exit 0
20+
}
21+
22+
Push-Location $PSScriptRoot
23+
try {
24+
docker build . -f .\copy.Dockerfile --tag copy-buildroot
25+
if ($LastExitCode -ne 0) { exit $LastExitCode }
26+
27+
$ContainerId = $(docker run --rm --detach copy-buildroot)
28+
$ContainerId = $ContainerId.Trim()
29+
30+
docker cp "${ContainerId}:/static/vmlinuz" static/vmlinuz
31+
if ($LastExitCode -ne 0) { exit $LastExitCode }
32+
docker cp "${ContainerId}:/static/initrd" static/initrd
33+
if ($LastExitCode -ne 0) { exit $LastExitCode }
34+
docker cp "${ContainerId}:/static/ipxe.efi" static/ipxe.efi
35+
if ($LastExitCode -ne 0) { exit $LastExitCode }
36+
docker cp "${ContainerId}:/static/wimboot" static/wimboot
37+
if ($LastExitCode -ne 0) { exit $LastExitCode }
38+
docker cp "${ContainerId}:/static/background.png" static/background.png
39+
if ($LastExitCode -ne 0) { exit $LastExitCode }
40+
41+
docker stop -t 0 $ContainerId
42+
if ($LastExitCode -ne 0) { exit $LastExitCode }
43+
} finally {
44+
Pop-Location
45+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM ghcr.io/redpointgames/uet/buildroot-prebuilt-base:latest AS source
2+
3+
FROM busybox
4+
COPY --from=source /static /static
5+
ENTRYPOINT [ "/bin/sleep", "3600" ]

UET/Lib/Container/rkm-initrd-builder/files/usr/lib/systemd/system/display-manager.service

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ After=xorg.service
55

66
[Service]
77
Type=simple
8-
ExecStart=/usr/bin/evilwm --bw 5 --display :0.0
9-
ExecStartPost=/bin/bash -c "grep rkm-in-recovery /proc/cmdline && DISPLAY=:0.0 feh --bg-scale /usr/share/background-x11-recovery.png --no-fehbg || DISPLAY=:0.0 feh --bg-scale /usr/share/background-x11.png --no-fehbg || true"
10-
Restart=always
11-
RestartSec=1s
8+
ExecStartPre=/bin/timeout 1s /bin/xset q
9+
ExecStart=/usr/bin/evilwm --bw 5
10+
ExecStartPost=/bin/bash -c "grep rkm-in-recovery /proc/cmdline && feh --bg-scale /usr/share/background-x11-recovery.png --no-fehbg || feh --bg-scale /usr/share/background-x11.png --no-fehbg || true"
11+
RestartSec=1s
12+
Environment="DISPLAY=:0"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[Unit]
22
Description=RKM Initrd Target
33
Requires=basic.target network.target
4-
Wants=dbus.service systemd-networkd.service rkm-rescue-shell.service xorg.service display-manager.service rkm-provision-client.service
4+
Wants=dbus.service systemd-networkd.service rkm-provisioning.target
55
Conflicts=multi-user.target rescue.service rescue.target
66
After=multi-user.target rescue.service rescue.target systemd-networkd.service
77
AllowIsolate=yes
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[Unit]
22
Description=RKM Provision Client
3-
Requires=display-manager.service
4-
After=display-manager.service
3+
Requires=xorg.service display-manager.service
4+
After=xorg.service display-manager.service
55

66
[Service]
77
Type=simple
8-
ExecStart=/usr/bin/xterm -bg black -fg white -maximized -e /bin/bash -c '/usr/bin/uet-bootstrap internal pxeboot provision-client; systemctl reboot'
9-
Restart=always
8+
ExecStartPre=/bin/timeout 1s /bin/xset q
9+
ExecStart=/usr/bin/xterm -bg black -fg white -maximized -e /bin/bash -c '/usr/bin/uet-bootstrap internal pxeboot provision-client'
1010
RestartSec=1s
1111
Environment="DOTNET_BUNDLE_EXTRACT_BASE_DIR=/tmp/dotnet-bundle"
1212
Environment="GRPC_PIPE_PATH_USER=/tmp/.grpc"
13-
Environment="DISPLAY=:0.0"
13+
Environment="DISPLAY=:0"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[Unit]
2+
Description=RKM Provisioning Services
3+
Upholds=xorg.service display-manager.service rkm-rescue-shell.service rkm-provision-client.service

UET/Lib/Container/rkm-initrd-builder/files/usr/lib/systemd/system/rkm-rescue-shell.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ Type=simple
66
ExecStart=/bin/bash
77
StandardInput=tty
88
StandardOutput=tty
9-
Restart=always
9+
RestartSec=1s
1010
TimeoutStopSec=0
1111
KillSignal=SIGKILL

0 commit comments

Comments
 (0)