Skip to content

module: sign with sha512 instead of sha1 by default #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/kdevops-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# SPDX-License-Identifier: GPL-2.0
#
# This can be used towards the end of your action. All tasks here run even if
# any of the previous tasks failed.

name: Kdevops cleanup workflow

on:
workflow_call: # Makes this workflow reusable

jobs:
cleanup:
name: Archive results and cleanup
runs-on: [self-hosted, Linux, X64]
steps:
- name: Set Linux kdevops development path
if: always()
run: echo "LINUX_KDEVOPS_PATH=${{ inputs.workspace }}" >> $GITHUB_ENV

- name: Get systemd journal files
if: always()
run: |
cd kdevops
make journal-dump

- name: Start SSH Agent
if: always()
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Build our kdevops archive results
if: always()
run: |
cd kdevops
make ci-archive

- name: Upload our kdevops results archive
if: always()
uses: actions/upload-artifact@v4
with:
name: kdevops-ci-results
path: ${{ env.LINUX_KDEVOPS_PATH }}/kdevops/archive/*.zip

- name: Run kdevops make destroy
if: always()
run: |
cd kdevops
make destroy
cd ..
rm -rf kdevops
36 changes: 36 additions & 0 deletions .github/workflows/kdevops-generic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# SPDX-License-Identifier: GPL-2.0
#
# Most simple Linux kernel subsystems can be tested with this target
# test setup. For more elaborates tests look for a topic branch under the
# kdevops-ci tree. For example to test a filesystem look at the fstests
# branch.

name: Run generic kdevops CI tests

on:
push:
branches: ['**']
pull_request:
branches: ['**']
workflow_dispatch: # Allow manual triggering

jobs:
setup:
uses: ./.github/workflows/kdevops-init.yml
secrets: inherit

run-tests:
needs: setup
name: Run CI tests
runs-on: [self-hosted, Linux, X64]
steps:
- name: Run CI tests
run: |
cd kdevops
make ci-test
echo "ok" > ci.result

cleanup:
needs: run-tests
uses: ./.github/workflows/kdevops-cleanup.yml
secrets: inherit
169 changes: 169 additions & 0 deletions .github/workflows/kdevops-init.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
# SPDX-License-Identifier: GPL-2.0
#
# This can be used as a initialization workflow for most Linux kernel
# development environments. This takes care of:
#
# - Checks out and re-using a local mirror for your kernel tree
# - Looks for a defconfig in kdevops to use for your kernel tree
# - Sets up CI metadata for kdevops-results-archive
# - Ensures your kernel tree at least builds with defconfig
# - Brings up target DUTs nodes
# - Installs your Linux kernel tree on them
# - Builds all of your test requirements for your Linux kernel tree

name: Base kdevops workflow

on:
workflow_call: # Makes this workflow reusable
inputs:
kdevops_defconfig:
required: false
type: string

jobs:
setup:
name: Setup kdevops environment
runs-on: [self-hosted, Linux, X64]
steps:
- name: Configure git
run: |
git config --global --add safe.directory '*'
git config --global user.name "kdevops"
git config --global user.email "[email protected]"

- name: Checkout kdevops
run: |
rm -rf kdevops
git clone /mirror/kdevops.git kdevops

- name: Make sure our repo kdevops defconfig exists
run: |
cd kdevops
if [[ -z "${{ inputs.kdevops_defconfig }}" ]]; then
KDEVOPS_DEFCONFIG=$(basename ${{ github.repository }})
else
KDEVOPS_DEFCONFIG="${{ inputs.kdevops_defconfig }}"
fi

if [[ ! -f defconfigs/$KDEVOPS_DEFCONFIG ]]; then
echo "kdevops lacks a defconfig for this repository, expected to find: defconfigs/$KDEVOPS_DEFCONFIG"
exit 1
fi

echo "KDEVOPS_DEFCONFIG=$KDEVOPS_DEFCONFIG" >> $GITHUB_ENV

- name: Checkout custom branch with delta on kdevops/linux
run: |
LINUX_TREE="https://github.com/${{ github.repository }}"
LINUX_TREE_REF="${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}"
cd kdevops
git clone $LINUX_TREE --reference /mirror/linux.git/ --depth=5 linux
cd linux
git fetch origin $LINUX_TREE_REF
git checkout $LINUX_TREE_REF
git log -1

- name: Initialize CI metadata for kdevops-results-archive for linux
run: |
cd kdevops/linux
echo "$(basename ${{ github.repository }})" > ../ci.trigger

# This supports using kdevops github actions using two different
# approaches:
#
# 1) Commit the .github/ directory onto a Linux tree before your
# kernel changes. This approach is used for example for
# testing patches posted on the mailing list with patchwork,
# this is the strategy kernel-patch-deaemon uses. Since the
# patches are ephemeral there is not important git history to
# maintain.
#
# 2) Merge the .github/ directory at the end of your development
# tree. This is useful for kernel developers wishing to test
# existing trees.
#
# So this checks to see if the last commit (top of the tree) *added*
# the .github directory. If the last commit added it, then we assume
# the commit prior to it was the one we'd like to document as the main
# test point.
if git diff-tree --no-commit-id --name-only --diff-filter=A -r HEAD | grep -q "^\.github/"; then
git log -2 --skip=1 --pretty=format:"%s" -1 > ../ci.subject
git describe --exact-match --tags HEAD^ 2>/dev/null || git rev-parse --short HEAD^ > ../ci.ref
else
git log -1 --pretty=format:"%s" > ../ci.subject
git describe --exact-match --tags HEAD 2>/dev/null || git rev-parse --short HEAD > ../ci.ref
fi

RELEVANT_GIT_TAG=$(cat ../ci.ref)
RELEVANT_GIT_REF=$(git rev-parse --short=12 $RELEVANT_GIT_TAG)

echo "LINUX_GIT_REF=$RELEVANT_GIT_REF" >> $GITHUB_ENV
echo "LINUX_GIT_TAG=$RELEVANT_GIT_TAG" >> $GITHUB_ENV

# Start out pessimistic
echo "unknown" > ../ci.result
echo "Nothing to write home about." > ../ci.commit_extra

- name: Run a quick Linux kernel defconfig build test
run: |
cd kdevops/linux
git reset --hard ${{ env.LINUX_GIT_TAG }}
make defconfig
make -j$(nproc)

- name: Run kdevops make defconfig-repo
run: |
LINUX_TREE="https://github.com/${{ github.repository }}"
LINUX_TREE_REF="${{ env.LINUX_GIT_TAG }}"

# We make the compromise here to use a relevant git tag for the
# host prefix so that folks can easily tell what exact kernel tree
# is being tested by using the relevant git ref. That is, if you
# pushed a tree with the .github/ directory as the top of the tree,
# that commit will not be used, we'll use the last one as that is
# the relevant git ref we want to annotate a test for.
#
# The compromise here is that we expect no two same identical tests
# on the same self-hosted server. We could extend this with something
# like github.run_id but its not yet clear if we can have kdevops
# hosts with a bundled prefix ID like that ref-runid-testname. Tests
# have been done with the full lenght sha1sum though and we know that
# does work.
KDEVOPS_HOSTS_PREFIX="${{ env.LINUX_GIT_REF }}"

echo "Going to use defconfig-${{ env.KDEVOPS_DEFCONFIG }}"

echo "Linux tree: $LINUX_TREE"
echo "Linux trigger ref: $LINUX_TREE_REF"
echo "Linux tag: ${{ env.LINUX_GIT_TAG }}"
echo "Runner ID: ${{ github.run_id }}"
echo "kdevops host prefix: $KDEVOPS_HOSTS_PREFIX"
echo "kdevops defconfig: defconfig-${{ env.KDEVOPS_DEFCONFIG }}"

KDEVOPS_ARGS="KDEVOPS_HOSTS_PREFIX=$KDEVOPS_HOSTS_PREFIX LINUX_TREE=$LINUX_TREE LINUX_TREE_REF=$LINUX_TREE_REF defconfig-${{ env.KDEVOPS_DEFCONFIG }}"
echo "Going to run:"
echo "make $KDEVOPS_ARGS"

cd kdevops
make $KDEVOPS_ARGS

- name: Run kdevops make
run: |
cd kdevops
make -j$(nproc)

- name: Run kdevops make bringup
run: |
cd kdevops
ls -ld linux
make bringup

- name: Build linux and boot test nodes on test kernel
run: |
cd kdevops
make linux

- name: Build required ci tests
run: |
cd kdevops
make ci-build-test
1 change: 1 addition & 0 deletions kernel/module/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ comment "Do not forget to sign required modules with scripts/sign-file"
choice
prompt "Hash algorithm to sign modules"
depends on MODULE_SIG || IMA_APPRAISE_MODSIG
default MODULE_SIG_SHA512
help
This determines which sort of hashing algorithm will be used during
signature generation. This algorithm _must_ be built into the kernel
Expand Down