dettrace icon indicating copy to clipboard operation
dettrace copied to clipboard

get rid of --working-dir and --fs-chroot

Open wangbj opened this issue 6 years ago • 3 comments

Both --working-dir and --fs-chroot seems to be workarounds for chrooted environment, such as DRB builds. --fs-chroot is rarely used, and it seems to have confusing meaning as to --already-in-chroot.

--working-dir by default is PATH_TO_DETTRACE/.., if it is not specified in comdline, then PATH_TO_DETTRACE/.. would be bind mounted to /build for the tracees. otherwise it would be working-dir-vaue => /build. Both doesn't seem intuitive, because it's not clear what's the intrinsic meaning of /build?

Since we're still revamping the cmdline, I suppose we can introduce --mount-home=home_dir_to_mount instead, by default we mounts host $HOME to tracees's $HOME (like /root). In this way we don't mount unintended directories by surprise, and we don't have to create new directory like /build.

What you guys think?

wangbj avatar Sep 17 '19 01:09 wangbj

Wait, I thought you were going to propose to get rid of -fs-minimal-host (ad-hoc DRB mode), not the ability to chroot. But for both these features, it's fair to ask how they could be reconstituted using more general capabilities.

  • --fs-chroot: subsume with an --already-in-chroot style option and let the user do the chroot. How much is really saved by a convenience feature that "does the chroot for you"? (CC @gatoWololo)
  • --fs-minimal-host: add a general --volume option, and then reconstitute the DRB pile-o-hacks not as baked into DT, but as a driver script that provides "root"/initramfs (base image), and then mounts a limited set of host dirs -v /usr -v /bin ....

Are things like --mount-home really any easier to implement than a full, Docker-style --volume?

Anyway, if it's factored out as a separate DRB script, that could use whatever policy it likes for mounting the package to /build or $HOME or whatever...

rrnewton avatar Sep 17 '19 15:09 rrnewton

Not any easier, I suppose we can add something like:

--mount src=mount_src,dst=mount_dst,type=xxx

just like docker.

wangbj avatar Sep 17 '19 17:09 wangbj

Actually, I think using -v,--volume can be easier to parse with cxxopts, accepted flag(s):

-v x, -v x:y, --volume x, --volume x:y

x will be bind mounted to y inside tracees.

wangbj avatar Sep 17 '19 21:09 wangbj