pmb.chroot.init: home links: create missing dirs (!1850)

When initializing the building chroots, some symlinks are created to
/mnt/pmbootstrap* dirs. With upcoming rust-related symlinks, they will
point to subdirs in /mnt/pmbootstrap-rust, such as
/mnt/pmbootstrap-rust/registry/cache. Create this directory structure if
it does not exist.
This commit is contained in:
Oliver Smith 2020-01-02 12:50:07 +01:00 committed by Daniele Debernardi
parent 02e514f4d3
commit b93e83d8b3
No known key found for this signature in database
GPG Key ID: 5782FCF5DAE9AF60
1 changed files with 2 additions and 0 deletions

View File

@ -104,6 +104,8 @@ def init(args, suffix="native"):
link_dir = os.path.dirname(link_name)
if not os.path.exists(chroot + link_dir):
pmb.chroot.user(args, ["mkdir", "-p", link_dir], suffix)
if not os.path.exists(chroot + target):
pmb.chroot.root(args, ["mkdir", "-p", target], suffix)
pmb.chroot.user(args, ["ln", "-s", target, link_name], suffix)
pmb.chroot.root(args, ["chown", "pmos:pmos", target],
suffix)