Skip to content

st3m_tar: only update sys files if changed

dx requested to merge dx/fastar into main

Becuase the tar extractor is streaming, this accomplishes that by:

  1. doing a big malloc() of the size of the file (which, given the files we have, and how early we are in the boot process, is perfectly reasonable)
  2. putting the file contents in there
  3. opening the file on disk and comparing to see if updating is needed
  4. writing only in that case

In hindsight the part of reading the file from disk could also be a big malloc but I went for 4kbyte buffers.

The performance difference between writing and doing anything else is so big that I didn't really need to care about making this code fast.

Merge request reports

Loading