2. 修改/编译kernel,luci登录

1. 修改kernel,在 openwrt/imx_openwrt/target/linux/imx/patches-5.15/ 目录下有一大堆补丁文件,就是用来给目标镜像打补丁的,在这里修改 kernel 补丁

修改 设备树 补丁文件 0002-add-dts-files.patch

+&pcie0{
+    pinctrl-names = "default";
+    pinctrl-0 = <&pinctrl_pcie0>;
+    disable-gpio = <&gpio1 5 GPIO_ACTIVE_LOW>;
+    reset-gpio = <&gpio4 21 GPIO_ACTIVE_LOW>;
+    clocks = <&clk IMX8MM_CLK_PCIE1_ROOT>,
+         <&clk IMX8MM_CLK_PCIE1_AUX>,
+         <&clk IMX8MM_CLK_PCIE1_PHY>,
+         <&pcie0_refclk>;
+    clock-names = "pcie", "pcie_aux", "pcie_phy", "pcie_bus";
+    assigned-clocks = <&clk IMX8MM_CLK_PCIE1_AUX>,
+              <&clk IMX8MM_CLK_PCIE1_PHY>,
+              <&clk IMX8MM_CLK_PCIE1_CTRL>;
+    assigned-clock-rates = <10000000>, <100000000>, <250000000>;
+    assigned-clock-parents = <&clk IMX8MM_SYS_PLL2_50M>,
+                 <&clk IMX8MM_SYS_PLL2_100M>,
+                 <&clk IMX8MM_SYS_PLL2_250M>;
+    ext_osc = <1>;
+    status = "disabled"; // 由 okey 改为 disabled
+};

单独编译 kernel 

make target/linux/clean V=s

make target/linux/prepare V=s

make target/linux/install V=s -j4 // 最终的烧录镜像也会跟着更新

 

2. 使用 luci 登录

make menuconfig 使能 luci

 

启动后 查看后台进程

1119 root      1620 S    /usr/sbin/uhttpd -f -h /www -r OpenWrt -x /cgi-bin -

ifconfig 查看网络

root@OpenWrt:/# ifconfig
br-lan    Link encap:Ethernet  HWaddr 5A:48:1C:DB:D4:F1
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fd4f:34cb:e8a4::1/60 Scope:Global
          inet6 addr: fe80::5848:1cff:fedb:d4f1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:128177 errors:0 dropped:0 overruns:0 frame:0
          TX packets:127280 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:11055827 (10.5 MiB)  TX bytes:15973718 (15.2 MiB)

eth0      Link encap:Ethernet  HWaddr 5A:48:1C:DB:D4:F1
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:128181 errors:0 dropped:0 overruns:0 frame:0
          TX packets:127279 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:13619655 (12.9 MiB)  TX bytes:15973626 (15.2 MiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:3308 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3308 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:266961 (260.7 KiB)  TX bytes:266961 (260.7 KiB)

把imx8mmini板的网卡(就一个网口)连接到电脑的网口,在电脑的浏览器输入:192.168.1.1

即可进入luci 界面:

 

posted on 2024-09-09 18:00  f1engmin11  阅读(9)  评论(0编辑  收藏  举报

导航