Last active
December 28, 2021 06:44
-
-
Save mattiasb/4cc74f213f34266232e7833851a723e1 to your computer and use it in GitHub Desktop.
OpenWRT Image Builder Raspberry Pi 4 Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VERSION=21.02.1 | |
TARGET=bcm27xx-bcm2711 | |
PROFILE=rpi-4 | |
PACKAGES=kmod-usb-net-rtl8152 luci luci-ssl | |
FILESYSTEM=ext4 | |
################### | |
BUILDER_BASEURL=https://downloads.openwrt.org/releases/$(VERSION)/targets/$(subst -,/,$(TARGET)) | |
BUILDER_TARBALL=openwrt-imagebuilder-$(VERSION)-$(TARGET).Linux-x86_64.tar.xz | |
BUILDER=$(basename $(basename $(BUILDER_TARBALL))) | |
IMAGE=openwrt-$(VERSION)-$(TARGET)-$(PROFILE)-$(FILESYSTEM)-factory.img.gz | |
IMAGE_PATH=bin/targets/$(subst -,/,$(TARGET))/$(IMAGE) | |
.PHONY: all clean | |
all: bin/$(IMAGE) | |
clean: | |
@rm -rf ext/ bin/ | |
ext bin: | |
@mkdir -p $@ | |
ext/$(BUILDER_TARBALL): | ext | |
@curl $(BUILDER_BASEURL)/$(BUILDER_TARBALL) -o $@ | |
ext/$(BUILDER): | ext/$(BUILDER_TARBALL) | |
@tar -C ext/ -Jxf $| | |
bin/$(IMAGE): ext/$(BUILDER)/$(IMAGE_PATH) | bin | |
@cp $< $@ | |
ext/$(BUILDER)/$(IMAGE_PATH): | ext/$(BUILDER) | |
@make -C $| image PACKAGES="$(PACKAGES)" PROFILE="$(PROFILE)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment