n810: Add firmware generator hotplug scripts
[openwrt.git] / target / linux / omap24xx / base-files / lib / preinit / 99_bme_pmm_image
1 #!/bin/sh
2
3 do_extract_cal_bme_pmm() {
4         [ -e /lib/firmware/n810-cal-bme-pmm.fw ] && return 0
5
6         [ -x /usr/bin/calvaria ] || { echo "CAL-BME extract: calvaria not found"; return 1; }
7
8         /usr/bin/calvaria -p -n bme -i last /dev/mtdblock1 >/lib/firmware/n810-cal-bme-pmm.fw || {
9                 echo "CAL-BME extract: Failed to extract blob"
10                 return 1
11         }
12 }
13
14 boot_hook_add preinit_mount_root do_extract_cal_bme_pmm