From patchwork Tue May 16 15:53:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sebastian Weyer X-Patchwork-Id: 1782138 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QLLPW4VC1z20dX for ; Wed, 17 May 2023 01:53:35 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id BA22341E4D; Tue, 16 May 2023 15:53:33 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org BA22341E4D X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bjZzpVndtPTR; Tue, 16 May 2023 15:53:32 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 9D5E741E3B; Tue, 16 May 2023 15:53:31 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 9D5E741E3B X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id E4D1D1BF3AA for ; Tue, 16 May 2023 15:53:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id BC93940345 for ; Tue, 16 May 2023 15:53:30 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org BC93940345 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oCqU1sWWUk1T for ; Tue, 16 May 2023 15:53:29 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org C332740355 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by smtp4.osuosl.org (Postfix) with ESMTPS id C332740355 for ; Tue, 16 May 2023 15:53:28 +0000 (UTC) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-3f49bf0223cso72805365e9.1 for ; Tue, 16 May 2023 08:53:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684252406; x=1686844406; 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=2CzlgxZcq0FqfNEKnRFFtDxEjxrcFlvXed+IoklM+ZM=; b=CjLhsvwz6jzXjX0NF6SfaihFlMgqUa/2sd3FJX8jwiBJewJKLvt/EGjdfBvz6Rk1AZ kflY7O2MAvcfLDsMKoKp70gYxGq6ZD0w7sibFfL6Uv9LU/EwK/BkOhiesLg+xDuY+3g3 xPJ73qViIv+NoX2Oy1cyQoY5gBmgOJ0PXM3eLlmzwvuVQgCsao0UUGBhh6nXUkv9K/oX +vpwrCiT1lTK6TxR0mN2enAudcDPMsga7u9++sQMvtV4FfU7kYPL1pt1VaCYetKaxX3j wQsjr2cgDVYLyGcjsVfkUAc0mtCto9m1cWR73KKjqYhPUQgtr5IOngYz3nlU293XQ2Zu HlOg== X-Gm-Message-State: AC+VfDxeD/hDAQtsVbn0VNhvSELE1qAOwYZ3vo0QWGL73qVeVS65WNOd rClEMP4NcJjgRjl3ivyW3Sa+nOKKNlfs7pOi55g= X-Google-Smtp-Source: ACHHUZ4EGbVt+MfZHMuICq04soYAGwGzEAtIJMxXzY62EzjpkzGv6EgVTVB7yCxcK7ZduSUToLcj/Q== X-Received: by 2002:a7b:c449:0:b0:3f4:2d04:f3f0 with SMTP id l9-20020a7bc449000000b003f42d04f3f0mr16820194wmi.39.1684252406582; Tue, 16 May 2023 08:53:26 -0700 (PDT) Received: from P-NAN-LIMA.. ([2a04:cec0:1026:f768:f6ad:f1ca:511:b07f]) by smtp.gmail.com with ESMTPSA id m25-20020a7bca59000000b003f17eaae2c9sm2817178wml.1.2023.05.16.08.53.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 May 2023 08:53:25 -0700 (PDT) From: Sebastian Weyer To: buildroot@buildroot.org Date: Tue, 16 May 2023 17:53:09 +0200 Message-Id: <20230516155310.1341998-1-sebastian.weyer@smile.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile-fr.20221208.gappssmtp.com; s=20221208; t=1684252406; x=1686844406; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=2CzlgxZcq0FqfNEKnRFFtDxEjxrcFlvXed+IoklM+ZM=; b=KtrspE5Z67/yyzivgS8ufdnr2S42o5z3h8q15Hks+imStasqE07h5GvwpPzgPCavdv QdqDcwF1AN6yNzhXyR9Kegom2pfvKzDOsn4UynggI7p+UPeECe6qi1pIg/eJIrU5PVfP O48cTCQlaevR8i7r5EL1QyGLghl77R1bEBCo2YWOw748jjliW8DxytkNA5xok3cuRp19 MXpswjw9/kQncclBSAtq/ehIww5O5RC1iIbcSbqCgTo7iw0FP/W5N4hWnhs9VPPpRmZI 1eppYopvg5Le4Lh6obAnSNy4ha1FmEkl5kZYnVzwJBo9C+IBbiiUeMI8Jewkv2pTLEcD I5lg== X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=smile-fr.20221208.gappssmtp.com header.i=@smile-fr.20221208.gappssmtp.com header.a=rsa-sha256 header.s=20221208 header.b=KtrspE5Z Subject: [Buildroot] [PATCH v2 1/2] package/amlogic-boot-fip: new host package to sign bootloader for amlogic SoCs X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sebastian Weyer , Thomas Petazzoni Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" This tool is needed by some SoCs to sign the bootloader. The supported SoCs are the following: bananapi-cm4io bananapi-m2-pro bananapi-m2s bananapi-m5 beelink-gt1 beelink-s922x jethub-j100 jethub-j80 khadas-vim khadas-vim2 khadas-vim3 khadas-vim3l lafrite lepotato nanopi-k2 odroid-c2 odroid-c4 odroid-go-ultra odroid-hc4 odroid-n2 odroid-n2l odroid-n2-plus p200 p201 p212 radxa-zero radxa-zero2 s400 sei510 sei610 tartiflette-s905d tartiflette-s912 u200 wetek-core2 wetek-hub wetek-play2 The variable BR2_PACKAGE_HOST_AMLOGIC_BOOT_FIP_DEVICE is used to specify for which device this package needs to be used. This tool uses pre-compiled binaries in order to sign the bootloader. These binaries are provided under a proprietary license that prohibits any redistribution of the resulting images. A similar tool was tried to be added in the past: http://patchwork.ozlabs.org/project/buildroot/patch/1533545408-11248-2-git-send-email-narmstrong@baylibre.com/ This time however a license file is present which can be used by make legal-info. Additionally, acs_tool.pyc was replaced by acs_tool.py and is therefore not compiled anymore. Signed-off-by: Sebastian Weyer --- To my knowledge there is no open-source alternative for A311D SoCs like the Khadas VIM3. For devices using a S805, S905, S912 or A113D SoC like the lafrite, the lepotato or the tartiflette, an open-source alternative might be supported: https://github.com/repk/gxlimg --- DEVELOPERS | 3 ++ package/Config.in.host | 1 + package/amlogic-boot-fip/Config.in.host | 52 +++++++++++++++++++ .../amlogic-boot-fip/amlogic-boot-fip.hash | 3 ++ package/amlogic-boot-fip/amlogic-boot-fip.mk | 31 +++++++++++ 5 files changed, 90 insertions(+) create mode 100644 package/amlogic-boot-fip/Config.in.host create mode 100644 package/amlogic-boot-fip/amlogic-boot-fip.hash create mode 100644 package/amlogic-boot-fip/amlogic-boot-fip.mk diff --git a/DEVELOPERS b/DEVELOPERS index e76717e845..53ce8408db 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -2589,6 +2589,9 @@ F: support/misc/toolchainfile.cmake.in N: Sam Voss F: package/ripgrep/ +N: Sebastian Weyer +F: package/amlogic-boot-fip + N: Sébastien Szymanski F: package/mmc-utils/ F: package/python-flask-jsonrpc/ diff --git a/package/Config.in.host b/package/Config.in.host index dcadbfdfc1..074adc51f2 100644 --- a/package/Config.in.host +++ b/package/Config.in.host @@ -3,6 +3,7 @@ menu "Host utilities" source "package/abootimg/Config.in.host" source "package/aespipe/Config.in.host" source "package/agent-proxy/Config.in.host" + source "package/amlogic-boot-fip/Config.in.host" source "package/android-tools/Config.in.host" source "package/asn1c/Config.in.host" source "package/babeltrace2/Config.in.host" diff --git a/package/amlogic-boot-fip/Config.in.host b/package/amlogic-boot-fip/Config.in.host new file mode 100644 index 0000000000..14ecc63bff --- /dev/null +++ b/package/amlogic-boot-fip/Config.in.host @@ -0,0 +1,52 @@ +config BR2_PACKAGE_HOST_AMLOGIC_BOOT_FIP + bool "host amlogic-boot-fip" + depends on BR2_HOSTARCH = "x86_64" + help + Firmware Image Pacakge (FIP) sources used to sign Amlogic + u-boot binaries in LibreELEC images + + https://github.com/LibreELEC/amlogic-boot-fip + +config BR2_PACKAGE_HOST_AMLOGIC_BOOT_FIP_DEVICE + string "amlogic-boot-fip device" + default "khadas-vim3" + depends on BR2_PACKAGE_HOST_AMLOGIC_BOOT_FIP + help + Device for which you want to use this package. + Valid options are: + bananapi-cm4io + bananapi-m2-pro + bananapi-m2s + bananapi-m5 + beelink-gt1 + beelink-s922x + jethub-j100 + jethub-j80 + khadas-vim + khadas-vim2 + khadas-vim3 + khadas-vim3l + lafrite + lepotato + nanopi-k2 + odroid-c2 + odroid-c4 + odroid-go-ultra + odroid-hc4 + odroid-n2 + odroid-n2l + odroid-n2-plus + p200 + p201 + p212 + radxa-zero + radxa-zero2 + s400 + sei510 + sei610 + tartiflette-s905d + tartiflette-s912 + u200 + wetek-core2 + wetek-hub + wetek-play2 diff --git a/package/amlogic-boot-fip/amlogic-boot-fip.hash b/package/amlogic-boot-fip/amlogic-boot-fip.hash new file mode 100644 index 0000000000..1a08341532 --- /dev/null +++ b/package/amlogic-boot-fip/amlogic-boot-fip.hash @@ -0,0 +1,3 @@ +# Locally calculated +sha256 2cc06bc7d5647fd8c0025181fa42c4a8ef0ed16b918a1fa2060ea83c22e47b20 amlogic-boot-fip-e96b6a694380ff07d5a9e4be644ffe254bd18512.tar.gz +sha256 4255537f71b1cd0d487de0fa2b8eddf1eb96ed96d119507336dde8b3782b86e6 LICENSE diff --git a/package/amlogic-boot-fip/amlogic-boot-fip.mk b/package/amlogic-boot-fip/amlogic-boot-fip.mk new file mode 100644 index 0000000000..0cb7a8d93f --- /dev/null +++ b/package/amlogic-boot-fip/amlogic-boot-fip.mk @@ -0,0 +1,31 @@ +################################################################################ +# +# amlogic-boot-fip +# +################################################################################ + +AMLOGIC_BOOT_FIP_VERSION = e96b6a694380ff07d5a9e4be644ffe254bd18512 +AMLOGIC_BOOT_FIP_SITE = $(call github,LibreELEC,amlogic-boot-fip,$(AMLOGIC_BOOT_FIP_VERSION)) +AMLOGIC_BOOT_FIP_LICENSE = PROPRIETARY +AMLOGIC_BOOT_FIP_LICENSE_FILES = LICENSE + +AMLOGIC_BOOT_FIP_INSTALL_DIR = $(BINARIES_DIR)/amlogic-boot-fip + +AMLOGIC_BOOT_FIP_DEVICE = $(BR2_PACKAGE_HOST_AMLOGIC_BOOT_FIP_DEVICE) + +define HOST_AMLOGIC_BOOT_FIP_INSTALL_CMDS + mkdir -p $(AMLOGIC_BOOT_FIP_INSTALL_DIR)/$(AMLOGIC_BOOT_FIP_DEVICE) + $(INSTALL) -D -m 0755 $(@D)/build-all-fip.sh $(AMLOGIC_BOOT_FIP_INSTALL_DIR) + $(INSTALL) -D -m 0755 $(@D)/build-fip.sh $(AMLOGIC_BOOT_FIP_INSTALL_DIR) + $(INSTALL) -D -m 0755 $(@D)/g12a.inc $(AMLOGIC_BOOT_FIP_INSTALL_DIR) + $(INSTALL) -D -m 0755 $(@D)/$(AMLOGIC_BOOT_FIP_DEVICE)/* $(AMLOGIC_BOOT_FIP_INSTALL_DIR)/$(AMLOGIC_BOOT_FIP_DEVICE) +endef + +# check for empty device string when we're building +ifeq ($(BR2_PACKAGE_HOST_AMLOGIC_BOOT_FIP)$(BR_BUILDING),yy) +ifeq ($(call qstrip,$(BR2_PACKAGE_HOST_AMLOGIC_BOOT_FIP_DEVICE)),) +$(error No device specified for amlogic-boot-fip, please check your BR2_PACKAGE_HOST_AMLOGIC_BOOT_FIP_DEVICE setting) +endif +endif + +$(eval $(host-generic-package))