Button::new("Abort", trigger_abort_install_dialog)
}
-fn get_eula() -> String {
- // TODO: properly using info from Proxmox::Install::Env::setup()
- std::fs::read_to_string("/cdrom/EULA")
+fn get_eula(setup: &SetupInfo) -> String {
+ let mut path = setup.locations.iso.clone();
+ path.push("EULA");
+
+ std::fs::read_to_string(path)
.unwrap_or_else(|_| "< Debug build - ignoring non-existing EULA >".to_owned())
}
TextView::new("END USER LICENSE AGREEMENT (EULA)").center(),
))
.child(Panel::new(ScrollView::new(
- TextView::new(get_eula()).center(),
+ TextView::new(get_eula(&state.setup_info)).center(),
)))
.child(PaddedView::lrtb(1, 1, 1, 0, bbar));
-use std::{cmp, collections::HashMap, fmt, fs::File, io::BufReader, net::IpAddr, path::Path};
+use std::{
+ cmp,
+ collections::HashMap,
+ fmt,
+ fs::File,
+ io::BufReader,
+ net::IpAddr,
+ path::{Path, PathBuf},
+};
use serde::{de, Deserialize, Deserializer, Serialize, Serializer};
pub isorelease: String,
}
+/// Paths in the ISO environment containing installer data.
+#[derive(Clone, Deserialize)]
+pub struct IsoLocations {
+ pub iso: PathBuf,
+}
+
#[derive(Clone, Deserialize)]
pub struct SetupInfo {
#[serde(rename = "product-cfg")]
pub config: ProductConfig,
#[serde(rename = "iso-info")]
pub iso_info: IsoInfo,
+ pub locations: IsoLocations,
}
#[derive(Clone, Deserialize)]