Add support to specify root_dir
Add three more patches