@@ -16,7 +16,7 @@ pub(crate) mod osconfig;
1616
1717use std:: collections:: HashMap ;
1818use std:: fs:: create_dir_all;
19- use std:: io:: { Read , Write } ;
19+ use std:: io:: Write ;
2020use std:: os:: fd:: { AsFd , AsRawFd } ;
2121use std:: os:: unix:: fs:: symlink;
2222use std:: os:: unix:: process:: CommandExt ;
@@ -41,9 +41,9 @@ use cap_std_ext::cap_tempfile::TempDir;
4141use cap_std_ext:: cmdext:: CapStdExtCommandExt ;
4242use cap_std_ext:: prelude:: CapStdExtDirExt ;
4343use clap:: ValueEnum ;
44+ use composefs_boot:: bootloader:: read_file;
4445use fn_error_context:: context;
4546use ostree:: gio;
46- use ostree_ext:: composefs:: tree:: RegularFile ;
4747use ostree_ext:: composefs:: {
4848 fsverity:: { FsVerityHashValue , Sha256HashValue } ,
4949 repository:: Repository as ComposefsRepository ,
@@ -1547,24 +1547,6 @@ fn get_booted_bls() -> Result<BLSConfig> {
15471547 Err ( anyhow:: anyhow!( "Booted BLS not found" ) )
15481548}
15491549
1550- pub fn read_file < ObjectID : FsVerityHashValue > (
1551- file : & RegularFile < ObjectID > ,
1552- repo : & ComposefsRepository < ObjectID > ,
1553- ) -> Result < Box < [ u8 ] > > {
1554- match file {
1555- RegularFile :: Inline ( data) => Ok ( data. clone ( ) ) ,
1556- RegularFile :: External ( id, size) => {
1557- let mut data = vec ! [ ] ;
1558- std:: fs:: File :: from ( repo. open_object ( id) ?) . read_to_end ( & mut data) ?;
1559- ensure ! (
1560- * size == data. len( ) as u64 ,
1561- "File content doesn't have the expected length"
1562- ) ;
1563- Ok ( data. into_boxed_slice ( ) )
1564- }
1565- }
1566- }
1567-
15681550pub ( crate ) enum BootSetupType < ' a > {
15691551 /// For initial setup, i.e. install to-disk
15701552 Setup ( ( & ' a RootSetup , & ' a State ) ) ,
0 commit comments