github.com/naohirotamura/u-root@v7.0.0+incompatible/cmds/core/mount/mount_plan9.go (about)

     1  // Copyright 2012-2020 the u-root Authors. All rights reserved
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // +build plan9
     6  
     7  // Mount mounts servename on old, with an optional keypattern spec
     8  //
     9  // Synopsis:
    10  //	 mount [ option ... ] servename old [ spec ]
    11  //
    12  // Description:
    13  //	Mount modifies the name space of the current
    14  //	process and other processes in the same name space group
    15  //	(see https://9p.io/magic/man2html/1/bind).
    16  //
    17  // Options:
    18  //	–b:	Both files must be directories. Add the new directory to the beginning of the union directory represented by the old file.
    19  //	–a:	Both files must be directories. Add the new directory to the end of the union directory represented by the old file.
    20  //	–c:	This can be used in addition to any of the above to permit creation in a union directory.
    21  //		When a new file is created in a union directory, it is placed in the first element of the union that has been bound or mounted with the –c flag.
    22  //		If that directory does not have write permission, the create fails.
    23  //	-C:	By default, file contents are always retrieved from the server.
    24  //		With this option, the kernel may instead use a local cache to satisfy read(5) requests for files accessible through this mount point.
    25  package main
    26  
    27  import (
    28  	"log"
    29  	"os"
    30  
    31  	"github.com/u-root/u-root/pkg/namespace"
    32  )
    33  
    34  func main() {
    35  	mod, err := namespace.ParseArgs(os.Args)
    36  	if err != nil {
    37  		log.Fatal(err)
    38  	}
    39  	if err := mod.Modify(namespace.DefaultNamespace, &namespace.Builder{}); err != nil {
    40  		log.Fatal(err)
    41  	}
    42  }