mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-19 09:00:54 +00:00
fix reporting error in directory listings
This commit is contained in:
parent
468e372bfa
commit
e02df18374
5 changed files with 31 additions and 5 deletions
|
|
@ -340,8 +340,10 @@ impl BasisCache {
|
||||||
let mut dict_set = HashSet::<String>::new();
|
let mut dict_set = HashSet::<String>::new();
|
||||||
for basis in self.cache.iter_mut() {
|
for basis in self.cache.iter_mut() {
|
||||||
basis.populate_caches(hw);
|
basis.populate_caches(hw);
|
||||||
for key in basis.dicts.keys() {
|
for (key, dcache) in basis.dicts.iter() {
|
||||||
dict_set.insert(String::from(key));
|
if dcache.flags.valid() {
|
||||||
|
dict_set.insert(String::from(key));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dict_set
|
dict_set
|
||||||
|
|
|
||||||
|
|
@ -193,8 +193,10 @@ impl DictCacheEntry {
|
||||||
if self.keys.len() < self.key_count as usize {
|
if self.keys.len() < self.key_count as usize {
|
||||||
self.fill(hw, v2p_map, cipher);
|
self.fill(hw, v2p_map, cipher);
|
||||||
}
|
}
|
||||||
for key in self.keys.keys() {
|
for (key, kcache) in self.keys.iter() {
|
||||||
merge_list.insert(key.to_string());
|
if kcache.flags.valid() {
|
||||||
|
merge_list.insert(key.to_string());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// Simply ensures we have the description of a key in cache. Only tries to load small key data.
|
/// Simply ensures we have the description of a key in cache. Only tries to load small key data.
|
||||||
|
|
|
||||||
|
|
@ -440,6 +440,14 @@ fn xmain() -> ! {
|
||||||
log::info!("Doing delete pattern test");
|
log::info!("Doing delete pattern test");
|
||||||
delete_pattern(&mut pddb_os, &mut basis_cache, None, None, None, None);
|
delete_pattern(&mut pddb_os, &mut basis_cache, None, None, None, None);
|
||||||
pddb_os.dbg_dump(Some("patterne".to_string()));
|
pddb_os.dbg_dump(Some("patterne".to_string()));
|
||||||
|
|
||||||
|
log::info!("Doing remount disk test");
|
||||||
|
let mut basis_cache = BasisCache::new();
|
||||||
|
if let Some(sys_basis) = pddb_os.pddb_mount() {
|
||||||
|
basis_cache.basis_add(sys_basis);
|
||||||
|
list_all(&mut pddb_os, &mut basis_cache);
|
||||||
|
pddb_os.dbg_dump(Some("remounte".to_string()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
log::info!("CI done");
|
log::info!("CI done");
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -224,11 +224,23 @@ pub(crate) fn delete_pattern(hw: &mut PddbOs, basis_cache: &mut BasisCache,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for dict in basis_cache.dict_list(hw).iter() {
|
||||||
|
let da = basis_cache.dict_attributes(hw, dict, None).unwrap();
|
||||||
|
log::info!("{:?}", da);
|
||||||
|
}
|
||||||
|
|
||||||
log::info!("doing all-basis sync");
|
log::info!("doing all-basis sync");
|
||||||
basis_cache.sync(hw, None).unwrap();
|
basis_cache.sync(hw, None).unwrap();
|
||||||
log::info!("all-basis sync done");
|
log::info!("all-basis sync done");
|
||||||
|
|
||||||
|
list_all(hw, basis_cache);
|
||||||
|
for dict in basis_cache.dict_list(hw).iter() {
|
||||||
|
let da = basis_cache.dict_attributes(hw, dict, None).unwrap();
|
||||||
|
log::info!("{:?}", da);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub(crate) fn list_all(hw: &mut PddbOs, basis_cache: &mut BasisCache) {
|
||||||
// now list all the attributes of the basis
|
// now list all the attributes of the basis
|
||||||
for dict in basis_cache.dict_list(hw).iter() {
|
for dict in basis_cache.dict_list(hw).iter() {
|
||||||
let da = basis_cache.dict_attributes(hw, &dict, None).unwrap();
|
let da = basis_cache.dict_attributes(hw, &dict, None).unwrap();
|
||||||
|
|
|
||||||
|
|
@ -668,6 +668,7 @@ class SpaceUpdate:
|
||||||
def decode_fscb(img, keys, FSCB_LEN_PAGES=2):
|
def decode_fscb(img, keys, FSCB_LEN_PAGES=2):
|
||||||
global SYSTEM_BASIS
|
global SYSTEM_BASIS
|
||||||
fscb = None
|
fscb = None
|
||||||
|
fscb_count = 0
|
||||||
if SYSTEM_BASIS in keys:
|
if SYSTEM_BASIS in keys:
|
||||||
key = keys[SYSTEM_BASIS]
|
key = keys[SYSTEM_BASIS]
|
||||||
pages = [img[i:i+4096] for i in range(0, len(img), 4096)]
|
pages = [img[i:i+4096] for i in range(0, len(img), 4096)]
|
||||||
|
|
@ -711,7 +712,8 @@ def decode_fscb(img, keys, FSCB_LEN_PAGES=2):
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
fscb.try_replace(SpaceUpdate(cipher.decrypt(entry)))
|
fscb.try_replace(SpaceUpdate(cipher.decrypt(entry)))
|
||||||
|
fscb_count += 1
|
||||||
|
print("Total FSCB entries found: {}".format(fscb_count))
|
||||||
return fscb
|
return fscb
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue