Skip to content

Commit

Permalink
Match-id-25d9ee7579f7fb6cf2e131cb605241b1b6223b98
Browse files Browse the repository at this point in the history
  • Loading branch information
BianTanggui committed Mar 21, 2023
1 parent e40c2c0 commit 79197af
Show file tree
Hide file tree
Showing 13 changed files with 171 additions and 723 deletions.
1 change: 1 addition & 0 deletions build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ function copy_file_output()
/bin/cp -f scripts/uninstall.sh run_pkg
/bin/cp -f scripts/base.list run_pkg
/bin/cp -f scripts/base.list_A500 run_pkg
/bin/cp -f scripts/base.list_A500A2 run_pkg
/bin/cp -f scripts/base.list_A200 run_pkg
/bin/cp -f scripts/base.list_A200ISoC run_pkg

Expand Down
38 changes: 38 additions & 0 deletions build/scripts/base.list_A500A2
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/usr/local/Ascend/driver/lib64
/usr/local/sbin/npu-smi
/etc/sys_version.conf
/etc/ld.so.conf.d/mind_so.conf
/etc/slog.conf
/etc/hdcBasic.cfg
/etc/ascend_install.info
/var/dmp_daemon
/var/davinci/driver/version.info
/var/slogd
/usr/lib64/libsemanage.so.2
/usr/lib64/libmmpa.so
/usr/lib64/libcrypto.so.1.1
/usr/lib64/libdrvdsmi.so
/usr/lib64/libdcmi.so
/usr/lib64/libstackcore.so
/usr/lib64/libascend_drvdmp.so
/usr/lib64/libdsmiproduct.so
/usr/lib64/libiam.so.1
/usr/lib64/libascend_drv_baselib.so
/usr/lib64/libascend_hal.so
/usr/lib64/libslog.so
/usr/lib64/libc_sec.so
/usr/lib64/libascend_drvupgrade.so
/usr/lib64/libeasy_comm.so.1
/usr/lib64/libfault_event.so.1
/usr/lib64/libheartbeat.so
/usr/lib64/libxshmem.so.1
/usr/lib64/libdevmmap.so
/usr/lib64/libmpi_dvpp_adapter.so
/usr/lib64/libaicpu_scheduler.so
/usr/lib64/libaicpu_processer.so
/usr/lib64/libaicpu_prof.so
/usr/lib64/libaicpu_sharder.so
/usr/lib64/libadump.so
/usr/lib64/libtsd_eventclient.so
/usr/lib64/libmsprof.so
/root/hdc_ppc
2 changes: 1 addition & 1 deletion build/scripts/help.info
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
--install-path Specify the installation path (default: /usr/local/Ascend/Ascend-Docker-Runtime)
--uninstall Uninstall the installed ascend-docker-runtime tool
--upgrade Upgrade the installed ascend-docker-runtime tool
--install-type=<type> Only A500, A200ISoC and A200 need to specify the installation type of Ascend-docker-runtime (eg: --install-type=A500)
--install-type=<type> Only A500, A500A2, A200ISoC and A200 need to specify the installation type of Ascend-docker-runtime (eg: --install-type=A500)
--ce=<ce> Only iSula need to specify the container engine(eg: --ce=isula)
11 changes: 10 additions & 1 deletion build/scripts/run_main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function save_install_args() {
echo -e "path=${INSTALL_PATH}"
echo -e "build=Ascend-docker-runtime_${PACKAGE_VERSION}-$(uname -m)"
echo -e "a500=${a500}"
echo -e "a500a2=${a500a2}"
echo -e "a200=${a200}"
echo -e "a200isoc=${a200isoc}"
} >> "${INSTALL_PATH}"/ascend_docker_runtime_install.info
Expand Down Expand Up @@ -85,6 +86,8 @@ function install()
cp -f ./base.list_A200 ${ASCEND_RUNTIME_CONFIG_DIR}/base.list
elif [ "${a200isoc}" == "y" ]; then
cp -f ./base.list_A200ISoC ${ASCEND_RUNTIME_CONFIG_DIR}/base.list
elif [ "${a500a2}" == "y" ]; then
cp -f ./base.list_A500A2 ${ASCEND_RUNTIME_CONFIG_DIR}/base.list
else
cp -f ./base.list ${ASCEND_RUNTIME_CONFIG_DIR}/base.list
fi
Expand Down Expand Up @@ -164,6 +167,9 @@ function upgrade()
if [ "$(grep "a500=y" "${INSTALL_PATH}"/ascend_docker_runtime_install.info)" == "a500=y" ];then
a500=y
cp -f ./base.list_A500 ${ASCEND_RUNTIME_CONFIG_DIR}/base.list
elif [ "$(grep "a500a2=y" "${INSTALL_PATH}"/ascend_docker_runtime_install.info)" == "a500a2=y" ]; then
a500a2=y
cp -f ./base.list_A500A2 ${ASCEND_RUNTIME_CONFIG_DIR}/base.list
elif [ "$(grep "a200=y" "${INSTALL_PATH}"/ascend_docker_runtime_install.info)" == "a200=y" ]; then
a200=y
cp -f ./base.list_A200 ${ASCEND_RUNTIME_CONFIG_DIR}/base.list
Expand All @@ -189,6 +195,7 @@ UPGRADE_FLAG=n
a500=n
a200=n
a200isoc=n
a500a2=n
quiet_flag=n
ISULA=none

Expand Down Expand Up @@ -252,7 +259,7 @@ do
shift
;;
--install-type=*)
if [ "${a500}" == "y" ] || [ "${a200}" == "y" ] || [ "${a200isoc}" == "y" ]; then
if [ "${a500}" == "y" ] || [ "${a200}" == "y" ] || [ "${a200isoc}" == "y" ] || [ "${a500a2}" == "y" ]; then
echo "warning :Repeat parameter!"
exit 1
fi
Expand All @@ -263,6 +270,8 @@ do
a200=y
elif [ "$3" == "--install-type=A200ISoC" ]; then
a200isoc=y
elif [ "$3" == "--install-type=A500A2" ]; then
a500a2=y
else
echo "ERROR :Please check the parameter of --install-type=<type>"
exit 1
Expand Down
27 changes: 0 additions & 27 deletions cli/src/basic.c

This file was deleted.

15 changes: 4 additions & 11 deletions cli/src/basic.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,16 @@
#include <sys/types.h>
#include <stdint.h>
#include <limits.h>
#include <stdbool.h>

#define DEVICE_NAME "davinci"
#define VDEVICE_NAME "vdavinci"
#define DAVINCI_MANAGER "davinci_manager"
#define DEVMM_SVM "devmm_svm"
#define HISI_HDC "hisi_hdc"
#define DEFAULT_DIR_MODE 0755
#define DEFAULT_LOG_MODE 0600
#define DUMP_LOG_MODE 0400
#define DEFAULT_LOGDIR_MODE 0700
#define BUF_SIZE 1024
#define MAX_DEVICE_NR 1024
#define MAX_MOUNT_NR 512
#define WHITE_LIST_NUM 9
#define WHITE_LIST_NUM 45

#define ROOT_UID 0

Expand All @@ -55,12 +51,13 @@
} \
} while (0)

#define ALLOW_PATH "/devices.allow"
#define ROOT_GAP 4
#define FSTYPE_GAP 2
#define MOUNT_SUBSTR_GAP 2
#define ROOT_SUBSTR_GAP 2

extern bool g_allowLink;

struct PathInfo {
char* src;
size_t srcLen;
Expand All @@ -75,15 +72,11 @@ struct MountList {

struct ParsedConfig {
char rootfs[BUF_SIZE];
size_t devices[MAX_DEVICE_NR];
size_t devicesNr;
char containerNsPath[BUF_SIZE];
char cgroupPath[BUF_SIZE];
int originNsFd;
const struct MountList *files;
const struct MountList *dirs;
};

void InitParsedConfig(struct ParsedConfig *parsedConfig);

#endif
Loading

0 comments on commit 79197af

Please sign in to comment.