ffc59822 (kx 2023-04-15 20:09:24 +0300 1)
ffc59822 (kx 2023-04-15 20:09:24 +0300 2) #
ffc59822 (kx 2023-04-15 20:09:24 +0300 3) # Firmware for the Linux Kernel: git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
ffc59822 (kx 2023-04-15 20:09:24 +0300 4) #
ffc59822 (kx 2023-04-15 20:09:24 +0300 5)
ffc59822 (kx 2023-04-15 20:09:24 +0300 6) url = git://git.kernel.org/pub/scm/linux/kernel/git/firmware
ffc59822 (kx 2023-04-15 20:09:24 +0300 7)
ffc59822 (kx 2023-04-15 20:09:24 +0300 8) repo_name = linux-firmware
ffc59822 (kx 2023-04-15 20:09:24 +0300 9)
ffc59822 (kx 2023-04-15 20:09:24 +0300 10) #
ffc59822 (kx 2023-04-15 20:09:24 +0300 11) # List of tags to be extracted:
ffc59822 (kx 2023-04-15 20:09:24 +0300 12) # ============================
ffc59822 (kx 2023-04-15 20:09:24 +0300 13) #
ffc59822 (kx 2023-04-15 20:09:24 +0300 14) # hash | date
ffc59822 (kx 2023-04-15 20:09:24 +0300 15) # ----------------------------------------+--------
ffc59822 (kx 2023-04-15 20:09:24 +0300 16) revisions = f8462923ed8fc874f770b8c6dfad49d39b381f14:20210518
ffc59822 (kx 2023-04-15 20:09:24 +0300 17) revisions += 8b07c1fb1d8de4259611a0cccaeda893d792cd91:20221012
ffc59822 (kx 2023-04-15 20:09:24 +0300 18)
ffc59822 (kx 2023-04-15 20:09:24 +0300 19) git_repo = .git_clone
ffc59822 (kx 2023-04-15 20:09:24 +0300 20)
ffc59822 (kx 2023-04-15 20:09:24 +0300 21) pkgname = kernel-firmware
ffc59822 (kx 2023-04-15 20:09:24 +0300 22) suffix = tar.xz
ffc59822 (kx 2023-04-15 20:09:24 +0300 23)
ffc59822 (kx 2023-04-15 20:09:24 +0300 24) versions = $(foreach tag, $(revisions), $(shell echo $(tag) | cut -f 2 -d ':'))
ffc59822 (kx 2023-04-15 20:09:24 +0300 25) tarballs = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
ffc59822 (kx 2023-04-15 20:09:24 +0300 26) sha1s = $(addsuffix .sha1sum, $(tarballs))
ffc59822 (kx 2023-04-15 20:09:24 +0300 27)
ffc59822 (kx 2023-04-15 20:09:24 +0300 28) TARGETS = repository_clean
ffc59822 (kx 2023-04-15 20:09:24 +0300 29)
ffc59822 (kx 2023-04-15 20:09:24 +0300 30) all: $(TARGETS)
ffc59822 (kx 2023-04-15 20:09:24 +0300 31)
ffc59822 (kx 2023-04-15 20:09:24 +0300 32) .PHONY: downloads_clean repository_clean
ffc59822 (kx 2023-04-15 20:09:24 +0300 33)
ffc59822 (kx 2023-04-15 20:09:24 +0300 34) $(git_repo):
ffc59822 (kx 2023-04-15 20:09:24 +0300 35) @echo -e "\n======= Clone $(repo_name).git repository =======\n"
ffc59822 (kx 2023-04-15 20:09:24 +0300 36) @rm -rf $(repo_name)
ffc59822 (kx 2023-04-15 20:09:24 +0300 37) @git clone $(url)/$(repo_name).git $(repo_name)
ffc59822 (kx 2023-04-15 20:09:24 +0300 38) @touch $@
ffc59822 (kx 2023-04-15 20:09:24 +0300 39)
ffc59822 (kx 2023-04-15 20:09:24 +0300 40) $(tarballs): $(git_repo)
ffc59822 (kx 2023-04-15 20:09:24 +0300 41) @for revision in $(revisions) ; do \
ffc59822 (kx 2023-04-15 20:09:24 +0300 42) hash=`echo $$revision | cut -f 1 -d ':'` ; \
ffc59822 (kx 2023-04-15 20:09:24 +0300 43) date=`echo $$revision | cut -f 2 -d ':'` ; \
ffc59822 (kx 2023-04-15 20:09:24 +0300 44) if [ ! -f $(pkgname)-$$date.$(suffix) ]; then \
ffc59822 (kx 2023-04-15 20:09:24 +0300 45) echo -e "\n======= Creating '$(pkgname)-$$date.$(suffix)' snapshot =======" ; \
ffc59822 (kx 2023-04-15 20:09:24 +0300 46) ( cd $(repo_name) && \
ffc59822 (kx 2023-04-15 20:09:24 +0300 47) git archive --format=tar --prefix=$(pkgname)-$$date/ $$hash | \
ffc59822 (kx 2023-04-15 20:09:24 +0300 48) xz >../$(pkgname)-$$date.$(suffix) ) ; \
ffc59822 (kx 2023-04-15 20:09:24 +0300 49) fi ; \
ffc59822 (kx 2023-04-15 20:09:24 +0300 50) done
ffc59822 (kx 2023-04-15 20:09:24 +0300 51)
ffc59822 (kx 2023-04-15 20:09:24 +0300 52) $(sha1s): %.$(suffix).sha1sum : %.$(suffix)
ffc59822 (kx 2023-04-15 20:09:24 +0300 53) @for tarball in $< ; do \
ffc59822 (kx 2023-04-15 20:09:24 +0300 54) echo -e "\n======= Calculation the '$$tarball' sha1sum =======" ; \
ffc59822 (kx 2023-04-15 20:09:24 +0300 55) sha1sum --binary $$tarball > $$tarball.sha1sum ; \
ffc59822 (kx 2023-04-15 20:09:24 +0300 56) done
ffc59822 (kx 2023-04-15 20:09:24 +0300 57)
ffc59822 (kx 2023-04-15 20:09:24 +0300 58) repository_clean: $(sha1s)
ffc59822 (kx 2023-04-15 20:09:24 +0300 59) @echo -e "\n======= Remove cloned $(repo_name).git repository =======\n"
ffc59822 (kx 2023-04-15 20:09:24 +0300 60) @rm -rf $(git_repo) $(repo_name)
ffc59822 (kx 2023-04-15 20:09:24 +0300 61)
ffc59822 (kx 2023-04-15 20:09:24 +0300 62) downloads_clean:
ffc59822 (kx 2023-04-15 20:09:24 +0300 63) @rm -rf $(tarballs) $(sha1s)
ffc59822 (kx 2023-04-15 20:09:24 +0300 64) @rm -rf $(git_repo) $(repo_name)