From 611bae8532480c04598d0884360fee797289a6f4 Mon Sep 17 00:00:00 2001 From: John Klug Date: Tue, 8 May 2018 10:14:30 -0500 Subject: Yocto 2.2 ignores kernel-image-uimage postinst routine --- recipes-kernel/linux/linux_3.12.70.bb | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'recipes-kernel') diff --git a/recipes-kernel/linux/linux_3.12.70.bb b/recipes-kernel/linux/linux_3.12.70.bb index 87e5fbe..7d64f36 100644 --- a/recipes-kernel/linux/linux_3.12.70.bb +++ b/recipes-kernel/linux/linux_3.12.70.bb @@ -59,3 +59,36 @@ DTB_APPEND_mtcap = "mtcap" do_rm_work() { echo "skipping" } + + +pkg_preinst_kernel-image-uimage() { + set -x + mkdir -m 0755 /var/volatile/boot 2>/dev/null || true + ls /boot || true + ls -l /boot | true + rm -rf /boot + ln -sf /var/volatile/boot /boot 2>/dev/null || true +} + +pkg_prerm_kernel-image-uimage() { + rm -rf /var/volatile/boot || true + rm -rf /boot || true +} + +PACKAGES =+ "kernel-image-uimage-inst" +RDEPENDS_kernel-image-uimage-inst += "kernel-image-uimage-${PV}" +ALLOW_EMPTY_kernel-image-uimage-inst = "1" + +pkg_postinst_kernel-image-uimage-inst() { + # Only installs all the kernel on the device (D is defined in bitbake) + if [[ -z "$D" ]] ; then + logger -s -p user.info -t opkg "Upgrading kernel ${PV} -- poweroff will create an unbootable device" + set -x + kernel_mtd="/dev/$(cat /proc/mtd | grep '\"uImage\"' | cut -d : -f 1)" + flash_erase ${kernel_mtd} 0 0 + if nandwrite -p ${kernel_mtd} /boot/uImage-${PV} ; then + echo 'Kernel image update is successful' + fi + set +x + fi +} -- cgit v1.2.3