Modifying/Compiling Kernel and Logging into LuCI on OpenWrt

1. Modify the kernel. In the directory openwrt/imx_openwrt/target/linux/imx/patches-5.15/, there are numerous patch files used to apply patches to the target image. Here, modify the kernel patch.

Modify the device tree patch file 0002-add-dts-files.patch

+&pcie0{+    pinctrl-names = "default";+    pinctrl-0 = <&pcie0_pinctrl>;+    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"; // Changed from okey to disabled+};

Compile the kernel separately

make target/linux/clean V=smake target/linux/prepare V=smake target/linux/install V=s -j4 // The final burned image will also be updated

2. Log in using LuCI

Use make menuconfig to enable LuCI

Modifying/Compiling Kernel and Logging into LuCI on OpenWrt

After starting, check the background processes

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

Use ifconfig to check the network

root@OpenWrt:/# ifconfigbr-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)

Connect the network card of the imx8mmini board (which has only one Ethernet port) to the computer’s Ethernet port, and enter: 192.168.1.1 in the computer’s browser

This will bring you to the LuCI interface:

Modifying/Compiling Kernel and Logging into LuCI on OpenWrtF

Leave a Comment