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