安装 Entware 软件包管理器
群晖 DSM 缺少常用软件包,且套件中心并未提供,因而需要使用额外的软件包工具来安装软件。
Entware 是一个为嵌入式设备设计的软件存储库,允许安装来自 OpenWrt 的软件包,它的包管理器为 opkg,前身是已停止维护的 Optware,包管理器为 ipkg。
[!NOTE]
该步骤事实上为可选项。为便于与官方资料同步,建议采用该标准流程进行部署。
如果跳过该步骤,请关注并参考后续步骤中相关的额外信息。不建议跳过该步骤。
1. 创建安装目录
sudo mkdir -p /volume1/@Entware/opt
2. 备份系统 /opt 附加软件包目录
sudo tar -cvpzf /opt_bakcup.tar.gz /opt
[!NOTE]
还原备份
sudo tar -xvpzf /opt_backup.tar.gz -C /
3. 删除系统 /opt 附加软件包目录
请确认已经完成备份,然后删除该命令开头处的 # 并运行。
#sudo rm -rf /opt
4. 绑定挂载 Optware 目录
sudo mkdir /opt
sudo mount -o bind "/volume1/@Entware/opt" /opt
[!NOTE]
如果绑定挂载命令无法正确运行,可以尝试创建软链接替代。
ln -s /volume1/@Entware/opt/ /opt
5. 备份 /etc/profile 系统环境配置文件
sudo cp /etc/profile /etc/profile.bak
6. 运行安装脚本
case $(uname -m) in
aarch64) url="https://bin.entware.net/aarch64-k3.10/installer/generic.sh" ;;
armv5*) url="https://bin.entware.net/armv5sf-k3.2/installer/generic.sh" ;;
armv7*) url="https://bin.entware.net/armv7sf-k3.2/installer/generic.sh" ;;
x86_64) url="https://bin.entware.net/x64-k3.2/installer/generic.sh" ;;
*) echo "Unsupported architecture"; exit 1 ;;
esac
wget -O - "$url" | sudo /bin/sh
7. 创建开机任务
sudo esynoscheduler --create task_name=Entware event=bootup enable=true 'owner={"0":"root"}' operation_type=script 'operation=#!/bin/sh
# Mount/Start Entware
mkdir -p /opt
mount -o bind "/volume1/@Entware/opt" /opt
/opt/etc/init.d/rc.unslung start
# Add Entware Profile in Global Profile
if grep -qF '/opt/etc/profile' /etc/profile; then
echo "Confirmed: Entware Profile in Global Profile"
else
echo "Adding: Entware Profile in Global Profile"
cat >> /etc/profile <<"EOF"
# Load Entware Profile
[ -r "/opt/etc/profile" ] && . /opt/etc/profile
EOF
fi
# Update Entware List
/opt/bin/opkg update'
[!NOTE]
可在 DSM 网页
控制面板 > 任务计划 处管理任务。
8. 重新启动 NAS
sudo reboot
参考来源