From patchwork Wed Jan 27 21:24:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 1432377 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=lwVMHEWi; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DQxST5yXWz9sVX for ; Thu, 28 Jan 2021 08:24:25 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 37A0E85EC0; Wed, 27 Jan 2021 21:24:24 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FN7aY5FUedPF; Wed, 27 Jan 2021 21:24:23 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 839F685EC6; Wed, 27 Jan 2021 21:24:23 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id E57CF1BF4E4 for ; Wed, 27 Jan 2021 21:24:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id E0CD485EC0 for ; Wed, 27 Jan 2021 21:24:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YQkqzFVGtjeu for ; Wed, 27 Jan 2021 21:24:20 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 88B5E8445A for ; Wed, 27 Jan 2021 21:24:20 +0000 (UTC) Received: by mail-wr1-f52.google.com with SMTP id c12so3392367wrc.7 for ; Wed, 27 Jan 2021 13:24:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=WItOUxUM2sytU1VEKSE9eOSVLs9yKFHFD+oqPY22j70=; b=lwVMHEWi8uNmNRRRozrS+eq1FBgJlMp7gczZw3dlBokuomO8FgIy3Bjsr4nKnPUxvz PHeeiCRPc0ZKMm1SS0TKFN8aUVYq6Tg2xe680uHOikJowoybxc79gjWImSNvsRdfYHSM D5F7YOEhSLzPU42yERluqnYf/ucr0nDWDZ0I/PQQqjpx+uAVcNQcw7J3439tvavsrGwn SfV8kxulJuD/qNnHdA/p8Wli4/tZfoMX1w0K1NyuF4KvovwReuccWsiDq0WNuYAYqZPP MbCTl9LWiYDasXFtBPch3ygKDZvT+V7SUZYsmOeznZaPEzbXFpwszxVkz9LgJ9/NG+eA RTpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=WItOUxUM2sytU1VEKSE9eOSVLs9yKFHFD+oqPY22j70=; b=tOpLSpkBL66R7QSifVrc2r5SntIoLOteCmK1+GF32KnEVl85CE79ZEtRBfbrFdPZ3m Ik3dK0wufkFqjJm7MjNKow/UzZ4ge0Qbv7plR6aQJbvlCiyAumRQosxdhd9zhYzzKpd6 pHc34kFetupvRTZQxXda0ZHhLXU0TwJyhT/W0NPdXa9c8XsU+rwY+bJlImtMK294Xrka AH1Nw6ZeIJ5kLqiT/kFtB3/AUlF8/fJLbjaHoYXljjZYY3ymodFvxfvZRRjMEkDqOPXH K1i55B4T5tL8ckFsLOidRBFhw7PSUdk8RBVA+RCQOjq25ebO6HvP1ly3Mv4Wc0HJHsZr a8Tw== X-Gm-Message-State: AOAM530O8dPIlKN9XuEkLJphxxfkqWoiNLvC9RZBKw66nS2OiDv/id/U C9CObxSGFw8nFMezzsBMB+8gCtHdGa8= X-Google-Smtp-Source: ABdhPJyqLzicJearJGQNm9d9qo2v41j6C70CpPNsXssQM1jmH9cf8JvOwueQUCE4w0tADAEvOIL9uQ== X-Received: by 2002:a05:6000:1372:: with SMTP id q18mr12897986wrz.280.1611782658857; Wed, 27 Jan 2021 13:24:18 -0800 (PST) Received: from localhost.localdomain ([2a01:cb19:8b51:cb00:3995:f0d8:83a8:6ccc]) by smtp.gmail.com with ESMTPSA id e11sm4127561wrt.35.2021.01.27.13.24.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jan 2021 13:24:18 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Wed, 27 Jan 2021 22:24:13 +0100 Message-Id: <20210127212413.2046623-1-yann.morin.1998@free.fr> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH] package/linux-headers: with headers from kernel, also override srcdir X-BeenThere: buildroot@busybox.net 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: Jarkko Sakkinen , "Yann E. MORIN" , Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" When using the headers from the kernel to be built, with the kernel set to a custom version, and overriding the kernel sources with LINUX_OVERRIDE_SRCDIR, the linux-headers package is still trying to download an archive, and fails to validate its hash. What is going on under the hood is that, with _OVERRIDE_SRCDIR, the _VERSION of a package is set to 'custom'. Furthermore, the variable BR_NO_CHECK_HASH_FOR is recursively expanded, so its value is only evaluated when it is needed. For linux-headers, we inherit the values from the linux package, and the LINUX_HEADERS_VERSION takes the value from the configuration. Thus we end up with the following situation: LINUX_VERSION=custom LINUX_HEADERS_VERSION=5.10 # For example BR_NO_CHECK_HASH_FOR=... linux-custom.tar.gz ... And thus the archive downloaded by linux-headers will not match any exclusion, and since there will most probably not be a hash for it, the download will fail, as was noticed and reported by Jarkko. But in this case, what we really want is to really use the headers from the kernel that we build, we do not even want to attempt a download at all. So, when using the headers from the kernel to be built, we also propagate the LINUX_OVERRIDE_SRCDIR to linux-headers, so that we also use the headers from the overridden sources. Furthermore, in that configuration, we explicitly disallow overriding the linux-headers specifically, as it does not make sense (even though, if they were overridden to the same location, that'd be OK, but to simplify the condition, we do not even check for that). Reported-by: Jarkko Sakkinen Signed-off-by: Yann E. MORIN Cc: Thomas Petazzoni Cc: Peter Korsgaard Cc: Arnout Vandecappelle --- package/linux-headers/linux-headers.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/linux-headers/linux-headers.mk b/package/linux-headers/linux-headers.mk index 807e574f4d..a8d1c2ccaf 100644 --- a/package/linux-headers/linux-headers.mk +++ b/package/linux-headers/linux-headers.mk @@ -18,6 +18,10 @@ LINUX_HEADERS_VERSION = $(call qstrip,$(BR2_LINUX_KERNEL_VERSION)) LINUX_HEADERS_CUSTOM_TARBALL_LOCATION = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION)) LINUX_HEADERS_REPO_URL = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_REPO_URL)) LINUX_HEADERS_CIP = $(BR2_LINUX_KERNEL_LATEST_CIP_VERSION)$(BR2_LINUX_KERNEL_LATEST_CIP_RT_VERSION) +ifneq ($(LINUX_HEADERS_OVERRIDE_SRCDIR),) +$(error LINUX_HEADERS_OVERRIDE_SRCDIR must not be set when BR2_KERNEL_HEADERS_AS_KERNEL=y) +endif +LINUX_HEADERS_OVERRIDE_SRCDIR = $(LINUX_OVERRIDE_SRCDIR) else # ! BR2_KERNEL_HEADERS_AS_KERNEL LINUX_HEADERS_CUSTOM_TARBALL = $(call qstrip,$(BR2_KERNEL_HEADERS_CUSTOM_TARBALL)) LINUX_HEADERS_CUSTOM_GIT = $(call qstrip,$(BR2_KERNEL_HEADERS_CUSTOM_GIT))