星际宝盒OpBoot启动OpenWrt官方固件?
OpBoot直接刷OpenWrt官方的固件是启动不了的,因为分区的定义不同。
其实在官方源码基础上改一下分区定义,自己编译固件就可解决,以下是流水帐。
下载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 @@
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=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
中添加network
项wwan
编辑 /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
导致。
资料
- 星际宝盒ttl接法
- 星际宝盒ttl串口连接参数
参考
- OpBoot作者对星际宝盒分区的说明
- 恩山无线论坛星际宝盒TTL刷机教程