diff --git a/.gitattributes b/.gitattributes index 315f9d66ff..c7070352b5 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,3 +2,4 @@ third_party/mbedtls/** -text crates/stela-tls/tests/fixtures/** -text guest/stela-app/*.sh text eol=lf +crates/stela-cli/src/setup/firmware/notices/** -text diff --git a/crates/stela-cli/src/setup/firmware.rs b/crates/stela-cli/src/setup/firmware.rs index c8eda12e63..3a92142e05 100644 --- a/crates/stela-cli/src/setup/firmware.rs +++ b/crates/stela-cli/src/setup/firmware.rs @@ -223,6 +223,10 @@ fn host_of(url: &str) -> &str { } fn download(client: &Client, artifact: &Artifact) -> Result> { + if let Some(bytes) = nvidia::carried(artifact) { + artifact.verify(bytes)?; + return Ok(bytes.to_vec()); + } if let Some(spec) = nvidia::spec(artifact) { let wire = download_slice( client, @@ -1495,6 +1499,32 @@ mod tests { assert!(heads[1].contains("range: bytes=2-\r\n"), "{heads:?}"); } + #[test] + fn every_nvidia_release_image_has_its_download_and_every_notice_a_source() { + for (object, notice) in bundle::complete() { + match nvidia::spec(object) { + Some(spec) => { + let (release, part) = recipes::nvidia_gsp(object).unwrap(); + assert_eq!(spec.wire, release.source(part)); + assert_eq!(spec.slice.is_some(), part == recipes::NvidiaPart::Gsp); + } + None => assert!(recipes::nvidia_gsp(object).is_none()), + } + // A notice is downloaded, or carried with its pinned bytes. + match nvidia::carried(notice) { + Some(bytes) => notice.verify(bytes).unwrap(), + None => assert!(!notice.urls().is_empty(), "{}", notice.member), + } + } + let gsp = &recipes::GB20X_570_211_01.images[2]; + assert_eq!(*gsp.license, recipes::NVIDIA_DRIVER_570_211_01_LICENSE); + let carried = nvidia::carried(gsp.license).unwrap(); + assert!(carried.starts_with(b"NVIDIA Driver License Agreement")); + // The CLI serves it without a network. + let client = super::client().unwrap(); + assert_eq!(download(&client, gsp.license).unwrap(), carried); + } + #[test] fn a_bounded_slice_requests_and_resumes_exact_byte_ranges() { let cut = "HTTP/1.1 206 Partial Content\r\nContent-Range: bytes 100-102/500\r\nContent-Length: 3\r\nConnection: close\r\n\r\nab"; diff --git a/crates/stela-cli/src/setup/firmware/notices/NVIDIA-Linux-x86_64-570.211.01-LICENSE b/crates/stela-cli/src/setup/firmware/notices/NVIDIA-Linux-x86_64-570.211.01-LICENSE new file mode 100644 index 0000000000..eebf02d403 --- /dev/null +++ b/crates/stela-cli/src/setup/firmware/notices/NVIDIA-Linux-x86_64-570.211.01-LICENSE @@ -0,0 +1,416 @@ +NVIDIA Driver License Agreement + +IMPORTANT NOTICE - PLEASE READ AND AGREE BEFORE USING THE SOFTWARE. + +This license agreement ("Agreement") is a legal agreement between you, whether +an individual or entity ("you") and NVIDIA Corporation ("NVIDIA") and governs +your use of the NVIDIA driver, and any additional software and materials +provided (the "SOFTWARE"). + +If you don't have the required age or authority to enter into this Agreement or +if you don't accept all the terms below, do not use the SOFTWARE. + +You agree to use the SOFTWARE only for purposes that are permitted by this +Agreement and any applicable law or regulation in the relevant jurisdictions. + +1. License. + +1.1 Subject to the terms of this Agreement, NVIDIA grants you a non-exclusive, +revocable, non-transferable and non-sublicensable (except as expressly provided +in this Agreement) license to: + +a. Install and use copies of the SOFTWARE, + +b. Modify and create derivative works of any portion of the SOFTWARE delivered +by NVIDIA in source code format, + +c. Deploy, for your own use, the SOFTWARE on infrastructure you own or lease, +and + +d. Distribute the SOFTWARE provided for use with operating system kernels +distributed under the terms of an OSI-approved open source license as listed by +the Open Source Initiative at http://opensource.org, provided that (i) the +binary files thereof are not modified in any way (except for uncompressing of +compressed files) and (ii) this Agreement is provided to each SOFTWARE +recipient. + +2. Limitations. + +The following license limitations apply to your use of the SOFTWARE: + +2.1 The SOFTWARE is only licensed for use in conjunction with microprocessor(s), +SoCs, and GPUs which have been (i) designed by NVIDIA and/or its affiliates and +(ii) sold (directly or indirectly) by NVIDIA and/or its affiliates ("NVIDIA +Platform"). You may only use firmware in NVIDIA Platforms. You may not translate +firmware, nor cause or permit firmware to be translated, from the architecture +or language in which it is originally provided by NVIDIA, into any other +architecture or language. + +2.2 You may not reverse engineer, decompile, or disassemble the SOFTWARE +provided in binary form, nor attempt in any other manner to obtain source code +of such SOFTWARE. + +2.3 You may not modify or create derivative works of the SOFTWARE provided in +binary form. + +2.4 You may not distribute any modified header files. + +2.5 You may not change or remove copyright or other proprietary notices in the +SOFTWARE, or misrepresent the authorship of the SOFTWARE, and you must cause any +modified files to carry prominent notices stating that you changed the files +such that modifications are not misrepresented as an original SOFTWARE. + +2.6 You may not bypass, disable, or circumvent any technical limitation, +encryption, security, digital rights management or authentication mechanism in +the SOFTWARE. + +2.7 Except as expressly granted in this Agreement, you may not sell, rent, +sublicense, distribute or transfer the SOFTWARE or provide commercial hosting +services with the SOFTWARE. + +2.8 You agree that GeForce or Titan SOFTWARE: (i) is licensed for use only on +GeForce or Titan hardware products you own, and (ii) is not licensed for +datacenter deployment. + +2.9 You may not use the SOFTWARE in any manner that would cause it to become +subject to an open source software license, subject to the terms in the +"Components Under Other Licenses" section below. + +2.10 You acknowledge that the SOFTWARE as delivered is not tested or certified +by NVIDIA for use in any system or application where the use of or failure of +such system or application developed with the SOFTWARE could result in injury, +death or catastrophic damage (each, a "Critical Application"). Examples of +Critical Applications include use in avionics, navigation, autonomous vehicle +applications, automotive products, military, medical, life support or other life +critical applications. NVIDIA will not be liable to you or any third party, in +whole or in part, for any claims or damages arising from these uses. You are +solely responsible for ensuring that systems and applications developed with the +SOFTWARE include sufficient safety and redundancy features, and comply with all +applicable legal and regulatory standards and requirements. + +2.11 You agree to defend, indemnify and hold harmless NVIDIA and its affiliates, +and their respective employees, contractors, agents, officers and directors, +from and against any and all claims, damages, obligations, losses, liabilities, +costs or debt, fines, restitutions and expenses (including but not limited to +attorney's fees and costs incident to establishing the right of indemnification) +arising out of or related to products or services that have been developed with +or use the SOFTWARE (including for use in or for Critical Applications), and for +use of the SOFTWARE outside of the scope of this Agreement or not in compliance +with its terms. + +3. Authorized Users. + +You may allow employees and contractors of your entity or of your +subsidiary(ies) to access and use the SOFTWARE from your secure network to +perform the work authorized by this Agreement on your behalf. + +If you are an academic institution, you may allow users enrolled or employed by +the academic institution to access and use the SOFTWARE as authorized by this +Agreement from your secure network. + +You are responsible for the compliance with the terms of this Agreement by your +authorized users. Any act or omission that if committed by you would constitute +a breach of this Agreement will be deemed to constitute a breach of this +Agreement if committed by your authorized users. + +4. Pre-Release SOFTWARE. + +The SOFTWARE versions identified as alpha, beta, preview or otherwise as +pre-release may not be fully functional, may contain errors or design flaws, and +may have reduced or different security, privacy, accessibility and reliability +standards relative to commercial versions of NVIDIA software and materials. + +You may use pre-release SOFTWARE at your own risk, understanding that +pre-release SOFTWARE is not intended for use in production or business-critical +systems and NVIDIA may choose not to make available a commercial version of any +pre-release SOFTWARE. + +5. Support and Updates. + +NVIDIA is not obligated to support any SOFTWARE, unless there is a separate +agreement for this purpose. NVIDIA may, at its option, make available patches, +workarounds or other updates to the SOFTWARE. Unless the updates are provided +with their separate governing terms, they are deemed part of the SOFTWARE +licensed to you as provided in this Agreement. + +6. Components Under Other Licenses. + +The SOFTWARE may include or be distributed with components provided with +separate legal notices or terms that accompany the components, such as open +source software licenses and other license terms ("Other Licenses"). The +components are subject to the applicable Other Licenses, including any +proprietary notices, disclaimers, requirements and extended use rights; except +that this Agreement will prevail regarding the use of third-party open source +software, unless a third-party open source software license requires its license +terms to prevail. Open source software license means any software, data or +documentation subject to any license identified as an open source license by the +Open Source Initiative (http://opensource.org), Free Software Foundation +(http://www.fsf.org) or other similar open source organization or listed by the +Software Package Data Exchange (SPDX) Workgroup under the Linux Foundation +(http://www.spdx.org). + +You acknowledge and agree that it is your sole responsibility to obtain any +additional third-party licenses required to make, have made, use, have used, +sell, import, and offer for sale your products or services that include or +incorporate any third-party software and content, including, without limitation, +audio and/or video encoders and decoders and implementations of technical +standards. NVIDIA does not grant to you under this Agreement any necessary +patent or other rights, including standard essential patent rights, with respect +to any third-party software and content. + +7. Termination. + +This Agreement will automatically terminate without notice from NVIDIA if you +fail to comply with any of the terms in this Agreement or if you commence or +participate in any legal proceeding against NVIDIA with respect to the +SOFTWARE. Upon any termination, you must stop using and destroy all copies of +the SOFTWARE. You can terminate this Agreement whenever you want by stopping use +of the SOFTWARE and destroying all copies of the SOFTWARE. Your prior +distributions according to this Agreement are not affected by termination. All +provisions will survive termination, except for the licenses granted to you. + +8. Ownership. + +The SOFTWARE, including all intellectual property rights, is and will remain the +sole and exclusive property of NVIDIA or its licensors. Except as expressly +granted in this Agreement, (i) NVIDIA reserves all rights, interests, and +remedies in connection with the SOFTWARE, and (ii) no other license or right is +granted to you by implication, estoppel or otherwise. You agree to cooperate +with NVIDIA and provide reasonably requested information to verify your +compliance with this Agreement. + +9. Feedback. + +You may, but you are not obligated to, provide suggestions, requests, fixes, +modifications, enhancements, or other feedback regarding the SOFTWARE +(collectively, "Feedback"). Feedback, even if designated as confidential by you, +will not create any confidentiality obligation for NVIDIA or its affiliates. If +you provide Feedback, you grant NVIDIA, its affiliates and its designees a +non-exclusive, perpetual, irrevocable, sublicensable, worldwide, royalty-free, +fully paid-up and transferable license, under your intellectual property rights, +to publicly perform, publicly display, reproduce, use, make, have made, sell, +offer for sale, distribute (through multiple tiers of distribution), import, +create derivative works of and otherwise commercialize and exploit the Feedback +at NVIDIA's discretion. You will not give Feedback (i) that you have reason to +believe is subject to any restriction that impairs the exercise of the grant +stated in this section; or (ii) subject to license terms which seek to require +any product incorporating or developed using such Feedback, or other +intellectual property of NVIDIA or its affiliates, to be licensed to or +otherwise shared with any third party. + +10. Governing Law and Dispute Resolution. + +10.1 Informal Resolution. + +If you or NVIDIA have any dispute, claim or controversy arising out of or +relating to the SOFTWARE or this Agreement ("Dispute"), the parties agree to +work in good faith to resolve the Dispute informally. If you have a Dispute, you +must first contact NVIDIA and give NVIDIA an opportunity to resolve it by +contacting NVIDIA by mail at NVIDIA Corporation, ATTN: Legal, 2788 San Tomas +Expressway, Santa Clara, California, 95051. Either you or NVIDIA may seek to +have a Dispute resolved in small claims court if all the requirements of the +small claims court are satisfied. Either you or NVIDIA may seek to have a +Dispute resolved in small claims court in your county of residence or the small +claims court in closest proximity to your residence at any time before an +arbitrator is appointed, and you may also bring a Dispute in small claims court +in the Superior Court of California, County of Santa Clara. + +10.2 Binding Arbitration. + +For any Disputes that are not resolved informally or by the small claims court, +you and NVIDIA each agree to resolve any such Dispute by binding arbitration +before an arbitrator from Judicial Mediation and Arbitration Services ("JAMS") +(rules available at https://www.jamsadr.com/). Except as otherwise provided in +this section, all issues are for the arbitrator to decide, including +jurisdictional and arbitrability issues and the formation, existence, validity, +interpretation, and scope of this arbitration provision. The arbitration will be +conducted in Santa Clara County, California (or the nearest JAMS office to Santa +Clara County), unless you request an in-person hearing in your hometown or you +and NVIDIA agree otherwise. You and NVIDIA agree that the parties will arbitrate +all Disputes, remedies, and requests for relief subject to individual +arbitration first, the arbitrator will only determine issues of liability on the +merits of any claim asserted, and the arbitrator may only award declaratory or +injunctive relief in favor of the individual party seeking relief and only to +the extent necessary to provide relief warranted by that party's individual +claim. You and NVIDIA agree that any remaining unresolved Disputes, remedies, or +requests for relief may be pursued in court only after the arbitrator's award +has been issued. In any later court proceeding, the arbitrator's factual +findings will not be entitled to deference by the court. Nothing in these terms +will prevent a party from seeking injunctive or other equitable relief from the +courts in any jurisdiction to prevent the actual or threatened violation of that +party's data security, intellectual property rights, or other proprietary +rights. If for any reason this Section 10.2 is unenforceable concerning any +Dispute, and a Dispute proceeds in a court of general jurisdiction, the Dispute +will be exclusively brought in state or federal court located in Santa Clara +County, California. + +10.3 Class Action, Representative Action, & Jury Trial Waiver. + +All Disputes must be brought by a party in its individual capacity, and not as a +plaintiff or class member in any purported class or representative +proceeding. You and NVIDIA agree to waive the right to a jury trial, participate +in class action lawsuits, class-wide arbitrations, any collective, consolidated, +or other proceeding or request for relief where someone acts in a representative +capacity. + +10.4 Right to Opt-Out. + +You may opt-out of the foregoing jury trial, class action, arbitration, and +collective or consolidated proceeding waiver provision by notifying NVIDIA in +writing within 30 days of commencement of use of the SOFTWARE, within 30 days of +the effective date of this Agreement, or within 30 days of any future change +NVIDIA may make to this Section 10.4. Such written notification must be sent by +mail to NVIDIA Corporation, Attn: Legal, 2788 San Tomas Expressway, Santa Clara, +California, 95051 and must include (1) your name, (2) your address, (3) the +reference to NVIDIA drivers as the software to which the notice relates, and (4) +a clear statement indicating that you do not wish to resolve disputes through +arbitration and demonstrating compliance with the 30-day time limit to +opt-out. Any opt-out notification received after the opt-out deadline or not +including the required items noted in (1)-(4) in the preceding sentence will not +be valid and you will be required to pursue your Dispute in arbitration or small +claims court. Opting out of this dispute resolution procedure will not affect +the terms and conditions of this Agreement, which still apply to you. If you +opt-out of any future change NVIDIA may make to this Section 10.4, the most +recent version of Section 10.4 before the change you rejected will apply. + +10.5 Governing Law. + +You and NVIDIA each agree that all Disputes will be governed by the Federal +Arbitration Act, in addition to the internal substantive laws of the State of +Delaware and the United States, without regard to or application of its conflict +of laws rules or principles. The United Nations Convention on Contracts for the +International Sale of Goods is expressly disclaimed. Any translation of this +Agreement is done for local requirements and, if there is a dispute between the +English and any non-English versions, you and NVIDIA agree that the English +version of this Agreement will govern to the extent not prohibited by local law +in your jurisdiction. + +11. Disclaimer of Warranties. + +THE SOFTWARE IS PROVIDED BY NVIDIA AS-IS AND WITH ALL FAULTS. TO THE FULLEST +EXTENT PERMITTED BY APPLICABLE LAW, NVIDIA DISCLAIMS ALL WARRANTIES AND +REPRESENTATIONS OF ANY KIND, WHETHER EXPRESS, IMPLIED OR STATUTORY, RELATING TO +OR ARISING UNDER THIS AGREEMENT, INCLUDING, WITHOUT LIMITATION, THE WARRANTIES +OF TITLE, NONINFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, +USAGE OF TRADE AND COURSE OF DEALING. WITHOUT LIMITING THE FOREGOING, NVIDIA +DOES NOT WARRANT THAT THE SOFTWARE WILL MEET YOUR REQUIREMENTS; THAT ANY DEFECTS +OR ERRORS WILL BE CORRECTED; THAT ANY CERTAIN CONTENT WILL BE AVAILABLE; OR THAT +THE SOFTWARE IS FREE OF VIRUSES OR OTHER HARMFUL COMPONENTS. + +In addition, you agree that you are solely responsible for maintaining +appropriate data backups and system restore points for systems that include the +SOFTWARE, and that NVIDIA will have no responsibility for any damage or loss to +such systems (including loss of data or access) arising from or relating to (a) +any changes to the configuration, application settings, environment variables, +registry, drivers, BIOS, or other attributes of the system (or any part of such +system) initiated through the SOFTWARE; or (b) installation of any SOFTWARE or +third party software patches through the NVIDIA update service. + +NO INFORMATION OR ADVICE GIVEN BY NVIDIA WILL IN ANY WAY INCREASE THE SCOPE OF +ANY WARRANTY EXPRESSLY PROVIDED IN THIS AGREEMENT. You are responsible for +checking that a SOFTWARE version is the appropriate one for your NVIDIA product +model, operating system, and computer hardware. + +12. Limitations of Liability. + +TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT WILL NVIDIA BE +LIABLE FOR ANY (I) INDIRECT, PUNITIVE, SPECIAL, INCIDENTAL OR CONSEQUENTIAL +DAMAGES, OR (II) DAMAGES FOR (A) THE COST OF PROCURING SUBSTITUTE GOODS, OR (B) +LOSS OF PROFITS, REVENUES, USE, DATA OR GOODWILL ARISING OUT OF OR RELATED TO +THIS AGREEMENT, WHETHER BASED ON BREACH OF CONTRACT, TORT (INCLUDING +NEGLIGENCE), STRICT LIABILITY, OR OTHERWISE, AND EVEN IF NVIDIA HAS BEEN ADVISED +OF THE POSSIBILITY OF SUCH DAMAGES AND EVEN IF A PARTY'S REMEDIES FAIL THEIR +ESSENTIAL PURPOSE. + +ADDITIONALLY, TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, NVIDIA'S TOTAL +CUMULATIVE AGGREGATE LIABILITY FOR ANY AND ALL LIABILITIES, OBLIGATIONS OR +CLAIMS ARISING OUT OF OR RELATED TO THIS AGREEMENT WILL NOT EXCEED FIVE +U.S. DOLLARS (US$5). + +13. Data Collection. + +If you are using the SOFTWARE on a Windows operating system, you hereby +acknowledge that at the time of SOFTWARE installation, NVIDIA will access and +collect data to: (a) properly configure and optimize the system for use with the +SOFTWARE; (b) deliver content or service through SOFTWARE; and (c) improve +NVIDIA products and services. Information collected may include configuration +data such as GPU and CPU, and operating system. + +The SOFTWARE may contain links to third party websites and services. NVIDIA +encourages you to review the privacy statements on those sites and services that +you choose to visit to understand how they may collect, use and share your +data. NVIDIA is not responsible for the privacy statements or practices of third +party sites or services. + +Please review the NVIDIA Privacy Policy, located at +https://www.nvidia.com/en-us/about-nvidia/privacy-policy, which explains +NVIDIA's policy for collecting and using data. + +14. Assignment. + +NVIDIA may assign, delegate or transfer its rights or obligations under this +Agreement by any means or operation of law. You may not, without NVIDIA's prior +written consent, assign, delegate or transfer any of its rights or obligations +under this Agreement by any means or operation of law, and any attempt to do so +is null and void. + +15. Trade Compliance. + +You agree to comply with all applicable export, import, trade and economic +sanctions laws and regulations, including U.S. Export Administration +Regulations and Office of Foreign Assets Control regulations. These laws include +restrictions on destinations, end-users and end-use. + +16. Government Use. + +The SOFTWARE, including related documentation ("Protected Items") is a +"Commercial product" as this term is defined at 48 C.F.R. 2.101, consisting of +"commercial computer software" and "commercial computer software documentation" +as such terms are used in, respectively, 48 C.F.R. 12.212 and 48 C.F.R. 227.7202 +& 252.227-7014(a)(1). Before any Protected Items are supplied to the +U.S. Government, you will (i) inform the U.S. Government in writing that the +Protected Items are and must be treated as commercial computer software and +commercial computer software documentation developed at private expense; (ii) +inform the U.S. Government that the Protected Items are provided subject to the +terms of this Agreement; and (iii) mark the Protected Items as commercial +computer software and commercial computer software documentation developed at +private expense. In no event will you permit the U.S. Government to acquire +rights in Protected Items beyond those specified in 48 +C.F.R. 52.227-19(b)(1)-(2) or 252.227-7013(c) except as expressly approved by +NVIDIA in writing. + +17. Notices. + +Please direct your legal notices or other correspondence to NVIDIA Corporation, +2788 San Tomas Expressway, Santa Clara, California 95051, United States of +America, Attention: Legal Department. If NVIDIA needs to contact you about the +SOFTWARE, you consent to receive the notices by email and that such notices will +satisfy any legal communication requirements. + +18. Entire Agreement. + +Regarding the subject matter of this Agreement, the parties agree that (i) this +Agreement constitutes the entire and exclusive agreement between the parties and +supersedes all prior and contemporaneous communications and (ii) any additional +or different terms or conditions, whether contained in purchase orders, order +acknowledgments, invoices or otherwise, will not be binding on the receiving +party and are null and void. This Agreement may only be modified in a writing +signed by an authorized representative of each party. + +If a court of competent jurisdiction rules that a provision of this Agreement is +unenforceable, that provision will be deemed modified to the extent necessary to +make it enforceable and the remainder of this Agreement will continue in full +force and effect. + +19. No Waiver. + +No failure or delay by a party to enforce any Agreement term or obligation will +operate as a waiver by that party, or prevent the enforcement of such term or +obligation later. + +20. Licensing. + +For any questions regarding this Agreement, please contact NVIDIA at +driver-licensing@nvidia.com + +(v. February 25, 2025) diff --git a/crates/stela-cli/src/setup/firmware/nvidia.rs b/crates/stela-cli/src/setup/firmware/nvidia.rs index bf94af90b4..5b0c9e9f16 100644 --- a/crates/stela-cli/src/setup/firmware/nvidia.rs +++ b/crates/stela-cli/src/setup/firmware/nvidia.rs @@ -5,7 +5,9 @@ //! against its pin before it is parsed, and each image after. use anyhow::{Context, Result, bail, ensure}; use std::io::Read; -use stela_loader::host_firmware::recipes::{self, Artifact, NvidiaGsp, NvidiaPart}; +use stela_loader::host_firmware::recipes::{ + self, Artifact, NVIDIA_DRIVER_570_211_01_LICENSE, NvidiaGsp, NvidiaPart, +}; /// How an image's pinned download maps to the image. pub(super) struct WireSpec { @@ -42,6 +44,13 @@ pub(super) fn spec(artifact: &Artifact) -> Option { }) } +/// The exact bytes of a notice the CLI carries, which no download serves +/// cheaply ([`NVIDIA_DRIVER_570_211_01_LICENSE`]). +pub(super) fn carried(artifact: &Artifact) -> Option<&'static [u8]> { + (*artifact == NVIDIA_DRIVER_570_211_01_LICENSE) + .then_some(include_bytes!("notices/NVIDIA-Linux-x86_64-570.211.01-LICENSE").as_slice()) +} + /// Extract one named `NvU8` array from an `open-gpu-kernel-modules` `bindata` C /// source file, decompressing raw DEFLATE payloads when `COMPRESSION: YES`. fn parse_bindata_array(source: &str, symbol: &str) -> Result> { diff --git a/crates/stela-loader/src/host_firmware/bundle/tests.rs b/crates/stela-loader/src/host_firmware/bundle/tests.rs index df57ec5d52..e22ab34e37 100644 --- a/crates/stela-loader/src/host_firmware/bundle/tests.rs +++ b/crates/stela-loader/src/host_firmware/bundle/tests.rs @@ -32,7 +32,11 @@ fn the_complete_bundle_holds_every_recipe_once_by_content() { assert!(bundle.missing().is_empty()); assert_eq!(bundle.notices.len(), notices().len()); for notice in &bundle.notices { - assert!(notice.member.contains("LICEN"), "{}", notice.member); + assert!( + notice.member.contains("LICEN") || notice.member == "COPYING", + "{}", + notice.member + ); } } diff --git a/crates/stela-loader/src/host_firmware/recipes.rs b/crates/stela-loader/src/host_firmware/recipes.rs index 3e542ae0ff..8e72808add 100644 --- a/crates/stela-loader/src/host_firmware/recipes.rs +++ b/crates/stela-loader/src/host_firmware/recipes.rs @@ -854,7 +854,8 @@ const fn gsp(member: &'static str, length: usize, sha256: &'static str) -> Recip } } -/// An image of an [`NvidiaGsp`] release. +/// An image of an [`NvidiaGsp`] release, under the notice of what it is +/// made from. const fn nvidia_image( source: &'static str, revision: &'static str, @@ -879,6 +880,30 @@ const fn nvidia_image( /// open-gpu-kernel-modules at its tag `570.211.01`. const OPEN_GPU_570_211_01: &str = "498793d5e2a86c981b83c1bfb31f1f4a082d0f7b"; +/// open-gpu-kernel-modules' `COPYING` at [`OPEN_GPU_570_211_01`]: its files +/// are MIT unless they say otherwise, and the generated `bindata` sources +/// the bootloader and GSP-FMC are built from say `SPDX-License-Identifier: +/// MIT`. +const OPEN_GPU_570_211_01_LICENSE: Artifact = Artifact { + source: NVIDIA_OPEN_GPU, + revision: OPEN_GPU_570_211_01, + member: "COPYING", + length: 19391, + sha256: "d8e96d29bc323000e7ba56102d77c88226a7a3d0d94e2081cb4b071ae9de4a06", +}; + +/// The `LICENSE` of `NVIDIA-Linux-x86_64-570.211.01.run`, the NVIDIA Driver +/// License Agreement its GSP-RM image is under. It lies 1.2 GB into the +/// installer's single `zstd` frame, so the CLI carries this file's exact +/// bytes rather than downloading the installer for it. +pub const NVIDIA_DRIVER_570_211_01_LICENSE: Artifact = Artifact { + source: NVIDIA_LINUX_DRIVER, + revision: "570.211.01", + member: "LICENSE", + length: 22653, + sha256: "c692fb14ad4f499c6aee1b9e144e6905148c420e6225b17cb2937366c1e507ad", +}; + /// GeForce Blackwell's GSP-RM 570.211.01 (`gb202` directory). pub const GB20X_570_211_01: NvidiaGsp = NvidiaGsp { bindata_chip: "GB202", @@ -914,7 +939,7 @@ pub const GB20X_570_211_01: NvidiaGsp = NvidiaGsp { "nvidia/gb202/gsp/bootloader-570.211.01.bin", 200812, "e5e505fb453bcd618a4966464aa601e97a1ced2b1d450cab5bcb69e4043dc7f2", - &GSP_LICENSE, + &OPEN_GPU_570_211_01_LICENSE, ), nvidia_image( NVIDIA_OPEN_GPU, @@ -922,7 +947,7 @@ pub const GB20X_570_211_01: NvidiaGsp = NvidiaGsp { "nvidia/gb202/gsp/fmc-570.211.01.bin", 199820, "e0950cdd16fe7045adbce11543f5b6d13146fca89e78158a9ab07d28dcbe576a", - &GSP_LICENSE, + &OPEN_GPU_570_211_01_LICENSE, ), nvidia_image( NVIDIA_LINUX_DRIVER, @@ -930,7 +955,7 @@ pub const GB20X_570_211_01: NvidiaGsp = NvidiaGsp { "nvidia/gb202/gsp/gsp-570.211.01.bin", 64116464, "3ce89a251900d0238d0593e4b9eb039c4571c6c54d09661fad7399f89e37d4bc", - &GSP_LICENSE, + &NVIDIA_DRIVER_570_211_01_LICENSE, ), ], }; @@ -2917,6 +2942,10 @@ mod tests { let image = nvidia_gsp(&recipe.image) .map_or(&recipe.image, |(release, part)| release.source(part)); for artifact in [image, recipe.license] { + if *artifact == NVIDIA_DRIVER_570_211_01_LICENSE { + // The CLI carries it. + continue; + } assert_eq!( artifact.urls().len(), if matches!(artifact.source, WIRELESS_REGDB | NVIDIA_OPEN_GPU) { @@ -2944,7 +2973,8 @@ mod tests { "https://us.download.nvidia.com/XFree86/Linux-x86_64/570.211.01/NVIDIA-Linux-x86_64-570.211.01.run" ] ); - + assert_eq!(bootloader.license.member, "COPYING"); + assert_eq!(*gsp.license, NVIDIA_DRIVER_570_211_01_LICENSE); let value = serde_json::json!({"schema":1,"complete":true,"requirements":[{ "name":"regulatory.db", "target":{"driver":"wifi-regulatory","hardware":"wireless-regdb","revision":"v20","board":null},"minimum_bytes":8 }]});