1. 秘技数码首页
  2. 数码搞机

Entware独立安装方法 中英文 翻译 by 悍匪.bat

项目地址:https://github.com/Entware/Entware/wiki/Install-on-Synology-NAS

Introduction

ARM & intel based devices are supported. DSM version must be 3.2 or higher. Use armv5 installer for Marvell Kirkwood mv6282 cpu, you can use armv7 installer for newer ARM cpu’s. Although armv7 repo was compiled with cortex-a9 optimization it was successfully tested on Marvell Armada XP based NAS. Use aarch64 installer for Realtek RTD129x CPU (64 bit arm).

Guide tested on Synology DS1618+ w/ DSM 6.2-23739 Update 1.

Deploying Entware

1. Create a folder on your hdd (outside rootfs)

mkdir -p /volume1/@Entware/opt

2. Remove /opt and mount optware folder

Make sure that /opt folder is empty (Optware is not installed), we will remove /opt folder with its contents at this step.

rm -rf /opt

mkdir /opt

mount -o bind “/volume1/@Entware/opt” /opt

3. Run install script depending on the processor (uname -m to know)

for armv8 (aarch64) – Realtek RTD129x 猫盘

wget -O – http://bin.entware.net/aarch64-k3.10/installer/generic.sh | /bin/sh

for armv5

wget -O – http://bin.entware.net/armv5sf-k3.2/installer/generic.sh | /bin/sh

for armv7

wget -O – http://bin.entware.net/armv7sf-k3.2/installer/generic.sh | /bin/sh

for x64 蜗牛星际

wget -O – http://bin.entware.net/x64-k3.2/installer/generic.sh | /bin/sh

4. Create Autostart Task 开机计划任务

Create a triggered user-defined task in Task Scheduler.

Goto: DSM > Control Panel > Task Scheduler

Create > Triggered Task > User Defined Script

General

Task: Entware

User: root

Event: Boot-up

Pretask: none

Task Settings

Run Command: (see bellow)

#!/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

. /opt/etc/profile

EOF

fi

# Update Entware List

/opt/bin/opkg update

6. Reboot your NAS.

Tips

Firmware update erases /opt folder. You should deploy Entware outside of rootfs and create symlink to /opt or use mount -o bind. After firmware update you may need to edit /etc/rc.local and /root/.profile files once more.

You can create task that start after Entware has loaded.

Create > Triggered Task > User Defined Script

General

Task: Entware – iperf3 Server

User: root

Event: Boot-up

Pretask: Entware (name of the other entware task)

Task Settings

Run Command: (see bellow)

# Run ( /opt/bin/iperf3 -s -D -p 5201 ) as GUEST user.

sudo -H -u guest bash -c ‘echo “I am $USER, with uid $UID”; /opt/bin/iperf3 -s -D -p 5201’

 

翻译 by 悍匪.bat

介绍

本篇说明适用于ARM和X64构架,DSM版本不能低于3.2。armv5版本适用于Marvell Kirkwood mv6282 cpu,你可以在更新版本的ARMCPU上安装armv7版本。尽管armv7 repo是基于cortex-a9适配的,它也可以成功的运行在Marvell Armada XP构架的群辉上。请在Realtek RTD129x CPU (64 bit arm)构架的机器上使用aarch64版本。(DS119J和DS120J也适用)

 

该指南基于Synology DS1618+ w/ DSM 6.2-23739 Update 1.

 

部署Entware

1. 在根文件目录之外创建Entware目录

mkdir -p /volume1/@Entware/opt

 

2.移除/opt并挂载optware 文件夹

请确定 /opt文件夹是空的(Optware 未安装),在这个步骤中我们会连带该目录内的文件一起删除。

rm -rf /opt

 

mkdir /opt

 

mount -o bind “/volume1/@Entware/opt” /opt

 

3. 根据处理器型号运行脚本

猫盘

wget -O – http://bin.entware.net/aarch64-k3.10/installer/generic.sh | /bin/sh

 

蜗牛星际等X64构架

wget -O – http://bin.entware.net/x64-k3.2/installer/generic.sh | /bin/sh

 

4.创建开机计划任务

 

在计划任务中创建一个触发的任务

 

进入DSM页面> 控制面板 > 计划任务

 

新增 > 触发的任务 >用户自定义脚本

 

常规

 

任务: Entware

 

用户账号: root

 

事件: 开机

 

先行任务: 无

 

任务设置

 

运行命令: (填写以下内容)

 

#!/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

 

. /opt/etc/profile

 

EOF

 

fi

 

# Update Entware List

 

/opt/bin/opkg update

 

6.重启你的群辉

 

注意事项

 

固件升级会擦除 /opt 文件夹. 你应当将Entware 部署在rootfs目录之外 并且向/opt建立符号连接,或者使用mount -o bind.当固件升级后,你可能需要再次 /etc/rc.local和/root/.profile 文件。

 

你如果需要建立一个基于Entware的自启动程序,你需要确保它在Entware启动后再进行加载,此处以iperf3服务器端为例。

新增 > 触发的任务 >用户自定义脚本

 

常规

 

任务: Entware – iperf3 Server

 

用户: root

 

事件: 开机

 

先行任务: Entware (选择你命名的Entware自启动事件)

 

任务设置

运行命令:

# Run ( /opt/bin/iperf3 -s -D -p 5201 ) as GUEST user.

sudo -H -u guest bash -c ‘echo “I am $USER, with uid $UID”; /opt/bin/iperf3 -s -D -p 5201’

原创文章,作者:MIJI.CN,如若转载,请注明出处:https://miji.cn/3117,站长联系QQ:656020080

发表评论

登录后才能评论