Commit Graph

8 Commits (f9f1314acb4cabfb3ffaf4ba5031b51ca2bbccd9)

Author SHA1 Message Date
Harald Hoyer 630334950c feat(skipcpio): speed up and harden skipcpio
Before:
```
Benchmark #1: ./skipcpio/skipcpio test-5.10.15-200.fc33.x86_64.img >/dev/null
  Time (mean ± σ):     125.5 ms ±   0.9 ms    [User: 97.4 ms, System: 27.9 ms]
  Range (min … max):   124.8 ms … 129.4 ms    23 runs
```

After:
```
Benchmark #1: ./skipcpio/skipcpio test-5.10.15-200.fc33.x86_64.img >/dev/null
  Time (mean ± σ):      12.2 ms ±   0.3 ms    [User: 2.7 ms, System: 9.5 ms]
  Range (min … max):    11.7 ms …  13.6 ms    212 runs
```

Besides the speedup, skipcpio now parses the cpio header and is not
falsely ending when the early cpio payload contains `TRAILER!!!`.

Fixes: https://github.com/dracutdevs/dracut/issues/1123
2021-02-25 14:48:22 +01:00
realtime-neil 68dd8af21d fix(skipcpio): edit skipcpio.c: strstr -> memmem
because CPIO_END might follow a NULL byte in buf
2021-01-26 21:06:15 +00:00
Harald Hoyer 6318baa45f skipcpio/skipcpio.c: linux kernel only accepts "070701" signature
don't bother with other signatures
2015-07-07 13:44:13 +02:00
Harald Hoyer 967cc19ab1 remove all vim and emacs code format comments 2014-08-29 13:38:47 +02:00
Harald Hoyer c23d6ce6ea skipcpio: limit the local var scope 2014-08-29 13:26:32 +02:00
Harald Hoyer a7316ae4f7 skipcpio: fixed signatured check 2014-01-29 08:35:47 +01:00
Cristian Rodríguez 6b449e8a6d skipcpio: return something at end of program
Otherwise the compiler emits a warning and the return vale is
in theory undefined.
2014-01-29 08:32:17 +01:00
Harald Hoyer 9ea68421f6 add skipcpio utility
skipcpio skips a cpio archive at the beginning of a file.

It is used for skipping an early cpio archive for lsinitrd.
2014-01-24 15:27:51 +01:00