From ce8a5c5646e2d5b6f868230a9908d52131e340c9 Mon Sep 17 00:00:00 2001 From: Robert Nelson Date: Thu, 8 Oct 2015 20:02:28 -0500 Subject: [PATCH] update: zz-uenv_txt Signed-off-by: Robert Nelson --- lib/shared/zz-uenv_txt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/shared/zz-uenv_txt b/lib/shared/zz-uenv_txt index 05f915e..94d467e 100644 --- a/lib/shared/zz-uenv_txt +++ b/lib/shared/zz-uenv_txt @@ -8,15 +8,13 @@ if [ -z "${version}" ] ; then exit 2 fi -#Single Media option where u-boot can read the rootfs partitions... if [ -f /boot/uEnv.txt ] ; then unset older_kernel - older_kernel=$(grep uname_r /boot/uEnv.txt | grep -v '#' | awk -F"=" '{print $2}' || true) + older_kernel=$(cat /boot/uEnv.txt | sed 's/ /\n/g' | grep -v '#' | grep 'uname_r=' | awk -F"=" '{print $2}' || true) if [ ! "x${older_kernel}" = "x" ] ; then if [ ! "x${older_kernel}" = "x${version}" ] ; then echo "zz-uenv_txt: Updating /boot/uEnv.txt [uname_r=${version}]" - #tested on: wheezy, jessie, trusty with default sed sed -i -e "s:uname_r=$older_kernel:uname_r=$version:g" /boot/uEnv.txt fi else @@ -24,13 +22,12 @@ if [ -f /boot/uEnv.txt ] ; then fi fi -#Dual Media option or where u-boot can not read the rootfs partition... udir="/boot/uboot/boot" if [ -f ${udir}/uEnv.txt ] ; then unset older_kernel - older_kernel=$(grep uname_r ${udir}/uEnv.txt | grep -v '#' | awk -F"=" '{print $2}' || true) + older_kernel=$(cat ${udir}/uEnv.txt | sed 's/ /\n/g' | grep -v '#' | grep 'uname_r=' | awk -F"=" '{print $2}' || true) unset zreladdr - zreladdr=$(grep zreladdr ${udir}/uEnv.txt | grep -v '#' | awk -F"=" '{print $2}' || true) + zreladdr=$(cat ${udir}/uEnv.txt | sed 's/ /\n/g' | grep -v '#' | grep 'zreladdr=' | awk -F"=" '{print $2}' || true) if [ "x${older_kernel}" = "xcurrent" ] ; then