From 6cc352f4fa0ddef9f698b0e73dcd70c24701921c Mon Sep 17 00:00:00 2001 From: Sonny Rao Date: Thu, 1 Feb 2018 17:49:01 -0800 Subject: [PATCH] crosvm: move kernel_cmdline to it's own crate We'll want architecture code to be able to supply and manipulate Linux kernel command lines, so let's move this out to it's own crate and export the interfaces. BUG=chromium:797868 TEST=./build_test passes on all architectures TEST=crosvm runs on caroline Change-Id: I94904055ac02582a4f4d8bbb54d0f41ed14b955d Signed-off-by: Sonny Rao Reviewed-on: https://chromium-review.googlesource.com/898351 Reviewed-by: Dylan Reid --- Cargo.lock | 8 ++++++++ Cargo.toml | 1 + kernel_cmdline/Cargo.toml | 9 +++++++++ {src => kernel_cmdline/src}/kernel_cmdline.rs | 0 src/main.rs | 2 +- 5 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 kernel_cmdline/Cargo.toml rename {src => kernel_cmdline/src}/kernel_cmdline.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index 51c183c8c8..b1da8064b7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -21,6 +21,7 @@ dependencies = [ "data_model 0.1.0", "devices 0.1.0", "io_jail 0.1.0", + "kernel_cmdline 0.1.0", "kernel_loader 0.1.0", "kvm 0.1.0", "libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)", @@ -80,6 +81,13 @@ dependencies = [ "libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "kernel_cmdline" +version = "0.1.0" +dependencies = [ + "libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "kernel_loader" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index c6a5575170..50534f3a2b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,6 +17,7 @@ devices = { path = "devices" } io_jail = { path = "io_jail" } kvm = { path = "kvm" } sys_util = { path = "sys_util" } +kernel_cmdline = { path = "kernel_cmdline" } kernel_loader = { path = "kernel_loader" } libc = "=0.2.34" byteorder = "=1.1.0" diff --git a/kernel_cmdline/Cargo.toml b/kernel_cmdline/Cargo.toml new file mode 100644 index 0000000000..03c43389b7 --- /dev/null +++ b/kernel_cmdline/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "kernel_cmdline" +version = "0.1.0" + +[dependencies] +libc = "*" + +[lib] +path = "src/kernel_cmdline.rs" diff --git a/src/kernel_cmdline.rs b/kernel_cmdline/src/kernel_cmdline.rs similarity index 100% rename from src/kernel_cmdline.rs rename to kernel_cmdline/src/kernel_cmdline.rs diff --git a/src/main.rs b/src/main.rs index 42481956f8..6e5885aa0b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,6 +11,7 @@ extern crate kvm; #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] extern crate x86_64; extern crate kernel_loader; +extern crate kernel_cmdline; extern crate byteorder; extern crate net_util; extern crate qcow; @@ -21,7 +22,6 @@ extern crate vm_control; extern crate data_model; pub mod argument; -pub mod kernel_cmdline; pub mod device_manager; pub mod linux;