-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: example of autorebase to uCore during CoreOS install (#8)
- Loading branch information
Showing
3 changed files
with
60 additions
and
5 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
variant: fcos | ||
version: 1.4.0 | ||
passwd: | ||
users: | ||
- name: core | ||
ssh_authorized_keys: | ||
- YOUR_SSH_PUB_KEY_HERE | ||
password_hash: YOUR_GOOD_PASSWORD_HASH_HERE | ||
storage: | ||
directories: | ||
- path: /etc/ucore-autorebase | ||
mode: 0754 | ||
files: | ||
- path: /etc/ucore-autorebase/ucore-autorebase.sh | ||
contents: | ||
inline: | | ||
#!/usr/bin/bash | ||
echo "Rebasing to uCore OCI in 5 seconds" | ||
sleep 5 | ||
rpm-ostree rebase ostree-unverified-registry:ghcr.io/ublue-os/ucore:stable \ | ||
&& touch /etc/ucore-autorebase/.complete \ | ||
&& systemctl disable ucore-autorebase.service \ | ||
&& systemctl reboot | ||
mode: 0754 | ||
systemd: | ||
units: | ||
- name: ucore-autorebase.service | ||
enabled: true | ||
contents: | | ||
[Unit] | ||
Description=uCore autorebase to OCI and reboot | ||
ConditionPathExists=!/etc/ucore-autorebase/.complete | ||
ConditionFileIsExecutable=/etc/ucore-autorebase/ucore-autorebase.sh | ||
After=network-online.target | ||
Wants=network-online.target | ||
[Service] | ||
Type=oneshot | ||
StandardOutput=journal+console | ||
RemainAfterExit=yes | ||
ExecStart=/etc/ucore-autorebase/ucore-autorebase.sh | ||
[Install] | ||
WantedBy=multi-user.target |