@@ -233,6 +233,18 @@ pub(crate) struct InstallConfigOpts {
233
233
pub ( crate ) stateroot : Option < String > ,
234
234
}
235
235
236
+ #[ derive( ValueEnum , Debug , Copy , Clone , PartialEq , Eq , Serialize , Deserialize , Default ) ]
237
+ pub ( crate ) enum BootType {
238
+ #[ default]
239
+ Bls ,
240
+ Uki ,
241
+ }
242
+
243
+ #[ derive( Debug , Clone , clap:: Parser , Serialize , Deserialize , PartialEq , Eq ) ]
244
+ pub ( crate ) struct InstallComposefsOptions {
245
+ pub ( crate ) boot : BootType ,
246
+ }
247
+
236
248
#[ cfg( feature = "install-to-disk" ) ]
237
249
#[ derive( Debug , Clone , clap:: Parser , Serialize , Deserialize , PartialEq , Eq ) ]
238
250
pub ( crate ) struct InstallToDiskOpts {
@@ -258,7 +270,10 @@ pub(crate) struct InstallToDiskOpts {
258
270
pub ( crate ) via_loopback : bool ,
259
271
260
272
#[ clap( long) ]
261
- pub ( crate ) composefs : bool ,
273
+ pub ( crate ) composefs_experimental : bool ,
274
+
275
+ #[ clap( flatten) ]
276
+ pub ( crate ) composefs_opts : InstallComposefsOptions ,
262
277
}
263
278
264
279
#[ derive( ValueEnum , Debug , Copy , Clone , PartialEq , Eq , Serialize , Deserialize ) ]
@@ -540,6 +555,17 @@ impl FromStr for MountSpec {
540
555
}
541
556
}
542
557
558
+ impl InstallToDiskOpts {
559
+ pub ( crate ) fn validate ( & self ) {
560
+ if !self . composefs_experimental {
561
+ // Reject using --boot without --composefs
562
+ if self . composefs_opts . boot != BootType :: default ( ) {
563
+ panic ! ( "--boot must not be provided without --composefs" ) ;
564
+ }
565
+ }
566
+ }
567
+ }
568
+
543
569
impl InstallAleph {
544
570
#[ context( "Creating aleph data" ) ]
545
571
pub ( crate ) fn new (
@@ -1643,6 +1669,8 @@ fn installation_complete() {
1643
1669
#[ context( "Installing to disk" ) ]
1644
1670
#[ cfg( feature = "install-to-disk" ) ]
1645
1671
pub ( crate ) async fn install_to_disk ( mut opts : InstallToDiskOpts ) -> Result < ( ) > {
1672
+ opts. validate ( ) ;
1673
+
1646
1674
let mut block_opts = opts. block_opts ;
1647
1675
let target_blockdev_meta = block_opts
1648
1676
. device
@@ -1685,7 +1713,7 @@ pub(crate) async fn install_to_disk(mut opts: InstallToDiskOpts) -> Result<()> {
1685
1713
( rootfs, loopback_dev)
1686
1714
} ;
1687
1715
1688
- install_to_filesystem_impl ( & state, & mut rootfs, Cleanup :: Skip , opts. composefs ) . await ?;
1716
+ install_to_filesystem_impl ( & state, & mut rootfs, Cleanup :: Skip , opts. composefs_experimental ) . await ?;
1689
1717
1690
1718
// Drop all data about the root except the bits we need to ensure any file descriptors etc. are closed.
1691
1719
let ( root_path, luksdev) = rootfs. into_storage ( ) ;
0 commit comments