bootlog: log agnos partition hashes (#28141)

* bootlog: log agnos partition hashes

* full path

* trimming

* slot

* boot is big

* give some time to start

---------

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 1a3125bb8f
beeps
Adeeb Shihadeh 2 years ago committed by GitHub
parent 0346e47d43
commit 2f8939dd0e
  1. 20
      system/hardware/tici/hardware.h
  2. 1
      system/loggerd/tests/test_loggerd.py

@ -75,9 +75,27 @@ public:
static std::map<std::string, std::string> get_init_logs() { static std::map<std::string, std::string> get_init_logs() {
return { std::map<std::string, std::string> ret = {
{"/BUILD", util::read_file("/BUILD")}, {"/BUILD", util::read_file("/BUILD")},
}; };
std::string bs = util::check_output("abctl --boot_slot");
ret["boot slot"] = bs.substr(0, bs.find_first_of("\n"));
std::string temp = util::read_file("/dev/disk/by-partlabel/ssd");
temp.erase(temp.find_last_not_of(std::string("\0\r\n", 3))+1);
ret["boot temp"] = temp;
// TODO: log something from system and boot
for (std::string part : {"xbl", "abl", "aop", "devcfg", "xbl_config"}) {
for (std::string slot : {"a", "b"}) {
std::string partition = part + "_" + slot;
std::string hash = util::check_output("sha256sum /dev/disk/by-partlabel/" + partition);
ret[partition] = hash.substr(0, hash.find_first_of(" "));
}
}
return ret;
} }
static bool get_ssh_enabled() { return Params().getBool("SshEnabled"); }; static bool get_ssh_enabled() { return Params().getBool("SshEnabled"); };

@ -133,6 +133,7 @@ class TestLoggerd(unittest.TestCase):
os.environ["LOGGERD_SEGMENT_LENGTH"] = str(length) os.environ["LOGGERD_SEGMENT_LENGTH"] = str(length)
managed_processes["loggerd"].start() managed_processes["loggerd"].start()
managed_processes["encoderd"].start() managed_processes["encoderd"].start()
time.sleep(1)
fps = 20.0 fps = 20.0
for n in range(1, int(num_segs*length*fps)+1): for n in range(1, int(num_segs*length*fps)+1):

Loading…
Cancel
Save