Init
This commit is contained in:
231
03-UnrealEngine/流程管理与部署/路由器与NAS/OMV与Debian安装与使用笔记.md
Normal file
231
03-UnrealEngine/流程管理与部署/路由器与NAS/OMV与Debian安装与使用笔记.md
Normal file
@@ -0,0 +1,231 @@
|
||||
---
|
||||
title: OMV与Debian安装与使用笔记
|
||||
date: 2022-09-20 09:31:42
|
||||
excerpt: 摘要
|
||||
tags: Debian
|
||||
rating: ⭐⭐
|
||||
---
|
||||
|
||||
## 前言
|
||||
推荐入门文章:
|
||||
- [Debian 新手指南(持续更新)](https://zhuanlan.zhihu.com/p/488109156)
|
||||
- [锐角云 N3450折腾OMV记录](https://www.cnblogs.com/wxfy/p/15765363.html):
|
||||
|
||||
- omv5 基于debian 10
|
||||
- omv6 基于debian 11
|
||||
|
||||
后台:http://ipv4.blueroses.top/
|
||||
| 版本 | 说明 | 示例 |
|
||||
| -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------- |
|
||||
| alpine | Alpine Linux 操作系统,它是一个独立发行版本,相比较 Debian 操作系统来说 Alpine,更加轻巧 https://alpinelinux.org | docker pull node:alpine3.14 |
|
||||
| jessie | Debian 8,更旧的稳定(oldoldstable)版,马上就淘汰了 2015 https://wiki.debian.org/DebianJessie | docker pull node:10.22.0-jessie |
|
||||
| stretch | Debian 9,旧的稳定(oldstable)版,现有长期支持 2017,比较老,目前除了 LTS 其他版本已经不再提供技术支持了,所以我们非必要情况下还是不要选择它比较好 https://wiki.debian.org/DebianStretch | docker pull node:lts-stretch |
|
||||
| buster | Debian 10,当前的稳定(stable)版 2019,比较新,支持比较全面,受广大Debian爱好者的好评!像 PHP、Python 之类的语言、应用都会使用这个版本的 Debian 搭建 Docker 基础镜像 https://wiki.debian.org/DebianBuster | docker pull node:lts-buster |
|
||||
| bullseye | Debian 11,即将上位的稳定(stable)版 2021https://wiki.debian.org/DebianBullseye docker pull node:lts-bullseye xxx-slim 一般都基于 Debian 和 glibc,删除了许多非必需的软件包,优化了体积 docker pull node:stretch-slim | docker pull node:buster-slim |
|
||||
|
||||
## 在Debian上安装OMV
|
||||
### 添加秘钥
|
||||
```
|
||||
apt-get install --yes gnupg
|
||||
wget -O "/etc/apt/trusted.gpg.d/openmediavault-archive-keyring.asc" https://packages.openmediavault.org/public/archive.key
|
||||
apt-key add "/etc/apt/trusted.gpg.d/openmediavault-archive-keyring.asc"
|
||||
```
|
||||
### 添加软件包存储库
|
||||
大陆地区使用TUNA的源:
|
||||
```ini
|
||||
cat <<EOF > /etc/apt/sources.list.d/openmediavault.list
|
||||
deb https://mirrors.tuna.tsinghua.edu.cn/OpenMediaVault/public usul main
|
||||
deb https://mirrors.tuna.tsinghua.edu.cn/OpenMediaVault/packages usul main
|
||||
## Uncomment the following line to add software from the proposed repository.
|
||||
# deb https://mirrors.tuna.tsinghua.edu.cn/OpenMediaVault/public usul-proposed main
|
||||
# deb https://mirrors.tuna.tsinghua.edu.cn/OpenMediaVault/packages usul-proposed main
|
||||
## This software is not part of OpenMediaVault, but is offered by third-party
|
||||
## developers as a service to OpenMediaVault users.
|
||||
# deb https://mirrors.tuna.tsinghua.edu.cn/OpenMediaVault/public usul partner
|
||||
# deb https://mirrors.tuna.tsinghua.edu.cn/OpenMediaVault/packages usul partner
|
||||
EOF
|
||||
```
|
||||
### 安装
|
||||
```c++
|
||||
export LANG=C.UTF-8
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
export APT_LISTCHANGES_FRONTEND=none
|
||||
apt-get update
|
||||
apt-get --yes --auto-remove --show-upgraded \
|
||||
--allow-downgrades --allow-change-held-packages \
|
||||
--no-install-recommends \
|
||||
--option DPkg::Options::="--force-confdef" \
|
||||
--option DPkg::Options::="--force-confold" \
|
||||
install openmediavault-keyring openmediavault
|
||||
|
||||
omv-confdbadm populate
|
||||
```
|
||||
|
||||
### 安装脚本(非桌面环境有效)
|
||||
大概率是需要没有安装过桌面的Debian:https://github.com/OpenMediaVault-Plugin-Developers/installScript
|
||||
|
||||
## Debian检查软件包依赖
|
||||
- 查看谁依赖了这个包:
|
||||
- aptitude why libboost1.71-tools-dev
|
||||
- 查看libboost-all-dev 依赖哪些包
|
||||
- apt-cache depends libboost-all-dev
|
||||
- 查看所有带libboost的包
|
||||
- dpkg -l | grep libboost
|
||||
|
||||
Debian phpapi-20151012 不能安装的原因可能是因为某个包安装了更新phpapi的版本。(可能是php7.4系列)
|
||||
|
||||
### 用apt安装时,出现依赖障碍时,如何解决?
|
||||
出现因依赖无法安装,可以尝试:
|
||||
>aptitude install xxx-软件
|
||||
|
||||
```ini
|
||||
install - 安装/升级软件包
|
||||
remove - 卸载软件包
|
||||
purge - 卸载软件包并删除其配置文件
|
||||
hold - 将软件包置于保持状态
|
||||
unhold - 取消对一个软件包的保持命令
|
||||
markauto - 将软件包标记为自动安装
|
||||
unmarkauto - 将软件包标记为手动安装
|
||||
forbid-version - 禁止 aptitude 升级到某一特定版本的软件包。
|
||||
update - 下载新/可升级软件包列表
|
||||
safe-upgrade - 执行一次安全的升级
|
||||
full-upgrade - 执行升级,可能会安装和卸载软件包
|
||||
forget-new - 忘记哪些软件包是“新”的
|
||||
search - 按名称 和/或 表达式搜索软件包
|
||||
show - 显示一个软件包的详细信息
|
||||
clean - 删除已下载的软件包文件
|
||||
autoclean - 删除旧的已下载软件包文件
|
||||
changelog - 查看一个软件包的变更日志
|
||||
download - 下载软件包的 .deb 文件
|
||||
reinstall - 下载并(可能)重新安装一个现在已经安装了的软件包
|
||||
```
|
||||
|
||||
## Debian安装时驱动加载
|
||||
参考:https://wiki.debian.org/Firmware
|
||||
一种简单的方法是使用直接包含所有非免费固件包的**安装程序映像** :[https://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/](https://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/)。另一种方法是单独下载固件已经烧纸镜像的移动介质中(U盘)。可以在[https://cdimage.debian.org/cdimage/unofficial/non-free/firmware/](https://cdimage.debian.org/cdimage/unofficial/non-free/firmware/)中寻找对应Debian版本的固件。
|
||||
|
||||
- Debian软件包查找:https://packages.debian.org/
|
||||
- firmware-iwlwifi_20210315-3_all.deb:https://packages.debian.org/bullseye/all/firmware-iwlwifi/download
|
||||
- 带有Nonfree固件的Debian镜像:https://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/
|
||||
- https://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/11.5.0+nonfree/amd64/iso-dvd/
|
||||
|
||||
### 加载驱动
|
||||
将下载的驱动`*.ucode`放到`/lib/firmware`(该目录需要手动新建)。或者在另一个U盘( 分区fat32)里新建一个目录`/firmware`并放置`*.ucode`或者deb软件包,或者放在根目录。
|
||||
|
||||
### OMV驱动版本
|
||||
>**openmediavault 是否有适用于我的硬件的驱动程序?**
|
||||
所有模块驱动程序均由 oldstable 8.9 版(又名 Jessie)的 Debian 标准内核提供。默认情况下,此发行版附带内核 3.16。可以选择安装 backport kernel 4.9。如果 Debian Jessie 支持硬件,那么 openmediavault 也支持硬件。Jessie backport kernel 4.9 是目前 Stretch (Debian 9.3) 使用的默认内核,因此它为较新的硬件提供支持。
|
||||
|
||||
## 更新源
|
||||
源目录:
|
||||
- 官方源
|
||||
```ini
|
||||
deb http://deb.debian.org/debian buster main contrib non-free
|
||||
# deb-src http://deb.debian.org/debian buster main contrib non-free
|
||||
deb http://deb.debian.org/debian buster-updates main contrib non-free
|
||||
# deb-src http://deb.debian.org/debian buster-updates main contrib non-free
|
||||
deb http://deb.debian.org/debian-security/ buster/updates main contrib non-free
|
||||
# deb-src http://deb.debian.org/debian-security/ buster/updates main contrib non-free
|
||||
```
|
||||
- 清华
|
||||
```ini
|
||||
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ testing main contrib non-free
|
||||
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ testing main contrib non-free
|
||||
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ testing-updates main contrib non-free
|
||||
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ testing-updates main contrib non-free
|
||||
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ testing-backports main contrib non-free
|
||||
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ testing-backports main contrib non-free
|
||||
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security testing-security main contrib non-free
|
||||
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security testing-security main contrib non-free
|
||||
```
|
||||
- 中国科技大学
|
||||
```ini
|
||||
deb https://mirrors.ustc.edu.cn/debian/ stretch main non-free contrib
|
||||
#deb-src https://mirrors.ustc.edu.cn/debian/ stretch main non-free contrib
|
||||
deb https://mirrors.ustc.edu.cn/debian/ stretch-updates main non-free contrib
|
||||
#deb-src https://mirrors.ustc.edu.cn/debian/ stretch-updates main non-free contrib
|
||||
deb https://mirrors.ustc.edu.cn/debian/ stretch-backports main non-free contrib
|
||||
#deb-src https://mirrors.ustc.edu.cn/debian/ stretch-backports main non-free contrib
|
||||
deb https://mirrors.ustc.edu.cn/debian-security/ stretch/updates main non-free contrib
|
||||
#deb-src https://mirrors.ustc.edu.cn/debian-security/ stretch/updates main non-free contrib
|
||||
```
|
||||
- 阿里云
|
||||
```ini
|
||||
deb http://mirrors.aliyun.com/debian/ stretch main non-free contrib
|
||||
#deb-src http://mirrors.aliyun.com/debian/ stretch main non-free contrib
|
||||
deb http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib
|
||||
#deb-src http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib
|
||||
deb http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib
|
||||
#deb-src http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib
|
||||
deb http://mirrors.aliyun.com/debian-security/ stretch/updates main non-free contrib
|
||||
#deb-src http://mirrors.aliyun.com/debian-security/ stretch/updates main non-free contrib
|
||||
```
|
||||
更新操作:
|
||||
```c++
|
||||
sudo apt-get update
|
||||
sudo apt-get upgrade
|
||||
sudo apt-get dist-upgrade
|
||||
```
|
||||
`apt-get dist-upgrade `为更新发行版/分支操作。
|
||||
|
||||
### 替换源解决源失效问题
|
||||
如果提示下面的问题,可以使用替换源的方式来解决:
|
||||
>E: Some index files failed to download, they have been ignored, or old ones used instead.
|
||||
>E: 仓库 “https://download.docker.com/linux/debian n/a Release” 没有 Release 文件
|
||||
|
||||
1. 修改`/etc/apt/sources.list`文件,在桌面系统内可以使用`gedit /etc/apt/sources.list`。
|
||||
2. 替换成其他的源。比如阿里云的:
|
||||
```ini
|
||||
deb http://mirrors.aliyun.com/debian wheezy main contrib non-free
|
||||
#deb-src http://mirrors.aliyun.com/debian wheezy main contrib non-free
|
||||
deb http://mirrors.aliyun.com/debian wheezy-updates main contrib non-free
|
||||
#deb-src http://mirrors.aliyun.com/debian wheezy-updates main contrib non-free
|
||||
deb http://mirrors.aliyun.com/debian-security wheezy/updates main contrib non-free
|
||||
#deb-src http://mirrors.aliyun.com/debian-security wheezy/updates main contrib non-free
|
||||
```
|
||||
3. 如果还是提示错误就需要删除 **/etc/apt/sources.list.d** 下的所有文件了。
|
||||
```ini
|
||||
cd /etc/apt/sources.list.d
|
||||
ls
|
||||
rm XXXX
|
||||
```
|
||||
|
||||
#### 其他更换源命令
|
||||
```ini
|
||||
mv /etc/apt/sources.list /etc/apt/sources.list.bak ?(先备份)
|
||||
echo "deb https://mirrors.ustc.edu.cn/debian/ stretch main non-free contrib" >/etc/apt/sources.list
|
||||
echo "deb https://mirrors.ustc.edu.cn/debian/ stretch-updates main non-free contrib " >>/etc/apt/sources.list
|
||||
echo "deb https://mirrors.ustc.edu.cn/debian/ stretch-backports main non-free contrib" >>/etc/apt/sources.list
|
||||
```
|
||||
|
||||
## 杂项
|
||||
### 允许Root用户登录
|
||||
默认情况下debian是不允许以root用户登录的,只能以其他用户登录系统中,然后su到root用户下进行操作。
|
||||
1. 修改/etc/gdm3/daemon.conf文件,新增下面一行AllowRoot = true。
|
||||
```ini
|
||||
[security]
|
||||
AllowRoot = true
|
||||
```
|
||||
2. 修改/etc/pam.d/gdm-password,注释掉下面内容
|
||||
```ini
|
||||
#auth required pam_succeed_if.so user != root quiet_success
|
||||
```
|
||||
然后重启操作系统,就可以使用root用户登录操作系统了。
|
||||
|
||||
### 安装V2rayA客户端
|
||||
https://v2raya.org/docs/prologue/installation/debian/
|
||||
|
||||
### Debian设置Http代理
|
||||
方法一:有系统变量文件/etc/profile 里增加
|
||||
>export http_proxy=[http://username:password@proxyIP:proxyPORT](http://username:password@proxyip:proxyPORT/)(或者ip地址+端口号)
|
||||
|
||||
方法二:有用户变量文件~/.bashrc 里增加上面那句,只对指定的用户生效。
|
||||
|
||||
方法三:修改/etc/apt/apt.conf 文件,如果没有这个文件可以新建一个 增加一句:
|
||||
>Acquire::http::Proxy "[http://username:password@proxyIP:proxyPORT](http://username:password@proxyip:proxyPORT/)"; (或者ip地址+端口号)注意后面有一个分号。
|
||||
|
||||
最后输入 sudo apt-get update 测试
|
||||
|
||||
# OMV网页后台出错解决方法
|
||||
清楚网页缓存
|
||||
Try if clearing the browser cache solves it. Or try Ctrl+Shift+R when you are on the OMV web GUI
|
82
03-UnrealEngine/流程管理与部署/路由器与NAS/如何在华硕路由器中使用自己编写的脚本.md
Normal file
82
03-UnrealEngine/流程管理与部署/路由器与NAS/如何在华硕路由器中使用自己编写的脚本.md
Normal file
@@ -0,0 +1,82 @@
|
||||
# 插件参考
|
||||
1. Develop Plugin for Asuswrt Merlin:https://wdicc.com/develop-plugin-for-asuswrt-merlin/
|
||||
2. [插件集成] 【AsusWrt】自制路由器信息插件:https://bbs.hassbian.com/thread-3697-1-1.html
|
||||
|
||||
# 脚本
|
||||
## 脚本1:重新拨号的脚本
|
||||
刷的官改固件,脚本可以放到/koolshare/scripts 下,重启的话也不会丢失,官方固件的话可以放到/jffs 下
|
||||
```bash
|
||||
vi /koolshare/scripts/repppd.sh
|
||||
#!/bin/sh
|
||||
/usr/bin/logger -c "断开拨号连接"
|
||||
killall pppd
|
||||
/usr/bin/logger -c "延时10秒"
|
||||
sleep 10
|
||||
/usr/bin/logger -c "重新拨号"
|
||||
pppd file /tmp/ppp/options.wan0 >/dev/null 2>&1 &
|
||||
```
|
||||
## 脚本2:检测脚本
|
||||
检测百度是否可以连接,5秒超时,两次检测,间隔1分钟,如果两次检测都无法连接百度则执行脚本1重新拨号。具体参数看懂了自己改哦很简单的。
|
||||
```bash
|
||||
vi /koolshare/scripts/checknetwork.sh
|
||||
#!/bin/sh
|
||||
#检测网络链接畅通
|
||||
function network()
|
||||
{
|
||||
#超时时间
|
||||
local timeout=5
|
||||
|
||||
#目标网站
|
||||
local target=www.baidu.com
|
||||
|
||||
#获取响应状态码
|
||||
local ret_code=`curl -I -s --connect-timeout ${timeout} ${target} -w %{http_code} | tail -n1`
|
||||
if [ "x$ret_code" = "x200" ]; then
|
||||
|
||||
#网络畅通
|
||||
return 1
|
||||
else
|
||||
|
||||
#网络不畅通
|
||||
return 0
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
#第1次检测
|
||||
network
|
||||
first_check=$?
|
||||
|
||||
#睡眠60秒
|
||||
sleep 60
|
||||
|
||||
#第2次检测
|
||||
network
|
||||
second_check=$?
|
||||
if [[ $first_check -eq 0 && $second_check -eq 0 ]];then
|
||||
/usr/bin/logger -c "无法连接互联网,准备重新拨号!"
|
||||
|
||||
#执行脚本1重新拨号
|
||||
/bin/sh /koolshare/scripts/repppd.sh
|
||||
exit -1
|
||||
fi
|
||||
/usr/bin/logger -c "网络正常"
|
||||
exit
|
||||
```
|
||||
|
||||
## 脚本3:开机添加定时任务脚本
|
||||
因为路由器重启后,crontab的定时任务会被清空,所以需要在开机时用命令添加定时检测任务, /jffs/scripts/这个目录下的脚本在重启后都会重新执行。我写的是每10分钟执行一次网络检测的脚本。
|
||||
|
||||
```bash
|
||||
vi /jffs/scripts/services-start.sh
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
#添加定时任务,每10分钟检测网络一次
|
||||
|
||||
/usr/sbin/cru a checknetwork "*/10 * * * * /bin/sh /koolshare/scripts/checknetwork.sh"
|
||||
|
||||
#每周一早上6点05分,重新拨号
|
||||
|
||||
/usr/sbin/cru a repppd "5 6 * * 1 /bin/sh /koolshare/scripts/repppd.sh"
|
||||
```
|
168
03-UnrealEngine/流程管理与部署/路由器与NAS/尝试在TUF-AX3000假设Gitea服务器.md
Normal file
168
03-UnrealEngine/流程管理与部署/路由器与NAS/尝试在TUF-AX3000假设Gitea服务器.md
Normal file
@@ -0,0 +1,168 @@
|
||||
## 前言
|
||||
之前买了华硕路由器,趁着过年有空打算好好玩玩,打算做个版本管理服务器啥。但最后因为买的机器内存只有0.5g,又遇到运行gitea二进制文件报错的问题就没继续了。
|
||||
> line 1: syntax error: unexpected "("
|
||||
|
||||
不过研究过程感觉有些意义便有了此文。之前建议先知道一下内核版本:
|
||||
```
|
||||
uname -a
|
||||
```
|
||||
本人的路由器为:
|
||||
```
|
||||
Linux TUF-AX3000-07F8 4.1.52 #2 SMP PREEMPT Sat Nov 7 03:08:27 CST 2020 armv7 GNU/Linux
|
||||
```
|
||||
另外本人不推荐购买ax3000。真要做版本管理服务器可能还是x86 CPU的NAS比较好。树莓派之前也尝试搭过gitlab(基本处于崩溃边缘),但用gitea就没问题。
|
||||
|
||||
## 对于USB2JFFS插件的U盘选择
|
||||
USB2JFFS插件对U盘读写速度有要求,同时也为了有更好的使用体验。所以本人购买了CHIPFANCIER U盘。品名为:
|
||||
>CHIPFANCIER固态U盘SSD 高性能纯金属 windows to go USB3.0旋转外壳 128G
|
||||
|
||||
这里不推荐使用金士顿以及闪迪的低端U盘。因为他们的写入速度都不会超过30MB/s,都不符合USB2JFFS插件要求(35MB/s)。本人购买U盘的测速结果:
|
||||
```
|
||||
【2021年02月16日 19:49:16】 USB磁盘[/dev/sda1]的三次平均顺序读取速度大约为:263.16 MB/s
|
||||
【2021年02月16日 19:49:16】 USB磁盘[/dev/sda1]的三次平均顺序写入速度大约为:132.74 MB/s
|
||||
【2021年02月16日 19:49:16】 USB磁盘[/dev/sda1]的读写速度符合USB2JFFS插件要求!
|
||||
```
|
||||
使用这个插件还需要将U盘格式化成EXT4。可以使用diskgenius来进行格式化。
|
||||
|
||||
## 安装Entware
|
||||
找到两种安装方法:
|
||||
### 使用SCRIPTS BOOTLOADER FOR ASUS ROUTER
|
||||
安装起来比较方便,附带几个常用插件,而且会将安装的内容都转移到U盘。但该插件只保证对在官方固件或梅林固件能完美运行。
|
||||
|
||||
安装过程:
|
||||
1. 插入空白U盘
|
||||
2. 登录ssh并输入命令
|
||||
```
|
||||
cd /tmp && wget -q -O /tmp/install_online --no-check-certificate "https://cdn.jsdelivr.net/gh/JACK-THINK/SCRIPTS-BOOTLOADER-FOR-ASUS-ROUTER@latest/script_bootloader/bin/install_online" && chmod 777 /tmp/install_online && /tmp/install_online
|
||||
```
|
||||
3. 中间会有需要输入参数的环节在输入后回车即可(虚拟内存以及路由器账号密码)
|
||||
|
||||
参考文章:
|
||||
- https://koolshare.cn/thread-138615-1-1.html
|
||||
- https://github.com/JACK-THINK/SCRIPTS-BOOTLOADER-FOR-ASUS-ROUTER/blob/master/How_to_Use_zh-CN.md#scripts-bootloader-for-asus-router-%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E
|
||||
|
||||
### 官方命令安装方法
|
||||
安装命令:
|
||||
```
|
||||
mkdir /jffs/entware-ng.arm
|
||||
ln -nsf /jffs/entware-ng.arm /tmp/opt
|
||||
wget -O - http://pkg.entware.net/binaries/ ... /entware_install.sh | /bin/sh
|
||||
echo "#!/bin/sh" > /jffs/scripts/services-start
|
||||
echo "sleep 20" >> /jffs/scripts/services-start
|
||||
echo "ln -ns /jffs/entware-ng.arm /tmp/opt" >> /jffs/scripts/services-start
|
||||
echo "/opt/etc/init.d/rc.unslung start" >> /jffs/scripts/services-start
|
||||
echo "#!/bin/sh" > /jffs/scripts/services-stop
|
||||
echo "/opt/etc/init.d/rc.unslung stop" >> /jffs/scripts/services-stop
|
||||
chmod a+rx /jffs/scripts/*
|
||||
```
|
||||
参考文章:
|
||||
- https://www.cnblogs.com/YangGC/p/12524609.html
|
||||
|
||||
## 查看entware软件列表
|
||||
安装之前最好看一些有哪些是可以安装的:
|
||||
http://pkg.entware.net/binaries/armv7/Packages.html
|
||||
|
||||
- lighttpd
|
||||
- node-npm
|
||||
- node
|
||||
- aria2
|
||||
- git
|
||||
- git-http
|
||||
- nagix
|
||||
|
||||
不过很可惜没有docker,所以gitea就必须手动部署了。
|
||||
|
||||
## Gitea
|
||||
这里我尝试使用二进制安装方式。
|
||||
|
||||
参考文章:
|
||||
- https://docs.gitea.io/en-us/install-from-binary/
|
||||
- https://www.cnblogs.com/skymyyang/p/13606587.html
|
||||
- https://www.cnblogs.com/azureology/p/13237221.html
|
||||
|
||||
## 其他环境安装
|
||||
### Node.js
|
||||
```
|
||||
opkg install node
|
||||
opkg install node-npm
|
||||
```
|
||||
之后安装request模块
|
||||
```
|
||||
npm install request
|
||||
```
|
||||
参考文章:
|
||||
- https://koolshare.cn/forum.php?mod=viewthread&tid=189560&extra=page%3D2%26filter%3Dtypeid%26typeid%3D104
|
||||
|
||||
### PHP环境安装
|
||||
使用的是ONMP
|
||||
|
||||
参考文章:
|
||||
- https://zhih.me/onmp-installation/
|
||||
|
||||
#### EDE+Entware+ONMP搭建个人私有云Nextcloud
|
||||
https://koolshare.cn/thread-137015-1-1.html
|
||||
|
||||
## 其他步骤
|
||||
### 查看默认Bash位置
|
||||
Enterprise 默认使用的shell即为bash shell。
|
||||
```
|
||||
echo $SHELL
|
||||
```
|
||||
## gitea
|
||||
### 下载二进制文件
|
||||
```
|
||||
wget -O gitea https://dl.gitea.io/gitea/1.13.2/gitea-1.13.2-linux-amd64
|
||||
chmod +x gitea
|
||||
```
|
||||
|
||||
### 增加用户
|
||||
文档中的命令为:
|
||||
```
|
||||
adduser \
|
||||
--system \
|
||||
--shell /bin/bash \
|
||||
--gecos 'Git Version Control' \
|
||||
--group \
|
||||
--disabled-password \
|
||||
--home /home/git \
|
||||
git
|
||||
```
|
||||
但路由器系统默认没有adduser命令,所以我们需要安装对应的模块:
|
||||
```
|
||||
opkginstall shadow-common
|
||||
opkginstall shadow-useradd
|
||||
opkginstall shadow-groupad
|
||||
opkginstall shadow-usermod
|
||||
```
|
||||
```
|
||||
useradd \
|
||||
--system \
|
||||
--shell /bin/bash \
|
||||
--comment 'Git Version Control' \
|
||||
--create-home \
|
||||
--home-dir /tmp/mnt/ASUS_ROUTER/home/git/ \
|
||||
git
|
||||
```
|
||||
会遇到问题:
|
||||
>useradd: cannot open /opt/etc/passwd
|
||||
```
|
||||
opkg install lsattr
|
||||
opkg install chattr
|
||||
```
|
||||
PS.但到这一步还是遇到无法cannot open /opt/etc/passwd的问题,之后尝试手动添加用户也宣告失败。但最后我发现可以在路由器的文件共享服务页面中添加用户。@-@
|
||||
|
||||
### 设置环境变量
|
||||
```
|
||||
export GITEA_WORK_DIR=/tmp/mnt/ASUS_ROUTER/var/lib/gitea/
|
||||
```
|
||||
|
||||
### 将Gitea二进制文件复制到全局位置
|
||||
```
|
||||
cp gitea /tmp/mnt/ASUS_ROUTER/usr/local/bin/
|
||||
```
|
||||
|
||||
## 运行Gitea
|
||||
### 从命令行/终端运行
|
||||
```
|
||||
GITEA_WORK_DIR=/tmp/mnt/ASUS_ROUTER/var/lib/gitea/ /tmp/mnt/ASUS_ROUTER/usr/local/bin/gitea web -c /tmp/mnt/ASUS_ROUTER/etc/gitea/app.ini
|
||||
```
|
137
03-UnrealEngine/流程管理与部署/路由器与NAS/远程唤醒WOL.md
Normal file
137
03-UnrealEngine/流程管理与部署/路由器与NAS/远程唤醒WOL.md
Normal file
@@ -0,0 +1,137 @@
|
||||
---
|
||||
title: 远程唤醒WOL
|
||||
date: 2022-8-10 22:00:49
|
||||
excerpt: 摘要
|
||||
tags: TODO
|
||||
rating: ⭐
|
||||
status: inprogress
|
||||
---
|
||||
|
||||
## 参考
|
||||
- [新手小白如何使用TeamViewer远程开关机(远程唤醒WOL)并远程控制电脑?](https://zhuanlan.zhihu.com/p/144834189)
|
||||
- [如何远程开启你的电脑:WoL的原理和陷阱](https://zhuanlan.zhihu.com/p/28859620)
|
||||
- [WOL网络唤醒在微星主板上开启(ubuntu 20.04/Windows 10双系统)](https://www.mobibrw.com/2020/28210)
|
||||
- [华硕主板如何在BIOS中设置和启用WOL(Wake On Lan)功能](https://www.asus.com/support/FAQ/1045950/)
|
||||
|
||||
大概率需要自己安装官方的驱动,而不是使用Win10自带的。
|
||||
|
||||
## APP
|
||||
- 手机APP
|
||||
- DD-WRT
|
||||
- PC APP
|
||||
- WakeOnLanGui
|
||||
|
||||
## 华硕路由器
|
||||
首先设置远程访问授权,系统管理-系统设置-远程访问设置。之后就可以通过8443端口进行访问了。
|
||||
|
||||
## OMV6
|
||||
除了在主板中开启这个设置外,在`网络-接口-高级设置`中勾选`网络唤醒 WOL`即可。
|
||||
|
||||
## 唤醒服务部署
|
||||
### wol-go-web(没有http page)
|
||||
参考:http://blog.sysu.tech/Docker/%E4%BD%BF%E7%94%A8Docker%E9%85%8D%E7%BD%AEWOL(Wake%20On%20Lan)%E6%9C%8D%E5%8A%A1/
|
||||
|
||||
```bash
|
||||
docker run -d \
|
||||
--net=host \
|
||||
--env PORT=8000 \
|
||||
--name=wol \
|
||||
chishin/wol-go-web
|
||||
```
|
||||
|
||||
使用说明:http://192.168.0.236:8000/;随后直接访问 [http://192.168.211.1:8002/wol?mac=your_mac](http://192.168.211.1:8002/wol?mac=your_mac) 即可远程开机。注意这里`your_mac`要替换为你要唤醒电脑网卡的mac地址
|
||||
|
||||
### go-rest-wol
|
||||
>需要手动先创建externall-file-on-host.csv文件。并且添加csv内容:
|
||||
```bash
|
||||
docker run --name=wol -d \
|
||||
-e "WOLHTTPPORT=7000" \
|
||||
-p 7000:7000 \
|
||||
-v /mnt/nfs-1/wol/externall-file-on-host.csv:/app/computer.csv \
|
||||
--restart unless-stopped \
|
||||
dabondi/go-rest-wol
|
||||
```
|
||||
|
||||
### 其他备选容器
|
||||
- 1M+ https://hub.docker.com/r/dabondi/go-rest-wol
|
||||
- 10k+ https://hub.docker.com/r/aranajuan/wolweb
|
||||
- 500k+ https://hub.docker.com/r/ex0nuss/remote-wake-sleep-on-lan-docker
|
||||
- 10k+ https://hub.docker.com/r/chtake/pi-wol
|
||||
|
||||
## 开启WOL
|
||||
参考
|
||||
- https://post.smzdm.com/p/amx025p4/
|
||||
- https://zhuanlan.zhihu.com/p/29100706
|
||||
- https://zhuanlan.zhihu.com/p/183704557
|
||||
- https://blog.berd.moe/archives/intel-nuc-i210-wol-troubleshooting/
|
||||
- https://office66.cn/post/39888.html
|
||||
|
||||
相关关键词:
|
||||
- ACPI
|
||||
- PCIE 设备开机
|
||||
- Automatic Power On
|
||||
- Wake on LAN/WLAN
|
||||
- Power Management
|
||||
- Power On by Onboard LAN
|
||||
- Power On by PCI-E Devices
|
||||
- ......
|
||||
|
||||
>注意路由器需要绑定静态路由表,否则关机时间长了,就会无法远程开机
|
||||
|
||||
微星BIOS:
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
Inter网卡需要安装对应驱动:**Intel PROSet Adapter Configuration Utility**。这个程序中会列出我们在 `devmgmt.msc` 中看不到的一部分设置,其中就包括 “电源关闭状态下魔包唤醒”,这个值在 I210 上默认是禁用,而在 I219 上默认是启用的
|
||||

|
||||
如图,`devmgmt.msc` 中不存在这个设置,应该是网卡特有的
|
||||

|
||||
|
||||
## 关机后网卡保持供电
|
||||
BIOS-Advanced-APM Configuration 里,将 Power On By PCI-E 设置为开启,如下图所示:
|
||||

|
||||
|
||||
|
||||
进系统后,安装过网卡官网驱动后,我们看网卡属性高级设置里,有“关机网络唤醒”的设置,这个设置,默认也是开启的,只要注意不要设置为关闭即可。然后机器关机。
|
||||
|
||||

|
||||
|
||||
板载 Realtek 8111x 系列的千兆网卡的主板,WOL 的实现中,Windows10 下 电源管理中,开启与关闭快速启动都不影响 WOL 的实现。
|
||||
|
||||
第二,我们介绍板载 Intel i219V 千兆网卡的主板的网络唤醒。
|
||||
|
||||
步骤如前,接上网线,开机后我们进入 BIOS-Advanced-APM Configuration 里, 将 Power On By PCI-E/PCI 设置为开启,如下图所示:
|
||||
|
||||

|
||||
|
||||
进入系统后,安装好官网的网卡驱动,进入设备管理器的网络适配器里找到 Intel(R) Ethernet Connetion I219V 网卡设备,在其属性----高级设置里这里有很多设置项 目,拉到下面,有个启用 PME 的设置,这个默认也是开启的,只要不设置为关闭即可。
|
||||
|
||||

|
||||
|
||||
对于 i219V 的千兆网卡,我们必须要把 Windows10 下面电源管理中的快速启动取消掉,才可以在 Windows 关机后实现 WOL。
|
||||
|
||||

|
||||
|
||||
第三,对于板载了 Intel i211AT 千兆网卡的主板来讲,网络唤醒的设置如下: BIOS-Advanced-APM Configuration 里,将 Power On By PCI-E/PCI 设置为开 启,如下图所示:
|
||||
|
||||

|
||||
|
||||
操作系统下,进入设备管理器的网络适配器里找到 Intel(R) I211 Gigabit Network Connetion 网卡设备,在其属性----高级设置里这里有很多设置项目,拉到下面,有个启用 PME 的设置,请一定把这个设置设置为开启,默认是关闭的。
|
||||
|
||||

|
||||
|
||||
开启后,无论 Windows10 里的快速关机开启与否,关机后,都可以实现网络唤醒。
|
||||
|
||||
最后以表格形式总结如下:
|
||||
|
||||

|
||||
|
||||
华硕主板
|
||||
http://m.dnxtc.net/zixun/zuzhuangjiaocheng/2022-09-28/11233.html
|
Reference in New Issue
Block a user