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