From 034b1f425150e39cccec2565905b16f5dba31ba7 Mon Sep 17 00:00:00 2001 From: spiritlhl <103393591+spiritLHLS@users.noreply.github.com> Date: Sun, 30 Jul 2023 14:19:28 +0000 Subject: [PATCH] Update --- README.md | 1 - scripts/build_backend.sh | 47 +++++++++++++++++++--------------------- 2 files changed, 22 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 4780c8f..495cdfb 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,6 @@ - 适配了ARM架构且已在hz的ARM机器上测试(Debian11及其更旧的系统)无问题,感谢[Proxmox-Arm64](https://github.com/jiangcuo/Proxmox-Arm64)提供的第三方补丁,本项目目前支持X86_64架构和ARM架构了 - 修改部分附加文件的存储位置至于```/usr/local/bin/```目录下 - CN的IP检测增加一个检测源,对CN的特殊处理增加对APT源的特殊处理 -- 暂时去除AppArmor模块的检测和自动安装 [更新日志](CHANGELOG.md) diff --git a/scripts/build_backend.sh b/scripts/build_backend.sh index 4e8abad..09375a7 100644 --- a/scripts/build_backend.sh +++ b/scripts/build_backend.sh @@ -86,31 +86,28 @@ else fi fi -# # 检测AppArmor模块 -# if ! dpkg -s apparmor > /dev/null 2>&1; then -# _green "AppArmor is being installed..." -# _green "正在安装 AppArmor..." -# apt-get update -# apt-get install -y apparmor -# fi -# if [ $? -ne 0 ]; then -# apt-get install -y apparmor --fix-missing -# fi -# if ! systemctl is-active --quiet apparmor.service; then -# _green "Starting the AppArmor service..." -# _green "启动 AppArmor 服务..." -# systemctl enable apparmor.service -# systemctl start apparmor.service -# fi -# if ! lsmod | grep -q apparmor; then -# _green "Loading AppArmor kernel module..." -# _green "正在加载 AppArmor 内核模块..." -# modprobe apparmor -# fi -# if ! lsmod | grep -q apparmor; then -# _yellow "AppArmor is still not loaded, please execute reboot to reboot the system to load" -# _yellow "AppArmor 仍未加载,请执行 reboot 重新启动系统加载" -# fi +# 检测AppArmor模块 +if ! dpkg -s apparmor > /dev/null 2>&1; then + _green "AppArmor is being installed..." + _green "正在安装 AppArmor..." + apt-get update + apt-get install -y apparmor +fi +if [ $? -ne 0 ]; then + apt-get install -y apparmor --fix-missing +fi +if ! systemctl is-active --quiet apparmor.service; then + _green "Starting the AppArmor service..." + _green "启动 AppArmor 服务..." + systemctl enable apparmor.service + systemctl start apparmor.service +fi +if ! lsmod | grep -q apparmor; then + _green "Loading AppArmor kernel module..." + _green "正在加载 AppArmor 内核模块..." + modprobe apparmor +fi +sleep 3 _yellow "Please execute reboot to reboot the system to load the PVE kernel." _yellow "请执行 reboot 重新启动系统加载PVE内核" echo "1" > "/root/build_backend_pve.txt"