summaryrefslogtreecommitdiff
path: root/target/linux/omap24xx/base-files/lib/preinit/99_bme_pmm_image
blob: 8e29fd520ed77967d9a00c6983c1bdf13e7c279b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh

do_extract_cal_bme_pmm() {
	[ -e /lib/firmware/n810-cal-bme-pmm.fw ] && return 0

	[ -x /usr/bin/calvaria ] || { echo "CAL-BME extract: calvaria not found"; return 1; }

	/usr/bin/calvaria -p -n bme -i last /dev/mtdblock1 >/lib/firmware/n810-cal-bme-pmm.fw || {
		echo "CAL-BME extract: Failed to extract blob"
		return 1
	}
}

boot_hook_add preinit_mount_root do_extract_cal_bme_pmm