diff --git a/bootstrap/src/initfs.rs b/bootstrap/src/initfs.rs index c33918da06..04d3cfe033 100644 --- a/bootstrap/src/initfs.rs +++ b/bootstrap/src/initfs.rs @@ -6,7 +6,7 @@ use core::str; use alloc::string::String; use hashbrown::HashMap; -use redox_initfs::{InitFs, Inode, InodeDir, InodeKind, InodeStruct, types::Timespec}; +use redox_initfs::{InitFs, Inode, InodeDir, InodeKind, InodeStruct}; use redox_rt::proc::FdGuard; use redox_scheme::{ @@ -315,8 +315,6 @@ impl SchemeSync for InitFsScheme { fn fstat(&mut self, id: usize, stat: &mut Stat, _ctx: &CallerCtx) -> Result<()> { let handle = self.handles.get(&id).ok_or(Error::new(EBADF))?.as_node()?; - let Timespec { sec, nsec } = self.fs.image_creation_time(); - let inode = Self::get_inode(&self.fs, handle.inode)?; stat.st_ino = inode.id(); @@ -331,10 +329,10 @@ impl SchemeSync for InitFsScheme { stat.st_gid = 0; stat.st_size = u64::try_from(inode_len(inode)?).unwrap_or(u64::MAX); - stat.st_ctime = sec.get(); - stat.st_ctime_nsec = nsec.get(); - stat.st_mtime = sec.get(); - stat.st_mtime_nsec = nsec.get(); + stat.st_ctime = 0; + stat.st_ctime_nsec = 0; + stat.st_mtime = 0; + stat.st_mtime_nsec = 0; Ok(()) } diff --git a/initfs/src/lib.rs b/initfs/src/lib.rs index db7ed8b008..1f42024a17 100644 --- a/initfs/src/lib.rs +++ b/initfs/src/lib.rs @@ -216,9 +216,6 @@ impl<'initfs> InitFs<'initfs> { Ok(this) } - pub fn image_creation_time(&self) -> Timespec { - self.get_header_assume_valid().creation_time - } fn get_header_assume_valid(&self) -> &Header { plain::from_bytes::
(&self.base[..core::mem::size_of::
()]) .expect("expected header type to require no alignment, and size to be sufficient") diff --git a/initfs/src/types.rs b/initfs/src/types.rs index 8dce929151..aea108466a 100644 --- a/initfs/src/types.rs +++ b/initfs/src/types.rs @@ -53,24 +53,16 @@ pub struct Offset(pub U32); #[derive(Clone, Copy, Debug)] pub struct Length(pub U32); -#[repr(C, packed)] -#[derive(Clone, Copy, Debug)] -pub struct Timespec { - pub sec: U64, - pub nsec: U32, -} - #[repr(C, packed)] #[derive(Clone, Copy, Debug)] pub struct Header { pub magic: Magic, pub inode_table_offset: Offset, - pub creation_time: Timespec, - pub inode_count: U16, - pub bootstrap_entry: U64, pub initfs_size: U64, pub page_size: U16, pub root_inode: U16, + pub inode_count: U16, + pub bootstrap_entry: U64, } const _: () = { diff --git a/initfs/tools/src/lib.rs b/initfs/tools/src/lib.rs index 38bc941e96..8d01587783 100644 --- a/initfs/tools/src/lib.rs +++ b/initfs/tools/src/lib.rs @@ -521,12 +521,6 @@ pub fn archive( let inode_table_offset = write_inode_table(&mut state)?; - let current_system_time = std::time::SystemTime::now(); - - let time_since_epoch = current_system_time - .duration_since(std::time::SystemTime::UNIX_EPOCH) - .context("could not calculate timestamp")?; - { let mut header_bytes = [0_u8; std::mem::size_of::()]; let header = plain::from_mut_bytes(&mut header_bytes) @@ -534,10 +528,6 @@ pub fn archive( *header = initfs::Header { magic: initfs::Magic(initfs::MAGIC), - creation_time: initfs::Timespec { - sec: time_since_epoch.as_secs().into(), - nsec: time_since_epoch.subsec_nanos().into(), - }, inode_count: state.inode_table.count().into(), inode_table_offset, bootstrap_entry: bootstrap_entry.into(),