[...]
password the encrypted user password, an asterisk (*), or the letter 'x'. (See pwconv(8) for an explanation of 'x'.)
[...]
so handle both situation
# reset root password to be empty
echo "Resetting root password in vserver-reference image"
-sed -i -e "s/root:\*/root:/" ${vdir}/etc/passwd
+sed -i -e "s/root:[\*|x]/root:/" ${vdir}/etc/passwd
# modify the sudoers file to remove the 'requiretty' attribute
echo "Removing requiretty from default /etc/sudoers file"