mirror of
https://github.com/thelittlerocket/pve.git
synced 2025-03-03 09:13:29 +08:00
Update
This commit is contained in:
parent
090a37c594
commit
74cb6c447a
2 changed files with 22 additions and 12 deletions
|
@ -16,6 +16,7 @@
|
|||
- 修复部分机器是IPV6子网前缀识别失效的问题
|
||||
- 更新Debian12安装的PVE版本为stable
|
||||
- 修复部分机器ifconfig命令不存在的问题
|
||||
- 适配部分机器ipv6网络是SLAAC动态分配的情况
|
||||
|
||||
[更新日志](CHANGELOG.md)
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
# from
|
||||
# https://github.com/spiritLHLS/pve
|
||||
# 2023.06.22
|
||||
# 2023.06.24
|
||||
|
||||
# 打印信息
|
||||
_red() { echo -e "\033[31m\033[01m$@\033[0m"; }
|
||||
|
@ -22,11 +22,14 @@ fi
|
|||
# 创建资源池
|
||||
POOL_ID="mypool"
|
||||
if pvesh get /pools/$POOL_ID > /dev/null 2>&1 ; then
|
||||
_green "Resource pool $POOL_ID already exists!"
|
||||
_green "资源池 $POOL_ID 已经存在!"
|
||||
else
|
||||
# 如果不存在则创建
|
||||
_green "Creating resource pool $POOL_ID..."
|
||||
_green "正在创建资源池 $POOL_ID..."
|
||||
pvesh create /pools --poolid $POOL_ID
|
||||
_green "Resource pool $POOL_ID has been created!"
|
||||
_green "资源池 $POOL_ID 已创建!"
|
||||
fi
|
||||
|
||||
|
@ -47,7 +50,8 @@ fi
|
|||
|
||||
# 开启硬件直通
|
||||
if [ `dmesg | grep -e DMAR -e IOMMU|wc -l` = 0 ];then
|
||||
_yellow "硬件不支持直通"
|
||||
_yellow "Hardware does not support passthrough"
|
||||
_yellow "硬件不支持直通"
|
||||
else
|
||||
if [ `cat /proc/cpuinfo|grep Intel|wc -l` = 0 ];then
|
||||
iommu="amd_iommu=on"
|
||||
|
@ -55,21 +59,23 @@ else
|
|||
iommu="intel_iommu=on"
|
||||
fi
|
||||
if [ `grep $iommu /etc/default/grub|wc -l` = 0 ];then
|
||||
sed -i 's|quiet|quiet '$iommu'|' /etc/default/grub
|
||||
update-grub
|
||||
if [ `grep "vfio" /etc/modules|wc -l` = 0 ];then
|
||||
echo 'vfio
|
||||
vfio_iommu_type1
|
||||
vfio_pci
|
||||
vfio_virqfd' >> /etc/modules
|
||||
fi
|
||||
sed -i 's|quiet|quiet '$iommu'|' /etc/default/grub
|
||||
update-grub
|
||||
if [ `grep "vfio" /etc/modules|wc -l` = 0 ];then
|
||||
echo 'vfio
|
||||
vfio_iommu_type1
|
||||
vfio_pci
|
||||
vfio_virqfd' >> /etc/modules
|
||||
fi
|
||||
else
|
||||
_green "已设置硬件直通"
|
||||
_green "Hardware passthrough is set"
|
||||
_green "已设置硬件直通"
|
||||
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
|
||||
|
@ -78,14 +84,17 @@ 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 仍未加载,请等待几分钟,然后执行 reboot 重新启动系统加载"
|
||||
_yellow "AppArmor is still not loaded, please wait 1 minute, then execute reboot to reboot the system to load"
|
||||
_yellow "AppArmor 仍未加载,请等待1分钟,然后执行 reboot 重新启动系统加载"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue