Skip to content

Commit 88c3b4d

Browse files
authored
Merge pull request #163 from Burning1020/fix-image
task: ignore not exist kernel param
2 parents 9ecee15 + 3ac32b1 commit 88c3b4d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

vmm/scripts/image/build_image.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ create_disk() {
339339
# The partition is the rootfs content
340340
info "Creating partitions"
341341
parted -s -a optimal "${image}" -- \
342-
mklabel msdos \
342+
mklabel gpt \
343343
mkpart primary "${fs_type}" "${part_start}"M "${rootfs_end}"M
344344

345345
OK "Partitions created"

vmm/task/src/main.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ lazy_static! {
314314
// allocate more memory than is physically available
315315
map.insert("/proc/sys/vm/overcommit_memory", "1");
316316

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

330330
// Set default sysctl
331331
for sysctl in DEFAULT_SYSCTL.iter() {
332+
if !Path::new(&sysctl.0).exists() {
333+
continue;
334+
}
332335
tokio::fs::write(&sysctl.0, &sysctl.1)
333336
.await
334-
.map_err(io_error!(e, "failed to set cgroup hierarchy to 1"))?;
337+
.map_err(io_error!(e, "failed to write kernel parameter "))?;
335338
}
336339

337340
Ok(())

0 commit comments

Comments
 (0)