Skip to content

Commit

Permalink
cleanup when building pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
UriHerrera committed Dec 18, 2024
1 parent c7d034f commit 8683961
Show file tree
Hide file tree
Showing 243 changed files with 51,100 additions and 52 deletions.
52 changes: 0 additions & 52 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,55 +1,3 @@
# Compiled source #
###################
*.asc
*.asm
*.c
*.cmake
*.diff
*.h
*.py
*.sh
*.yaml
*.yml
*LICENCE.*
*LICENSE.*
*LICENCE*
*Makefile*
*NOTICE.txt
*Notice.txt
*WHENCE*
*iwlwifi-*
*.directory*
lib/firmware/.codespell.cfg
lib/firmware/.directory
lib/firmware/.editorconfig
lib/firmware/.gitignore
lib/firmware/Apache-2
lib/firmware/Dockerfile
lib/firmware/GPL-2
lib/firmware/GPL-3
lib/firmware/README.md
lib/firmware/amd-ucode/README
lib/firmware/atusb/ChangeLog
lib/firmware/av7110/Boot.S
lib/firmware/av7110/Makefile
lib/firmware/brcm/brcmfmac43340-sdio.Insyde-VESPA2.txt
lib/firmware/brcm/brcmfmac43362-sdio.ASUSTeK COMPUTER INC.-ME176C.txt
lib/firmware/brcm/brcmfmac43430-sdio.ilife-S806.txt
lib/firmware/brcm/brcmfmac4354-sdio.nvidia,p2371-2180.txt
lib/firmware/contrib/templates/debian.changelog
lib/firmware/contrib/templates/debian.control
lib/firmware/contrib/templates/debian.copyright
lib/firmware/contrib/templates/rpm.spec
lib/firmware/isci/README

# Directories #
###############
/lib/firmware/amd
/lib/firmware/amd-ucode
/lib/firmware/amdgpu
/lib/firmware/amdtee
/lib/firmware/ar3k
/lib/firmware/brcm
/lib/firmware/carl9170fw
/lib/firmware/cirrus
/lib/firmware/nvidia
59 changes: 59 additions & 0 deletions gh-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,65 @@ set -x
apt -qq update
apt -qq -yy install equivs git devscripts lintian --no-install-recommends

### Remove files and directories fomr upstream source.
files=(
"*.asc" "*.asm" "*.c" "*.cmake" ".directory" "*.diff" "*.h" "*.py" "*.sh" "*.yaml" "*.yml"

"*[Ll][Ii][Cc][Ee][Nn][Cc][Ee]*"
"*Makefile*"
"*[Nn][Oo][Tt][Ii][Cc][Ee]*.txt"
"*WHENCE*"

"*iwlwifi-*"
"lib/firmware/.codespell.cfg"
"lib/firmware/.editorconfig"
"lib/firmware/.gitignore"
"lib/firmware/Apache-2"
"lib/firmware/Dockerfile"
"lib/firmware/GPL-2"
"lib/firmware/GPL-3"
"lib/firmware/README.md"
"lib/firmware/amd-ucode/README"
"lib/firmware/atusb/ChangeLog"
"lib/firmware/av7110/Boot.S"
"lib/firmware/av7110/Makefile"
"lib/firmware/brcm/brcmfmac43340-sdio.Insyde-VESPA2.txt"
"lib/firmware/brcm/brcmfmac43362-sdio.ASUSTeK COMPUTER INC.-ME176C.txt"
"lib/firmware/brcm/brcmfmac43430-sdio.ilife-S806.txt"
"lib/firmware/brcm/brcmfmac4354-sdio.nvidia,p2371-2180.txt"
"lib/firmware/contrib/templates/debian.changelog"
"lib/firmware/contrib/templates/debian.control"
"lib/firmware/contrib/templates/debian.copyright"
"lib/firmware/contrib/templates/rpm.spec"
"lib/firmware/isci/README"
)


directories=(
"lib/firmware/amd"
"lib/firmware/amd-ucode"
"lib/firmware/amdgpu"
"lib/firmware/amdnpu"
"lib/firmware/amdtee"
"lib/firmware/ar3k"
"lib/firmware/brcm"
"lib/firmware/carl9170fw"
"lib/firmware/cirrus"
"lib/firmware/nvidia"
)

echo "Removing files..."
for file in "${files[@]}"; do
find . -type f -name "$file" -exec rm -f {} +
done

echo "Removing directories..."
for dir in "${directories[@]}"; do
rm -rf "$dir"
done

echo "Cleanup complete."

### Install Dependencies
mk-build-deps -i -t "apt-get --yes" -r

Expand Down
4 changes: 4 additions & 0 deletions lib/firmware/.codespell.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[codespell]
builtin = clear,informal,en-GB_to_en-US
skip = .git,carl9170fw,licence
ignore-words-list = fils
21 changes: 21 additions & 0 deletions lib/firmware/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# To use this config on you editor, follow the instructions at:
# http://editorconfig.org

root = true

[*]
charset = utf-8
insert_final_newline = true
tab_width = 8
max_line_length = 90

[Makefile]
indent_style = tab

[*.{sh,py}]
indent_style = space
indent_size = 4

[*.{yml,yaml}]
indent_style = space
indent_size = 2
70 changes: 70 additions & 0 deletions lib/firmware/.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
.debcommon: &debcommon
- apt update
- apt install build-essential debhelper git python3-jinja2 rdfind -y
- make deb

.rpmcommon: &rpmcommon
- dnf install make git python3-jinja2 rpmdevtools rdfind -y
- make rpm

check-commits:
stage: test
image: registry.gitlab.com/kernel-firmware/linux-firmware
rules:
- if: $CI_MERGE_REQUEST_ID
script:
- ci-fairy check-commits --signed-off-by --textwidth=0

pre-commit:
stage: test
image: registry.gitlab.com/kernel-firmware/linux-firmware
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
script:
- pre-commit run --all-files

deb-release:
stage: deploy
image: debian
rules:
- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
when: never
- if: $RELEASE_TOKEN
- if: $CI_COMMIT_TAG
artifacts:
paths:
- dist/*
script:
- *debcommon

rpm-release:
stage: deploy
image: fedora
rules:
- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
when: never
- if: $RELEASE_TOKEN
- if: $CI_COMMIT_TAG
artifacts:
paths:
- dist/*
script:
- *rpmcommon

release:
stage: deploy
rules:
- 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
30 changes: 30 additions & 0 deletions lib/firmware/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
default_stages: [commit]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: check-executables-have-shebangs
- id: forbid-new-submodules
- id: check-yaml
- id: check-symlinks
- id: destroyed-symlinks
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.5
hooks:
- id: shellcheck
- repo: https://github.com/ambv/black
rev: 22.6.0
hooks:
- id: black
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.33.0
hooks:
- id: markdownlint
args: ['--fix']
- repo: local
hooks:
- id: check-whence
name: Check whence
files: 'WHENCE'
language: script
entry: ./check_whence.py
Loading

0 comments on commit 8683961

Please sign in to comment.