@@ -16,7 +16,7 @@ pub(crate) mod osconfig;
16
16
17
17
use std:: collections:: HashMap ;
18
18
use std:: fs:: create_dir_all;
19
- use std:: io:: { Read , Write } ;
19
+ use std:: io:: Write ;
20
20
use std:: os:: fd:: { AsFd , AsRawFd } ;
21
21
use std:: os:: unix:: fs:: symlink;
22
22
use std:: os:: unix:: process:: CommandExt ;
@@ -42,9 +42,9 @@ use cap_std_ext::cap_tempfile::TempDir;
42
42
use cap_std_ext:: cmdext:: CapStdExtCommandExt ;
43
43
use cap_std_ext:: prelude:: CapStdExtDirExt ;
44
44
use clap:: ValueEnum ;
45
+ use composefs_boot:: bootloader:: read_file;
45
46
use fn_error_context:: context;
46
47
use ostree:: gio;
47
- use ostree_ext:: composefs:: tree:: RegularFile ;
48
48
use ostree_ext:: composefs:: {
49
49
fsverity:: { FsVerityHashValue , Sha256HashValue } ,
50
50
repository:: Repository as ComposefsRepository ,
@@ -1571,24 +1571,6 @@ fn get_booted_bls() -> Result<BLSConfig> {
1571
1571
Err ( anyhow:: anyhow!( "Booted BLS not found" ) )
1572
1572
}
1573
1573
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
-
1592
1574
pub ( crate ) enum BootSetupType < ' a > {
1593
1575
/// For initial setup, i.e. install to-disk
1594
1576
Setup ( ( & ' a RootSetup , & ' a State ) ) ,
0 commit comments