GithubHelp home page GithubHelp logo

mkoshtenko / openwrt-builder Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 22.2 MB

Build a custom OpenWRT image for Raspberry Pi 4 in a virtual environment

Shell 100.00%
openwrt raspberry-pi-4 vagrant ansible cm4

openwrt-builder's Introduction

openwrt-builder

This project contains all necessary files to build a custom OpenWRT image for Raspberry Pi model 4 or CM4 with the following additions to the oficial image:

The latest Raspberry Pi 4 compatible image can be downloaded from the official OpenWRT website from the target bcm2711

How it works

Custom OpenWRT images can be created with the official bcm2711 image builder. This image builder is stored in the same folder with the original build openwrt-imagebuilder-bcm27xx-bcm2711.Linux-x86_64.tar.xz. The builder requires Linux-based operating system running on x86_64 CPU.

Vagrant prepares a virtual Debian host using Ansible playbook for building a new image. It uses VirtualBox as a provider for virtual hosts. The build.sh script downloads all necessary files on the virtual host, runs all build steps and returns the final build to the workstation.

If your workstation is a linux host, you don't need a virtual machine and can execute scripts/build.sh directly from the repo's root folder.

Hardware RPi-4 setup

                                        |
                                  ______| lan = 1Gb/s
                                 /      |___________________
                   --eth0 ------/         PoE IEEE 802.3af/at SWITCH
RPi4(w/ PoE hat)--|                     ____________________
                   --eth1-usb3 -\       |
                                 \_____ | wan = 1Gb/s       [------ CABLE/FIBRE
                                        |___________________
                                          ISP MODEM

OSX Steps

Install all dependencies before moving forward

  • Vagrant brew install vagrant
  • Ansible brew install ansible
  • VirtualBox can be downloaded from https://www.virtualbox.org
    • Note: ARM64(aka Apple CPU) hosts are not supported at the moment

Clone the builder repo:

git clone https://github.com/mkoshtenko/openwrt-builder.git
cd openwrt-builder

Setup the infrastructure:

vagrant up

Create build:

vagrant ssh -c './scripts/build.sh'

Clean up:

vagrant destroy

The image file should be in ./builds directory, e.g. ./builds/openwrt-rpi-4.img.gz

Troubleshooting

Run Ansible playbook w/o destroying the deployment:

vagrant provision

openwrt-builder's People

Contributors

mkoshtenko avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

djeraseit

openwrt-builder's Issues

didn't work

➜ openwrt-builder git:(master) vagrant ssh -c 'cd ~/; ./scripts/build'
➜ Make "builder" directory.
mkdir: cannot create directory ‘builder’: File exists
➜ Download and unpack image builder.
--2021-02-06 18:38:50-- https://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/openwrt-imagebuilder-bcm27xx-bcm2711.Linux-x86_64.tar.xz
Resolving downloads.openwrt.org (downloads.openwrt.org)... failed: Temporary failure in name resolution.
wget: unable to resolve host address ‘downloads.openwrt.org’
tar: openwrt-imagebuilder-bcm27xx-bcm2711.Linux-x86_64.tar.xz: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
➜ Create feeds config.
➜ Update feeds.
./scripts/build: 26: ./scripts/build: ./scripts/feeds: not found
➜ Build image.
make: *** No rule to make target 'image'. Stop.
➜ Copy build.
cp: cannot stat '/home/vagrant/builder/bin/targets/bcm27xx/bcm2711/openwrt-bcm27xx-bcm2711-rpi-4-ext4-factory.img.gz': No such file or directory
Connection to 127.0.0.1 closed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.