Skip to content

studychao/dbs-cli

 
 

Repository files navigation

DBS-CLI

for more details about args: refer to doc:args

[简体中文版]

1. Examples:

See all options:

./dbs-cli --help

A simple example:

./dbs-cli \
  --kernel-path ~/path/to/kernel/vmlinux.bin \
  --rootfs ~/path/to/rootfs/rootfs.dmg \
  --boot-args "console=ttyS0 tty0 reboot=k debug panic=1 pci=off root=/dev/vda1" ;

For the rootfs from firecracker:

./dbs-cli \
  --kernel-path ~/path/to/kernel/vmlinux.bin \
  --rootfs ~/path/to/rootfs/bionic.rootfs.ext4 \
  --boot-args "console=ttyS0 tty0 reboot=k debug panic=1 pci=off root=/dev/vda" ;

Set the log level and log file:

The log-level argument is case-insensitive: ErrOR and InFO are valid.

./dbs-cli \
  --log-file dbs-cli.log --log-level ERROR \
  --kernel-path ~/path/to/kernel/vmlinux.bin \
  --rootfs ~/path/to/rootfs/bionic.rootfs.ext4 \
  --boot-args "console=ttyS0 tty0 reboot=k debug panic=1 pci=off root=/dev/vda1" ;

Create a vsock console (communication with sock file)

When the parameter serial-path is not given or set to "stdio", dbs-cli will create a stdio console.

Otherwise, dbs-cli will create a vsock console with a sock file, namely the value of serial-path.

./dbs-cli \
  --log-file dbs-cli.log --log-level ERROR \
  --kernel-path ~/path/to/kernel/vmlinux.bin \
  --rootfs ~/path/to/rootfs/bionic.rootfs.ext4 \
  --boot-args "console=ttyS0 tty0 reboot=k debug panic=1 pci=off root=/dev/vda1" \
  --serial-path "/tmp/dbs" ;

2. Usage

1. Exit vm

If you want to exit vm, just input reboot in vm's console.

2. For developers

If you wish to modify some details or debug to figure out the fault of codes, you can do as follow to see whether the program act expectedly or not.

cargo run -- --kernel-path ~/path/to/kernel/vmlinux.bin \
  --rootfs ~/path/to/rootfs/rootfs.dmg \
  --boot-args "console=ttyS0 tty0 reboot=k debug panic=1 pci=off root=/dev/vda1" ;

To see some help:

cargo run -- --help

3. Some off-topic remarks

Regarding the dependency issue of the upstream library, it is recommended to build the build target of Makefile to avoid it temporally.

make build

License

DBS-CLI is licensed under Apache License, Version 2.0.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 96.7%
  • Makefile 3.3%