[demos] Update rootfs mount API called in demos
This commit is contained in:
parent
13153504f3
commit
09ca34182e
@ -63,7 +63,10 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
|
|
||||||
// Mount the image
|
// Mount the image
|
||||||
const SYS_MOUNT_FS: i64 = 363;
|
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 {
|
if ret < 0 {
|
||||||
return Err(Box::new(std::io::Error::last_os_error()));
|
return Err(Box::new(std::io::Error::last_os_error()));
|
||||||
}
|
}
|
||||||
|
@ -130,8 +130,8 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
const SYS_MOUNT_FS: i64 = 363;
|
const SYS_MOUNT_FS: i64 = 363;
|
||||||
// User can provide valid path for runtime mount and boot
|
// User can provide valid path for runtime mount and boot
|
||||||
// Otherwise, just pass null pointer to do general mount and boot
|
// Otherwise, just pass null pointer to do general mount and boot
|
||||||
let root_config_path: *const i8 = std::ptr::null();
|
let rootfs_config: *const i8 = std::ptr::null();
|
||||||
let ret = unsafe { syscall(SYS_MOUNT_FS, key_ptr, root_config_path) };
|
let ret = unsafe { syscall(SYS_MOUNT_FS, key_ptr, rootfs_config) };
|
||||||
if ret < 0 {
|
if ret < 0 {
|
||||||
return Err(Box::new(std::io::Error::last_os_error()));
|
return Err(Box::new(std::io::Error::last_os_error()));
|
||||||
}
|
}
|
||||||
|
@ -93,8 +93,8 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
const SYS_MOUNT_FS: i64 = 363;
|
const SYS_MOUNT_FS: i64 = 363;
|
||||||
// User can provide valid path for runtime mount and boot
|
// User can provide valid path for runtime mount and boot
|
||||||
// Otherwise, just pass null pointer to do general mount and boot
|
// Otherwise, just pass null pointer to do general mount and boot
|
||||||
let root_config_path: *const i8 = std::ptr::null();
|
let rootfs_config: *const i8 = std::ptr::null();
|
||||||
let ret = unsafe { syscall(SYS_MOUNT_FS, key_ptr, root_config_path) };
|
let ret = unsafe { syscall(SYS_MOUNT_FS, key_ptr, rootfs_config) };
|
||||||
if ret < 0 {
|
if ret < 0 {
|
||||||
return Err(Box::new(std::io::Error::last_os_error()));
|
return Err(Box::new(std::io::Error::last_os_error()));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user