예제 #1
0
        public void RecursiveBindMount(PathName source, PathName target)
        {
            var bind = MountRun($"mount --verbose --rbind {source} {target}");

            this.mountPoints.Push(new MountPoint(target, true));

            Bash.ThrowOnError(bind);
        }
예제 #2
0
        public void ProcfsMount(PathName target)
        {
            var bind = MountRun($"mount --verbose --types proc proc {target}");

            this.mountPoints.Push(new MountPoint(target, false));

            Bash.ThrowOnError(bind);
        }
예제 #3
0
        private void UnMountOne(ChrootBox box, MountPoint mountPoint, Progress progress)
        {
            var flag = (mountPoint.Recursive ? "--recursive" : string.Empty);

            var umount = new Bash()
                         .Command($"umount --verbose {flag} {mountPoint.Path}")
                         .WithProgress(progress)
                         .Run();

            Bash.ThrowOnError(umount);
        }
예제 #4
0
        public void MountOverlay()
        {
            this.box.Base.CreateDirectory();
            this.box.Changes.CreateDirectory();
            this.box.Work.CreateDirectory();
            this.box.Merged.CreateDirectory();

            var lowerdir = $"/:{this.box.Base}:{this.box.Pogo.Root}";
            var upperdir = box.Changes;
            var workdir  = box.Work;

            var options = $"lowerdir={lowerdir},upperdir={upperdir},workdir={workdir}";
            var command = $"mount --verbose --types overlay overlay --options {options} {box.Merged}";
            var mount   = MountRun(command);

            this.mountPoints.Push(new MountPoint(box.Merged, false));

            Bash.ThrowOnError(mount);
        }