Avoid infinite loop if the last record in EXTRA_USRES_PARAMS doesn't
end with a semicolon.
It's possible the the users will write configurations like below.
INHERIT += "extrausers"
EXTRA_USERS_PARAMS = "useradd tester; useradd developer"
In such situation, the do_rootfs task will enter an infinite loop.
An infinite loop is never acceptable.
This patch fixes the above problem.
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bbfatal "Invalid command in EXTRA_USERS_PARAMS: $cmd"
;;
esac
+ # Avoid infinite loop if the last parameter doesn't end with ';'
+ if [ "$setting" = "$remaining" ]; then
+ break
+ fi
# iterate to the next setting
setting=`echo $remaining | cut -d ';' -f1`
remaining=`echo $remaining | cut -d ';' -f2-`