mtk_openwrt 编译uboot

  1. 进入Uboot目录 (/home/lbo/work/furrion/code/openwrt7621/Uboot
  2. 配置BootLoader配置(make menuconfig
  3. 选择 单image。 ( [ ] Dual Image
  4. make

这里写图片描述

Mediatek BootLoader 5.0.0.0 Configuration
 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  +--------------------------------------------------------------------------------------- Main Menu ---------------------------------------------------------------------------------------+
  |  Arrow keys navigate the menu.  <Enter> selects submenus --->.  Highlighted letters are hotkeys.  Pressing <Y> includes, <N> excludes, <M> modularizes features.  Press <Esc><Esc> to   |  
  |  exit, <?> for Help.  Legend: [*] built-in  [ ] excluded  <M> module  < > module capable                                                                                                |  
  |                                                                                                                                                                                         |  
  |                                                                                                                                                                                         |  
  | +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |  
  | |                                                                     Cross Compiler Path: "/opt/mips-2012.03/bin/"                                                                   | |  
  | |                                                                ---                                                                                                                  | |  
  | |                                                                (ASIC) Chip Type                                                                                                     | |  
  | |                                                                (MT7621) Chip ID                                                                                                     | |  
  | |                                                                (GMAC1) Use GE1 or GE2                                                                                               | |  
  | |                                                                (GE_RGMII_FORCE_1000) GE1 connected to                                                                               | |  
  | |                                                                (SPI) Flash Type                                                                                                     | |  
  | |                                                                (1024Mb) DDR Component                                                                                               | |  
  | |                                                                (800Mhz) DRAM Speed                                                                                                  | |  
  | |                                                                (880Mhz) CPU Frequency                                                                                               | |  
  | |                                                                ---                                                                                                                  | |  
  | |                                                                [ ] Tiny Uboot                                                                                                       | |  
  | |                                                                (ROM) Ram/Rom version                                                                                                | |  
  | |                                                                [ ] Dual Image                                                                                                       | |  
  | |                                                                [*] Dual Core Support                                                                                                | |  
  | |                                                                [*] Partition LAN/WAN                                                                                                | |  
  | |                                                                (LLLL/W) LAN/WAN Board Layout                                                                                        | |  
  | |                                                                [*] DDR ACTiming Setting                                                                                             | |  
  | |                                                                (DDR3_Default(4Gb)) DDR Chip                                                                                         | |  
  | |                                                                ---                                                                                                                  | |  
  | |                                                                Load an Alternate Configuration File                                                                                 | |  
  | |                                                                Save Configuration to an Alternate File                                                                              | |  
  | |                                                                                                                                                                                     | |  
  | |                                                                                                                                                                                     | |  
  | +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |  
  +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+  
  |                                                                            <Select>    < Exit >    < Help >                                                                             |  
  +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+  

lbo@donglebuild2:~/work/furrion/code/openwrt7621$ ls
branches  doc  tool  trunk  Uboot
lbo@donglebuild2:~/work/furrion/code/openwrt7621$ cd Uboot/
lbo@donglebuild2:~/work/furrion/code/openwrt7621/Uboot$ ls
autoconf.h  config.in  CREDITS  fs           MAINTAINERS     mkconfig              mt7621_stage_L2_noprint.bin    PT30.config  stage1      uboot.bin
board       config.mk  disk     include      MAKEALL         mt7621_ddr_param.txt  mt7621_stage_sram.bin          README       System.map  u-boot.map
CHANGELOG   COPYING    doc      lib_generic  Makefile        mt7621_ddr.sh         mt7621_stage_sram_noprint.bin  rtc          tools       u-boot.srec
common      cpu        drivers  lib_mips     mips_config.mk  mt7621_stage_L2.bin   net                            scripts      u-boot      uboot_version.h
lbo@donglebuild2:~/work/furrion/code/openwrt7621/Uboot$ make menuconfig 
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
1. 下载SDK 首先需要从OpenWrt官网下载SDK。选择与路由器硬件平台对应的SDK,例如:如果你的路由器是MT7620A芯片,则需要下载MT7620A SDK。 2. 解压SDK 将下载的SDK解压到任意目录下,例如:/opt/mt7620a_sdk。 3. 进入SDK目录 打开终端,进入SDK目录,例如:cd /opt/mt7620a_sdk。 4. 配置SDK 执行make menuconfig命令,进入SDK配置界面,进行以下配置: - Target System: 选择路由器的芯片类型,例如:MediaTek Ralink MIPS - Target Profile: 选择路由器的型号,例如:MT7620A based boards - Target Images: 选择编译软件包的目标平台,例如:ramips/mt7620a 5. 添加软件包源 执行以下命令,添加软件包源: echo "src/gz openwrt_custom http://openwrt.inkworm.com/chaos_calmer/15.05/mt7620a/packages/custom" >> /etc/opkg/customfeeds.conf opkg update 6. 安装编译工具 执行以下命令,安装编译工具: opkg install gcc make libpthread libstdcpp 7. 编写Makefile文件 在任意目录下创建一个文件夹,例如:/opt/my_package,并在该文件夹下创建一个名为Makefile的文件。在Makefile文件中编写软件包的编译规则。 以下是一个简单的Makefile文件示例: ``` include $(TOPDIR)/rules.mk PKG_NAME:=hello-world PKG_VERSION:=1.0 PKG_RELEASE:=1 include $(INCLUDE_DIR)/package.mk define Package/hello-world SECTION:=utils CATEGORY:=Utilities TITLE:=Hello World DEPENDS:=@TARGET_ramips_mt7620a endef define Package/hello-world/description This is a Hello World package. endef define Build/Compile $(MAKE) -C $(PKG_BUILD_DIR) $(TARGET_CONFIGURE_OPTS) endef define Package/hello-world/install $(INSTALL_DIR) $(1)/bin $(INSTALL_BIN) $(PKG_BUILD_DIR)/hello-world $(1)/bin/ endef $(eval $(call BuildPackage,hello-world)) ``` 8. 编译软件包 执行以下命令,编译软件包: make package/hello-world/compile V=s 编译完成后,在SDK目录下的bin目录中可以找到编译好的软件包。 9. 安装软件包 将编译好的软件包拷贝到路由器上,并执行以下命令安装: opkg install hello-world_1.0-1_ramips_24kec.ipk 安装完成后,在路由器上执行hello-world命令即可看到输出结果。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值