已合并
dflow、ge-compiler、ge-executor安装权限规范统一 #4546
qinhan创建于 27 天前
dflow、ge-compiler、ge-executor安装权限规范统一 #4546
已合并
共 8 个文件变更+2-80
| @@ -13,8 +13,8 @@ if(NOT PROJECT_SOURCE_DIR) | |||
| 13 | else() | 13 | else() |
| 14 | include(FetchContent) | 14 | include(FetchContent) |
| 15 | 15 | ||
| 16 | - set(CANN_CMAKE_TAG "master-052") # CANN_CMAKE_TAG变量会在scripts/download_third_party_source.sh中用到,确保这个变量存在 | 16 | + set(CANN_CMAKE_TAG "master-054") # CANN_CMAKE_TAG变量会在scripts/download_third_party_source.sh中用到,确保这个变量存在 |
| 17 | - set(CANN_CMAKE_SHA256 "beea3a50b100da2e1d87a4c3bd649b6c7fc033b8314dda28b03a74af705993ed") | 17 | + set(CANN_CMAKE_SHA256 "43fb1a2cb376192bb307bd4003c0c4bd82ab66a7eb62d3ddfa9f70f988b7ff18") |
| 18 | if(CANN_3RD_LIB_PATH AND EXISTS "${CANN_3RD_LIB_PATH}/cmake-${CANN_CMAKE_TAG}.tar.gz") | 18 | if(CANN_3RD_LIB_PATH AND EXISTS "${CANN_3RD_LIB_PATH}/cmake-${CANN_CMAKE_TAG}.tar.gz") |
| 19 | FetchContent_Declare( | 19 | FetchContent_Declare( |
| 20 | cann-cmake | 20 | cann-cmake |
| @@ -354,19 +354,4 @@ fi | |||
| 354 | 354 | ||
| 355 | clear_kernel_cache_dir | 355 | clear_kernel_cache_dir |
| 356 | 356 | ||
| 357 | -# copy_all模式下do_chmod_file_dir跳过了copy类型文件的chmod, | ||
| 358 | -# 需要在此处补充设置文件权限 | ||
| 359 | -if [ -n "${common_parse_dir}" ]; then | ||
| 360 | - local_arch="$(ls -d ${common_parse_dir}/*-linux 2>/dev/null | head -1 | xargs basename 2>/dev/null | cut -d'-' -f1)" | ||
| 361 | - chmod 440 "${common_parse_dir}/compat/cann-udf-compat.tar.gz" 2>/dev/null | ||
| 362 | - chmod 550 "${common_parse_dir}/${local_arch}-linux/lib64/libbuilt_in_flowfunc.so" 2>/dev/null | ||
| 363 | - chmod 550 "${common_parse_dir}/${local_arch}-linux/lib64/libflow_func.so" 2>/dev/null | ||
| 364 | - chmod 550 "${common_parse_dir}/${local_arch}-linux/lib64/libreader_writer.so" 2>/dev/null | ||
| 365 | - chmod 550 "${common_parse_dir}/${local_arch}-linux/lib64/libudf_dump.so" 2>/dev/null | ||
| 366 | - chmod 550 "${common_parse_dir}/${local_arch}-linux/lib64/libudf_profiling.so" 2>/dev/null | ||
| 367 | - chmod 550 "${common_parse_dir}/${local_arch}-linux/devlib/device/libflow_func.so" 2>/dev/null | ||
| 368 | - chmod 550 "${common_parse_dir}/${local_arch}-linux/devlib/linux/${local_arch}/libflow_func.so" 2>/dev/null | ||
| 369 | - chmod 550 "${common_parse_dir}/${local_arch}-linux/lib64/stub/linux/${local_arch}/libflow_func.so" 2>/dev/null | ||
| 370 | -fi | ||
| 371 | - | ||
| 372 | exit 0 | 357 | exit 0 |
| @@ -94,13 +94,6 @@ chmod_end() { | |||
| 94 | current_install_path="$current_install_path/$pkg_version_dir" | 94 | current_install_path="$current_install_path/$pkg_version_dir" |
| 95 | fi | 95 | fi |
| 96 | 96 | ||
| 97 | - # data dir/file permission | ||
| 98 | - chmod_single_dir "$default_dir/ascend_install.info" 640 file 2> /dev/null | ||
| 99 | - chmod_single_dir "$default_dir/version.info" 440 file 2> /dev/null | ||
| 100 | - chmod_single_dir "$default_dir/scene.info" 640 file 2> /dev/null | ||
| 101 | - chmod_single_dir "$default_dir" 750 dir 2> /dev/null | ||
| 102 | - chmod_single_dir "$default_dir/script" 550 dir 2> /dev/null | ||
| 103 | - chmod_recur "$default_dir/script" 550 file 2> /dev/null | ||
| 104 | chown -R "$username":"$usergroup" "$default_dir" 2> /dev/null | 97 | chown -R "$username":"$usergroup" "$default_dir" 2> /dev/null |
| 105 | if [ $(id -u) -eq 0 ]; then | 98 | if [ $(id -u) -eq 0 ]; then |
| 106 | chown "root:root" "$default_dir" 2> /dev/null | 99 | chown "root:root" "$default_dir" 2> /dev/null |
| @@ -525,7 +518,6 @@ update_version_info_version() { | |||
| 525 | cp -f "$pkg_version_path" "$default_dir" | 518 | cp -f "$pkg_version_path" "$default_dir" |
| 526 | log "INFO" "Base version set successfully!" | 519 | log "INFO" "Base version set successfully!" |
| 527 | fi | 520 | fi |
| 528 | - chmod_single_dir "$default_dir/version.info" 440 file >> /dev/null 2>&1 | ||
| 529 | } | 521 | } |
| 530 | 522 | ||
| 531 | log_base_version() { | 523 | log_base_version() { |
| @@ -360,13 +360,4 @@ if [ $? -ne 0 ]; then | |||
| 360 | exit 1 | 360 | exit 1 |
| 361 | fi | 361 | fi |
| 362 | 362 | ||
| 363 | -# copy_all模式下do_chmod_file_dir跳过了copy类型文件的chmod, | ||
| 364 | -# 需要在此处补充设置文件权限 | ||
| 365 | -if [ -n "${common_parse_dir}" ]; then | ||
| 366 | - chmod 550 "${common_parse_dir}/fwkacllib/lib64/switch_by_index.o" 2>/dev/null | ||
| 367 | - chmod 640 "${common_parse_dir}/${pkg_arch_name}-linux/lib64/plugin/opskernel/config/init.conf" 2>/dev/null | ||
| 368 | - chmod 550 "${common_parse_dir}/${pkg_arch_name}-linux/python/func2graph/func2graph.py" 2>/dev/null | ||
| 369 | - chmod 444 "${common_parse_dir}/${pkg_arch_name}-linux/lib64/"ge_py_pass_bridge-*.whl 2>/dev/null | ||
| 370 | -fi | ||
| 371 | - | ||
| 372 | exit 0 | 363 | exit 0 |
| @@ -79,7 +79,6 @@ create_stub_softlink() { | |||
| 79 | for lib in $(get_stub_libs_from_filelist); do | 79 | for lib in $(get_stub_libs_from_filelist); do |
| 80 | [ -f "$lib" ] && ln -sf "$lib" "$(basename $lib)" | 80 | [ -f "$lib" ] && ln -sf "$lib" "$(basename $lib)" |
| 81 | done | 81 | done |
| 82 | - chmod u-w . | ||
| 83 | }) | 82 | }) |
| 84 | } | 83 | } |
| 85 | 84 | ||
| @@ -91,7 +90,6 @@ remove_stub_softlink() { | |||
| 91 | local arch_name="$pkg_arch_name" | 90 | local arch_name="$pkg_arch_name" |
| 92 | ([ -d "$install_path/${arch_name}-linux/devlib" ] && cd "$install_path/${arch_name}-linux/devlib" && { | 91 | ([ -d "$install_path/${arch_name}-linux/devlib" ] && cd "$install_path/${arch_name}-linux/devlib" && { |
| 93 | chmod u+w . && get_stub_libs_from_filelist | while read -r line; do basename "$line"; done | xargs rm -rf | 92 | chmod u+w . && get_stub_libs_from_filelist | while read -r line; do basename "$line"; done | xargs rm -rf |
| 94 | - chmod u-w . | ||
| 95 | }) | 93 | }) |
| 96 | } | 94 | } |
| 97 | 95 | ||
| @@ -95,38 +95,6 @@ chmod_end() { | |||
| 95 | current_install_path="$current_install_path/$pkg_version_dir" | 95 | current_install_path="$current_install_path/$pkg_version_dir" |
| 96 | fi | 96 | fi |
| 97 | 97 | ||
| 98 | - # data dir/file permission | ||
| 99 | - chmod_recur "$default_dir/python" 750 dir | ||
| 100 | - chmod_recur "$current_install_path/python" 750 dir | ||
| 101 | - | ||
| 102 | - if [ "$pylocal" = "y" ]; then | ||
| 103 | - local ge_python_pass_artifacts="$current_install_path/python/site-packages/ge/passes/python_pass_artifacts" | ||
| 104 | - mkdir -p "$ge_python_pass_artifacts" 2> /dev/null | ||
| 105 | - chmod_recur "$current_install_path/python/site-packages/llm_datadist_v1" 550 dir | ||
| 106 | - chmod_recur "$current_install_path/python/site-packages/llm_datadist_v1" 550 file | ||
| 107 | - chmod_recur "$current_install_path/python/site-packages/llm_datadist_v1-0.0.1.dist-info" 550 dir | ||
| 108 | - chmod_recur "$current_install_path/python/site-packages/llm_datadist_v1-0.0.1.dist-info" 550 file | ||
| 109 | - chmod_recur "$current_install_path/python/site-packages/dataflow" 550 dir | ||
| 110 | - chmod_recur "$current_install_path/python/site-packages/dataflow" 550 file | ||
| 111 | - chmod_recur "$current_install_path/python/site-packages/dataflow-0.0.1.dist-info" 550 dir | ||
| 112 | - chmod_recur "$current_install_path/python/site-packages/dataflow-0.0.1.dist-info" 550 file | ||
| 113 | - chmod_recur "$current_install_path/python/site-packages/ge" 550 dir | ||
| 114 | - chmod_recur "$current_install_path/python/site-packages/ge" 550 file | ||
| 115 | - chmod_recur "$ge_python_pass_artifacts" 750 dir | ||
| 116 | - chmod_recur "$ge_python_pass_artifacts" 550 file | ||
| 117 | - chmod_recur "$current_install_path/python/site-packages/ge_py-0.0.1.dist-info" 550 dir | ||
| 118 | - chmod_recur "$current_install_path/python/site-packages/ge_py-0.0.1.dist-info" 550 file | ||
| 119 | - chmod_recur "$current_install_path/python/site-packages/ge_py_pass_bridge-0.0.1.dist-info" 550 dir | ||
| 120 | - chmod_recur "$current_install_path/python/site-packages/ge_py_pass_bridge-0.0.1.dist-info" 550 file | ||
| 121 | - chmod_recur "$current_install_path/python/site-packages/LICENSE" 440 file | ||
| 122 | - fi | ||
| 123 | - | ||
| 124 | - chmod_single_dir "$default_dir/ascend_install.info" 640 file 2> /dev/null | ||
| 125 | - chmod_single_dir "$default_dir/version.info" 440 file 2> /dev/null | ||
| 126 | - chmod_single_dir "$default_dir/scene.info" 640 file 2> /dev/null | ||
| 127 | - chmod_single_dir "$default_dir" 750 dir 2> /dev/null | ||
| 128 | - chmod_single_dir "$default_dir/script" 550 dir 2> /dev/null | ||
| 129 | - chmod_recur "$default_dir/script" 550 file 2> /dev/null | ||
| 130 | chown -R "$username":"$usergroup" "$default_dir" 2> /dev/null | 98 | chown -R "$username":"$usergroup" "$default_dir" 2> /dev/null |
| 131 | if [ $(id -u) -eq 0 ]; then | 99 | if [ $(id -u) -eq 0 ]; then |
| 132 | chown "root:root" "$default_dir" 2> /dev/null | 100 | chown "root:root" "$default_dir" 2> /dev/null |
| @@ -551,7 +519,6 @@ update_version_info_version() { | |||
| 551 | cp -f "$pkg_version_path" "$default_dir" | 519 | cp -f "$pkg_version_path" "$default_dir" |
| 552 | log "INFO" "Base version set successfully!" | 520 | log "INFO" "Base version set successfully!" |
| 553 | fi | 521 | fi |
| 554 | - chmod_single_dir "$default_dir/version.info" 440 file >> /dev/null 2>&1 | ||
| 555 | } | 522 | } |
| 556 | 523 | ||
| 557 | log_base_version() { | 524 | log_base_version() { |
| @@ -79,7 +79,6 @@ create_stub_softlink() { | |||
| 79 | for lib in $(get_stub_libs_from_filelist); do | 79 | for lib in $(get_stub_libs_from_filelist); do |
| 80 | [ -f "$lib" ] && ln -sf "$lib" "$(basename $lib)" | 80 | [ -f "$lib" ] && ln -sf "$lib" "$(basename $lib)" |
| 81 | done | 81 | done |
| 82 | - chmod u-w . | ||
| 83 | }) | 82 | }) |
| 84 | } | 83 | } |
| 85 | 84 | ||
| @@ -91,7 +90,6 @@ remove_stub_softlink() { | |||
| 91 | local arch_name="$pkg_arch_name" | 90 | local arch_name="$pkg_arch_name" |
| 92 | ([ -d "$install_path/${arch_name}-linux/devlib" ] && cd "$install_path/${arch_name}-linux/devlib" && { | 91 | ([ -d "$install_path/${arch_name}-linux/devlib" ] && cd "$install_path/${arch_name}-linux/devlib" && { |
| 93 | chmod u+w . && get_stub_libs_from_filelist | while read -r line; do basename "$line"; done | xargs rm -rf | 92 | chmod u+w . && get_stub_libs_from_filelist | while read -r line; do basename "$line"; done | xargs rm -rf |
| 94 | - chmod u-w . | ||
| 95 | }) | 93 | }) |
| 96 | } | 94 | } |
| 97 | 95 | ||
| @@ -126,7 +124,6 @@ create_acl_empty_headers() { | |||
| 126 | for header in acl_base_mdl.h acl_mdl.h acl_op.h; do | 124 | for header in acl_base_mdl.h acl_mdl.h acl_op.h; do |
| 127 | gen_acl_header "$acl_headers_dir/$header" | 125 | gen_acl_header "$acl_headers_dir/$header" |
| 128 | done | 126 | done |
| 129 | - chmod u-w "$acl_headers_dir" | ||
| 130 | fi | 127 | fi |
| 131 | } | 128 | } |
| 132 | 129 | ||
| @@ -94,13 +94,6 @@ chmod_end() { | |||
| 94 | current_install_path="$current_install_path/$pkg_version_dir" | 94 | current_install_path="$current_install_path/$pkg_version_dir" |
| 95 | fi | 95 | fi |
| 96 | 96 | ||
| 97 | - # data dir/file permission | ||
| 98 | - chmod_single_dir "$default_dir/ascend_install.info" 640 file 2> /dev/null | ||
| 99 | - chmod_single_dir "$default_dir/version.info" 440 file 2> /dev/null | ||
| 100 | - chmod_single_dir "$default_dir/scene.info" 640 file 2> /dev/null | ||
| 101 | - chmod_single_dir "$default_dir" 750 dir 2> /dev/null | ||
| 102 | - chmod_single_dir "$default_dir/script" 550 dir 2> /dev/null | ||
| 103 | - chmod_recur "$default_dir/script" 550 file 2> /dev/null | ||
| 104 | chown -R "$username":"$usergroup" "$default_dir" 2> /dev/null | 97 | chown -R "$username":"$usergroup" "$default_dir" 2> /dev/null |
| 105 | if [ $(id -u) -eq 0 ]; then | 98 | if [ $(id -u) -eq 0 ]; then |
| 106 | chown "root:root" "$default_dir" 2> /dev/null | 99 | chown "root:root" "$default_dir" 2> /dev/null |
| @@ -525,7 +518,6 @@ update_version_info_version() { | |||
| 525 | cp -f "$pkg_version_path" "$default_dir" | 518 | cp -f "$pkg_version_path" "$default_dir" |
| 526 | log "INFO" "Base version set successfully!" | 519 | log "INFO" "Base version set successfully!" |
| 527 | fi | 520 | fi |
| 528 | - chmod_single_dir "$default_dir/version.info" 440 file >> /dev/null 2>&1 | ||
| 529 | } | 521 | } |
| 530 | 522 | ||
| 531 | log_base_version() { | 523 | log_base_version() { |