惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog RSS Feed
J
Java Code Geeks
H
Help Net Security
Google DeepMind News
Google DeepMind News
博客园 - 司徒正美
Microsoft Security Blog
Microsoft Security Blog
宝玉的分享
宝玉的分享
Stack Overflow Blog
Stack Overflow Blog
D
DataBreaches.Net
The GitHub Blog
The GitHub Blog
S
SegmentFault 最新的问题
U
Unit 42
博客园 - 三生石上(FineUI控件)
Last Week in AI
Last Week in AI
M
MIT News - Artificial intelligence
WordPress大学
WordPress大学
小众软件
小众软件
博客园 - 叶小钗
D
Docker
量子位
P
Proofpoint News Feed
博客园_首页
T
Tailwind CSS Blog
F
Fortinet All Blogs

方永、南天紫雲

linux透明代理 技术的边界 停机问题通俗说明 Rust与oracle、redis集群的纠结 学习能力的增长 微信调试的原语 mac外接移动硬盘安装ArchLinux linux的死机问题 linux下全键盘操作 漂亮又好用的bspwm linux本机透明代理 ssh、mosh、autossh linux不能待机又一例 从WordPress切换到Hugo 折腾电脑开机 linux系统QQ新思路 Arch Linux的字体渲染 svn管理之submin OpenWrt自动fucking墙記錄 二维码(qrcode)名片的一些事儿 用lua nginx module搭建一个二维码(qr code)生成器 CentOS 7 安裝註記 php程序連接MySQL时只能127.0.0.1而localhost無法連接的問題 ThinkPad之FAN_ERROR、hi fi聲卡 jetty多端口部署 OpenWrt簡單暴力限網 linux中cron之PATH变量 OpenWrt的WDS無線橋接模式 再敘OpenWrt下的rtl8187無線中繼 sed之模擬tail
星际宝盒OpBoot启动OpenWrt官方固件
zola · 2021-05-02 · via 方永、南天紫雲

星际宝盒OpBoot启动OpenWrt官方固件?

OpBoot直接刷OpenWrt官方的固件是启动不了的,因为分区的定义不同。

其实在官方源码基础上改一下分区定义,自己编译固件就可解决,以下是流水帐。

git clone [email protected]:openwrt/openwrt.git

修改分区定义

patch文件内容如下:

--- target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-cm520-79f.dts	2021-05-02 21:24:53.459040886 +0800
+++ qcom-ipq4019-cm520-79f.dts	2021-05-02 21:25:52.606234556 +0800
@@ -9,6 +9,10 @@
 	model = "MobiPromo CM520-79F";
 	compatible = "mobipromo,cm520-79f";
 
+	chosen {
+		bootargs-append = " ubi.block=0,1 root=/dev/ubiblock0_1";
+	};
+
 	aliases {
 		led-boot = &led_sys;
 		led-failsafe = &led_sys;
@@ -216,65 +220,8 @@
 			#size-cells = <1>;
 
 			partition@0 {
-				label = "SBL1";
-				reg = <0x0 0x100000>;
-				read-only;
-			};
-
-			partition@100000 {
-				label = "MIBIB";
-				reg = <0x100000 0x100000>;
-				read-only;
-			};
-
-			partition@200000 {
-				label = "BOOTCONFIG";
-				reg = <0x200000 0x100000>;
-			};
-
-			partition@300000 {
-				label = "QSEE";
-				reg = <0x300000 0x100000>;
-				read-only;
-			};
-
-			partition@400000 {
-				label = "QSEE_1";
-				reg = <0x400000 0x100000>;
-				read-only;
-			};
-
-			partition@500000 {
-				label = "CDT";
-				reg = <0x500000 0x80000>;
-				read-only;
-			};
-
-			partition@580000 {
-				label = "CDT_1";
-				reg = <0x580000 0x80000>;
-				read-only;
-			};
-
-			partition@600000 {
-				label = "BOOTCONFIG1";
-				reg = <0x600000 0x80000>;
-			};
-
-			partition@680000 {
-				label = "APPSBLENV";
-				reg = <0x680000 0x80000>;
-			};
-
-			partition@700000 {
-				label = "APPSBL";
-				reg = <0x700000 0x200000>;
-				read-only;
-			};
-
-			partition@900000 {
-				label = "APPSBL_1";
-				reg = <0x900000 0x200000>;
+				label = "Bootloader";
+				reg = <0x0 0xb00000>;
 				read-only;
 			};
 
@@ -285,7 +232,7 @@
 			};
 
 			partition@b80000 {
-				label = "ubi";
+				label = "rootfs";
 				reg = <0xb80000 0x7480000>;
 			};
 		};

或在这里下载,覆盖 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-cm520-79f.dts

编译

./scripts/feeds update -a
./scripts/feeds install -a
make menuconfig
# 编译时需从外网下载源码,ALL_PROXY设置了代理
ALL_PROXY=socks5h://localhost make -j9

make menuconfig时`,

Target System选择Qualcomm Atheros IPQ40XX`,

Target Profile选择MobiPromo CM520-79F即可。

安装

编译好的固件路径: bin/targets/ipq40xx/generic/openwrt-ipq40xx-generic-mobipromo_cm520-79f-squashfs-nand-sysupgrade.bin

OpenWrt的菜单System -> Backup / Flash Firmware或通过OpBoot刷写固件均可。

配置

由于是SNAPSHOT版本,是没有luci的,只能通过ssh登录。

如果网线接路由器,网线接蓝色的WAN口即可上网;如果是WIFI中转,需做如下配置:

编辑 /etc/config/firewall,在zone wan中添加networkwwan

编辑 /etc/config/network,添加

config interface 'wwan'
        option proto 'dhcp'

编辑 /etc/config/wireless,修改

config wifi-iface 'default_radio1'
        option device 'radio1'
        option network 'wwan'
        option mode 'sta'
        option ssid 'WIFI名称'
        option encryption 'psk2'
        option key 'WIFI密码'

然后执行 /etc/init.d/network restart使配置生效。

后记

其实折腾时并不是非常顺利,

首先是reset按键孔,用0.7的中性笔是无法触发reset开关的;

然后遇到固件内核及root都可启动,但是查看ttl输出,在执行/bin/init时报错loading shared library libgcc_s.so.1: Exec format error

分析后发现是make menuconfig时选择了Strip unnecessary functions from libraries导致。

资料

  1. 星际宝盒ttl接法

  1. 星际宝盒ttl串口连接参数

参考

  1. OpBoot作者对星际宝盒分区的说明
  2. 恩山无线论坛星际宝盒TTL刷机教程