@@ -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 ;
@@ -42,9 +42,9 @@ use cap_std_ext::cap_tempfile::TempDir;
4242use cap_std_ext:: cmdext:: CapStdExtCommandExt ;
4343use cap_std_ext:: prelude:: CapStdExtDirExt ;
4444use clap:: ValueEnum ;
45+ use composefs_boot:: bootloader:: read_file;
4546use fn_error_context:: context;
4647use ostree:: gio;
47- use ostree_ext:: composefs:: tree:: RegularFile ;
4848use ostree_ext:: composefs:: {
4949 fsverity:: { FsVerityHashValue , Sha256HashValue } ,
5050 repository:: Repository as ComposefsRepository ,
@@ -1571,24 +1571,6 @@ fn get_booted_bls() -> Result<BLSConfig> {
15711571 Err ( anyhow:: anyhow!( "Booted BLS not found" ) )
15721572}
15731573
1574- pub fn read_file < ObjectID : FsVerityHashValue > (
1575- file : & RegularFile < ObjectID > ,
1576- repo : & ComposefsRepository < ObjectID > ,
1577- ) -> Result < Box < [ u8 ] > > {
1578- match file {
1579- RegularFile :: Inline ( data) => Ok ( data. clone ( ) ) ,
1580- RegularFile :: External ( id, size) => {
1581- let mut data = vec ! [ ] ;
1582- std:: fs:: File :: from ( repo. open_object ( id) ?) . read_to_end ( & mut data) ?;
1583- ensure ! (
1584- * size == data. len( ) as u64 ,
1585- "File content doesn't have the expected length"
1586- ) ;
1587- Ok ( data. into_boxed_slice ( ) )
1588- }
1589- }
1590- }
1591-
15921574pub ( crate ) enum BootSetupType < ' a > {
15931575 /// For initial setup, i.e. install to-disk
15941576 Setup ( ( & ' a RootSetup , & ' a State ) ) ,
0 commit comments