Browse Source

Merge branch 'mlimonci/make-dist' into 'main'

Add new `make dist` target

See merge request kernel-firmware/linux-firmware!4
main
Josh Boyer 1 year ago
parent
commit
20d250e3e9
No known key found for this signature in database
  1. 2
      .gitignore
  2. 4
      .gitlab-ci.yml
  3. 11
      Makefile
  4. 10
      copy-firmware.sh

2
.gitignore vendored

@ -1 +1,3 @@ @@ -1 +1,3 @@
debian/
dist/
release/

4
.gitlab-ci.yml

@ -18,8 +18,12 @@ release: @@ -18,8 +18,12 @@ release:
- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
when: never
- if: $RELEASE_TOKEN
artifacts:
paths:
- dist/*
script:
- CI_PUSH_REPO=`echo "$CI_REPOSITORY_URL" | sed 's/^.*@/@/g'`
- git remote set-url --push origin "https://gitlab-ci-token:${RELEASE_TOKEN}$CI_PUSH_REPO"
- git tag `date "+%Y%m%d"`
- git push --tags
- make dist

11
Makefile

@ -12,6 +12,14 @@ check: @@ -12,6 +12,14 @@ check:
fi
@pre-commit run --all-files

dist:
@mkdir -p release dist
./copy-firmware.sh release
@TARGET=linux-firmware_`git describe`.tar.gz; \
cd release && tar -czf ../dist/$${TARGET} *; \
echo "Created dist/$${TARGET}"
@rm -rf release

install:
install -d $(DESTDIR)$(FIRMWAREDIR)
./copy-firmware.sh $(DESTDIR)$(FIRMWAREDIR)
@ -23,3 +31,6 @@ install-xz: @@ -23,3 +31,6 @@ install-xz:
install-zst:
install -d $(DESTDIR)$(FIRMWAREDIR)
./copy-firmware.sh --zstd $(DESTDIR)$(FIRMWAREDIR)

clean:
rm -rf release dist

10
copy-firmware.sh

@ -9,12 +9,16 @@ prune=no @@ -9,12 +9,16 @@ prune=no
# shellcheck disable=SC2209
compress=cat
compext=
quiet=">/dev/null"
rdfind_results=/dev/null

while test $# -gt 0; do
case $1 in
-v | --verbose)
# shellcheck disable=SC2209
verbose=echo
quiet=
rdfind_results=results.txt
shift
;;

@ -115,6 +119,12 @@ grep -E '^Link:' WHENCE | sed -e 's/^Link: *//g;s/-> //g' | while read f d; do @@ -115,6 +119,12 @@ grep -E '^Link:' WHENCE | sed -e 's/^Link: *//g;s/-> //g' | while read f d; do
fi
done

$verbose rdfind -makesymlinks true "$destdir" -outputname $rdfind_results "$quiet"
find "$destdir" -type l | while read -r l; do
target="$(realpath "$l")"
ln -fs "$(realpath --relative-to="$(dirname "$(realpath -s "$l")")" "$target")" "$l"
done

exit 0

# vim: et sw=4 sts=4 ts=4

Loading…
Cancel
Save