-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add elemental-setup services to elemental-rootfs
The elemental-setup and rootfs features are heavily dependent on each other. This commit copies the elemental-setup feature into elemental-rootfs, and changes the mount-command to actually start the elemental-setup-rootfs service during mount to not run the yip rootfs stage twice. Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
- Loading branch information
Showing
18 changed files
with
138 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
ARG GO_VERSION=1.20 | ||
ARG GO_VERSION=1.21 | ||
ARG LEAP_VERSION=15.5 | ||
|
||
FROM golang:${GO_VERSION}-alpine as elemental-bin | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
pkg/features/embedded/elemental-rootfs/etc/dracut.conf.d/02-elemental-setup-initramfs.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
install_items+=" /usr/lib/systemd/system/elemental-setup-initramfs.service /etc/systemd/system/initrd.target.requires/elemental-setup-initramfs.service " | ||
install_items+=" /usr/lib/systemd/system/elemental-setup-rootfs.service /etc/systemd/system/initrd-fs.target.requires/elemental-setup-rootfs.service " | ||
install_items+=" /etc/hosts " | ||
add_dracutmodules+=" network " |
11 changes: 11 additions & 0 deletions
11
pkg/features/embedded/elemental-rootfs/usr/lib/systemd/system/elemental-setup-boot.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[Unit] | ||
Description=Elemental system configuration | ||
Before=getty.target | ||
|
||
[Service] | ||
Type=oneshot | ||
RemainAfterExit=yes | ||
ExecStart=/usr/bin/elemental run-stage boot | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
14 changes: 14 additions & 0 deletions
14
pkg/features/embedded/elemental-rootfs/usr/lib/systemd/system/elemental-setup-fs.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[Unit] | ||
Description=Elemental system after FS setup | ||
DefaultDependencies=no | ||
After=local-fs.target | ||
Wants=local-fs.target | ||
Before=sysinit.target | ||
|
||
[Service] | ||
Type=oneshot | ||
RemainAfterExit=yes | ||
ExecStart=/usr/bin/elemental run-stage fs | ||
|
||
[Install] | ||
WantedBy=sysinit.target |
16 changes: 16 additions & 0 deletions
16
...atures/embedded/elemental-rootfs/usr/lib/systemd/system/elemental-setup-initramfs.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[Unit] | ||
Description=Elemental system initramfs setup before switch root | ||
DefaultDependencies=no | ||
After=initrd-fs.target | ||
Requires=initrd-fs.target | ||
Before=initrd.target | ||
|
||
[Service] | ||
RootDirectory=/sysroot | ||
BindPaths=/proc /sys /dev /run /tmp | ||
Type=oneshot | ||
RemainAfterExit=yes | ||
ExecStart=/usr/bin/elemental run-stage initramfs | ||
|
||
[Install] | ||
RequiredBy=initrd.target |
17 changes: 17 additions & 0 deletions
17
...features/embedded/elemental-rootfs/usr/lib/systemd/system/elemental-setup-network.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[Unit] | ||
Description=Elemental setup after network | ||
After=network-online.target | ||
Wants=network-online.target | ||
|
||
[Service] | ||
Nice=19 | ||
IOSchedulingClass=2 | ||
IOSchedulingPriority=7 | ||
Type=oneshot | ||
ExecStart=/usr/bin/elemental run-stage network | ||
TimeoutStopSec=180 | ||
KillMode=process | ||
KillSignal=SIGINT | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
15 changes: 15 additions & 0 deletions
15
...atures/embedded/elemental-rootfs/usr/lib/systemd/system/elemental-setup-reconcile.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[Unit] | ||
Description=Elemental setup reconciler | ||
|
||
[Service] | ||
Nice=19 | ||
IOSchedulingClass=2 | ||
IOSchedulingPriority=7 | ||
Type=oneshot | ||
ExecStart=/bin/bash -c "systemd-inhibit /usr/bin/elemental run-stage reconcile" | ||
TimeoutStopSec=180 | ||
KillMode=process | ||
KillSignal=SIGINT | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
10 changes: 10 additions & 0 deletions
10
...features/embedded/elemental-rootfs/usr/lib/systemd/system/elemental-setup-reconcile.timer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[Unit] | ||
Description=Elemental setup reconciler | ||
|
||
[Timer] | ||
OnBootSec=5min | ||
OnUnitActiveSec=60min | ||
Unit=elemental-setup-reconcile.service | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
15 changes: 15 additions & 0 deletions
15
pkg/features/embedded/elemental-rootfs/usr/lib/systemd/system/elemental-setup-rootfs.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[Unit] | ||
Description=Elemental system early rootfs setup | ||
DefaultDependencies=no | ||
After=initrd-root-fs.target | ||
Requires=initrd-root-fs.target | ||
Conflicts=initrd-switch-root.target | ||
|
||
[Service] | ||
Type=oneshot | ||
RemainAfterExit=yes | ||
ExecStartPre=/usr/bin/ln -sf -t / /sysroot/system | ||
ExecStart=/usr/bin/elemental run-stage rootfs | ||
|
||
[Install] | ||
RequiredBy=initrd-fs.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters