From patchwork Mon Jun 17 08:03:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFwaGHDq2wgTcOpbG90dGU=?= X-Patchwork-Id: 1948531 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::138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W2j7R0GFLz20Wg for ; Mon, 17 Jun 2024 18:03:30 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 682FD81F08; Mon, 17 Jun 2024 08:03:27 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Ay8wmWWRdHTN; Mon, 17 Jun 2024 08:03:26 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 378A381F33 Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 378A381F33; Mon, 17 Jun 2024 08:03:26 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 59EB01BF2AB for ; Mon, 17 Jun 2024 08:03:24 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 47C9160883 for ; Mon, 17 Jun 2024 08:03:24 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id ABM1NtPlkuyx for ; Mon, 17 Jun 2024 08:03:23 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a00:1450:4864:20::129; helo=mail-lf1-x129.google.com; envelope-from=raphael.melotte@essensium.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 602786087B DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 602786087B Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by smtp3.osuosl.org (Postfix) with ESMTPS id 602786087B for ; Mon, 17 Jun 2024 08:03:21 +0000 (UTC) Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-52c8342af5eso4349414e87.3 for ; Mon, 17 Jun 2024 01:03:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718611400; x=1719216200; 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=9PqMC5RBc/8rHgii44xuV48kBBQKux6VFHYZVPYWPUs=; b=OTE9OfQ0f+cMjx/MbLuB97i6cpBazC9zPHKUXLCs7K37B/bjxVDH1lhskig5IS4YpG yQ185XQwAePiMKw+U0PofqzC9U3fnsnPFkH3Fk8NzPeSgCM+Gb0fiUgmH1W7sMxNPBs1 JctX0uj5atQPy5Y36WDeVO6o4I3aXCadkw0NAM8kPeYA2vCkRvBGNrMFUQDrWbWWGkka aIznB2luKwR/FZgKTbcGkViBO+vaVQxlcCbnC7aFkLwti9viSBK+BqfYexqj12wvu462 Cdm58Vu0ZuBxQJkD5ueH00ZJQAai5cVPxc/IUYJDX1obGoGR0zY6mPs6bl0R873tuFwT RN7g== X-Gm-Message-State: AOJu0YxjoBddoo8fbwjceIl1UtZxCG5xBJTP5W89R7erWIvU7dJ6rsdz j/0ddhRgD7nmPKRFeZCAgjeJJeuUds6BIjD/GvdjScRcVkqDO3n/222ANEoUUPkebmFebDhijYA cr3Y= X-Google-Smtp-Source: AGHT+IHdkwqzbixg9Gx+mUJuMNL3OTX2Bb5l3QmsOeHImSLmTGIUru7qON4DntMJ7OqhCh3Rp9UGmw== X-Received: by 2002:a05:6512:ad2:b0:52c:9468:c991 with SMTP id 2adb3069b0e04-52ca6e55dfbmr6082601e87.14.1718611398591; Mon, 17 Jun 2024 01:03:18 -0700 (PDT) Received: from junian.fritz.box (94.105.103.7.dyn.edpnet.net. [94.105.103.7]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36075104c17sm11234918f8f.106.2024.06.17.01.03.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 01:03:17 -0700 (PDT) To: buildroot@buildroot.org Date: Mon, 17 Jun 2024 10:03:09 +0200 Message-Id: <20240617080310.2433521-1-raphael.melotte@mind.be> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mind.be; s=google; t=1718611400; x=1719216200; darn=buildroot.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=9PqMC5RBc/8rHgii44xuV48kBBQKux6VFHYZVPYWPUs=; b=DIw9EkumDbzNGcXN0FUtNk6NtlyhQjLRVJu0As2mWIn8Csyj2NsvrtoJ+A3MxAjZSp xG5r0BnUKtRCZQ4doCE/iGmS1QW+pH017KL550l4bu0IR51ohQhH3JaKNj1TOPNAuHB5 OoIwiIG5arGVg9k6jCrBArGuTc9iRg4gVWnblvtTwhw/k7ydTuYhqkINlY2IlPutzEea TDyvw+NQrCzYmFfKIMzAx6qeNZvFdQZqaaSGwSGIO5Izh98HhBttcOhNBemO0VBAP2Po qXqvaMAU0IrbM9gpX72NLYxgbvGFFMuCia6zPG+CXyLFMlX+x3cfimd0OjhBIw3WnpBh jbTw== X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=mind.be X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=mind.be header.i=@mind.be header.a=rsa-sha256 header.s=google header.b=DIw9Ekum Subject: [Buildroot] [PATCH 1/1] package/systemd: fix compiling with headers < 4.14 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: , X-Patchwork-Original-From: =?utf-8?q?Rapha=C3=ABl_M=C3=A9lotte_via_buildroot?= From: =?utf-8?b?UmFwaGHDq2wgTcOpbG90dGU=?= Reply-To: =?utf-8?b?UmFwaGHDq2wgTcOpbG90dGU=?= Cc: Norbert Lange , =?utf-8?b?UmFwaGHDq2wgTcOpbG90dGU=?= , "Yann E. MORIN" , Sen Hastings Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" In commit 360a7cd738a85067ba60b029ca88eb7c874bfe4f ("package/systemd: bump linux-headers dependency to 4.14"), the headers requirements were bumped to 4.14 because of new build failures due to LOOP_SET_BLOCK_SIZE. Even though systemd does not recommend using it with headers < 4.15 (see [1]), it is still possible to build it and use some of its features (after fixing the build failure). Note that this was build-tested with 4.4 headers only, and not all the way back to 3.15 (which is the version requirement that was used before 360a7cd738a85067ba60b029ca88eb7c874bfe4f). [1]: https://github.com/systemd/systemd/blob/main/README Signed-off-by: Raphaël Mélotte --- ...g_loop.h-fix-missing-LOOP_SET_BLOCK_.patch | 40 +++++++++++++++++++ package/systemd/Config.in | 7 ++-- system/Config.in | 6 +-- 3 files changed, 47 insertions(+), 6 deletions(-) create mode 100644 package/systemd/0001-src-basic-missing_loop.h-fix-missing-LOOP_SET_BLOCK_.patch diff --git a/package/systemd/0001-src-basic-missing_loop.h-fix-missing-LOOP_SET_BLOCK_.patch b/package/systemd/0001-src-basic-missing_loop.h-fix-missing-LOOP_SET_BLOCK_.patch new file mode 100644 index 0000000000..6072b1be7b --- /dev/null +++ b/package/systemd/0001-src-basic-missing_loop.h-fix-missing-LOOP_SET_BLOCK_.patch @@ -0,0 +1,40 @@ +From 1b205aa9b15f04c510f76f3574726f6159f08291 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rapha=C3=ABl=20M=C3=A9lotte?= +Date: Fri, 14 Jun 2024 14:37:29 +0200 +Subject: [PATCH] src/basic/missing_loop.h: fix missing LOOP_SET_BLOCK_SIZE +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Builds with kernels headers < 4.14 fail with: + +../src/shared/loop-util.c: In function ‘loop_configure_fallback’: +../src/shared/loop-util.c:237:31: error: ‘LOOP_SET_BLOCK_SIZE’ undeclared (first use in this function); did you mean ‘LOOP_SET_DIRECT_IO’? + if (ioctl(fd, LOOP_SET_BLOCK_SIZE, (unsigned long) c->block_size) < 0) + ^~~~~~~~~~~~~~~~~~~ + LOOP_SET_DIRECT_IO + +Fixes: https://github.com/systemd/systemd/issues/33341 + +Upstream: https://github.com/systemd/systemd/pull/33342 + +Signed-off-by: Raphaël Mélotte +--- + src/basic/missing_loop.h | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/basic/missing_loop.h b/src/basic/missing_loop.h +index b88501d78b..f83a14c914 100644 +--- a/src/basic/missing_loop.h ++++ b/src/basic/missing_loop.h +@@ -29,3 +29,7 @@ assert_cc(LOOP_SET_DIRECT_IO == 0x4C08); + #ifndef LOOP_SET_STATUS_SETTABLE_FLAGS + # define LOOP_SET_STATUS_SETTABLE_FLAGS (LO_FLAGS_AUTOCLEAR | LO_FLAGS_PARTSCAN) + #endif ++ ++#ifndef LOOP_SET_BLOCK_SIZE ++# define LOOP_SET_BLOCK_SIZE 0x4C09 ++#endif +-- +2.45.1 + diff --git a/package/systemd/Config.in b/package/systemd/Config.in index a94e9b73b8..82c0e30474 100644 --- a/package/systemd/Config.in +++ b/package/systemd/Config.in @@ -22,7 +22,7 @@ menuconfig BR2_PACKAGE_SYSTEMD depends on !BR2_STATIC_LIBS # kmod depends on BR2_TOOLCHAIN_USES_GLIBC depends on BR2_TOOLCHAIN_HAS_SSP - depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_14 # LOOP_SET_BLOCK_SIZE + depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_15 depends on BR2_TOOLCHAIN_GCC_AT_LEAST_5 depends on BR2_HOST_GCC_AT_LEAST_5 # host-systemd select BR2_PACKAGE_HAS_UDEV @@ -239,6 +239,7 @@ config BR2_PACKAGE_SYSTEMD_HOMED depends on BR2_USE_MMU # cryptsetup -> lvm2 depends on !BR2_STATIC_LIBS # cryptsetup -> lvm2 depends on BR2_TOOLCHAIN_HAS_SYNC_4 # cryptsetup -> json-c + depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_12 # fscrypt_key select BR2_PACKAGE_CRYPTSETUP select BR2_PACKAGE_OPENSSL select BR2_PACKAGE_OPENSSL_FORCE_LIBOPENSSL @@ -249,11 +250,11 @@ config BR2_PACKAGE_SYSTEMD_HOMED https://www.freedesktop.org/software/systemd/man/systemd-homed.service.html -comment "homed support needs a toolchain w/ threads, dynamic library" +comment "homed support needs a toolchain w/ threads, dynamic library, kernel headers >= 4.12" depends on BR2_USE_MMU depends on BR2_TOOLCHAIN_HAS_SYNC_4 depends on !BR2_TOOLCHAIN_HAS_THREADS || \ - BR2_STATIC_LIBS + BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_12 config BR2_PACKAGE_SYSTEMD_HOSTNAMED bool "enable hostname daemon" diff --git a/system/Config.in b/system/Config.in index 3fb17ed1c6..bc0c6eb6bc 100644 --- a/system/Config.in +++ b/system/Config.in @@ -125,19 +125,19 @@ config BR2_INIT_SYSTEMD depends on BR2_TOOLCHAIN_USES_GLIBC depends on BR2_TOOLCHAIN_HAS_SSP depends on BR2_TOOLCHAIN_HAS_THREADS - depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_14 + depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_15 depends on BR2_TOOLCHAIN_GCC_AT_LEAST_5 depends on BR2_HOST_GCC_AT_LEAST_5 select BR2_ROOTFS_MERGED_USR select BR2_PACKAGE_SYSTEMD select BR2_PACKAGE_SKELETON_INIT_SYSTEMD if BR2_ROOTFS_SKELETON_DEFAULT -comment "systemd needs a glibc toolchain w/ SSP, headers >= 4.14, host and target gcc >= 5" +comment "systemd needs a glibc toolchain w/ SSP, headers >= 3.15, host and target gcc >= 5" depends on BR2_PACKAGE_SYSTEMD_ARCH_SUPPORTS depends on BR2_USE_MMU depends on !BR2_TOOLCHAIN_USES_GLIBC || \ !BR2_TOOLCHAIN_HAS_SSP || \ - !BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_14 || \ + !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_15 || \ !BR2_TOOLCHAIN_GCC_AT_LEAST_5 || \ !BR2_HOST_GCC_AT_LEAST_5