diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-fw-utils_2013.04.bb b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-fw-utils_2013.04.bb index d9141950b..91dd8e9d7 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-fw-utils_2013.04.bb +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-fw-utils_2013.04.bb @@ -39,6 +39,17 @@ do_install() { install -m 0644 ${WORKDIR}/fw_env.config ${D}${sysconfdir}/ } +pkg_postinst_${PN}() { + # run the postinst script on first boot + if [ x"$D" != "x" ]; then + exit 1 + fi + MMCDEV="$(sed -ne 's,.*root=/dev/mmcblk\([0-9]\)p.*,\1,g;T;p' /proc/cmdline)" + if [ -n "${MMCDEV}" ]; then + sed -i -e "s,^/dev/mmcblk[^[:blank:]]\+,/dev/mmcblk${MMCDEV},g" /etc/fw_env.config + fi +} + PACKAGE_ARCH = "${MACHINE_ARCH}" COMPATIBLE_MACHINE = "(ccimx6)"