From patchwork Thu Oct 3 05:42:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Portia Stephens X-Patchwork-Id: 1992219 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XK0v00zsjz1xtk for ; Thu, 3 Oct 2024 15:42:35 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1swEbW-0005lL-S5; Thu, 03 Oct 2024 05:42:22 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1swEbV-0005lA-28 for kernel-team@lists.ubuntu.com; Thu, 03 Oct 2024 05:42:21 +0000 Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id BB4C43F6B0 for ; Thu, 3 Oct 2024 05:42:20 +0000 (UTC) Received: by mail-pf1-f197.google.com with SMTP id d2e1a72fcca58-71985a317fcso737146b3a.1 for ; Wed, 02 Oct 2024 22:42:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727934138; x=1728538938; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=62ufad+Bl8AabG0OFIhU61/v5aZEX/8HcWu6dTz3mHo=; b=TQyhgy7sTmAa936ckWtlf1XfBq+4ebaItRU5356KsOaYpnd6FnnTHajL2GXAv3mCaq 5uVKTNIxtp+sV1QD3qKoLmRCniPoO/YoAOqRTnbz/bDGFRXwe5kRHG8buRXbCq6cbGJd IS8HOZWSPXTZL7piXQejbwzo35yCK0CWXB1PJhG+lL0fqwYCeHDEGVmPvase6mbJlSWb CJMif+UVi6FGJqaldupbM7YeRgZ9LgRHmv/QXxlJV6fd+xPkncrGZxXX4aWYhf18xGj9 NZs6m9mP9gHP1rCqV4AXS456/+f7kzqfcQX+ZOcEKEW2NXSTixXFmtYXy/A2B3vbC9uB /8gA== X-Gm-Message-State: AOJu0Yx7b/jbfmWfDXYjoPT7yFG/5GpZNWW8I+SlmizJ4ZNmz2qDOLlU gvHxkpN8TloGVsU+PvfXlCkF7fvJZvCHEQK0oQp4O2/LrcHI+cGdlV5puXMeC6linwesi6JPWvc yHUcQyGlYwIi1bcYTxkA4AA2cQ9KomTCNzfWVTIOdX4SoVpp2MHGocGL6/+T10OG1H15hk1m+M3 1vCK9/Tk743A== X-Received: by 2002:a05:6a00:2d94:b0:717:8dd1:c309 with SMTP id d2e1a72fcca58-71dc5c67055mr8432523b3a.9.1727934136988; Wed, 02 Oct 2024 22:42:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE9syRQW+bQ9w8/JjaiVUG4pDPloXkyKFKhCdZid4C9VVwCyOERHX1oDVgQTVjBSBzI/+JYkA== X-Received: by 2002:a05:6a00:2d94:b0:717:8dd1:c309 with SMTP id d2e1a72fcca58-71dc5c67055mr8432445b3a.9.1727934135116; Wed, 02 Oct 2024 22:42:15 -0700 (PDT) Received: from localhost ([159.196.41.205]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71dd9d9c19dsm502931b3a.95.2024.10.02.22.42.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2024 22:42:14 -0700 (PDT) From: Portia Stephens To: kernel-team@lists.ubuntu.com Subject: [kernel-snaps-u24.04][pc] components: add support for nvidia-550 kernel components Date: Thu, 3 Oct 2024 15:42:11 +1000 Message-ID: <20241003054211.1699948-1-portia.stephens@canonical.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: andy.whitcroft@canonical.com Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" This adds the kernel component for nvidia 550 kernel drivers to be published alongside the pc-kernel snap. There exist two hooks, assemble.sh which is run when the component is installed and provides the linking of the ko files and remove.sh which removes the ko files when the component is uninstalled. Signed-off-by: Portia Stephens Signed-off-by: Aaron Jauregui --- files/meta/kernel.yaml | 1 + nvidia-ko-hooks/assemble.sh | 18 ++++++++++++++++++ nvidia-ko-hooks/remove.sh | 6 ++++++ snapcraft.yaml | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 57 insertions(+) create mode 100644 files/meta/kernel.yaml create mode 100644 nvidia-ko-hooks/assemble.sh create mode 100644 nvidia-ko-hooks/remove.sh diff --git a/files/meta/kernel.yaml b/files/meta/kernel.yaml new file mode 100644 index 0000000..aa09f00 --- /dev/null +++ b/files/meta/kernel.yaml @@ -0,0 +1 @@ +dynamic-modules: $SNAP_DATA diff --git a/nvidia-ko-hooks/assemble.sh b/nvidia-ko-hooks/assemble.sh new file mode 100644 index 0000000..e1c0834 --- /dev/null +++ b/nvidia-ko-hooks/assemble.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set -eux + +mkdir $SNAP_COMMON/nvidia-ko +cp -r $SNAP_COMPONENT/bits $SNAP_COMMON/nvidia-ko/bits + +cd $SNAP_COMMON/nvidia-ko/bits + +sed -i "s|/usr/bin/ld.bfd|$SNAP_COMPONENT/bin/ld.bfd|" BUILD +sed -i "s|make|$SNAP_COMPONENT/bin/make|" BUILD + +# TODO rewrite lib path for more generic +LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SNAP_COMPONENT/lib/x86_64-linux-gnu sh BUILD + +mkdir -p $SNAP_DATA/modules/$(uname -r) + +mv ../*.ko $SNAP_DATA/modules/$(uname -r)/ diff --git a/nvidia-ko-hooks/remove.sh b/nvidia-ko-hooks/remove.sh new file mode 100644 index 0000000..b0547cc --- /dev/null +++ b/nvidia-ko-hooks/remove.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +set -eux + +rm -rf $SNAP_COMMON/nvidia-ko +rm -rf $SNAP_DATA/modules/$(uname -r) diff --git a/snapcraft.yaml b/snapcraft.yaml index c08095e..64a6a84 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -14,6 +14,13 @@ platforms: amd64: arm64: +components: + nvidia-550-ko: + type: test + summary: nvidia 550 kernel objects + description: nvidia 550 kernel objects + version: "0.1" + parts: kernel: source: https://git.launchpad.net/canonical-kernel-snaps @@ -78,3 +85,28 @@ parts: mkdir "$CRAFT_PART_INSTALL"/firmware/updates craftctl default + + nvidia-550-ko-comp: + source: ./nvidia-ko-hooks + plugin: nil + + stage-packages: + - binutils + - make + + override-build: | + craftctl default + #clean up unnecessary libs + rm -f -- $CRAFT_PART_INSTALL/usr/lib/x86_64-linux-gnu/libc.so.6 + apt-get download linux-objects-nvidia-550-server-6.8.0-41-generic + dpkg-deb -x *.deb nvidia-objects + mv nvidia-objects/lib/modules/*/kernel/nvidia-550srv/bits $CRAFT_PART_INSTALL/ + mv assemble.sh $CRAFT_PART_INSTALL/assemble.sh + mv remove.sh $CRAFT_PART_INSTALL/remove.sh + + organize: + bits/: (component/nvidia-550-ko)/bits + usr/bin: (component/nvidia-550-ko)/bin + usr/lib: (component/nvidia-550-ko)/lib + assemble.sh: (component/nvidia-550-ko)/snap/hooks/install + remove.sh: (component/nvidia-550-ko)/snap/hooks/remove