OpenWRT中添加新设备支持

摘要:
这里是为OpenWRT添加对小型路由的支持。将新设备image/build/profile/mt7620a写入target/linux/ramps/image/makefile_CLZ=$(callbuildFirmware/Default8M/$(1),$(1个),mt7620a_CLZ,mt7620a_CLZ)$(callimage/build/profile/mt7620a_CLZ$(

这里还是向OpenWRT中添加对小度路由的支持
向 target/linux/ramips/image/makefile中写入新设备

image/build/profile/mt7620a_CLZ=$(call buildFirmware/Default8M/$(1),$(1),mt7620a_clz,MT7620a_CLZ)
$(call image/Build/Profile/MT7620a_CLZ,$(1))

base-files中的一些可用配置:

base-files/etc/diag.sh 控制LED在OpenWRT启动时是否闪烁
base-files/lib/upgrade/platform.sh 允许sysupgrade工作
base-files/etc/uci-defaults/network to configure(安装) default network interface(界面) settings, particularly MAC addresses
base-files/etc/uci-defaults/leds if you have configurable(可配置的) LEDs which should default to a behavior(行为), like a WLAN activity LED
base-files/etc/hotplug.d/firmware(固件)/10-rt2x00-eeprom to extract(提取) the firmware image for the wireless(无线的) module
base-files/lib/preinit/06_set_iface_mac to set the MAC addresses of any other interfaces(界面)

编写的小度路由用的dts文件

/dts-v1/;

/include/ "mt7620a.dtsi"

/ {
    compatible = "ralink,mt7620a-eval-board", "ralink,mt7620a-soc";
    model = "Ralink MT7620A xiaodu board";

    palmbus@10000000 {
        sysc@0 {
            ralink,gpiomux = "i2c";
            ralink,uartmux = "gpio";
            ralink,wdtmux = <1>;
        };

        gpio0: gpio@600 {
            status = "okay";
        };

        spi@b00 {
            status = "okay";

            w25q64bv@0 {
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "w25q64bv";
                reg = <0 0>;
                linux,modalias = "w25q64bv";
                spi-max-frequency = <1000000>;

                partition@0 {
                    label = "u-boot";
                    reg = <0x0 0x30000>;
                    read-only;
                };

                partition@30000 {
                    label = "u-boot-env";
                    reg = <0x30000 0x10000>;
                    read-only;
                };

                factory: partition@40000 {
                    label = "factory";
                    reg = <0x40000 0x10000>;
                    read-only;
                };

                partition@50000 {
                    label = "firmware";
                    reg = <0x50000 0x6b0000>;
                };

                partition@700000 {
                    label = "usercfg";
                    reg = <0x700000 0x100000>;
                };
            };
        };
    };

    ethernet@10100000 {
        status = "okay";

        pinctrl-names = "default";
        pinctrl-0 = <&ephy_pins>;

        ralink,port-map = "llllw";
    };

    gsw@10110000 {
        ralink,port4 = "ephy";
    };

    sdhci@10130000 {
        status = "okay";
    };

    pcie@10140000 {
        status = "okay";
    };

    gpio-keys-polled {
        compatible = "gpio-keys";
        #address-cells = <1>;
        #size-cells = <0>;
        poll-interval = <20>;
        wps {
            label = "wps";
            gpios = <&gpio0 12 1>;
            linux,code = <0x100>;
        };
        reset {
            label = "reset";
            gpios = <&gpio0 13 1>;
            linux,code = <0x101>;
        };
    };
};

添加设备后,最好需要将之前编译产生的临时文件删除,语句如下

 cd trunk
 rm -rf tmp
 make menuconfig

本文章由http://www.wifidog.pro/2015/06/22/openwrt%E6%B7%BB%E5%8A%A0%E6%96%B0%E8%AE%BE%E5%A4%87.html 整理编辑,转载请注明出处

免责声明:文章转载自《OpenWRT中添加新设备支持》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇Layui用户中心模板Loadrunner 11安装和破解下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

Frp内网穿透安装教程#Frpc OpenWrt客户端安装#图形化管理

本文转自:https://blog.csdn.net/sugoods/article/details/108839840 注意事项:在OpenWrt环境下,一定要先安装frpc客户端再安装图形操作界面 luci-app-frpc,要不就会出问题。不要问我怎么知道的,反正按着我的步骤装就好。 一、路由器安装Frp客户端Frpc,按下面的操作步骤。目前最新版本...

在openwrt上编译一个最简单的ipk包

1 什么是opkg   Opkg 是一个轻量快速的套件管理系统,目前已成为 Opensource 界嵌入式系统标准。常用于路由、交换机等嵌入式设备中,用来管理软件包的安装升级与下载。   opkg update 更新可以获取的软件包列表   opkg upgrade 对已经安装的软件包升级   opkg list 获取软件列表   opkg install...

openwrt 代码框架分析

这次讲讲openwrt的结构. 1.代码上来看有几个重要目录package, target, build_root, bin, dl....---build_dir/host目录是建立工具链时的临时目录---build_dir/toolchain-是对应硬件的工具链的目录---staging_dir/toolchain- 则是工具链的安装位置---targ...

在OpenWrt中安装Wiwiz实现portal认证

1.系统需求硬件 已安装了OpenWrt固件的无线路由器(典型的有Linksys WRT54G系列) 软件 Wifidog 你可以尝试执行以下命令安装Wifidog: opkg update # Optional opkg install wifidog 复制代码将无线路由器接入Internet。设置并启用无线网络,即,使用无线路由器创建一个可用的Acc...

OpenWrt包管理软件opkg的使用(极路由)

说明: 1、OpenWrt本身系统没什么问题,关键点是一些路由器尝试的限制,比如一些厂商设置成内存分区为只读,那么这个安装软件就变得没什么意义了。 2、opkg的操作有点反人类,正常步骤是查询,安装;而opkg在一些厂商的限制下需要update,然后download,最后install;且有时会安装在tmp区,重启会没有。 常用安装步骤: 如果想要安装一个...

转:openwrt 框架分析

本文是本人对OpenWrt的Makefile的理解,并非转载。OpenWrt是一个典型的嵌入式Linux工程,了解OpenWrt的Makefile的工作过程对提高嵌入式Linux工程的开发能力有极其重要意义。OpenWrt的主Makefile文件只有100行,可以简单分为三部分,1~17行为前导部分,19~31为首次执行部分,33~101为再次执行部分。前...