From patchwork Mon Mar 13 08:15:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Walle X-Patchwork-Id: 1756084 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 4PZqK65KLLz1yWp for ; Mon, 13 Mar 2023 19:17:46 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id F067D4018B; Mon, 13 Mar 2023 08:17:44 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org F067D4018B 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 ZQLHEEkw7zTf; Mon, 13 Mar 2023 08:17:44 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id D382940132; Mon, 13 Mar 2023 08:17:42 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org D382940132 X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 021881BF3E0 for ; Mon, 13 Mar 2023 08:17:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id CD7BD81322 for ; Mon, 13 Mar 2023 08:17:15 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org CD7BD81322 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id M5ZSQspOpwDj for ; Mon, 13 Mar 2023 08:17:15 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org EC6A681338 Received: from mail.3ffe.de (0001.3ffe.de [IPv6:2a01:4f8:c0c:9d57::1]) by smtp1.osuosl.org (Postfix) with ESMTPS id EC6A681338 for ; Mon, 13 Mar 2023 08:17:14 +0000 (UTC) Received: from mwalle01.kontron.local. (unknown [213.135.10.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.3ffe.de (Postfix) with ESMTPSA id 4978115A7; Mon, 13 Mar 2023 09:17:12 +0100 (CET) To: buildroot@buildroot.org Date: Mon, 13 Mar 2023 09:15:48 +0100 Message-Id: <20230313081549.493823-2-michael@walle.cc> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230313081549.493823-1-michael@walle.cc> References: <20230313081549.493823-1-michael@walle.cc> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1678695432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oksPfofBTl31lGVMA+wnlip5lKG03oVd4EnXTH7o01M=; b=qwaYHAdmvz1dsxO1eqhTfrbfLSoUmBJGoMfW0Fri/4YL5ffDgpmGN1zTSpxcpD3oxra7CG q/2dB5K8xZj3PSrufJP54S2l8s7xPmsVFbm/S2glYCr3MEs0UJ98PzgP3i7nxDpscws5cc tSTwvpZ5c9wVxdSVKfq3Ck+3m1mCDYvVvuab2twD7CDtAeGfZmpUTffxThUBiNotRhwmDd OI1yirQs0kkdqqt/qs55WLes+xt9GMRWNKoOuVKXHRkC5qxD4XSy7P5tLO7eB6m4X5YbF+ 63qs/rRkg+9hF4tJaqOYPH2u+rp0cuMikJgUrNEJ/e5EEmoN+nVvwDmjxQEGSg== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=walle.cc header.i=@walle.cc header.a=rsa-sha256 header.s=mail2022082101 header.b=qwaYHAdm Subject: [Buildroot] [PATCH RESEND 1/2] package/urandom-scripts: move to new package busybox-initscripts 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: Michael Walle via buildroot From: Michael Walle Reply-To: Michael Walle Cc: Michael Walle , "Yann E . MORIN" , Thomas Petazzoni Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" As a preparation to add new initscripts, rename the urandom-scripts package to a more generic one and prepare the package to support more than one initscript. This way we don't need one package per initscript. Individual initscripts are chosen as a configuration option of the package. Signed-off-by: Michael Walle --- Config.in.legacy | 11 +++++++++++ package/Config.in | 2 +- package/buildroot-initscripts/Config.in | 17 +++++++++++++++++ .../S20seedrng | 0 .../buildroot-initscripts.mk | 16 ++++++++++++++++ package/urandom-scripts/Config.in | 7 ------- package/urandom-scripts/urandom-scripts.mk | 12 ------------ 7 files changed, 45 insertions(+), 20 deletions(-) create mode 100644 package/buildroot-initscripts/Config.in rename package/{urandom-scripts => buildroot-initscripts}/S20seedrng (100%) create mode 100644 package/buildroot-initscripts/buildroot-initscripts.mk delete mode 100644 package/urandom-scripts/Config.in delete mode 100644 package/urandom-scripts/urandom-scripts.mk diff --git a/Config.in.legacy b/Config.in.legacy index 7f69462f2e..d82bd0f1f8 100644 --- a/Config.in.legacy +++ b/Config.in.legacy @@ -144,6 +144,17 @@ endif ############################################################################### +comment "Legacy options removed in 2023.05" + +config BR2_PACKAGE_URANDOM_SCRIPTS + bool "urandom-initscripts package was renamed" + select BR2_LEGACY + select BR2_PACKAGE_BUILDROOT_INITSCRIPTS + select BR2_PACKAGE_BUILDROOT_INITSCRIPTS_URANDOM + help + Package urandom-scripts was moved as option to + package buildroot-initscripts. + comment "Legacy options removed in 2023.02" config BR2_KERNEL_HEADERS_6_0 diff --git a/package/Config.in b/package/Config.in index 7c32305129..df618c48cb 100644 --- a/package/Config.in +++ b/package/Config.in @@ -2570,7 +2570,6 @@ menu "Security" source "package/selinux-python/Config.in" source "package/semodule-utils/Config.in" source "package/setools/Config.in" - source "package/urandom-scripts/Config.in" endmenu menu "Shell and utilities" @@ -2626,6 +2625,7 @@ menu "System tools" source "package/audit/Config.in" source "package/balena-engine/Config.in" source "package/bubblewrap/Config.in" + source "package/buildroot-initscripts/Config.in" source "package/cgroupfs-mount/Config.in" source "package/circus/Config.in" source "package/containerd/Config.in" diff --git a/package/buildroot-initscripts/Config.in b/package/buildroot-initscripts/Config.in new file mode 100644 index 0000000000..8e84e975fa --- /dev/null +++ b/package/buildroot-initscripts/Config.in @@ -0,0 +1,17 @@ +config BR2_PACKAGE_BUILDROOT_INITSCRIPTS + bool "buildroot-initscripts" + default y if BR2_PACKAGE_INITSCRIPTS + depends on !BR2_PACKAGE_SYSTEMD + help + Support for various initscripts. + +if BR2_PACKAGE_BUILDROOT_INITSCRIPTS + +config BR2_PACKAGE_BUILDROOT_INITSCRIPTS_URANDOM + bool "urandom" + default y if BR2_PACKAGE_INITSCRIPTS + depends on BR2_PACKAGE_BUSYBOX + help + Initscript to preserve the random seed between reboots. + +endif diff --git a/package/urandom-scripts/S20seedrng b/package/buildroot-initscripts/S20seedrng similarity index 100% rename from package/urandom-scripts/S20seedrng rename to package/buildroot-initscripts/S20seedrng diff --git a/package/buildroot-initscripts/buildroot-initscripts.mk b/package/buildroot-initscripts/buildroot-initscripts.mk new file mode 100644 index 0000000000..098113bcbd --- /dev/null +++ b/package/buildroot-initscripts/buildroot-initscripts.mk @@ -0,0 +1,16 @@ +################################################################################ +# +# buildroot-initscripts +# +################################################################################ + +BUILDROOT_INITSCRIPTS_SCRIPTS_$(BR2_PACKAGE_BUILDROOT_INITSCRIPTS_URANDOM) += S20seedrng + +define BUILDROOT_INITSCRIPTS_INSTALL_INIT_SYSV + for i in $(BUILDROOT_INITSCRIPTS_SCRIPTS_y); do \ + $(INSTALL) -D -m 0755 $(BUILDROOT_INITSCRIPTS_PKGDIR)/$$i \ + $(TARGET_DIR)/etc/init.d/$$i || exit 1; \ + done +endef + +$(eval $(generic-package)) diff --git a/package/urandom-scripts/Config.in b/package/urandom-scripts/Config.in deleted file mode 100644 index 6b4a609f95..0000000000 --- a/package/urandom-scripts/Config.in +++ /dev/null @@ -1,7 +0,0 @@ -config BR2_PACKAGE_URANDOM_SCRIPTS - bool "urandom-initscripts" - default y if BR2_PACKAGE_INITSCRIPTS - depends on BR2_PACKAGE_BUSYBOX - depends on !BR2_PACKAGE_SYSTEMD - help - Initscript to preserve the random seed between reboots. diff --git a/package/urandom-scripts/urandom-scripts.mk b/package/urandom-scripts/urandom-scripts.mk deleted file mode 100644 index 32f3e09343..0000000000 --- a/package/urandom-scripts/urandom-scripts.mk +++ /dev/null @@ -1,12 +0,0 @@ -################################################################################ -# -# urandom-scripts -# -################################################################################ - -define URANDOM_SCRIPTS_INSTALL_INIT_SYSV - $(INSTALL) -D -m 0755 $(URANDOM_SCRIPTS_PKGDIR)/S20seedrng \ - $(TARGET_DIR)/etc/init.d/S20seedrng -endef - -$(eval $(generic-package)) From patchwork Mon Mar 13 08:15:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Walle X-Patchwork-Id: 1756083 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 4PZqJt141zz1yWp for ; Mon, 13 Mar 2023 19:17:34 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 22EC54018B; Mon, 13 Mar 2023 08:17:32 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 22EC54018B 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 qVVE6BawAQ-x; Mon, 13 Mar 2023 08:17:31 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 5BFEE405E7; Mon, 13 Mar 2023 08:17:30 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 5BFEE405E7 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 5D2501BF3E0 for ; Mon, 13 Mar 2023 08:17:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 43F4240297 for ; Mon, 13 Mar 2023 08:17:16 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 43F4240297 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 9w59Seuei0r7 for ; Mon, 13 Mar 2023 08:17:15 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 3409440287 Received: from mail.3ffe.de (0001.3ffe.de [IPv6:2a01:4f8:c0c:9d57::1]) by smtp4.osuosl.org (Postfix) with ESMTPS id 3409440287 for ; Mon, 13 Mar 2023 08:17:15 +0000 (UTC) Received: from mwalle01.kontron.local. (unknown [213.135.10.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.3ffe.de (Postfix) with ESMTPSA id C0324163C; Mon, 13 Mar 2023 09:17:12 +0100 (CET) To: buildroot@buildroot.org Date: Mon, 13 Mar 2023 09:15:49 +0100 Message-Id: <20230313081549.493823-3-michael@walle.cc> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230313081549.493823-1-michael@walle.cc> References: <20230313081549.493823-1-michael@walle.cc> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1678695432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SEKd2U4sYa97PyyVzquThQ9qzyX3cZzZzz0zDnk+sX4=; b=zsocS94bTJnqbHNccTp5ZWeOwEPCU2hc2Tu91FPt3WzO1ZkrA4G7C/wT/p/RETwQf/RZCl xFOm8Mt3bSxW8+svhwh7z742XBHwyxNNfqiefHDGP1plekfMns7AmWF/y5NBOJvLtZYVhO AgCAP0H0RcRN9TlB+XgkRM9PT+i7AN5ki9X0h4p88urr9DqgGlvJPn23HbDQDqrnVw53sJ aPFYj1rTevqusCkeKg+Gv+Xvax8f7oysF3YS2S6J1ZT6pQQW/N8o99XH5gka6iU4HWgJlr xgQd4uf4VmUxOhMl26cEjCMOGZO45Yfi9jeB5PILz0kMXmraatQaLqtc7FUO9g== X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=walle.cc header.i=@walle.cc header.a=rsa-sha256 header.s=mail2022082101 header.b=zsocS94b Subject: [Buildroot] [PATCH RESEND 2/2] package/buildroot-initscripts: add hwclock initscript 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: Michael Walle via buildroot From: Michael Walle Reply-To: Michael Walle Cc: Michael Walle , "Yann E . MORIN" , Thomas Petazzoni Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Add a new initscript to save the date and time to the hardware clock on shutdown. Signed-off-by: Michael Walle --- package/buildroot-initscripts/Config.in | 6 ++++++ package/buildroot-initscripts/S20hwclock | 21 +++++++++++++++++++ .../buildroot-initscripts.mk | 1 + 3 files changed, 28 insertions(+) create mode 100644 package/buildroot-initscripts/S20hwclock diff --git a/package/buildroot-initscripts/Config.in b/package/buildroot-initscripts/Config.in index 8e84e975fa..b30c91b646 100644 --- a/package/buildroot-initscripts/Config.in +++ b/package/buildroot-initscripts/Config.in @@ -7,6 +7,12 @@ config BR2_PACKAGE_BUILDROOT_INITSCRIPTS if BR2_PACKAGE_BUILDROOT_INITSCRIPTS +config BR2_PACKAGE_BUILDROOT_INITSCRIPTS_HWCLOCK + bool "hwclock" + help + Initscript to save the date and time to the hardware clock on + shutdown. + config BR2_PACKAGE_BUILDROOT_INITSCRIPTS_URANDOM bool "urandom" default y if BR2_PACKAGE_INITSCRIPTS diff --git a/package/buildroot-initscripts/S20hwclock b/package/buildroot-initscripts/S20hwclock new file mode 100644 index 0000000000..3e6ea98fe8 --- /dev/null +++ b/package/buildroot-initscripts/S20hwclock @@ -0,0 +1,21 @@ +#! /bin/sh + +RTC_DEVICE=rtc0 + +[ -r "/etc/default/hwclock" ] && . "/etc/default/hwclock" + +# Quietly do nothing if /dev/rtc0 does not exist +[ -c /dev/$RTC_DEVICE ] || exit 0 + +case "$1" in + start) + exit 0 + ;; + stop) + echo "Saving the system clock to /dev/$RTC_DEVICE.." + /sbin/hwclock -f /dev/$RTC_DEVICE -w + ;; + *) + echo "Usage: $0 {start|stop}" + exit 1 +esac diff --git a/package/buildroot-initscripts/buildroot-initscripts.mk b/package/buildroot-initscripts/buildroot-initscripts.mk index 098113bcbd..980a5fe1e4 100644 --- a/package/buildroot-initscripts/buildroot-initscripts.mk +++ b/package/buildroot-initscripts/buildroot-initscripts.mk @@ -4,6 +4,7 @@ # ################################################################################ +BUILDROOT_INITSCRIPTS_SCRIPTS_$(BR2_PACKAGE_BUILDROOT_INITSCRIPTS_HWCLOCK) += S20hwclock BUILDROOT_INITSCRIPTS_SCRIPTS_$(BR2_PACKAGE_BUILDROOT_INITSCRIPTS_URANDOM) += S20seedrng define BUILDROOT_INITSCRIPTS_INSTALL_INIT_SYSV