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