rootfs.py: merge changes from updated rootfs.py upstream

While building with updated poky layer, I noticed this build failure during do_rootfs task because the upstream version of rootfs.py has been recently updated and our local copy of rootfs.py needed those changes as well. This fix will be required after the next layer update.