Compare commits

..

21 Commits

Author SHA1 Message Date
elseif
68dcd99bc0 modified: keygen/keygen_arm64
modified:   keygen/keygen_x86
2026-07-22 23:00:59 +08:00
elseif
63bff2eed4 modified: keygen/keygen_arm64
modified:   keygen/keygen_x86
2026-07-22 19:21:38 +08:00
elseif
7163a9d629 Change alignment setting from 1 to 8 in sgdisk commands
change to 4k align

Signed-off-by: elseif <elseif@live.cn>
2026-07-22 04:38:39 +08:00
elseif
1403e9c3d5 Update cloud service section in README_CN.md
Signed-off-by: elseif <elseif@live.cn>
2026-07-22 04:29:43 +08:00
elseif
e7899eef0a Update README_CN.md
Signed-off-by: elseif <elseif@live.cn>
2026-07-22 04:29:20 +08:00
elseif
3bb2470535 Fix formatting in feature guide of README
Correct formatting of feature guide section in README.

Signed-off-by: elseif <elseif@live.cn>
2026-07-22 04:28:32 +08:00
elseif
072d684830 Update README.md
Signed-off-by: elseif <elseif@live.cn>
2026-07-22 04:27:52 +08:00
elseif
e2387c9ab3 Update README.md
Signed-off-by: elseif <elseif@live.cn>
2026-07-22 04:26:53 +08:00
elseif
3d7033276a Update README.md
Signed-off-by: elseif <elseif@live.cn>
2026-07-22 04:26:21 +08:00
elseif
34aba15f4c modified: .github/workflows/main.yml 2026-07-21 18:15:03 +08:00
elseif
e6b0e3a7c7 modified: .github/workflows/main.yml 2026-07-21 18:11:30 +08:00
elseif
bf1143fa81 modified: chr.sh 2026-07-21 13:54:24 +08:00
elseif
53cfc32c64 modified: README.md 2026-07-21 09:59:27 +08:00
elseif
4522e4c245 modified: README.md
modified:   README_CN.md
2026-07-21 09:38:40 +08:00
elseif
155823c638 modified: README.md
new file:   README_CN.md
2026-07-21 09:29:18 +08:00
elseif
5ef16bd0a2 modified: README.md 2026-07-21 09:17:20 +08:00
elseif
37bc80919a modified: README.md 2026-07-21 09:16:27 +08:00
elseif
57a1f98516 modified: README.md 2026-07-20 17:12:28 +08:00
elseif
45cfa3693a modified: README.md 2026-07-20 17:05:09 +08:00
elseif
bc4887e9e5 modified: .github/workflows/build_docker.yml 2026-07-20 16:57:24 +08:00
elseif
cd727fe33c modified: .github/workflows/build_docker.yml 2026-07-20 16:49:11 +08:00
8 changed files with 206 additions and 51 deletions

View File

@@ -77,7 +77,7 @@ jobs:
# x86 架构
mkdir -p "amd64"
wget -nv -O "amd64/chr-$VERSION.img.zip" \
"https://github.com/elseif/MikroTikPatch/releases/download/$VERSION/chr-$VERSION.img.zip"
"https://github.com/elseif/MikroTikPatch/releases/download/$VERSION/chr-$VERSION-legacy-bios.img.zip"
unzip "amd64/chr-$VERSION.img.zip" -d "amd64/"
rm "amd64/chr-$VERSION.img.zip"

View File

@@ -2,7 +2,7 @@
name: Patch Mikrotik RouterOS
on:
schedule:
- cron: "00 10 * * *" # At UTC 10:00 (Beijing 18:00) on every day
- cron: "00 09 * * *" # At UTC 09:00 (Beijing 17:00) on every day
workflow_dispatch:
inputs:
version:

View File

@@ -623,7 +623,7 @@ jobs:
truncate --size 128M $BUILD_DIR/chr-$VERSION$ARCH_EXT.img
sgdisk \
--zap-all \
--set-alignment=1 \
--set-alignment=8 \
--new=1:34:+32M --typecode=1:8300 --change-name=1:"RouterOS Boot" \
--new=2:0:0 --typecode=2:8300 --change-name=2:"RouterOS" \
--gpttombr=1:2 \
@@ -632,7 +632,7 @@ jobs:
printf '\x01' | dd of=$BUILD_DIR/mbr.bin bs=1 count=1 seek=336 conv=notrunc
sgdisk \
--zap-all \
--set-alignment=1 \
--set-alignment=8 \
--new=1:34:+32M --typecode=1:EF00 --change-name=1:"RouterOS Boot" \
--new=2:0:0 --typecode=2:8300 --change-name=2:"RouterOS" \
$BUILD_DIR/chr-$VERSION$ARCH_EXT.img
@@ -699,7 +699,7 @@ jobs:
truncate --size 128M $BUILD_DIR/chr-$VERSION$ARCH_EXT-legacy-bios.img
sgdisk \
--zap-all \
--set-alignment=1 \
--set-alignment=8 \
--new=1:34:+32M --typecode=1:8300 --change-name=1:"RouterOS Boot" --attributes=1:set:2 \
--new=2:0:-4096 --typecode=2:8300 --change-name=2:"RouterOS" \
--gpttombr=1:2 \
@@ -710,7 +710,7 @@ jobs:
printf '\x80' | sudo dd of=$BUILD_DIR/mbr.bin bs=1 count=1 seek=446 conv=notrunc
sgdisk \
--zap-all \
--set-alignment=1 \
--set-alignment=8 \
--new=1:34:+32M --typecode=1:8300 --change-name=1:"RouterOS Boot" --attributes=1:set:2 \
--new=2:0:-4096 --typecode=2:8300 --change-name=2:"RouterOS" \
$BUILD_DIR/chr-$VERSION$ARCH_EXT-legacy-bios.img
@@ -782,7 +782,7 @@ jobs:
truncate --size 128M $BUILD_DIR/chr-$VERSION$ARCH_EXT.img
sgdisk \
--zap-all \
--set-alignment=1 \
--set-alignment=8 \
--new=1:34:+32M --typecode=1:8300 --change-name=1:"RouterOS Boot" \
--new=2:0:0 --typecode=2:8300 --change-name=2:"RouterOS" \
--gpttombr=1:2 \
@@ -791,7 +791,7 @@ jobs:
printf '\x01' | dd of=$BUILD_DIR/mbr.bin bs=1 count=1 seek=336 conv=notrunc
sgdisk \
--zap-all \
--set-alignment=1 \
--set-alignment=8 \
--new=1:34:+32M --typecode=1:EF00 --change-name=1:"RouterOS Boot" \
--new=2:0:0 --typecode=2:8300 --change-name=2:"RouterOS" \
$BUILD_DIR/chr-$VERSION$ARCH_EXT.img

120
README.md
View File

@@ -5,66 +5,100 @@
[![License: WTFPL](https://img.shields.io/badge/License-WTFPL-brightgreen.svg)](./LICENSE)
[![CoC:WTFCoC](https://img.shields.io/badge/CoC-WTFCoC-brightgreen.svg)](./CODE_OF_CONDUCT.md)
**English** | [中文](./README_CN.md)
## ⚠️ 重要声明
**此项目及工具仅供测试用途。使用风险自负。生产环境请使用官方授权版本。**
> ## ⚠️ Important Notice
>
> **This project and its tools are for testing purposes only. Use at your own risk. Please use the officially licensed version for production environments.**
## 架构x86、arm64
- **主页:** https://mikrotik.ltd/
- **演示:** https://demo.mikrotik.ltd/
- **授权: 安装option.npk后将自动授予最高级别许可证。**
- **源代码:** https://github.com/elseif/MikroTikPatch
- **授权BOT** https://t.me/ROS_Keygen_Bot
## 🏗️ Architecture Support
### x86 / arm64 (This Project)
- **Homepage:** https://mikrotik.ltd/
- **Demo:** https://demo.mikrotik.ltd/
- **License: Installing `option.npk` will automatically grant the highest-level license.**
- **License Bot:** https://t.me/ROS_Keygen_Bot
- **Docker** `docker run -d --privileged --name chr ghcr.io/elseif/chr:latest`
## 架构:arm64, arm, mipsbe, mmips, ppc, smips, x86
- **主页:** https://routeros.ltd/
- **授权: 需要赞助***CHR版本(x86/Arm64)支持在线直接获取授权*
- **功能:** 支持在线自定义制作品牌包
### arm64, arm, mipsbe, mmips, ppc, smips, x86
- **Homepage:** https://routeros.ltd/
- **License: Sponsorship required.** *CHR versions (x86/Arm64) support online direct licensing.*
- **Features:** Supports online custom brand package creation.
---
## 支持的云功能
| 功能 | 命令 |
|------|------|
| 在线升级 | `system/package/update/install` |
| DDNS | `ip/cloud/set ddns-enabled=yes` |
| 云备份 | `/system/backup/cloud/upload-file action=create-and-upload password=any` |
## 🔧 Feature Guide
> All features below require the `option.npk` package to be installed first.
### 1. Enable Container Mode (No Physical Reboot Required)
```bash
# Step 1: Enable container mode
/system/device-mode/update container=yes
# Step 2: Force reboot (execute in a new terminal)
/system/shell cmd="reboot -f"
```
### 2. Shell Access
#### A. Via Terminal
```bash
/system/shell
# or shorthand
/sh
```
#### B. Via SSH / Telnet
```bash
# Username: devel
# Password: Same as the admin password
ssh devel@<router-ip>
```
### 3. x86 Architecture: CHR ↔ x86 Mode Switch
## 启用容器模式(无需物理重启)
1. 安装 `option.npk` 包;
2. 打开终端执行:`system/device-mode/update container=yes`
3. 打开新终端执行:`system/shell cmd="reboot -f"`
```bash
# Execute after entering shell
keygen chr # Switch to CHR mode
keygen x86 # Switch to x86 mode
```
### 4. Boot Auto-Run Script
## 通过终端进入shell
- 安装 `option.npk`
- 打开终端执行:`/system/shell``/sh`
1. Create or edit the `/rw/disk/rc.local` file.
2. Write your script content, for example
## 通过ssh或telnet进入shell
- 安装 `option.npk`
- ssh或telnet登录用户名为:`devel`,密码与`admin`密码相同。
## x86架构支持CHR和x86模式切换
- 安装 `option.npk`
- 进入shell执行`keygen chr``keygen x86`
## 支持开机自动运行脚本
- 安装 `option.npk`
- 创建或者编辑文件目录下的`rc.local`文件,即:`/rw/disk/rc.local`文件
- 写入脚本内容,例如:
```bash
#!/bin/sh
# This script will be executed *before* RouterOS *loader* start.
# You can put your own initialization stuff in here
echo "Hello, world!"
```
- 开机启动时将看到输出增加:`Starting rc.local...`
- 启动后进入shell执行`cat /ram/startup.catlog | grep 'Hello'` 查看输出。
3. You will see the output during boot: `Starting rc.local...`
4. After boot, check the output:
```bash
# Enter shell
cat /ram/startup.catlog | grep 'Hello'
```
---
## ☁️ Cloud Services
| Feature | Command |
|------|------|
| Online Upgrade | `system/package/update/install` |
| Dynamic DNS | `ip/cloud/set ddns-enabled=yes` |
| Cloud Backup | `/system/backup/cloud/upload-file action=create-and-upload password=any` |
| Internet Detection | `/interface/detect-internet/set detect-interface-list=all` |
---
## 📚 Resources
- [MikroTik Official Documentation](https://manual.mikrotik.com/)
- [Telegram Group](https://t.me/+99Mw06p3K7NlMmNl)
- [GitHub Source Code](https://github.com/elseif/MikroTikPatch)
### 更多关于RouterOS的信息请查看: https://manual.mikrotik.com/
### 感谢赞助
[DartNode(aff)](https://dartnode.com?aff=SnazzyLobster067) | [ZMTO(aff)](https://console.zmto.com/?affid=1588) | [Vultr(aff)](https://www.vultr.com/?ref=9807160-9J)
---
## 💖 Sponsors
[![Powered by DartNode](https://dartnode.com/branding/DN-Open-Source-sm.png)](https://dartnode.com "Powered by DartNode - Free VPS for Open Source")
[DartNode(aff)](https://dartnode.com?aff=SnazzyLobster067) | [ZMTO(aff)](https://console.zmto.com/?affid=1588) | [Vultr(aff)](https://www.vultr.com/?ref=9807160-9J)

115
README_CN.md Normal file
View File

@@ -0,0 +1,115 @@
# MikroTik RouterOS Patch
[![Patch Mikrotik RouterOS](https://github.com/elseif/MikroTikPatch/actions/workflows/main.yml/badge.svg)](https://github.com/elseif/MikroTikPatch/actions/workflows/main.yml)
![Cloud Status](https://img.shields.io/endpoint?url=https://mikrotik.ltd/status/cloud)
[![License: WTFPL](https://img.shields.io/badge/License-WTFPL-brightgreen.svg)](./LICENSE)
[![CoC:WTFCoC](https://img.shields.io/badge/CoC-WTFCoC-brightgreen.svg)](./CODE_OF_CONDUCT.md)
[English](./README.md) | **中文**
>## ⚠️ 重要声明
>
>**此项目及工具仅供测试用途。使用风险自负。生产环境请使用官方授权版本。**
## 🏗️ 架构支持
### x86 / arm64 (本项目)
- **主页:** https://mikrotik.ltd/
- **演示:** https://demo.mikrotik.ltd/
- **授权: 安装option.npk后将自动授予最高级别许可证。**
- **授权BOT** https://t.me/ROS_Keygen_Bot
- **Docker** `docker run -d --privileged --name chr ghcr.io/elseif/chr:latest`
### arm64, arm, mipsbe, mmips, ppc, smips, x86
- **主页:** https://routeros.ltd/
- **授权: 需要赞助***CHR版本(x86/Arm64)支持在线直接获取授权*
- **功能:** 支持在线自定义制作品牌包
---
## 🔧 功能指南
> 以下功能均需先安装 `option.npk` 包。
### 1. 启用容器模式(无需物理重启)
```bash
# 步骤 1启用容器模式
/system/device-mode/update container=yes
# 步骤 2强制重启在新终端中执行
/system/shell cmd="reboot -f"
```
### 2. Shell 访问
#### A. 通过终端
```bash
/system/shell
# 或简写
/sh
```
#### B. 通过 SSH / Telnet
```bash
# 用户名: devel
# 密码: 与 admin 密码相同
ssh devel@<router-ip>
```
### 3. x86 架构CHR ↔ x86 模式切换
```bash
# 进入 shell 后执行
keygen chr # 切换为 CHR 模式
keygen x86 # 切换为 x86 模式
```
### 4. 开机自动运行脚本
1. 创建或编辑 `/rw/disk/rc.local` 文件
2. 写入脚本内容,例如:
```bash
#!/bin/sh
# This script will be executed *before* RouterOS *loader* start.
# You can put your own initialization stuff in here
echo "Hello, world!"
```
3. 开机启动时将看到输出:`Starting rc.local...`
4. 启动后查看输出:
```bash
# 进入 shell
cat /ram/startup.catlog | grep 'Hello'
```
---
## ☁️ 云服务
| 功能 | 命令 |
|------|------|
| 在线升级 | `system/package/update/install` |
| 动态域名 | `ip/cloud/set ddns-enabled=yes` |
| 云备份 | `/system/backup/cloud/upload-file action=create-and-upload password=any` |
| 网络检测 | `/interface/detect-internet/set detect-interface-list=all` |
---
## 📚 相关资源
- [MikroTik 官方文档](https://manual.mikrotik.com/)
- [Telegram 群组](https://t.me/+99Mw06p3K7NlMmNl)
- [GitHub 源码](https://github.com/elseif/MikroTikPatch)
---
## 💖 感谢赞助
[![Powered by DartNode](https://dartnode.com/branding/DN-Open-Source-sm.png)](https://dartnode.com "Powered by DartNode - Free VPS for Open Source")
[DartNode(aff)](https://dartnode.com?aff=SnazzyLobster067) | [ZMTO(aff)](https://console.zmto.com/?affid=1588) | [Vultr(aff)](https://www.vultr.com/?ref=9807160-9J)

6
chr.sh
View File

@@ -294,6 +294,12 @@ create_autorun() {
ask_until "$MSG_ADMIN_PASSWORD" "$RANDOM_ADMIN_PASS"
RANDOM_ADMIN_PASS=$resp
cat <<EOF > "$MNT/rw/autorun.scr"
/tool mac-server set allowed-interface-list=none
/tool mac-server mac-winbox set allowed-interface-list=none
/tool mac-server ping set enabled=no
/ip neighbor discovery-settings set discover-interface-list=none
/tool bandwidth-server set enabled=no
/ip dns set allow-remote-requests=no
/user set admin password="$RANDOM_ADMIN_PASS"
/ip dns set servers=$DNS
/ip address add address=$ADDRESS interface=[/interface ethernet get [find mac-address=$MAC] name]

Binary file not shown.

Binary file not shown.