build_image: generate /etc/shadow from /etc/passwd

When a password has been marked as shadowed, we need to make sure there
is an entry for it in /etc/shadow.  Otherwise, pam will prevent people
from logging in as those accounts even when other auth methods will work
(like ssh keys).

TEST=built an image and checked content/perms of /etc/shadow and looked correct
TEST=built an image and could ssh into it

Change-Id: I5ddabdd9e959d7632733217090343028a14ebd6d
Reviewed-by: Chris Masone <>
Commit-Queue: Mike Frysinger <>
Tested-by: Mike Frysinger <>
3 files changed