add hello-world binary
This commit is contained in:
parent
b14e4260b2
commit
42d499e76a
|
@ -2,11 +2,15 @@
|
|||
# It is not intended for manual editing.
|
||||
version = 4
|
||||
|
||||
[[package]]
|
||||
name = "hello"
|
||||
version = "0.1.0"
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.172"
|
||||
version = "0.2.174"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa"
|
||||
checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776"
|
||||
|
||||
[[package]]
|
||||
name = "nit"
|
||||
|
|
18
Cargo.toml
18
Cargo.toml
|
@ -1,12 +1,6 @@
|
|||
[package]
|
||||
name = "nit"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
|
||||
[features]
|
||||
aws = []
|
||||
default = ["aws"]
|
||||
|
||||
[dependencies]
|
||||
libc = "0.2.172"
|
||||
[workspace]
|
||||
resolver = "2"
|
||||
members = [
|
||||
"crates/nit",
|
||||
"crates/hello",
|
||||
]
|
||||
|
|
|
@ -21,6 +21,7 @@ WORKDIR /src
|
|||
RUN cargo build ${CARGOFLAGS}
|
||||
WORKDIR /build_cpio
|
||||
RUN cp /src/target/${TARGET}/release/nit init
|
||||
RUN cp /src/target/${TARGET}/release/hello hello
|
||||
ENV KBUILD_BUILD_TIMESTAMP=1
|
||||
COPY <<-EOF initramfs.list
|
||||
file /init init 0755 0 0
|
||||
|
@ -33,6 +34,7 @@ COPY <<-EOF initramfs.list
|
|||
dir /sys 0755 0 0
|
||||
dir /usr 0755 0 0
|
||||
dir /usr/bin 0755 0 0
|
||||
file /usr/bin/hello hello 0755 0 0
|
||||
dir /usr/sbin 0755 0 0
|
||||
dir /dev 0755 0 0
|
||||
dir /dev/shm 0755 0 0
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
[package]
|
||||
name = "hello"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
|
@ -0,0 +1,6 @@
|
|||
fn main() {
|
||||
println!("Hello, world!");
|
||||
loop {
|
||||
std::thread::sleep(std::time::Duration::from_secs(5));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 4
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.172"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa"
|
||||
|
||||
[[package]]
|
||||
name = "nit"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"libc",
|
||||
]
|
|
@ -0,0 +1,12 @@
|
|||
[package]
|
||||
name = "nit"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
|
||||
[features]
|
||||
aws = []
|
||||
default = ["aws"]
|
||||
|
||||
[dependencies]
|
||||
libc = "0.2.172"
|
|
@ -39,7 +39,7 @@ pub fn get_config() -> Result<Config> {
|
|||
|
||||
let platform = platform::get_current_platform(values.remove("platform").as_deref())?;
|
||||
|
||||
let target = values.remove("target").unwrap_or(String::from("/bin/sh"));
|
||||
let target = values.remove("target").unwrap_or(String::from("/usr/bin/hello"));
|
||||
|
||||
Ok(Config { platform, mode, target })
|
||||
}
|
Loading…
Reference in New Issue