@@ -8,9 +8,9 @@ use strum::IntoEnumIterator;
88use tracing:: { error, info} ;
99
1010use crate :: cli:: prompt:: Prompt ;
11- use crate :: foundry:: molds :: DefaultSource ;
11+ use crate :: foundry:: os :: DefaultSource ;
1212use crate :: foundry:: ImageElement ;
13- use crate :: foundry:: { molds :: ImageMold , Foundry , FoundryConfigPath } ;
13+ use crate :: foundry:: { os :: Os , Foundry , FoundryConfigPath } ;
1414
1515fn print_banner ( ) {
1616 if console:: colors_enabled ( ) {
@@ -28,7 +28,7 @@ pub fn run(cmd: super::Commands) -> ExitCode {
2828 match cmd {
2929 super :: Commands :: Init {
3030 name,
31- mold ,
31+ os ,
3232 format,
3333 size,
3434 mimic_hardware : _,
@@ -43,8 +43,8 @@ pub fn run(cmd: super::Commands) -> ExitCode {
4343 foundry. size = size;
4444 }
4545
46- if mold . len ( ) > 0 {
47- // If a mold name was given, use the default
46+ if os . len ( ) > 0 {
47+ // If an OS was given, use the default
4848 if let Some ( name) = name {
4949 foundry. name = name;
5050 } else {
@@ -54,11 +54,11 @@ pub fn run(cmd: super::Commands) -> ExitCode {
5454 }
5555 }
5656
57- for m in mold {
57+ for m in os {
5858 if let Ok ( source) = m. default_source ( foundry. arch ) {
5959 foundry. alloy . push ( ImageElement {
6060 source,
61- mold : m,
61+ os : m,
6262 fabricators : None ,
6363 pref_size : None ,
6464 } ) ;
@@ -70,7 +70,7 @@ pub fn run(cmd: super::Commands) -> ExitCode {
7070 // Generate QEMU flags for this hardware
7171 //config.qemuargs = generate_qemuargs()?;
7272 } else {
73- // If no mold was given, begin interactive config
73+ // If no OS was given, begin interactive config
7474 print_banner ( ) ;
7575
7676 let theme = ColorfulTheme {
@@ -136,44 +136,44 @@ pub fn run(cmd: super::Commands) -> ExitCode {
136136 foundry. arch = architectures[ choice_index] ;
137137 }
138138
139- // Prompt mold
139+ // Prompt OS
140140 loop {
141- // Find molds suitable for the architecture
142- let mut molds : Vec < ImageMold > = ImageMold :: iter ( )
143- . filter ( |mold| mold . architectures ( ) . contains ( & foundry. arch ) )
144- . filter ( |mold | foundry. alloy . len ( ) == 0 || mold . alloy ( ) )
141+ // Find operating systems suitable for the architecture
142+ let mut supported_os : Vec < Os > = Os :: iter ( )
143+ . filter ( |os| os . architectures ( ) . contains ( & foundry. arch ) )
144+ . filter ( |os | foundry. alloy . len ( ) == 0 || os . alloy ( ) )
145145 . collect ( ) ;
146146
147147 let choice_index = Select :: with_theme ( & theme)
148- . with_prompt ( "Image mold ?" )
149- . items ( & molds )
148+ . with_prompt ( "Operating system ?" )
149+ . items ( & supported_os )
150150 . interact ( )
151151 . unwrap ( ) ;
152152
153- let mold = & mut molds [ choice_index] ;
153+ let os = & mut supported_os [ choice_index] ;
154154
155155 if Confirm :: with_theme ( & theme)
156- . with_prompt ( "Edit mold configuration?" )
156+ . with_prompt ( "Edit OS configuration?" )
157157 . interact ( )
158158 . unwrap ( )
159159 {
160160 // TODO show some kind of banner
161- mold . prompt ( & foundry, Box :: new ( ColorfulTheme :: default ( ) ) )
161+ os . prompt ( & foundry, Box :: new ( ColorfulTheme :: default ( ) ) )
162162 . unwrap ( ) ;
163163 }
164164
165- if let Ok ( source) = mold . default_source ( foundry. arch ) {
165+ if let Ok ( source) = os . default_source ( foundry. arch ) {
166166 foundry. alloy . push ( ImageElement {
167167 source,
168- mold : mold . to_owned ( ) ,
168+ os : os . to_owned ( ) ,
169169 fabricators : None ,
170170 pref_size : None ,
171171 } ) ;
172172 } else {
173173 return ExitCode :: FAILURE ;
174174 }
175175
176- if !mold . alloy ( )
176+ if !os . alloy ( )
177177 || !Confirm :: with_theme ( & theme)
178178 . with_prompt ( "Create an alloy image (multiboot)?" )
179179 . interact ( )
0 commit comments