@@ -15,7 +15,7 @@ pub(crate) mod osconfig;
1515
1616use std:: collections:: HashMap ;
1717use std:: fs:: create_dir_all;
18- use std:: io:: { Read , Write } ;
18+ use std:: io:: Write ;
1919use std:: os:: fd:: { AsFd , AsRawFd } ;
2020use std:: os:: unix:: fs:: symlink;
2121use std:: os:: unix:: process:: CommandExt ;
@@ -40,9 +40,9 @@ use cap_std_ext::cmdext::CapStdExtCommandExt;
4040use cap_std_ext:: prelude:: CapStdExtDirExt ;
4141use chrono:: prelude:: * ;
4242use clap:: ValueEnum ;
43+ use composefs_boot:: bootloader:: read_file;
4344use fn_error_context:: context;
4445use ostree:: gio;
45- use ostree_ext:: composefs:: tree:: RegularFile ;
4646use ostree_ext:: composefs:: {
4747 fsverity:: { FsVerityHashValue , Sha256HashValue } ,
4848 repository:: Repository as ComposefsRepository ,
@@ -1591,24 +1591,6 @@ fn get_booted_bls() -> Result<BLSConfig> {
15911591 Err ( anyhow:: anyhow!( "Booted BLS not found" ) )
15921592}
15931593
1594- pub fn read_file < ObjectID : FsVerityHashValue > (
1595- file : & RegularFile < ObjectID > ,
1596- repo : & ComposefsRepository < ObjectID > ,
1597- ) -> Result < Box < [ u8 ] > > {
1598- match file {
1599- RegularFile :: Inline ( data) => Ok ( data. clone ( ) ) ,
1600- RegularFile :: External ( id, size) => {
1601- let mut data = vec ! [ ] ;
1602- std:: fs:: File :: from ( repo. open_object ( id) ?) . read_to_end ( & mut data) ?;
1603- ensure ! (
1604- * size == data. len( ) as u64 ,
1605- "File content doesn't have the expected length"
1606- ) ;
1607- Ok ( data. into_boxed_slice ( ) )
1608- }
1609- }
1610- }
1611-
16121594pub ( crate ) enum BootSetupType < ' a > {
16131595 /// For initial setup, i.e. install to-disk
16141596 Setup ( ( & ' a RootSetup , & ' a State ) ) ,
0 commit comments