diff --git a/Makefile b/Makefile index d45bf6557..f7fad27d3 100644 --- a/Makefile +++ b/Makefile @@ -103,10 +103,9 @@ update-overlay: @echo "\033[33mALL CHANGES WILL BE REVERTED IF YOU RESTART THE DEVICE\033[0m" @if [ -z "$(REMOTE)" ]; then >&2 echo "Must specify REMOTE" && false; fi @if [ "`ssh $(REMOTE) 'cat /usr/lib/embassy/VERSION.txt'`" != "`cat ./VERSION.txt`" ]; then >&2 echo "StartOS requires migrations: update-overlay is unavailable." && false; fi - @if ssh $(REMOTE) "pidof embassy-init"; then >&2 echo "Embassy in INIT: update-overlay is unavailable." && false; fi - ssh $(REMOTE) "sudo systemctl stop embassyd" + ssh $(REMOTE) "sudo systemctl stop startd" $(MAKE) install REMOTE=$(REMOTE) OS_ARCH=$(OS_ARCH) - ssh $(REMOTE) "sudo systemctl start embassyd" + ssh $(REMOTE) "sudo systemctl start startd" update: @if [ -z "$(REMOTE)" ]; then >&2 echo "Must specify REMOTE" && false; fi diff --git a/backend/README.md b/backend/README.md index 8734e6f70..986972efd 100644 --- a/backend/README.md +++ b/backend/README.md @@ -12,18 +12,17 @@ ## Structure -The StartOS backend is broken up into 4 different binaries: +The StartOS backend is packed into a single binary `startbox` that is symlinked under +several different names for different behaviour: -- embassyd: This is the main workhorse of StartOS - any new functionality you +- startd: This is the main workhorse of StartOS - any new functionality you want will likely go here -- embassy-init: This is the component responsible for allowing you to set up - your device, and handles system initialization on startup -- embassy-cli: This is a CLI tool that will allow you to issue commands to - embassyd and control it similarly to the UI -- embassy-sdk: This is a CLI tool that aids in building and packaging services +- start-cli: This is a CLI tool that will allow you to issue commands to + startd and control it similarly to the UI +- start-sdk: This is a CLI tool that aids in building and packaging services you wish to deploy to StartOS -Finally there is a library `embassy` that supports all four of these tools. +Finally there is a library `startos` that supports all of these tools. See [here](/backend/Cargo.toml) for details. diff --git a/backend/build-prod.sh b/backend/build-prod.sh index 4f16ee558..db2331eb4 100755 --- a/backend/build-prod.sh +++ b/backend/build-prod.sh @@ -72,5 +72,3 @@ sudo chown -R $USER ../libs/target if [ -n "$fail" ]; then exit 1 fi - -#rust-arm64-builder aarch64-linux-gnu-strip target/aarch64-unknown-linux-gnu/release/embassyd diff --git a/backend/src/bins/mod.rs b/backend/src/bins/mod.rs index 24972cef5..76329e094 100644 --- a/backend/src/bins/mod.rs +++ b/backend/src/bins/mod.rs @@ -4,24 +4,24 @@ use std::path::Path; pub mod avahi_alias; pub mod deprecated; #[cfg(feature = "cli")] -pub mod embassy_cli; +pub mod start_cli; #[cfg(feature = "daemon")] -pub mod embassy_init; +pub mod start_init; #[cfg(feature = "sdk")] -pub mod embassy_sdk; +pub mod start_sdk; #[cfg(feature = "daemon")] -pub mod embassyd; +pub mod startd; fn select_executable(name: &str) -> Option { match name { #[cfg(feature = "avahi-alias")] "avahi-alias" => Some(avahi_alias::main), #[cfg(feature = "cli")] - "start-cli" => Some(embassy_cli::main), + "start-cli" => Some(start_cli::main), #[cfg(feature = "sdk")] - "start-sdk" => Some(embassy_sdk::main), + "start-sdk" => Some(start_sdk::main), #[cfg(feature = "daemon")] - "startd" => Some(embassyd::main), + "startd" => Some(startd::main), "embassy-cli" => Some(|| deprecated::renamed("embassy-cli", "start-cli")), "embassy-sdk" => Some(|| deprecated::renamed("embassy-sdk", "start-sdk")), "embassyd" => Some(|| deprecated::renamed("embassyd", "startd")), diff --git a/backend/src/bins/embassy_cli.rs b/backend/src/bins/start_cli.rs similarity index 100% rename from backend/src/bins/embassy_cli.rs rename to backend/src/bins/start_cli.rs diff --git a/backend/src/bins/embassy_init.rs b/backend/src/bins/start_init.rs similarity index 99% rename from backend/src/bins/embassy_init.rs rename to backend/src/bins/start_init.rs index d423c6ba2..a562eacf6 100644 --- a/backend/src/bins/embassy_init.rs +++ b/backend/src/bins/start_init.rs @@ -225,7 +225,7 @@ async fn inner_main(cfg_path: Option) -> Result, Error } pub fn main() { - let matches = clap::App::new("embassy-init") + let matches = clap::App::new("start-init") .arg( clap::Arg::with_name("config") .short('c') diff --git a/backend/src/bins/embassy_sdk.rs b/backend/src/bins/start_sdk.rs similarity index 100% rename from backend/src/bins/embassy_sdk.rs rename to backend/src/bins/start_sdk.rs diff --git a/backend/src/bins/embassyd.rs b/backend/src/bins/startd.rs similarity index 98% rename from backend/src/bins/embassyd.rs rename to backend/src/bins/startd.rs index ac9836511..e6c272803 100644 --- a/backend/src/bins/embassyd.rs +++ b/backend/src/bins/startd.rs @@ -105,11 +105,11 @@ pub fn main() { EmbassyLogger::init(); if !Path::new("/run/embassy/initialized").exists() { - super::embassy_init::main(); + super::start_init::main(); std::fs::write("/run/embassy/initialized", "").unwrap(); } - let matches = clap::App::new("embassyd") + let matches = clap::App::new("startd") .arg( clap::Arg::with_name("config") .short('c') diff --git a/backend/src/diagnostic.rs b/backend/src/diagnostic.rs index c4c8adbfb..1d4c3bcf5 100644 --- a/backend/src/diagnostic.rs +++ b/backend/src/diagnostic.rs @@ -9,11 +9,10 @@ use crate::disk::repair; use crate::init::SYSTEM_REBUILD_PATH; use crate::logs::{fetch_logs, LogResponse, LogSource}; use crate::shutdown::Shutdown; +use crate::system::SYSTEMD_UNIT; use crate::util::display_none; use crate::Error; -pub const SYSTEMD_UNIT: &'static str = "embassy-init"; - #[command(subcommands(error, logs, exit, restart, forget_disk, disk, rebuild))] pub fn diagnostic() -> Result<(), Error> { Ok(()) diff --git a/backend/src/system.rs b/backend/src/system.rs index c52eeb038..138e01fea 100644 --- a/backend/src/system.rs +++ b/backend/src/system.rs @@ -22,7 +22,7 @@ use crate::util::serde::{display_serializable, IoFormat}; use crate::util::{display_none, Invoke}; use crate::{Error, ErrorKind, ResultExt}; -pub const SYSTEMD_UNIT: &'static str = "embassyd"; +pub const SYSTEMD_UNIT: &'static str = "startd"; #[command(subcommands(zram))] pub async fn experimental() -> Result<(), Error> {