Skip to content

Commit

Permalink
Merge pull request #163 from Burning1020/fix-image
Browse files Browse the repository at this point in the history
task: ignore not exist kernel param
  • Loading branch information
abel-von authored Aug 16, 2024
2 parents 9ecee15 + 3ac32b1 commit 88c3b4d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion vmm/scripts/image/build_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ create_disk() {
# The partition is the rootfs content
info "Creating partitions"
parted -s -a optimal "${image}" -- \
mklabel msdos \
mklabel gpt \
mkpart primary "${fs_type}" "${part_start}"M "${rootfs_end}"M

OK "Partitions created"
Expand Down
7 changes: 5 additions & 2 deletions vmm/task/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ lazy_static! {
// allocate more memory than is physically available
map.insert("/proc/sys/vm/overcommit_memory", "1");

// Enable automatic expiration of nodest connections
// Enable automatic expiration of nodest connections in IPVS
map.insert("/proc/sys/net/ipv4/vs/expire_nodest_conn", "1");
map
};
Expand All @@ -329,9 +329,12 @@ async fn init_vm_rootfs() -> Result<()> {

// Set default sysctl
for sysctl in DEFAULT_SYSCTL.iter() {
if !Path::new(&sysctl.0).exists() {
continue;
}
tokio::fs::write(&sysctl.0, &sysctl.1)
.await
.map_err(io_error!(e, "failed to set cgroup hierarchy to 1"))?;
.map_err(io_error!(e, "failed to write kernel parameter "))?;
}

Ok(())
Expand Down

0 comments on commit 88c3b4d

Please sign in to comment.