From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id mNxOLVHKiWTPCwEASxT56A (envelope-from ) for ; Wed, 14 Jun 2023 16:10:25 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id IJFJLVHKiWRdmQAAauVa8A (envelope-from ) for ; Wed, 14 Jun 2023 16:10:25 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 448C9A3DE for ; Wed, 14 Jun 2023 16:10:25 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q9RCL-000322-SC; Wed, 14 Jun 2023 10:10:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q9RCH-00031W-56 for guix-patches@gnu.org; Wed, 14 Jun 2023 10:10:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q9RCG-0004mK-Nk; Wed, 14 Jun 2023 10:10:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q9RCD-0005TS-U7; Wed, 14 Jun 2023 10:10:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#64068] [PATCH] gnu: Add u-boot-lichee-rv-dock. Resent-From: Z572 <873216071@qq.com> Original-Sender: "Debbugs-submit" Resent-CC: efraim@flashner.co.il, ludo@gnu.org, vagrant@debian.org, guix-patches@gnu.org Resent-Date: Wed, 14 Jun 2023 14:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 64068 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 64068@debbugs.gnu.org Cc: Efraim Flashner , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Vagrant Cascadian X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Efraim Flashner , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Vagrant Cascadian Received: via spool by submit@debbugs.gnu.org id=B.168675177621001 (code B ref -1); Wed, 14 Jun 2023 14:10:01 +0000 Received: (at submit) by debbugs.gnu.org; 14 Jun 2023 14:09:36 +0000 Received: from localhost ([127.0.0.1]:44994 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q9RBn-0005Sc-Mb for submit@debbugs.gnu.org; Wed, 14 Jun 2023 10:09:36 -0400 Received: from lists.gnu.org ([209.51.188.17]:41394) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <873216071@qq.com>) id 1q9RBj-0005SQ-8w for submit@debbugs.gnu.org; Wed, 14 Jun 2023 10:09:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <873216071@qq.com>) id 1q9RBj-0002xr-2h for guix-patches@gnu.org; Wed, 14 Jun 2023 10:09:31 -0400 Received: from out203-205-221-239.mail.qq.com ([203.205.221.239]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <873216071@qq.com>) id 1q9RBd-0004Wt-QG for guix-patches@gnu.org; Wed, 14 Jun 2023 10:09:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1686751755; bh=xEVqo46Fw1Rvd32il4mDTnimyRyrNph8h1VpU39biXE=; h=From:To:Subject:Date; b=cVBIBneII+j//QComh/NGPMTFRGOu44Rz9yikUWndkBCS1i6t/QFbKGPwhga3POiQ XipcD1bL/kkfj36ZF/aklvtP0ksGv8B7gMEZJbc6JfeFlQMA5vGCdnnbRBJR2dCov0 MIH1x576HQIpCWC5pE3ss/uoZYdc7O6K+JZTWACg= Received: from localhost.localdomain ([111.0.51.197]) by newxmesmtplogicsvrsza12-0.qq.com (NewEsmtp) with SMTP id 24D91867; Wed, 14 Jun 2023 22:09:13 +0800 X-QQ-mid: xmsmtpt1686751753tdwug2wus Message-ID: X-QQ-XMAILINFO: N7h1OCCDntujEsnnP6Oe5+pUFSuvsU2U3VO0T17YSSTI2OoN/YRiNo0Fu94Beh jXL6Uwg4K5zOJ+YQgCo/K663Y9Td+FN2FhaeWwUdiVIw6H1GAxckzDyZQG8Rdxy5YAH0Rgs1a6Em xDqXOM9Hp83u50pGOGou48PMFk5DBk+Hlluh3ZQ7qaat1r4gLdfbWT85b3f0VLrpJp+orU/4EjlH gRLMTTc2/VCzjztnLCCK77h6HsmWM34QYBw9vEKpPeBaecW9uFwFvAe//BRV0KxT3A5AufGiQk5X IcJ5pV+6yghZ4qFUmanO/oOa6x2B7aofO8Mwe/oSC+fiheB71/T9SMzPQLy4ydO2WqLROOxPorUE KBAjUo6m16LOCG57+iQ4QHS134Hkgdo8K+ndvzjXagGzw83AlIQoTahitmD8we1lc8yHQimmrFFZ KrpsHwds8pBIjLAfqLJHEkAB3fAIpbtZgE/heEh/uR41bx3kJkaQ/Xi4QusGQLVHPsKGkCQtcvnf 0c8V0LbI2ZnrqaQgqvTAzmXph2kcHe8QkS07q1ZTA+il3YzDP4FRkbpXoP/UaHFqMF2VrTgbvbYa V7riY2bTKUVjt0+4OT8M13tm+9pDn6mc12xeyuZkyqGZ4kqfNhIZNNeAfNHf6d1ElHRfge52KYwo vF3Plw7udc7Pw57qfZXoN7lapUo+uzU80QEmbTqrVWYPZSyGIopX6BJbz0Jplv7OZCVsTA3mG8hu myGH3QSF5yUOFicFiY1zlEnFDjXAJ1dSbo3kO88On2SUzG5anCK+aKdH+Xma2KDMt8DDw2qXD0or L8HDh+qwK+8XkOczMlDwUPN6kWlpI/BMZtvXKhsvmEOIybTdxgOhXS13XsXLSkNwk3u4w8MLrSwv JttNuTTygsn5fc8x4PxQgQRjwT8pITnJogJMxJWKPRuAoC+CrVCp7SdBJda2lgAtxfmT2y7B5ucm Gp6R3u8M4= X-QQ-XMAILREADINFO: M6MeDH90Kfa7jdireGRnptI= Date: Wed, 14 Jun 2023 22:09:13 +0800 X-OQ-MSGID: X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Type: text/plain; charset=y Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=203.205.221.239; envelope-from=873216071@qq.com; helo=out203-205-221-239.mail.qq.com X-Spam_score_int: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HELO_DYNAMIC_IPADDR=1.951, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_DYNAMIC=0.982, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Z572 <873216071@qq.com> X-ACL-Warn: , Z572 via Guix-patches From: Z572 via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1686751825; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=xEVqo46Fw1Rvd32il4mDTnimyRyrNph8h1VpU39biXE=; b=dOn1H/gB9buKNRrYUsznazSSvJk4/kNhCmR4puRCQS4V5Mj2gRPyZyjHU5wmAhsk/IlNj0 JftwgGjK6/rids02DHl9/JiEs7YRRewFWUd3O81ivEcp0EAuqu4jjruH8cUwrOSAGQFAdi Y/8Vu0wXsUd5YxFJ5ICXDfncIcjqOYcuKRidP4/flCI93dLBU0CqMNx5aexdQKGfgVOm1N fsQv0kBgRg2xbJM0ctn0dEkHANihHxrL2OCOld0LYdBICo1Gf8ZytNAz/M8I1E9pLnkKEI IEifqw+uT3NiuuNxN/DZwVaNGAC3xXTZoTs81OWjnURvVHPW04E3lppnltw2VA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=qq.com header.s=s201512 header.b=cVBIBneI; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1686751825; a=rsa-sha256; cv=none; b=HIQkKyb4qH+tK3SHXD0H7q4TN4LjbZcP8yEKJEngv0vpCWNZu4ROSOVcHpS/p+IGrSUsgu MmSXgR4VXeu/zp8y1u7y+eqsW3xd+X2cYDikvRmbrYPHexjaGOrIxU3gSthN8ckC4+XwuT PCWTGHc1PmXJdXXHLfS+nSP2OcdgO2+T8Y5yuOJesuQnt/BahOuO2SmJFI06LQvOKJkqYX VFDbAPvK5PVvwfQa/YBWPqlrBEMvbkBfabvbGkK+d6OEzYdNJN+TIMmwToILDfOtH3/bMa ERQ1sQU0YNq/oAFRqtsbOrFF8fOlHXS4nGQGsxBkp64ncA7J9rLXXul9aSm1Mg== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -2.43 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=qq.com header.s=s201512 header.b=cVBIBneI; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 448C9A3DE X-Spam-Score: -2.43 X-TUID: bW++X87E8UZE * gnu/packages/bootloaders.scm (u-boot-lichee-rv-dock): New variable. * gnu/packages/patches/u-boot-lichee-rv-dock-disable-openssl.patch: New file. * gnu/local.mk(dist_patch_DATA): register it. --- gnu/local.mk | 1 + gnu/packages/bootloaders.scm | 39 ++++ ...-boot-lichee-rv-dock-disable-openssl.patch | 216 ++++++++++++++++++ 3 files changed, 256 insertions(+) create mode 100644 gnu/packages/patches/u-boot-lichee-rv-dock-disable-openssl.patch diff --git a/gnu/local.mk b/gnu/local.mk index 209556b56d..b2f4aaadc3 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1993,6 +1993,7 @@ dist_patch_DATA = \ %D%/packages/patches/u-boot-allow-disabling-openssl.patch \ %D%/packages/patches/u-boot-fix-build-python-3.10.patch \ %D%/packages/patches/u-boot-infodocs-target.patch \ + %D%/packages/patches/u-boot-lichee-rv-dock-disable-openssl.patch \ %D%/packages/patches/u-boot-patman-guix-integration.patch \ %D%/packages/patches/u-boot-nintendo-nes-serial.patch \ %D%/packages/patches/u-boot-rockchip-inno-usb.patch \ diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index a9685a9ef9..4b80eaf3e8 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -18,6 +18,7 @@ ;;; Copyright © 2022 Denis 'GNUtoo' Carikli ;;; Copyright © 2021 Stefan ;;; Copyright © 2022 Maxim Cournoyer +;;; Cournoyer © 2023 Zheng Junjie <873216071@qq.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -1188,6 +1189,44 @@ (define-public u-boot-sifive-unmatched (modify-inputs (package-inputs base) (append opensbi-generic)))))) +(define-public u-boot-lichee-rv-dock + (let ((commit "528ae9bc6c55edd3ffe642734b4132a8246ea777") + (base (make-u-boot-package + "lichee_rv_dock" + "riscv64-linux-gnu"))) + (package + (inherit base) + (source (origin + (inherit (package-source base)) + (method git-fetch) + (uri (git-reference + (url "https://github.com/smaeul/u-boot") + (commit commit))) + (file-name (git-file-name + (package-name base) + (package-version base))) + (patches + (append + (search-patches + "u-boot-lichee-rv-dock-disable-openssl.patch") + ;;; rebase from %u-boot-allow-disabling-openssl-patch + (filter (negate (cut string-contains <> "openssl")) + (origin-patches (package-source base))))) + (sha256 + (base32 + "1rfk2d9wxxmf8ypvmwq07g1vifkvzy2nzs4mdwdgxsadlhi8dn9s")))) + (arguments + (substitute-keyword-arguments (package-arguments base) + ((#:phases phases) + #~(modify-phases #$phases + (add-after 'unpack 'set-environment + (lambda* (#:key inputs #:allow-other-keys) + (setenv "OPENSBI" (search-input-file inputs + "fw_dynamic.bin")))))))) + (inputs + (modify-inputs (package-inputs base) + (append opensbi-generic)))))) + (define-public u-boot-rock64-rk3328 (let ((base (make-u-boot-package "rock64-rk3328" "aarch64-linux-gnu"))) (package diff --git a/gnu/packages/patches/u-boot-lichee-rv-dock-disable-openssl.patch b/gnu/packages/patches/u-boot-lichee-rv-dock-disable-openssl.patch new file mode 100644 index 0000000000..f8e22d2c57 --- /dev/null +++ b/gnu/packages/patches/u-boot-lichee-rv-dock-disable-openssl.patch @@ -0,0 +1,216 @@ +From b2dff4fe9d1a53bbe3565435e190db19e7d6f4e7 Mon Sep 17 00:00:00 2001 +From: Z572 +Date: Mon, 8 May 2023 18:00:55 +0800 +Subject: [PATCH] remove openssl + +--- + include/image.h | 2 ++ + tools/fit_image.c | 3 ++- + tools/image-host.c | 4 ++++ + tools/kwbimage.c | 21 +++++++++++++++++++-- + 4 files changed, 27 insertions(+), 3 deletions(-) + +diff --git a/include/image.h b/include/image.h +index e5e12ce5..5c858a16 100644 +--- a/include/image.h ++++ b/include/image.h +@@ -1172,6 +1172,7 @@ int fit_image_hash_get_value(const void *fit, int noffset, uint8_t **value, + + int fit_set_timestamp(void *fit, int noffset, time_t timestamp); + ++#ifdef CONFIG_FIT_PRELOAD + /** + * fit_pre_load_data() - add public key to fdt blob + * +@@ -1186,6 +1187,7 @@ int fit_set_timestamp(void *fit, int noffset, time_t timestamp); + * < 0, on failure + */ + int fit_pre_load_data(const char *keydir, void *keydest, void *fit); ++#endif + + int fit_cipher_data(const char *keydir, void *keydest, void *fit, + const char *comment, int require_keys, +diff --git a/tools/fit_image.c b/tools/fit_image.c +index 923a9755..7a73f24a 100644 +--- a/tools/fit_image.c ++++ b/tools/fit_image.c +@@ -59,9 +59,10 @@ static int fit_add_file_data(struct image_tool_params *params, size_t size_inc, + ret = fit_set_timestamp(ptr, 0, time); + } + ++#ifdef CONFIG_FIT_PRELOAD + if (!ret) + ret = fit_pre_load_data(params->keydir, dest_blob, ptr); +- ++#endif + if (!ret) { + ret = fit_cipher_data(params->keydir, dest_blob, ptr, + params->comment, +diff --git a/tools/image-host.c b/tools/image-host.c +index 4e0512be..da70fcb4 100644 +--- a/tools/image-host.c ++++ b/tools/image-host.c +@@ -14,9 +14,11 @@ + #include + #include + ++#ifdef CONFIG_FIT_PRELOAD + #include + #include + ++#endif + /** + * fit_set_hash_value - set hash value in requested has node + * @fit: pointer to the FIT format image header +@@ -1119,6 +1121,7 @@ static int fit_config_add_verification_data(const char *keydir, + return 0; + } + ++#ifdef CONFIG_FIT_PRELOAD + /* + * 0) open file (open) + * 1) read certificate (PEM_read_X509) +@@ -1227,6 +1230,7 @@ int fit_pre_load_data(const char *keydir, void *keydest, void *fit) + out: + return ret; + } ++#endif + + int fit_cipher_data(const char *keydir, void *keydest, void *fit, + const char *comment, int require_keys, +diff --git a/tools/kwbimage.c b/tools/kwbimage.c +index 6abb9f2d..d8159070 100644 +--- a/tools/kwbimage.c ++++ b/tools/kwbimage.c +@@ -19,6 +19,7 @@ + #include + #include "kwbimage.h" + ++#ifdef CONFIG_KWB_SECURE + #include + #include + #include +@@ -44,7 +45,7 @@ void EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx) + EVP_MD_CTX_reset(ctx); + } + #endif +- ++#endif + /* fls - find last (most-significant) bit set in 4-bit integer */ + static inline int fls4(int num) + { +@@ -62,8 +63,9 @@ static inline int fls4(int num) + + static struct image_cfg_element *image_cfg; + static int cfgn; ++#ifdef CONFIG_KWB_SECURE + static int verbose_mode; +- ++#endif + struct boot_mode { + unsigned int id; + const char *name; +@@ -278,6 +280,8 @@ image_count_options(unsigned int optiontype) + return count; + } + ++#if defined(CONFIG_KWB_SECURE) ++ + static int image_get_csk_index(void) + { + struct image_cfg_element *e; +@@ -288,6 +292,7 @@ static int image_get_csk_index(void) + + return e->csk_idx; + } ++#endif + + static bool image_get_spezialized_img(void) + { +@@ -432,6 +437,7 @@ static uint8_t baudrate_to_option(unsigned int baudrate) + } + } + ++#if defined(CONFIG_KWB_SECURE) + static void kwb_msg(const char *fmt, ...) + { + if (verbose_mode) { +@@ -926,6 +932,7 @@ static int kwb_dump_fuse_cmds(struct secure_hdr_v1 *sec_hdr) + done: + return ret; + } ++#endif + + static size_t image_headersz_align(size_t headersz, uint8_t blockid) + { +@@ -1079,11 +1086,13 @@ static size_t image_headersz_v1(int *hasext) + */ + headersz = sizeof(struct main_hdr_v1); + ++#if defined(CONFIG_KWB_SECURE) + if (image_get_csk_index() >= 0) { + headersz += sizeof(struct secure_hdr_v1); + if (hasext) + *hasext = 1; + } ++#endif + + cpu_sheeva = image_is_cpu_sheeva(); + +@@ -1270,6 +1279,7 @@ err_close: + return -1; + } + ++#if defined(CONFIG_KWB_SECURE) + static int export_pub_kak_hash(RSA *kak, struct secure_hdr_v1 *secure_hdr) + { + FILE *hashf; +@@ -1382,6 +1392,7 @@ static int add_secure_header_v1(struct image_tool_params *params, uint8_t *ptr, + + return 0; + } ++#endif + + static void finish_register_set_header_v1(uint8_t **cur, uint8_t **next_ext, + struct register_set_hdr_v1 *register_set_hdr, +@@ -1406,7 +1417,9 @@ static void *image_create_v1(size_t *imagesz, struct image_tool_params *params, + struct main_hdr_v1 *main_hdr; + struct opt_hdr_v1 *ohdr; + struct register_set_hdr_v1 *register_set_hdr; ++#if defined(CONFIG_KWB_SECURE) + struct secure_hdr_v1 *secure_hdr = NULL; ++#endif + size_t headersz; + uint8_t *image, *cur; + int hasext = 0; +@@ -1491,6 +1504,7 @@ static void *image_create_v1(size_t *imagesz, struct image_tool_params *params, + if (main_hdr->blockid == IBR_HDR_PEX_ID) + main_hdr->srcaddr = cpu_to_le32(0xFFFFFFFF); + ++#if defined(CONFIG_KWB_SECURE) + if (image_get_csk_index() >= 0) { + /* + * only reserve the space here; we fill the header later since +@@ -1502,6 +1516,7 @@ static void *image_create_v1(size_t *imagesz, struct image_tool_params *params, + next_ext = &secure_hdr->next; + } + ++#endif + datai = 0; + for (cfgi = 0; cfgi < cfgn; cfgi++) { + e = &image_cfg[cfgi]; +@@ -1552,9 +1567,11 @@ static void *image_create_v1(size_t *imagesz, struct image_tool_params *params, + &datai, delay); + } + ++#if defined(CONFIG_KWB_SECURE) + if (secure_hdr && add_secure_header_v1(params, ptr, payloadsz + headersz, + headersz, image, secure_hdr)) + return NULL; ++#endif + + *imagesz = headersz; + +-- +2.39.2 + base-commit: 7c12255eb9fdd73b481c3c588b02809abd633be8 -- 2.40.1