07_trigger_fip_scrubbing 364 B

12345678910111213141516
  1. #!/bin/sh
  2. trigger_fip_scrubbing() {
  3. local vol voltype volname
  4. for vol in /sys/class/ubi/ubi*_*; do
  5. [ -e "$vol" ] || continue
  6. voltype="$(cat "$vol"/type)"
  7. volname="$(cat "$vol"/name)"
  8. if [ "$voltype" = "static" ] && [ "$volname" = "fip" ]; then
  9. cat "/dev/${vol##*/}" > /dev/null
  10. break
  11. fi
  12. done
  13. }
  14. boot_hook_add preinit_main trigger_fip_scrubbing