Port do_rootfs to python