dag to keep mirrors in sync

main
Ricard Illa 2023-05-02 12:08:31 +02:00
parent 2bb6f4affa
commit b2139012aa
8 changed files with 137 additions and 0 deletions

19
mirrors/Make.config Normal file
View File

@ -0,0 +1,19 @@
################################################################################
MIRRORS_PATH = /mnt/mirrors
################################################################################
ALPINE_VERSIONS = v3.17
ALPINE_ARCHS = aarch64
ALPINE_SUBFOLDERS = main community releases
ALPINE_DEST = $(MIRRORS_PATH)/alpine
ALPINE_URL=rsync://rsync.alpinelinux.org
################################################################################
RPI_FIRMWARE_DEST = $(MIRRORS_PATH)/raspberrypi/firmware
################################################################################
# vi: ft=make

15
mirrors/Make.init Normal file
View File

@ -0,0 +1,15 @@
include Make.config
################################################################################
ALPINE_FOLDERS := $(foreach version,$(ALPINE_VERSIONS), \
$(foreach repo,$(ALPINE_SUBFOLDERS), \
$(foreach arch,$(ALPINE_ARCHS), \
$(ALPINE_DEST)/$(version)/$(repo)/$(arch) \
) \
) \
)
################################################################################
# vi: ft=make

32
mirrors/Makefile Normal file
View File

@ -0,0 +1,32 @@
include Make.config
include Make.init
################################################################################
all: alpine rpi_firmware tftp
.PHONY: all alpine force rpi_firwmare tftp
################################################################################
alpine: $(ALPINE_FOLDERS)
RSYNC_ARGS=--archive --update --hard-links --delete --delete-after --delay-updates --timeout=600 --progress
$(ALPINE_DEST)/%: force
@mkdir -p $(@D)
@echo $@
@rsync $(RSYNC_ARGS) $(ALPINE_URL)/alpine/$* $(@D)
################################################################################
rpi_firmware:
git -C $(RPI_FIRMWARE_DEST) pull
################################################################################
tftp:
make -C tftp
################################################################################
# vi: ft=make

4
mirrors/tftp/Make.config Normal file
View File

@ -0,0 +1,4 @@
PXE_URL = http://netboot.monotremata.xyz
TFTP_DIR = /srv/tftp
# vi: ft=make

12
mirrors/tftp/Makefile Normal file
View File

@ -0,0 +1,12 @@
include ../Make.config
include Make.config
all: $(TFTP_DIR)/bootcode.bin kitchen
.PHONY: kitchen
$(TFTP_DIR)/bootcode.bin: $(RPI_FIRMWARE_DEST)/boot/bootcode.bin
install --mode=644 $< $@
kitchen:
make -C kitchen

View File

@ -0,0 +1,6 @@
ARCH = aarch64
ALPINE_VERSION = v3.17
ALPINE_REVISION = 3.17.3
SERIAL_NO = 1385d29c
# vi: ft=make

View File

@ -0,0 +1,45 @@
include ../../Make.config
include ../Make.config
include Make.config
RPI=rpi
RPI_BOOT_PATH = $(RPI_FIRMWARE_DEST)/boot
ALPINE_FILES_PATH = alpine/$(ALPINE_VERSION)
NETBOOT_FILES_PATH = $(ALPINE_FILES_PATH)/releases/$(ARCH)/netboot-$(ALPINE_REVISION)
ALPINE_REPO = $(PXE_URL)/$(ALPINE_FILES_PATH)/main/$(ARCH)
MODLOOP = $(PXE_URL)/$(NETBOOT_FILES_PATH)/modloop-$(RPI)
DEST_DIR = $(TFTP_DIR)/$(SERIAL_NO)
all: $(DEST_DIR)/fixup.dat $(DEST_DIR)/start.elf $(DEST_DIR)/bcm2710-rpi-3-b-plus.dtb $(DEST_DIR)/initramfs-rpi $(DEST_DIR)/vmlinuz-rpi $(DEST_DIR)/config.txt $(DEST_DIR)/cmdline.txt
$(DEST_DIR)/fixup.dat: $(RPI_BOOT_PATH)/fixup.dat
mkdir -p $(@D)
install --mode=644 $< $@
$(DEST_DIR)/start.elf: $(RPI_BOOT_PATH)/start.elf
mkdir -p $(@D)
install --mode=644 $^ $@
$(DEST_DIR)/bcm2710-rpi-3-b-plus.dtb: $(RPI_BOOT_PATH)/bcm2710-rpi-3-b-plus.dtb
mkdir -p $(@D)
install --mode=644 $^ $@
$(DEST_DIR)/initramfs-rpi: $(MIRRORS_PATH)/$(NETBOOT_FILES_PATH)/initramfs-rpi
mkdir -p $(@D)
install --mode=644 $^ $@
$(DEST_DIR)/vmlinuz-rpi: $(MIRRORS_PATH)/$(NETBOOT_FILES_PATH)/vmlinuz-rpi
mkdir -p $(@D)
install --mode=644 $^ $@
$(DEST_DIR)/cmdline.txt:
mkdir -p $(@D)
echo "modules=loop,squashfs console=ttyAMA0,115200 ip=dhcp alpine_repo=$(ALPINE_REPO) modloop=$(MODLOOP)" > $@
$(DEST_DIR)/config.txt: config.txt
mkdir -p $(@D)
install --mode=644 $^ $@

View File

@ -0,0 +1,4 @@
[pi3+]
kernel=vmlinuz-rpi
initramfs initramfs-rpi
arm_64bit=1