cmdline

package
v0.0.0-...-ad77c74 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2020 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(cmdline string) map[string]*Mount

Parse attempts to find rbd options from input kernel cmdline and return one or more Images. Only JSON formats below is implemented.

rbd.<name>... where <name> is an arbitrary string identifer for the mount rbd.root.image=test-image1 rbd.root.image.pool=rbd rbd.root.image.mons=192.168.0.1,192.168.0.2,192.168.0.3:6789 rbd.root.image.user=admin rbd.root.image.secret=<key>

Optional rbd.root.image.snap=snap1 rbd.root.image.opts=rw,share rbd.root.part=1 rbd.root.mntopts=defaults rbd.root.fstype=ext4 rbd.root.overlay=false rbd.root.path=/newroot

JSON rbd={"root": {"image":{"mons": ["192.168.0.1","192.168.0.2","192.168.0.3:6789"], "opts":{"name": "admin", "secret": "AQAvjX9eabfZAhAAj/g5nXSe/uaemYGCu1w53Q=="}, "pool":"rbd", "image":"test-image1"}, "path":"/newroot", "fstype":"ext4"}} rbd.root={"image":{"mons": ["192.168.0.1","192.168.0.2","192.168.0.3:6789"], "opts":{"name": "admin", "secret": "AQAvjX9eabfZAhAAj/g5nXSe/uaemYGCu1w53Q=="}, "pool":"rbd", "image":"test-image1"}, "path":"/newroot", "fstype":"ext4"}

func Read

func Read(path string) ([]byte, error)

Read open and returns all of the contents of the provided file.

Types

type Mount

type Mount struct {
	Image     *krbd.Image
	MountOpts string `json:"mntopts"`
	Part      string
	Overlay   bool
	Path      string
	Fstype    string
}

Mount is filesystem mount specification including Ceph RBD Image mapping configuration which was generated via parsed data from the kernel cmdline.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL