From 0fd7d5aadb55e763c4e7d7795f37773ce264481e Mon Sep 17 00:00:00 2001 From: Stefan Eichenberger Date: Thu, 22 Feb 2018 15:56:31 +0100 Subject: [PATCH] sw-update: add support for nrhw20 --- recipes-core/sw-update/sw-update.bb | 2 ++ .../sw-update/am335x-nrhw20/sw_update_config | 35 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 recipes-core/sw-update/sw-update/am335x-nrhw20/sw_update_config diff --git a/recipes-core/sw-update/sw-update.bb b/recipes-core/sw-update/sw-update.bb index 9255a38..82cd097 100644 --- a/recipes-core/sw-update/sw-update.bb +++ b/recipes-core/sw-update/sw-update.bb @@ -4,6 +4,8 @@ LICENSE = "Proprietary" LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Proprietary;md5=0557f9d92cf58f2ccdd50f62f8ac0b28" RDEPENDS_${PN} = "e2fsprogs" +FILESEXTRAPAHT_prepend := "${THISDIR}/${PN}/${MACHINE}:" + PV = "1.0.0" SRC_URI = " \ diff --git a/recipes-core/sw-update/sw-update/am335x-nrhw20/sw_update_config b/recipes-core/sw-update/sw-update/am335x-nrhw20/sw_update_config new file mode 100644 index 0000000..207f79a --- /dev/null +++ b/recipes-core/sw-update/sw-update/am335x-nrhw20/sw_update_config @@ -0,0 +1,35 @@ +PLATFORM_FIRST_PARTITION="/dev/mmcblk1p1" +PLATFORM_SECOND_PARTITION="/dev/mmcblk1p2" +PLATFORM_PROD_COMPATIBILITY= +PLATFORM_HW_VERSION= +get_active_partition() +{ + boot_part=$(bd read boot_part) + if [ "$boot_part" == "None" ]; then + flag=$(bd read partition64.flags) + if [ $flag -ne 0 ]; then + boot_part=0 + else + boot_part=1 + fi + fi + echo $boot_part +} +PLATFORM_ACTIVE_PARTITION=$(get_active_partition) + +set_active_partition() +{ + boot_part=$(bd read boot_part) + if [ "$boot_part" == "None" ]; then + if [ $1 -eq 0 ]; then + bd write partition64.flags=128 + bd write partition64_1.flags=0 + else + bd write partition64_1.flags=128 + bd write partition64.flags=0 + fi + else + bd write boot_part=$1 + fi +} +