-
Notifications
You must be signed in to change notification settings - Fork 141
deb: DKMS packaging improvements #331
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
Open
changchinlan
wants to merge
6
commits into
Xilinx-CNS:master
Choose a base branch
from
changchinlan:deb/packaging-improvements
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4fd3174
deb: support configurable Debian revision in source packages
changchinlan 8b7eff6
deb: support Makefile overlay, dkms.append.conf, and quilt patches
changchinlan 2c6c27e
deb: integrate dh_dkms for DKMS lifecycle management
changchinlan c9bff3e
deb: add initramfs hook, module autoload, and dpkg triggers
changchinlan 11d793d
deb: make pybuild conditional on pyproject.toml
changchinlan 8a031c3
deb: pass --python-layout=deb for releases without pyproject.toml
changchinlan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| #!/bin/sh | ||
| PREREQ="" | ||
| prereqs() | ||
| { | ||
| echo "$PREREQ" | ||
| } | ||
|
|
||
| case $1 in | ||
| prereqs) | ||
| prereqs | ||
| exit 0 | ||
| ;; | ||
| esac | ||
|
|
||
| . /usr/share/initramfs-tools/hook-functions | ||
| # Begin real processing below this line | ||
|
|
||
| # In ther future, it's possible to extend this script to a split dkms-prefer package with something like | ||
| # | ||
| # CONF_FILE="/etc/initramfs-tools/dkms-prefer.modules" | ||
| # # Read module list | ||
| # MODULES_LIST="" | ||
| # if [ -f "$CONF_FILE" ]; then | ||
| # # strip comments and blanks | ||
| # MODULES_LIST="$(sed -e 's/#.*$//' -e '/^[[:space:]]*$/d' "$CONF_FILE")" | ||
| # fi | ||
| # | ||
| # But we keep it simple for now. | ||
| MODULES_LIST="xilinx_efct sfc" | ||
|
|
||
| # Nothing to do? | ||
| [ -n "${MODULES_LIST:-}" ] || exit 0 | ||
|
|
||
| # Provided by initramfs-tools | ||
| DKMS_BASE="/lib/modules/${version}/updates/dkms" | ||
| DEST_DKMS_DIR="${DESTDIR}${DKMS_BASE}" | ||
| KERNEL_BASE="${DESTDIR}/lib/modules/${version}/kernel" | ||
|
|
||
| mkdir -p "$DEST_DKMS_DIR" | ||
|
|
||
| for mod in $MODULES_LIST; do | ||
| # Does *any* DKMS file for this module exist (host filesystem)? | ||
| if find "/lib/modules/${version}/updates/dkms" -maxdepth 1 -type f -name "${mod}.ko*" -print -quit | grep -q .; then | ||
| # Copy all matching DKMS files into the image (no globbing in the shell) | ||
| find "/lib/modules/${version}/updates/dkms" -maxdepth 1 -type f -name "${mod}.ko*" \ | ||
| | while IFS= read -r f; do | ||
| [ -n "$f" ] && copy_file module "$f" "$DKMS_BASE/" | ||
| done | ||
|
|
||
|
|
||
| # Remove any in-tree copies of the same module from the image | ||
| if [ -d "$KERNEL_BASE" ]; then | ||
| find "$KERNEL_BASE" -type f -name "${mod}.ko*" -delete || true | ||
| fi | ||
|
|
||
| # Ensure dependencies get pulled in | ||
| manual_add_modules "$mod" || true | ||
| echo "initramfs-tools: using DKMS '${mod}' (updates/dkms) for ${version}" >&2 | ||
| else | ||
| # No DKMS — warn and fall back to in-tree | ||
| echo "initramfs-tools: WARNING: DKMS module '${mod}' not found for ${version}; using in-tree if available" >&2 | ||
| manual_add_modules "$mod" || true | ||
| fi | ||
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,40 @@ | ||
| #!/bin/sh | ||
| # SPDX-License-Identifier: BSD-2-Clause | ||
| # SPDX-FileCopyrightText: (c) Copyright 2023-2024 Advanced Micro Devices, Inc. | ||
|
|
||
| # Remove if already exists | ||
| dkms remove -m #TYPE# -v #VERSION# --all > /dev/null 2>&1 || true | ||
| set -e | ||
|
|
||
| # Build and install | ||
| dkms add -m #TYPE# -v #VERSION# | ||
| dkms build -m #TYPE# -v #VERSION# | ||
| dkms install -m #TYPE# -v #VERSION# --force | ||
| install_dkms() { | ||
| # Remove if already exists | ||
| dkms remove -m #TYPE# -v #VERSION# --all > /dev/null 2>&1 || true | ||
|
|
||
| # Build and install | ||
| dkms add -m #TYPE# -v #VERSION# | ||
| dkms build -m #TYPE# -v #VERSION# | ||
| dkms install -m #TYPE# -v #VERSION# --force | ||
| } | ||
|
|
||
| case "$1" in | ||
| configure) | ||
| install_dkms | ||
| ;; | ||
|
|
||
| triggered) | ||
| install_dkms | ||
| # HACK: Force initramfs update because x3522 package does not trigger it | ||
| dpkg-trigger update-initramfs | ||
| ;; | ||
|
|
||
| abort-upgrade|abort-remove|abort-deconfigure) | ||
| exit 0 | ||
| ;; | ||
|
|
||
| *) | ||
| echo "postinst called with unknown argument \`$1'" >&2 | ||
| exit 1 | ||
| ;; | ||
| esac | ||
|
|
||
| #DEBHELPER# | ||
|
|
||
| exit 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| # SPDX-License-Identifier: BSD-2-Clause | ||
| # SPDX-FileCopyrightText: (c) Copyright 2023 Advanced Micro Devices, Inc. | ||
|
|
||
| dkms remove -m #TYPE# -v #VERSION# | ||
| #DEBHELPER# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| interest /usr/share/doc/xilinx-efct-dkms/changelog.gz | ||
| activate-noawait update-initramfs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How will this help if it is for older releases as this code is only for newer releases by definition? Or did we miss compat for older OSs? Bear in mind the current master branch targets Debian 12+ and Ubuntu 24.04 plus and we'd probably happily bump to Trixie if we found anything that needed it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The motivation is to reuse the same debian templates across multiple onload versions without maintaining a separate fork of the templates (as we are still packaging 8.1.3.40 and 9.1.0.24 dkms alongside master). I'm happy to drop them if that's not something upstream wants to carry.