site  contact  subhomenews

EasyOS Dunfell update weird error

December 26, 2020 — BarryK

EasyOS Dunfell 0.101 was announced yesterday:

https://bkhome.org/news/202012/easyos-dunfell-0101-released.html

The previous release is 0.98 and if you are running that, there is an "update" icon on the desktop. Forum member 'banned' reported that this was broken, and I did find a strange fault, and fixed it. But that fix was after 0.98 was released.

Anyway, I tried it, in a running 0.98, with latest /usr/local/easy_version/easy-update script, and this time got another error. Here is where it fails, with fix shown in red:

wget -4 -t 2 -T 20 --waitretry=20 --directory-prefix=/tmp/easy_version --level=1 http://distro.ibiblio.org/easyos/${DISTRO_TARGETARCH}/releases/${DISTRO_COMPAT_VERSION}
#...this creates a html file /tmp/easy_version/${DISTRO_COMPAT_VERSION}, ex: 'buster'
fsync /tmp/easy_version/${DISTRO_COMPAT_VERSION} #20201226 try fix weird error below if test fails.
if [ ! -s /tmp/easy_version/${DISTRO_COMPAT_VERSION} ];then #20201109
echo -en '\033[1;31m' #bright red.
echo "$(gettext 'Sorry, there was an error probing ibiblio.org, aborting script.')"
echo -e '\033[0;39m' #reset.
echo -e "\033[1;31m${MSGexit}\033[0;39m"
exit 1
fi

the size test was failing. But why should I have to run that "fsync'? Looking back at the previous fix in this script, it was a similar problem, that I fixed by a small "sleep".

The script is using bash, I don't recall why. Easy Dunfell has bash 5.0, Buster has 5.0.3. The script works fine in Buster, without the two last "fixes".

I did a very quick online search of bug reports for bash 5.0, and yes, there is some kind of timing problem. So, I am going back to OpenEmbedded and compile a later version of bash.

EDIT 2020-12-27:
This morning conducted an experiment. Running Easy Dunfell 0.98, script without the above "fix", and changed the shebang line to "#!/bin/ash". Ran the script, and discovered why I was using bash -- it uses the COLUMNS variable, which is inbuilt to bash, not in ash -- just set COLUMNS to a suitable value, then the script WORKED!

This confirms that it is a problem with bash 5.0, as I had garnered from a very quick online search. EasyOS has /bin/sh a symlink to bash, so probably this timing problem will occur with the "#!/bin/sh" shebang also.

Who knows what mischief bash will get up to. Really, this is an insidious bug. Next thing I want to do is recompile bash 5.0 with all the Debian patches. Note, it is possible that OE patches have introduced this bug, that it is not in a pristine bash 5.0.

EDIT 2020-12-27:
I have compiled bash 5.0 with Debian patches, as used in Buster, in a running Easy Dunfell, and that fixes bash. The script works without that "fix" shown above.

This is such a nasty bug, I will bring out the next release of Easy Dunfell very soon. 

EDIT 2020-12-27:
Bash fixed in OE:
https://bkhome.org/news/202012/extra-patches-applied-to-bash-in-oe.html 
  

Tags: easy