mirror of
https://github.com/Ascend/ascend-docker-runtime.git
synced 2025-10-11 06:50:07 +08:00
Match-id-211a5acee295801abbb9cb3fd85a2877e35002ed
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#define DAVINCI_MANAGER_PATH "/dev/davinci_manager"
|
||||
#define DEVMM_SVM_PATH "/dev/devmm_svm"
|
||||
#define HISI_HDC_PATH "/dev/hisi_hdc"
|
||||
#define ASCEND_DRIVER_PATH "/usr/local/Ascend/driver"
|
||||
#define DEFAULT_DIR_MODE 0755
|
||||
#define BUF_SIZE 1024
|
||||
#define ALLOW_PATH "/devices.allow"
|
||||
@@ -309,6 +310,18 @@ int DoCtrlDeviceMounting(const char *rootfs)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int DoDirectoryMounting(const char *rootfs)
|
||||
{
|
||||
/* directory */
|
||||
unsigned long reMountRwFlag = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NODEV | MS_NOSUID;
|
||||
int ret = MountFiles(rootfs, ASCEND_DRIVER_PATH, reMountRwFlag);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "error: failed to do mount %s\n", ASCEND_DRIVER_PATH);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int DoMounting(const struct CmdArgs *args)
|
||||
{
|
||||
int ret;
|
||||
@@ -325,6 +338,12 @@ int DoMounting(const struct CmdArgs *args)
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret = DoDirectoryMounting(args->rootfs);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "error: failed to do mount directory\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user