Builds OpenWrt firmware images with the OpenWrt Image Builder.
Optionally, can also flash firmware images to compatible devices.
Does not require root privileges.
Requires system dependencies to build the images.
To install dependencies in Debian and Ubuntu systems:
sudo apt install -y \
unzip wget rsync git python gawk gettext \
build-essential zlib1g-dev libssl1.0-dev \
libncurses5-dev libncursesw5-dev xsltproc
See Prerequisites for more information or how to install in other systems.
Actions control which task(s) are run to achievde a result.
They can be set using openwrt_action
variable.
Supported actions:
download
, to download image builder (for a target, sub-target and release combination)clean
, to delete firmware images and build files (for a target, sub-target and release combination)build
, to build a firmware image for a deviceflash-sysupgrade
, to flash a firmware image to a device usingsysupgrade
reset-soft
, to soft reset a device usingfirstboot
reset-hard
, to hard reset a device usingjffs2reset
See defaults/main.yml
for information.
Has no Ansible Galaxy dependencies.
To build firmware images:
- name: "OpenWrt :: Build firmware image"
hosts: openwrt_devices
gather_facts: no
tasks:
- include_role:
name: revboot.openwrt
vars:
openwrt_action:
- "download"
- "build"
To delete firmware images and build files:
- name: "OpenWrt :: Delete firmware image and build files"
hosts: openwrt_devices
gather_facts: no
tasks:
- include_role:
name: revboot.openwrt
vars:
openwrt_action:
- "clean"
To flash firmware images with the OpenWrt Sysupgrade:
- name: "OpenWrt :: Flash firmware image (Sysupgrade)"
hosts: openwrt_devices
gather_facts: no
tasks:
- include_role:
name: revboot.openwrt
vars:
openwrt_action:
- "flash-sysupgrade"
NOTE: The
sysupgrade
image flash method will only work on devices previously flashed with OpenWrt using a*squashfs-factory.bin
file.
To soft-reset devices:
- name: "OpenWrt :: Soft-reset device"
hosts: openwrt_devices
gather_facts: no
tasks:
- include_role:
name: revboot.openwrt
vars:
openwrt_action:
- "reset-soft"
To hard-reset devices:
- name: "OpenWrt :: Hard-reset device"
hosts: openwrt_devices
gather_facts: no
tasks:
- include_role:
name: revboot.openwrt
vars:
openwrt_action:
- "reset-hard"
For more information, see the OpenWrt project resources:
- Website
- Version history
- Table of Hardware
- Firmware Selector
- Technical Downloads
- GitHub Project
- Documentation
- Developer Guide
Building OpenWrt and firmware images:
- Quick image building guide
- Using the Image Builder
- Using the toolchain
- Using the SDK
- Build system setup
- Build system usage
Revboot Ansible :: OpenWrt role
Copyright (C) 2021 Revboot - Tecnologias de Informação e Comunicação, Unipessoal Lda.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Created and maintained by Luís Pedro Algarvio.