hypha: multiple cleanups to fix shared module

This commit is contained in:
Alex Zenla
2024-02-06 10:28:39 +00:00
parent 5edbff02a7
commit 44d3799dd3
6 changed files with 28 additions and 33 deletions

View File

@ -1,7 +1,7 @@
use crate::image::ImageInfo;
use crate::shared::LaunchInfo;
use anyhow::Result;
use backhand::{FilesystemWriter, NodeHeader};
use hypha::LaunchInfo;
use log::trace;
use std::fs;
use std::fs::File;

View File

@ -5,9 +5,9 @@ use crate::ctl::cfgblk::ConfigBlock;
use crate::image::cache::ImageCache;
use crate::image::name::ImageName;
use crate::image::{ImageCompiler, ImageInfo};
use crate::shared::{LaunchInfo, LaunchNetwork};
use advmac::MacAddr6;
use anyhow::{anyhow, Result};
use hypha::{LaunchInfo, LaunchNetwork};
use ipnetwork::Ipv4Network;
use loopdev::LoopControl;
use std::io::{Read, Write};
@ -114,10 +114,9 @@ impl Controller {
let cmdline_options = [if debug { "debug" } else { "quiet" }, "elevator=noop"];
let cmdline = cmdline_options.join(" ");
let mac = MacAddr6::random()
.to_string()
.replace('-', ":")
.to_lowercase();
let mut mac = MacAddr6::random();
mac.set_local(true);
let mac = mac.to_string().replace('-', ":");
let config = DomainConfig {
backend_domid: 0,
name: &name,

View File

@ -1,4 +1,3 @@
pub mod autoloop;
pub mod ctl;
pub mod image;
pub mod shared;

View File

@ -1,14 +0,0 @@
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug)]
pub struct LaunchNetwork {
pub link: String,
pub ipv4: String,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct LaunchInfo {
pub network: Option<LaunchNetwork>,
pub env: Option<Vec<String>>,
pub run: Option<Vec<String>>,
}