From 09ca34182eb486122b704364d4841cc32cc76a8b Mon Sep 17 00:00:00 2001 From: "Zheng, Qi" Date: Mon, 22 May 2023 15:50:52 +0800 Subject: [PATCH] [demos] Update rootfs mount API called in demos --- .../azure_attestation/maa_init/init/src/main.rs | 5 ++++- demos/remote_attestation/init_ra_flow/init_ra/src/main.rs | 4 ++-- example/init_ra/src/main.rs | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/demos/remote_attestation/azure_attestation/maa_init/init/src/main.rs b/demos/remote_attestation/azure_attestation/maa_init/init/src/main.rs index caca8859..6d9eb86c 100644 --- a/demos/remote_attestation/azure_attestation/maa_init/init/src/main.rs +++ b/demos/remote_attestation/azure_attestation/maa_init/init/src/main.rs @@ -63,7 +63,10 @@ fn main() -> Result<(), Box> { // Mount the image const SYS_MOUNT_FS: i64 = 363; - let ret = unsafe { syscall(SYS_MOUNT_FS, key_ptr, occlum_json_mac_ptr) }; + // User can provide valid path for runtime mount and boot + // Otherwise, just pass null pointer to do general mount and boot + let rootfs_config: *const i8 = std::ptr::null(); + let ret = unsafe { syscall(SYS_MOUNT_FS, key_ptr, rootfs_config) }; if ret < 0 { return Err(Box::new(std::io::Error::last_os_error())); } diff --git a/demos/remote_attestation/init_ra_flow/init_ra/src/main.rs b/demos/remote_attestation/init_ra_flow/init_ra/src/main.rs index d133ab73..a986ef9d 100644 --- a/demos/remote_attestation/init_ra_flow/init_ra/src/main.rs +++ b/demos/remote_attestation/init_ra_flow/init_ra/src/main.rs @@ -130,8 +130,8 @@ fn main() -> Result<(), Box> { const SYS_MOUNT_FS: i64 = 363; // User can provide valid path for runtime mount and boot // Otherwise, just pass null pointer to do general mount and boot - let root_config_path: *const i8 = std::ptr::null(); - let ret = unsafe { syscall(SYS_MOUNT_FS, key_ptr, root_config_path) }; + let rootfs_config: *const i8 = std::ptr::null(); + let ret = unsafe { syscall(SYS_MOUNT_FS, key_ptr, rootfs_config) }; if ret < 0 { return Err(Box::new(std::io::Error::last_os_error())); } diff --git a/example/init_ra/src/main.rs b/example/init_ra/src/main.rs index 930d99b9..1e609879 100644 --- a/example/init_ra/src/main.rs +++ b/example/init_ra/src/main.rs @@ -93,8 +93,8 @@ fn main() -> Result<(), Box> { const SYS_MOUNT_FS: i64 = 363; // User can provide valid path for runtime mount and boot // Otherwise, just pass null pointer to do general mount and boot - let root_config_path: *const i8 = std::ptr::null(); - let ret = unsafe { syscall(SYS_MOUNT_FS, key_ptr, root_config_path) }; + let rootfs_config: *const i8 = std::ptr::null(); + let ret = unsafe { syscall(SYS_MOUNT_FS, key_ptr, rootfs_config) }; if ret < 0 { return Err(Box::new(std::io::Error::last_os_error())); }