mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
misc fixes (#2892)
* use docker for build steps that require linux when not on linux * use fuse for overlay * quiet mountpoint * node 22 * misc fixes * make shasum more compliant * optimize download-base-image.sh with cleaner url handling and checksum verification * fix script * fixes #2900 * bump node and npm versions in web readme * Minor pl.ts fixes * fixes in response to synapse issues * beta.8 * update ts-matches * beta.11 * pl.ts finetuning --------- Co-authored-by: Mariusz Kogen <k0gen@pm.me> Co-authored-by: Matt Hill <mattnine@protonmail.com>
This commit is contained in:
@@ -91,6 +91,8 @@ pub enum ErrorKind {
|
||||
Cancelled = 73,
|
||||
Git = 74,
|
||||
DBus = 75,
|
||||
InstallFailed = 76,
|
||||
UpdateFailed = 77,
|
||||
}
|
||||
impl ErrorKind {
|
||||
pub fn as_str(&self) -> &'static str {
|
||||
@@ -171,6 +173,8 @@ impl ErrorKind {
|
||||
Cancelled => "Cancelled",
|
||||
Git => "Git Error",
|
||||
DBus => "DBus Error",
|
||||
InstallFailed => "Install Failed",
|
||||
UpdateFailed => "Update Failed",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ impl TryFrom<ManifestV1> for Manifest {
|
||||
let default_url = value.upstream_repo.clone();
|
||||
Ok(Self {
|
||||
id: value.id,
|
||||
title: value.title.into(),
|
||||
title: format!("{} (Compatibility Mode)", value.title).into(),
|
||||
version: ExtendedVersion::from(
|
||||
exver::emver::Version::from_str(&value.version)
|
||||
.with_kind(ErrorKind::Deserialization)?,
|
||||
|
||||
@@ -41,7 +41,7 @@ impl Context for ContainerCliContext {
|
||||
.runtime
|
||||
.get_or_init(|| {
|
||||
Arc::new(
|
||||
tokio::runtime::Builder::new_current_thread()
|
||||
tokio::runtime::Builder::new_multi_thread()
|
||||
.enable_all()
|
||||
.build()
|
||||
.unwrap(),
|
||||
|
||||
@@ -5,8 +5,22 @@ use models::{FromStrParser, PackageId};
|
||||
|
||||
use crate::service::effects::prelude::*;
|
||||
use crate::service::rpc::CallbackId;
|
||||
use crate::service::RebuildParams;
|
||||
use crate::status::MainStatus;
|
||||
|
||||
pub async fn rebuild(context: EffectContext) -> Result<(), Error> {
|
||||
let seed = context.deref()?.seed.clone();
|
||||
let ctx = seed.ctx.clone();
|
||||
let id = seed.id.clone();
|
||||
drop(seed);
|
||||
tokio::spawn(async move {
|
||||
super::super::rebuild(ctx, RebuildParams { id })
|
||||
.await
|
||||
.log_err()
|
||||
});
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn restart(
|
||||
context: EffectContext,
|
||||
ProcedureId { procedure_id }: ProcedureId,
|
||||
|
||||
@@ -34,6 +34,12 @@ pub fn handler<C: Context>() -> ParentHandler<C> {
|
||||
from_fn(callbacks::clear_callbacks).no_cli(),
|
||||
)
|
||||
// control
|
||||
.subcommand(
|
||||
"rebuild",
|
||||
from_fn_async(control::rebuild)
|
||||
.no_display()
|
||||
.with_call_remote::<ContainerCliContext>(),
|
||||
)
|
||||
.subcommand(
|
||||
"restart",
|
||||
from_fn_async(control::restart)
|
||||
|
||||
@@ -209,7 +209,10 @@ impl ServiceRef {
|
||||
.request(rpc::Exit, Empty {})
|
||||
.await?;
|
||||
shutdown.shutdown();
|
||||
hdl.await.with_kind(ErrorKind::Cancelled)?;
|
||||
tokio::time::timeout(Duration::from_secs(30), hdl)
|
||||
.await
|
||||
.with_kind(ErrorKind::Timeout)?
|
||||
.with_kind(ErrorKind::Cancelled)?;
|
||||
}
|
||||
let service = Arc::try_unwrap(self.0).map_err(|_| {
|
||||
Error::new(
|
||||
@@ -482,7 +485,11 @@ impl Service {
|
||||
None,
|
||||
) // TODO timeout
|
||||
.await
|
||||
.with_kind(ErrorKind::MigrationFailed)?; // TODO: handle cancellation
|
||||
.with_kind(if src_version.is_some() {
|
||||
ErrorKind::UpdateFailed
|
||||
} else {
|
||||
ErrorKind::InstallFailed
|
||||
})?; // TODO: handle cancellation
|
||||
|
||||
if let Some(mut progress) = progress {
|
||||
progress.finalization_progress.complete();
|
||||
|
||||
@@ -65,7 +65,6 @@ impl Shutdown {
|
||||
Command::new("reboot").spawn().unwrap().wait().unwrap();
|
||||
} else {
|
||||
Command::new("shutdown")
|
||||
.arg("-h")
|
||||
.arg("now")
|
||||
.spawn()
|
||||
.unwrap()
|
||||
|
||||
Reference in New Issue
Block a user