-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
simplified greenboot with implementation in rust
the pr currently implements only greenboot health-check, failing required script and missing required directory will render health-check as failure whcih in turn will trigger reboot until boot_counter reaches -1, motd is implemented with status as greedboot/redboot in figlet. greenboot can work without config file as default values are embedded in the script itself. Signed-off-by: Sayan Paul <[email protected]>
- Loading branch information
Showing
12 changed files
with
442 additions
and
215 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM fedora:latest | ||
|
||
RUN bash -c "$(curl -fsSL "https://raw.githubusercontent.com/microsoft/vscode-dev-containers/main/script-library/common-redhat.sh")" -- "true" "vscode" "1000" "1000" "true" | ||
|
||
RUN dnf install -y \ | ||
sudo git cargo rust rust-src git-core clippy rustfmt \ | ||
&& dnf clean all | ||
|
||
USER vscode |
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,28 @@ | ||
{ | ||
"name": "greenboot-rs", | ||
"build": { | ||
"dockerfile": "Dockerfile" | ||
}, | ||
"runArgs": [ | ||
"--cap-add=SYS_PTRACE", | ||
"--security-opt", | ||
"seccomp=unconfined" | ||
], | ||
"settings": { | ||
"rust-analyzer.checkOnSave.command": "clippy" | ||
}, | ||
"extensions": [ | ||
"mutantdino.resourcemonitor", | ||
"matklad.rust-analyzer", | ||
"serayuzgur.crates" | ||
], | ||
"hostRequirements": { | ||
"memory": "4gb" | ||
}, | ||
"remoteUser": "vscode", | ||
"updateContentCommand": [ | ||
"cargo", | ||
"build" | ||
], | ||
"waitFor": "onCreateCommand" | ||
} |
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 |
---|---|---|
|
@@ -15,3 +15,5 @@ nix = "0.25.0" | |
glob = "0.3.0" | ||
serde = "1.0" | ||
serde_json = "1.0" | ||
thiserror = "1.0.38" | ||
figlet-rs = "0.1.5" |
This file was deleted.
Oops, something went wrong.
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,13 +1,13 @@ | ||
[Unit] | ||
Description=Greenboot - TODO | ||
After=multi-user.target | ||
Description=greenboot Health Checks Runner | ||
Before=boot-complete.target | ||
OnFailureJobMode=fail | ||
|
||
[Service] | ||
Type=oneshot | ||
RemainAfterExit=yes | ||
ExecStart=/usr/libexec/greenboot/greenboot check | ||
Restart=no | ||
ExecStart=/usr/libexec/greenboot/greenboot health-check | ||
|
||
[Install] | ||
RequiredBy=boot-complete.target | ||
WantedBy=multi-user.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Greenboot configuration file | ||
|
||
## Generic | ||
GREENBOOT_MAX_BOOT_ATTEMPTS=3 |
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
Oops, something went wrong.