@@ -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 ;
@@ -41,9 +41,9 @@ use cap_std_ext::cap_tempfile::TempDir;
41
41
use cap_std_ext:: cmdext:: CapStdExtCommandExt ;
42
42
use cap_std_ext:: prelude:: CapStdExtDirExt ;
43
43
use clap:: ValueEnum ;
44
+ use composefs_boot:: bootloader:: read_file;
44
45
use fn_error_context:: context;
45
46
use ostree:: gio;
46
- use ostree_ext:: composefs:: tree:: RegularFile ;
47
47
use ostree_ext:: composefs:: {
48
48
fsverity:: { FsVerityHashValue , Sha256HashValue } ,
49
49
repository:: Repository as ComposefsRepository ,
@@ -1547,24 +1547,6 @@ fn get_booted_bls() -> Result<BLSConfig> {
1547
1547
Err ( anyhow:: anyhow!( "Booted BLS not found" ) )
1548
1548
}
1549
1549
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
-
1568
1550
pub ( crate ) enum BootSetupType < ' a > {
1569
1551
/// For initial setup, i.e. install to-disk
1570
1552
Setup ( ( & ' a RootSetup , & ' a State ) ) ,
0 commit comments