fix rss error, mod readme, add rss update.

This commit is contained in:
Ing 2023-04-22 01:28:04 +08:00
parent 4cd71f298e
commit 6796c5e905
12 changed files with 427 additions and 573 deletions

45
.github/workflows/update.yml vendored Normal file
View File

@ -0,0 +1,45 @@
#
# Copyright (C) 2022 Ing <https://github.com/wjz304>
#
# This is free software, licensed under the MIT License.
# See /LICENSE for more information.
#
name: Update
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main
- name: Set up Python 3
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Initialization environment
run : |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
sudo timedatectl set-timezone "Asia/Shanghai"
pip install requests BeautifulSoup4 pyyaml
- name: update pats
run: |
python rssupdate.py
- name: Check and Push
run: |
git pull
status=$(git status -s | grep -E 'model-configs|rss' | awk '{printf " %s", $2}')
if [ -n "${status}" ]; then
git add ${status}
git commit -m "update $(date +%Y-%m-%d" "%H:%M:%S)"
git push -f
fi

1
.gitignore vendored
View File

@ -13,3 +13,4 @@ cache
/files/board/arpl/p3/lkms
/files/board/arpl/p3/modules
/tests
/extractor

View File

@ -4,8 +4,7 @@
### 原版:
<b>https://github.com/fbelavenuto/arpl</b>
* [作者说明(En)](./arpl-README-En.md)
* [作者说明(Zh)](./arpl-README-Zh.md)
* [arpl说明](https://github.com/fbelavenuto/arpl/blob/main/README.md)
### 汉化:
<b>https://github.com/wjz304/arpl-zh_CN</b>
@ -14,7 +13,8 @@
### i18n:
<b>https://github.com/wjz304/arpl-i18n</b>
* 多语言支持.
* 包含我的修改.
* 6.2&7.2支持.
* other.
## 说明
@ -25,7 +25,7 @@
# 如果要切换原版修改第二条命令中的 wjz304/arpl-i18n 为 fbelavenuto/arpl
# 如果切换中文版修改第二条命令中的 wjz304/arpl-i18n 为 wjz304/arpl-zh_CN
CURREPO=`grep "github.com.*update" menu.sh | sed -r 's/.*com\/(.*)\/releases.*/\1/'`
sed -i "s|${CURREPO}|wjz304/arpl-i18n|g; s|ACTUALVERSION=\"v\${ARPL_VERSION}\"|ACTUALVERSION=\"v0.0\"|g" /opt/arpl/menu.sh
sed -i "s|${CURREPO}|wjz304/arpl-i18n|g" /opt/arpl/menu.sh
# 进入设置菜单执行更新arpl操作即可.
# 更新后请重启.
```
@ -36,12 +36,13 @@
# 解压
unzip /opt/arpl/arpl.zip
# 挂载 img
losetup /dev/loop0 /opt/arpl/arpl.img
LOOPX=`sudo losetup -f`
losetup ${LOOPX} /opt/arpl/arpl.img
# 复制 p1 p3 分区
mkdir -p /mnt/loop0p1; mount /dev/loop0p1 /mnt/loop0p1; cp -r /mnt/loop0p1/* /mnt/p1/; umount /mnt/loop0p1
mkdir -p /mnt/loop0p3; mount /dev/loop0p3 /mnt/loop0p2; cp -r /mnt/loop0p3/* /mnt/p3/; umount /mnt/loop0p3
mkdir -p /mnt/loop0p1; mount ${LOOPX}p1 /mnt/loop0p1; cp -rf /mnt/loop0p1/* /mnt/p1/; umount /mnt/loop0p1
mkdir -p /mnt/loop0p3; mount ${LOOPX}p3 /mnt/loop0p2; cp -rf /mnt/loop0p3/* /mnt/p3/; umount /mnt/loop0p3
# 卸载 img
losetup -d /dev/loop0
losetup -d ${LOOPX}
# 如果安装的版本中无你当前安装的DSM请尽量删除 /mnt/p1/user-config.yml, /mnt/p3/*-dsm, /mnt/p2/*
rm -rf /mnt/p1/user-config.yml /mnt/p3/*-dsm /mnt/p2/*
# 重启
@ -64,7 +65,6 @@
## 打赏一下
* > ### 作者: Ing QQ群: 21609194 QQ频道: 0pg8m22666
* <img src="https://raw.githubusercontent.com/wjz304/wjz304/master/my/20220908134226.jpg" width="400">

View File

@ -1,99 +0,0 @@
# Automated Redpill Loader
[中文说明](./README-Zh.md)
This particular project was created to facilitate my testing with Redpill and I decided to share it with other users.
I'm Brazilian and my English is not good, so I apologize for my translations.
I tried to make the system as user-friendly as possible, to make life easier. The loader automatically detects which device is being used, SATADoM or USB, detecting its VID and PID correctly. redpill-lkm has been edited to allow booting the kernel without setting the variables related to network interfaces so the loader (and user) doesn't have to worry about that. The Jun's code that makes the zImage and Ramdisk patch is embedded, if there is a change in "zImage" or "rd.gz" by some smallupdate, the loader re-applies the patches. The most important kernel modules are built into the DSM ramdisk image for automatic peripheral detection.
# Important considerations
- Some users have experienced an excessively long time to boot. In this case is highly recommended to use an SSD for the loader in the case of the option via DoM or a fast USB flash drive;
- You must have at least 4GB of RAM, both in baremetal and VMs;
- The DSM kernel is compatible with SATA ports, not SAS/SCSI/etc. For device-tree models only SATA ports work. For the other models, another type of disks may work;
- It is possible to use HBA cards, however SMART and serial numbers are only functional on DS3615xs, DS3617xs and DS3622xs+ models.
# Use
## General
To use this project, download the latest image available and burn it to a USB stick or SATA disk-on-module. Set the PC to boot from the burned media and follow the informations on the screen.
The loader will automatically increase the size of the last partition and use this space as cache if it is larger than 2GiB.
## Acessing loader
### Via terminal
Call the "menu.sh" command from the computer itself.
### Via web
From another machine into same network, type the address provided on the screen `http://<ip>:7681` in browser.
### Via ssh
From another machine into same network, use a ssh client, username `root` and password `Redp1lL-1s-4weSomE`
## Using loader
The menu system is dynamic and I hope it is intuitive enough that the user can use it without any problems.
There is no need to configure the VID/PID (if using a USB stick) or define the MAC Addresses of the network interfaces. If the user wants to modify the MAC Address of any interface, uses the "Change MAC" into "cmdline" menu.
If a model is chosen that uses the Device-tree system to define the HDs, there is no need to configure anything. In the case of models that do not use device-tree, the configurations must be done manually and for this there is an option in the "cmdline" menu to display the SATA controllers, DUMMY ports and ports in use, to assist in the creation of the "SataPortMap", "DiskIdxMap" and "sata_remap" if necessary.
Another important point is that the loader detects whether or not the CPU has the MOVBE instruction and does not display the models that require it. So if the DS918+ and DVA3221 models are not displayed it is because of the CPU's lack of support for MOVBE instructions. You can disable this restriction and test at your own risk.
I developed a simple patch to no longer display the DUMMY port error on models without device-tree, the user will be able to install without having to worry about it.
## Quickstart guide
After booting the loader, the following screen should appear. Type menu.sh and press `<ENTER>`:
![](doc/first-screen.png)
If you prefer, you can access it via the web:
![](doc/ttyd.png)
Select the "model" option and choose the model you prefer:
![](doc/model.png)
Select the "Buildnumber" option and choose the first option:
![](doc/buildnumber.png)
Go to "Serial" menu and choose "Generate a random serial number".
Select the "Build" option and wait for the loader to be generated:
![](doc/making.png)
Select the "Boot" option and wait for the DSM to boot:
![](doc/DSM%20boot.png)
The DSM kernel does not display messages on the screen, so it is necessary to continue the process of configuring DSM through the browser by accessing the address `http://<ip>`.
There are several tutorials on how to configure DSM over the internet, which will not be covered here.
# Tutorials
An ARPL user (Rikkie) created a tutorial to install ARPL on a proxmox server:
https://hotstuff.asia/2023/01/03/xpenology-with-arpl-on-proxmox-the-easy-way/
# Troubles/questions/etc
Please search the forums at https://xpenology.com/forum if your question/problem has been discussed and resolved. If you can't find a solution, use github issues.
# Thanks
All code was based on the work of TTG, pocopico, jumkey and others involved in continuing TTG's original redpill-load project.
More information will be added in the future.

View File

@ -1,97 +0,0 @@
# 自动Redpill装载程序
这个特别的项目是为了方便我用Redpill进行测试而创建的我决定与其他用户分享它。
我是巴西人,我的英语不好,所以我为我的翻译道歉。
我试着让这个系统尽可能的人性化让生活更简单。加载器自动检测哪个设备正在使用SATADoM或USB检测其VID和PID正确。redpilll -lkm已经被编辑允许在不设置与网络接口相关的变量的情况下引导内核这样加载程序(和用户)就不必担心了。制作zImage和Ramdisk补丁的Jun代码是嵌入的如果smallupdate在“zImage”或“rd.gz”中有变化加载器会重新应用补丁。最重要的内核模块被内置到DSM ramdisk映像中用于自动外围设备检测。
# 重要注意事项
- 一部分用户启动时间过长。在这种情况下强烈建议在DoM选项或快速USB闪存驱动器的情况下使用SSD作为加载器;
- 你必须有至少4GB的内存无论是在裸机和虚拟机;
- DSM内核兼容SATA端口不兼容SAS/SCSI等。对于设备树型号只有SATA端口工作。对于其他型号可以使用其他类型的磁盘;
- 可以使用HBA卡但SMART和序列号仅适用于DS3615xs, DS3617xs和DS3622xs+型号。
# 使用
## 一般
要使用这个项目请下载可用的最新映像并将其刻录到USB闪存或SATA硬盘模块上。将电脑设置为从刻录媒体启动并遵循屏幕上的信息。
如果最后一个分区的大小大于2GiB加载器将自动增加该分区的大小并将该空间用作缓存。
## 访问加载器
### 通过终端
从计算机本身调用“menu.sh”命令。
### 通过网络
从另一台机器进入同一网络,在浏览器中输入屏幕上提供的地址`http://<ip>:7681`
### 通过ssh
从另一台机器进入同一网络使用ssh客户端用户名 `root` 和密码: `Redp1lL-1s-4weSomE`
## 使用加载器
菜单系统是动态的,我希望它足够直观,用户可以没有任何问题的使用它
不需要配置VID/PID(如果使用u盘)或定义网络接口的MAC地址。如果用户想修改任何接口的MAC地址使用“Change MAC”到“cmdline”菜单。
如果选择使用Device-tree系统定义hd的模型则不需要配置任何内容。在不使用device-tree的情况下配置必须手动完成在“cmdline”菜单中有一个选项可以显示SATA控制器、虚拟端口和正在使用的端口如果需要可以帮助创建“satapportmap”、“DiskIdxMap”和“sata_remap”。
另一个重要的一点是加载器检测CPU是否有MOVBE指令并且不显示需要它的型号。因此如果DS918+和DVA3221型号没有显示这是因为CPU缺乏对MOVBE指令的支持。您可以禁用此限制并自行承担测试风险。
我开发了一个简单的补丁在没有device-tree的模型上不再显示虚拟端口错误用户将能够安装而不必担心它。
## 快速入门指南
启动加载程序后,应该出现以下屏幕。输入 menu.sh 并按 `<ENTER>`:
![](doc/first-screen.png)
如果你愿意,你可以通过网络访问:
![](doc/ttyd.png)
选择“型号”选项,并选择您喜欢的型号:
![](doc/model.png)
选择“Buildnumber”选项并选择第一个选项:
![](doc/buildnumber.png)
进入“Serial”菜单选择“Generate a random Serial number”。
选择“Build”选项等待加载器生成:
![](doc/making.png)
选择“Boot”选项等待DSM启动:
![](doc/DSM%20boot.png)
由于DSM内核不会在屏幕上显示消息因此需要通过浏览器访问地址`http://<ip>`来继续配置DSM的过程。
有一些关于如何在互联网上配置DSM的教程这里不做介绍。
# 教程
ARPL用户(Rikkie)创建了一个在proxmox服务器上安装ARPL的教程:
https://hotstuff.asia/2023/01/03/xpenology-with-arpl-on-proxmox-the-easy-way/
# 麻烦/问题/等等
如果您的问题已经被讨论和解决,请搜索论坛 https://xpenology.com/forum 如果你找不到解决方案,请使用 github issues。
# 感谢
所有代码都是基于TTG、pocopico、jumkey和其他参与继续TTG最初的redpill-load项目的人的工作。
更多信息将在未来添加。

View File

@ -30,8 +30,8 @@ LOOPX=`sudo losetup -f`
sudo losetup -P "${LOOPX}" "${IMAGE_FILE}"
# Format partitions
sudo mkdosfs -F32 -n ARPL1 "${LOOPX}p1" >/dev/null 2>&1
sudo mkfs.ext2 -F -F -L ARPL2 "${LOOPX}p2" >/dev/null 2>&1
sudo mkfs.ext4 -F -F -L ARPL3 "${LOOPX}p3" >/dev/null 2>&1
sudo mkfs.ext2 -F -L ARPL2 "${LOOPX}p2" >/dev/null 2>&1
sudo mkfs.ext4 -F -L ARPL3 "${LOOPX}p3" >/dev/null 2>&1
echo "Mounting image file"
mkdir -p "${BINARIES_DIR}/p1"

View File

@ -6,9 +6,9 @@ synoinfo: &synoinfo
support_led_brightness_adjustment: "no"
support_leds_lp3943: ""
buzzeroffen: "0xffff"
rss_server: "https://raw.githubusercontent.com/wjz304/arpl-arpl-i18n/main/rss.xml"
rss_server_ssl: "https://raw.githubusercontent.com/wjz304/arpl-arpl-i18n/main/rss.xml"
rss_server_v2: "https://raw.githubusercontent.com/wjz304/arpl-arpl-i18n/main/rss.json"
rss_server: "https://raw.githubusercontent.com/wjz304/arpl-i18n/main/rss.xml"
rss_server_ssl: "https://raw.githubusercontent.com/wjz304/arpl-i18n/main/rss.xml"
rss_server_v2: "https://raw.githubusercontent.com/wjz304/arpl-i18n/main/rss.json"
#support_ssd_cache: "yes"
support_syno_hybrid_raid:
supportraidgroup:

View File

@ -6,9 +6,9 @@ synoinfo: &synoinfo
support_bde_internal_10g: "no"
support_oob_ctl: "no"
support_led_brightness_adjustment: "no"
rss_server: "https://raw.githubusercontent.com/wjz304/arpl-arpl-i18n/main/rss.xml"
rss_server_ssl: "https://raw.githubusercontent.com/wjz304/arpl-arpl-i18n/main/rss.xml"
rss_server_v2: "https://raw.githubusercontent.com/wjz304/arpl-arpl-i18n/main/rss.json"
rss_server: "https://raw.githubusercontent.com/wjz304/arpl-i18n/main/rss.xml"
rss_server_ssl: "https://raw.githubusercontent.com/wjz304/arpl-i18n/main/rss.xml"
rss_server_v2: "https://raw.githubusercontent.com/wjz304/arpl-i18n/main/rss.json"
support_syno_hybrid_raid:
supportraidgroup:
cmdline: &cmdline

View File

@ -4,8 +4,8 @@ synoinfo: &synoinfo
support_disk_compatibility: "no"
support_memory_compatibility: "no"
support_led_brightness_adjustment: "no"
rss_server: "https://raw.githubusercontent.com/wjz304/arpl-arpl-i18n/main/rss.xml"
rss_server_ssl: "https://raw.githubusercontent.com/wjz304/arpl-arpl-i18n/main/rss.xml"
rss_server: "https://raw.githubusercontent.com/wjz304/arpl-i18n/main/rss.xml"
rss_server_ssl: "https://raw.githubusercontent.com/wjz304/arpl-i18n/main/rss.xml"
support_syno_hybrid_raid:
supportraidgroup:
cmdline: &cmdline

View File

@ -3,9 +3,9 @@ synoinfo: &synoinfo
support_disk_compatibility: "no"
support_memory_compatibility: "no"
support_led_brightness_adjustment: "no"
rss_server: "https://raw.githubusercontent.com/wjz304/arpl-arpl-i18n/main/rss.xml"
rss_server_ssl: "https://raw.githubusercontent.com/wjz304/arpl-arpl-i18n/main/rss.xml"
rss_server_v2: "https://raw.githubusercontent.com/wjz304/arpl-arpl-i18n/main/rss.json"
rss_server: "https://raw.githubusercontent.com/wjz304/arpl-i18n/main/rss.xml"
rss_server_ssl: "https://raw.githubusercontent.com/wjz304/arpl-i18n/main/rss.xml"
rss_server_v2: "https://raw.githubusercontent.com/wjz304/arpl-i18n/main/rss.json"
support_syno_hybrid_raid:
supportraidgroup:
cmdline: &cmdline

View File

@ -11,7 +11,7 @@ import xml.etree.ElementTree as ET
from urllib.parse import urlparse
from bs4 import BeautifulSoup
root = '' # os.path.dirname(os.path.abspath(__file__))
FILE_PATH = os.path.dirname(os.path.abspath(__file__))
def fullversion(ver):
out = ver
@ -73,8 +73,12 @@ def synoextractor(url):
os.mkdir(filepath)
if isencrypted is True:
toolpath = "extractor"
commands = [f"sudo", f"LD_LIBRARY_PATH={toolpath}", f"{toolpath}/syno_extract_system_patch", filename, filepath]
TOOL_PATH = os.path.join(FILE_PATH, 'extractor')
if not os.path.exists(TOOL_PATH):
commands = ["bash", "-c", ". {}; getExtractor {}".format(os.path.join(FILE_PATH, 'scripts/func.sh'), TOOL_PATH)]
result = subprocess.check_output(commands)
commands = ["sudo", "LD_LIBRARY_PATH={}".format(TOOL_PATH), "{}/syno_extract_system_patch".format(TOOL_PATH), filename, filepath]
result = subprocess.check_output(commands)
pass
else:
@ -106,7 +110,7 @@ def main(): # if __name__ == '__main__':
configs = "files/board/arpl/overlayfs/opt/arpl/model-configs"
for filename in os.listdir(os.path.join(root, configs)):
for filename in os.listdir(os.path.join(FILE_PATH, configs)):
if ".yml" in filename: # filename.endswith(".yml"):
models.append(filename.split(".yml")[0])
@ -156,13 +160,13 @@ def main(): # if __name__ == '__main__':
with open('rsshead.json', "r", encoding='utf-8') as f:
rssjson = json.loads(f.read())
for filename in os.listdir(os.path.join(root, configs)):
for filename in os.listdir(os.path.join(FILE_PATH, configs)):
if ".yml" not in filename: # filename.endswith(".yml"):
continue
model = filename.split(".yml")[0]
data = ''
with open(os.path.join(root, configs, filename), "r", encoding='utf-8') as f:
with open(os.path.join(FILE_PATH, configs, filename), "r", encoding='utf-8') as f:
data = yaml.load(f, Loader=yaml.BaseLoader)
try:
isChange=False
@ -182,7 +186,7 @@ def main(): # if __name__ == '__main__':
# data["builds"][ver]["pat"] = hashdata # pyyaml 会修改文件格式
# yq -iy '.builds."25556".pat |= {url:"...", hash:"..."}' DS918+.yml # yq 也会修改文件格式
pat = data["builds"][ver]["pat"]
commands = ['sed', '-i', 's|{}|{}|; s|{}|{}|; s|{}|{}|; s|{}|{}|; s|{}|{}|'.format(pat["url"], hashdata["url"], pat["hash"], hashdata["hash"], pat["ramdisk-hash"], hashdata["ramdisk-hash"], pat["zimage-hash"], hashdata["zimage-hash"], pat["md5-hash"], hashdata["md5-hash"]), os.path.join(root, configs, filename)]
commands = ['sed', '-i', 's|{}|{}|; s|{}|{}|; s|{}|{}|; s|{}|{}|; s|{}|{}|'.format(pat["url"], hashdata["url"], pat["hash"], hashdata["hash"], pat["ramdisk-hash"], hashdata["ramdisk-hash"], pat["zimage-hash"], hashdata["zimage-hash"], pat["md5-hash"], hashdata["md5-hash"]), os.path.join(FILE_PATH, configs, filename)]
result = subprocess.check_output(commands)
# rss.xml
@ -195,14 +199,14 @@ def main(): # if __name__ == '__main__':
rssjson["channel"]["item"][idx]["model"].append({"mUnique": hashdata["unique"], "mLink": hashdata["url"], "mCheckSum": hashdata["md5-hash"]})
# # pyyaml 会修改文件格式
# if isChange is True:
# with open(os.path.join(root, configs, filename), "w", encoding='utf-8') as f:
# with open(os.path.join(FILE_PATH, configs, filename), "w", encoding='utf-8') as f:
# yaml.dump(data, f, Dumper=yaml.SafeDumper, sort_keys=False) # 双引号: default_style='"',
except:
pass
rssxml.write("rss.xml", xml_declaration=True)
# ET 处理 rss 的后与原有rss会多一个encode
commands = ['sed', '-i', 's|^<?xml .*\?>$|<?xml version="1.0"?>|', os.path.join(root, 'rss.xml')]
commands = ['sed', '-i', 's|^<?xml .*\?>$|<?xml version="1.0"?>|', os.path.join(FILE_PATH, 'rss.xml')]
result = subprocess.check_output(commands)
# ET 处理 rss 的并不会格式化
commands = ['xmllint', '--format', 'rss.xml', '-o', 'rss_new.xml']