build_image: correctly label var for rootfs.

${rootfs}/var is a bind-mount from stateful/var_overlay. setfiles
will skip directories on a different device.

This change umounts ${rootfs}/var so setfiles can correctly label
var in rootfs, instead of skipping var.
During boot-time, /var is mounted as encrypted stateful partition,
and labelled as cros_var. But besides the var in encrypted stateful
partition, we also need origional var in rootfs to be correctly

TEST=boot, umount /var; ls -Zd /var

Change-Id: If54e441ac786e5c3c648833ea76bf20211151f8f
Commit-Ready: Qijiang Fan <>
Tested-by: Qijiang Fan <>
Reviewed-by: Mike Frysinger <>
4 files changed