Skip to content

Commit 8c700b5

Browse files
committed
example(elf2uki): add example to CI
1 parent 8503529 commit 8c700b5

File tree

5 files changed

+32
-0
lines changed

5 files changed

+32
-0
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ jobs:
4949
# Install dependencies for build & test
5050
sudo apt-get update -y
5151
sudo apt-get install -y faketime protobuf-compiler libsgx-dcap-ql-dev clang-18 musl-tools gcc-multilib
52+
# ukify tool for elf2uki
53+
sudo apt install systemd-ukify
5254
5355
- name: Setup Rust toolchain
5456
run: |
@@ -132,3 +134,6 @@ jobs:
132134

133135
- name: snmalloc correntness test
134136
run: cd ./examples/mem-correctness-test && cargo run
137+
138+
- name: Run elf2uki example
139+
run: ./examples/elf2uki/convert_hello_world.sh

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ members = [
4141
]
4242
exclude = [
4343
"examples/backtrace_panic",
44+
"examples/elf2uki",
4445
"examples/mpsc-crypto-mining",
4546
"examples/tls",
4647
"examples/unit_tests",
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
set -x
4+
5+
source_dir=$(dirname "${BASH_SOURCE[0]}")
6+
app_dir="$source_dir/hello_world"
7+
8+
pushd "$app_dir"
9+
#builds statically linked bin for `musl`
10+
cargo -q build --release
11+
popd
12+
13+
# build UKI and write it to `/dev/null`
14+
cargo -q run -p elf2uki -- \
15+
--app "$app_dir/target/x86_64-unknown-linux-musl/release/hello_world" \
16+
--cmdline "console=ttyS0 earlyprintk=serial" \
17+
--output /dev/null
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[package]
2+
name = "hello_world"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[dependencies]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
println!("Hello, world!");
3+
}

0 commit comments

Comments
 (0)