# m4-openwrt **Repository Path**: weimingtom2000/m4-openwrt ## Basic Information - **Project Name**: m4-openwrt - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 8 - **Created**: 2024-03-22 - **Last Updated**: 2024-03-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 安装依赖 ubuntu 18.04.7 64位系统 ````sh sudo apt-get install subversion build-essential libncurses5-dev zlib1g-dev gawk git ccache \ gettext libssl-dev xsltproc libxml-parser-perl \ gengetopt default-jre-headless ocaml-nox sharutils texinfo mtd-utils sudo dpkg --add-architecture i386 sudo apt-get update sudo apt-get install zlib1g:i386 libstdc++6:i386 libc6:i386 libc6-dev-i386 sudo apt-get install device-tree-compiler python3 python3-pip pip3 install pycryptodomex pip3 install fdt ```` # 下载代码 1. 下载主工程代码 ``` git clone https://gitee.com/qiming-zhixian/m4-openwrt.git ``` 2. 下载feeds软件包 ``` cd m4-openwrt git clone https://gitee.com/qiming-zhixian/zx-feeds.git ``` # 安装toolchian 1. 下载toolchain https://pan.baidu.com/s/1HlQWjvmJT9RhN4Iir8K_tQ 提取码:hlrj 2. 解压缩toolchain ``` sudo tar riscv64-linux-x86_64-20210512.tag.gz -xvf -C /opt/ ``` 3. 设置环境变量,修改 ~/.profile文件, 将下面这行添加到文件末尾 ``` PATH="/opt/riscv64-linux-x86_64-20210512/bin:$PATH" ``` 手动生效环境变量 ``` source ~/.profile ``` 测试交叉工具链 ``` riscv64-unknown-linux-gnu-gcc --version ``` # 编译 1. 生成配置文件 ``` cd m4-openwrt make ZXM47D00_zx ``` 2. 编译 ``` make V=s -j4 ``` 3. 编译产物 位于bin/targets/m4/nand/ZXM47D00 | 文件名 | 说明 | | ------------------------------------------------- | -------------------- | | m4_ZXM47D00_nand_page_2k_block_128k_v1.0.0.img | 工具升级文件 |