From patchwork Fri Sep 15 15:58:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Reza Arbab X-Patchwork-Id: 1835042 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=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (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 4RnJmw1grRz1yhR for ; Sat, 16 Sep 2023 02:00:16 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 50F6542248; Fri, 15 Sep 2023 16:00:14 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 50F6542248 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 K4ORi79BskWV; Fri, 15 Sep 2023 16:00:13 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 60CA6400EA; Fri, 15 Sep 2023 16:00:12 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 60CA6400EA 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 B95641BF31E for ; Fri, 15 Sep 2023 15:58:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 8148683C00 for ; Fri, 15 Sep 2023 15:58:53 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 8148683C00 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 vLoQ9MRQIAk6 for ; Fri, 15 Sep 2023 15:58:51 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by smtp1.osuosl.org (Postfix) with ESMTPS id 2CBD983BE4 for ; Fri, 15 Sep 2023 15:58:51 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 2CBD983BE4 Received: from pps.filterd (m0353727.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38FFdMla015530; Fri, 15 Sep 2023 15:58:50 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3t4s0ka98c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Sep 2023 15:58:50 +0000 Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 38FEH728002304; Fri, 15 Sep 2023 15:58:49 GMT Received: from smtprelay02.wdc07v.mail.ibm.com ([172.16.1.69]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3t158kvr1n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Sep 2023 15:58:49 +0000 Received: from smtpav03.dal12v.mail.ibm.com (smtpav03.dal12v.mail.ibm.com [10.241.53.102]) by smtprelay02.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 38FFwmd663308126 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Sep 2023 15:58:48 GMT Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6E53C58063; Fri, 15 Sep 2023 15:58:48 +0000 (GMT) Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5E90D58060; Fri, 15 Sep 2023 15:58:48 +0000 (GMT) Received: from arbab-laptop.localdomain (unknown [9.53.178.221]) by smtpav03.dal12v.mail.ibm.com (Postfix) with ESMTPS; Fri, 15 Sep 2023 15:58:48 +0000 (GMT) Received: by arbab-laptop.localdomain (Postfix, from userid 152845) id D481A180F30; Fri, 15 Sep 2023 10:58:47 -0500 (CDT) From: Reza Arbab To: buildroot@buildroot.org Date: Fri, 15 Sep 2023 10:58:31 -0500 Message-Id: <20230915155835.51140-2-arbab@linux.ibm.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20230915155835.51140-1-arbab@linux.ibm.com> References: <20230915155835.51140-1-arbab@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: c6pGNBJGQz9Q6c1pRitKqi5GotEMEnae X-Proofpoint-ORIG-GUID: c6pGNBJGQz9Q6c1pRitKqi5GotEMEnae X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-09-15_12,2023-09-15_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 spamscore=0 impostorscore=0 bulkscore=0 suspectscore=0 malwarescore=0 priorityscore=1501 mlxlogscore=909 clxscore=1015 adultscore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2309150138 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=D1naP8uXYvFnQsjAHMJ98w/m8UdoHWgAItyuuRXlLeA=; b=fPH2Co81LBK88PckyN2LPYyMkQTznk/GBhfPPaXWxsR4IgEeGRVP44KgN0UeB16xQ9hQ 2FUZCaJwCBi8SAuRAbMu0s3yzzqGQzpKIeXNbJeOX8pu8Xwrzf1PxMH/joQqZbOZdIQ7 blTH1SzzL3kNd0c5Foh77wTxzVz7HX/HNsEpkulgFr37Oz4zNi3mh1Kp9xZoV85RJMaz MRQ5ap4EqGJ9sNe2eJqIGVRZojHPRzV/H+bjiQeCGGCWRetb8OriwccWi4U4V+u+/kbf HtOn71qapYJto/KYTdjIfyz5ee2gOHWE3aHDqr2Gs2YOZzuL+QrBmqU6K+5Ho7IWPPX5 FA== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=fPH2Co81 Subject: [Buildroot] [PATCH v2 1/5] package/petitboot: fix HOST_PROG_SHUTDOWN value 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: Reza Arbab , Laurent Vivier , Joel Stanley Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" HOST_PROG_SHUTDOWN currently references a file that doesn't exist. Fix by setting it to /usr/libexec/petitboot/bb-kexec-reboot, which this package already installs but doesn't use. Signed-off-by: Reza Arbab Reviewed-by: Laurent Vivier --- package/petitboot/petitboot.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/petitboot/petitboot.mk b/package/petitboot/petitboot.mk index 8b4c14207ec4..8d220f88f45a 100644 --- a/package/petitboot/petitboot.mk +++ b/package/petitboot/petitboot.mk @@ -21,7 +21,7 @@ PETITBOOT_CONF_OPTS = \ --without-twin-x11 \ $(if $(BR2_PACKAGE_BUSYBOX),--enable-busybox,--disable-busybox) \ HOST_PROG_KEXEC=/usr/sbin/kexec \ - HOST_PROG_SHUTDOWN=/usr/sbin/kexec-restart + HOST_PROG_SHUTDOWN=/usr/libexec/petitboot/bb-kexec-reboot # HPA and Busybox tftp are supported. HPA tftp is part of Buildroot's tftpd # package. From patchwork Fri Sep 15 15:58:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Reza Arbab X-Patchwork-Id: 1835040 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::137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (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 4RnJmP2vG2z1yhR for ; Sat, 16 Sep 2023 01:59:49 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 9EA6342224; Fri, 15 Sep 2023 15:59:47 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 9EA6342224 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 k444roXp_lsq; Fri, 15 Sep 2023 15:59:46 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 6831F42226; Fri, 15 Sep 2023 15:59:45 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 6831F42226 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 16E3E1BF995 for ; Fri, 15 Sep 2023 15:58:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 4E79483CE0 for ; Fri, 15 Sep 2023 15:58:52 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 4E79483CE0 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 UU_HYy3lR7Wj for ; Fri, 15 Sep 2023 15:58:51 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by smtp1.osuosl.org (Postfix) with ESMTPS id 97AFA83C93 for ; Fri, 15 Sep 2023 15:58:51 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 97AFA83C93 Received: from pps.filterd (m0353726.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38FFbaQR010707; Fri, 15 Sep 2023 15:58:50 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3t4r2wc9y6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Sep 2023 15:58:50 +0000 Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 38FEOOAi011974; Fri, 15 Sep 2023 15:58:49 GMT Received: from smtprelay07.wdc07v.mail.ibm.com ([172.16.1.74]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 3t15r2mkxm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Sep 2023 15:58:49 +0000 Received: from smtpav06.dal12v.mail.ibm.com (smtpav06.dal12v.mail.ibm.com [10.241.53.105]) by smtprelay07.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 38FFwm1A62128602 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Sep 2023 15:58:48 GMT Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6F5A258059; Fri, 15 Sep 2023 15:58:48 +0000 (GMT) Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5F14558055; Fri, 15 Sep 2023 15:58:48 +0000 (GMT) Received: from arbab-laptop.localdomain (unknown [9.53.178.221]) by smtpav06.dal12v.mail.ibm.com (Postfix) with ESMTPS; Fri, 15 Sep 2023 15:58:48 +0000 (GMT) Received: by arbab-laptop.localdomain (Postfix, from userid 152845) id D89D2180F3A; Fri, 15 Sep 2023 10:58:47 -0500 (CDT) From: Reza Arbab To: buildroot@buildroot.org Date: Fri, 15 Sep 2023 10:58:32 -0500 Message-Id: <20230915155835.51140-3-arbab@linux.ibm.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20230915155835.51140-1-arbab@linux.ibm.com> References: <20230915155835.51140-1-arbab@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 611CdBkumpeWzZMFS0sP68pbc8EKLPn5 X-Proofpoint-ORIG-GUID: 611CdBkumpeWzZMFS0sP68pbc8EKLPn5 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-09-15_12,2023-09-15_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 clxscore=1015 malwarescore=0 lowpriorityscore=0 phishscore=0 mlxscore=0 suspectscore=0 mlxlogscore=541 adultscore=0 impostorscore=0 priorityscore=1501 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2309150138 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=Zl+0/KA7Tsj/KMuax5f0JPNeuHG8MyY5RtUb2wRFmMg=; b=tLA0ZKwj/4niMvHC1jmHrX6xcSocMGr5ErfooetIJ/YUzRFbhpzPZFmesOGkd2A5/bUq 2dj4wdBKdD0Zwgpf2X+Ia8d/E9M0ArxVdRoNDMKXfOHq2tow0J3AKF3DuUb7alTPmgi4 6g9o1Fk8Wpm+3RRdNOqb2x03QGI/KY35iKql7q94bvoFPuwb3NI06b4C0pma4TPy6Z1J 3+Euy6B1aoY3LnInHI7Kn7X8HzqT9HetXEkDCdjbIPqtVqccQ/TCbv0GRPuGoYnHdnFS ENZiQM4/Cvn9YFjMNWuLIE69818+sQ9dTp024YM2v84rqmBnT0PnSEh5crh8SFhiY1u5 qQ== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=tLA0ZKwj Subject: [Buildroot] [PATCH v2 2/5] package/petitboot: run pb-console at boot 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: Reza Arbab , Laurent Vivier , Joel Stanley Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Install a udev rule to run the petitboot UI on commonly-known consoles instead of getty. To prevent the kernel's console output from trampling the UI, also add a sysctl file to reduce the kernel log levels to KERN_ALERT. Signed-off-by: Reza Arbab Reviewed-by: Joel Stanley Reviewed-by: Laurent Vivier --- v2: * Add ttyGF* to list of commonly-known consoles. * Don't select BR2_TARGET_GENERIC_GETTY by default. package/petitboot/petitboot-console-ui.rules | 5 +++++ package/petitboot/petitboot.mk | 4 ++++ package/petitboot/sysctl.conf | 1 + system/Config.in | 2 +- 4 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 package/petitboot/petitboot-console-ui.rules create mode 100644 package/petitboot/sysctl.conf diff --git a/package/petitboot/petitboot-console-ui.rules b/package/petitboot/petitboot-console-ui.rules new file mode 100644 index 000000000000..e5c188387bc5 --- /dev/null +++ b/package/petitboot/petitboot-console-ui.rules @@ -0,0 +1,5 @@ +# spawn a petitboot UI on common user-visible interface devices +SUBSYSTEM=="tty", KERNEL=="hvc*", RUN+="/usr/libexec/petitboot/pb-console --getty --detach -- -n -i 0 $name linux" +SUBSYSTEM=="tty", KERNEL=="tty0", RUN+="/usr/libexec/petitboot/pb-console --getty --detach -- -n -i 0 $name linux" +SUBSYSTEM=="tty", KERNEL=="ttyGF*", RUN+="/usr/libexec/petitboot/pb-console --getty --detach -- -n -i 0 $name linux" +SUBSYSTEM=="tty", KERNEL=="ttyS*", RUN+="/usr/libexec/petitboot/pb-console --getty --detach -- -n -i 0 $name linux" diff --git a/package/petitboot/petitboot.mk b/package/petitboot/petitboot.mk index 8d220f88f45a..556d41230237 100644 --- a/package/petitboot/petitboot.mk +++ b/package/petitboot/petitboot.mk @@ -55,6 +55,10 @@ define PETITBOOT_POST_INSTALL $(TARGET_DIR)/etc/petitboot/boot.d/90-sort-dtb $(INSTALL) -m 0755 -D $(PETITBOOT_PKGDIR)/S15pb-discover \ $(TARGET_DIR)/etc/init.d/S15pb-discover + $(INSTALL) -D -m 0755 $(PETITBOOT_PKGDIR)/petitboot-console-ui.rules \ + $(TARGET_DIR)/etc/udev/rules.d/petitboot-console-ui.rules + $(INSTALL) -D -m 0755 $(PETITBOOT_PKGDIR)/sysctl.conf \ + $(TARGET_DIR)/etc/sysctl.d/petitboot.conf mkdir -p $(TARGET_DIR)/usr/share/udhcpc/default.script.d/ ln -sf /usr/sbin/pb-udhcpc \ $(TARGET_DIR)/usr/share/udhcpc/default.script.d/ diff --git a/package/petitboot/sysctl.conf b/package/petitboot/sysctl.conf new file mode 100644 index 000000000000..02ab8e3275b5 --- /dev/null +++ b/package/petitboot/sysctl.conf @@ -0,0 +1 @@ +kernel.printk = 1 1 1 1 diff --git a/system/Config.in b/system/Config.in index 24798dc06803..9587dd9ce4db 100644 --- a/system/Config.in +++ b/system/Config.in @@ -375,7 +375,7 @@ config BR2_SYSTEM_BIN_SH menuconfig BR2_TARGET_GENERIC_GETTY bool "Run a getty (login prompt) after boot" - default y + default y if !BR2_PACKAGE_PETITBOOT if BR2_TARGET_GENERIC_GETTY config BR2_TARGET_GENERIC_GETTY_PORT From patchwork Fri Sep 15 15:58:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Reza Arbab X-Patchwork-Id: 1835031 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=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (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 4RnJlS4xJbz1yhR for ; Sat, 16 Sep 2023 01:58:58 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 7EB1A40089; Fri, 15 Sep 2023 15:58:55 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 7EB1A40089 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 wHz1IjBXN1Qs; Fri, 15 Sep 2023 15:58:54 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 7888B400EA; Fri, 15 Sep 2023 15:58:53 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 7888B400EA 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 3C4621BF31E for ; Fri, 15 Sep 2023 15:58:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 1C67661363 for ; Fri, 15 Sep 2023 15:58:52 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 1C67661363 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RSXkP0_QspTu for ; Fri, 15 Sep 2023 15:58:51 +0000 (UTC) Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by smtp3.osuosl.org (Postfix) with ESMTPS id 4E7C160BAD for ; Fri, 15 Sep 2023 15:58:51 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 4E7C160BAD Received: from pps.filterd (m0353724.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38FFQ36N009374; Fri, 15 Sep 2023 15:58:50 GMT Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3t4swhrx7t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Sep 2023 15:58:49 +0000 Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 38FFESsG023142; Fri, 15 Sep 2023 15:58:49 GMT Received: from smtprelay03.wdc07v.mail.ibm.com ([172.16.1.70]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3t141pd50a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Sep 2023 15:58:49 +0000 Received: from smtpav02.wdc07v.mail.ibm.com (smtpav02.wdc07v.mail.ibm.com [10.39.53.229]) by smtprelay03.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 38FFwmDJ1245876 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Sep 2023 15:58:48 GMT Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BA98F58058; Fri, 15 Sep 2023 15:58:48 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A32B65805B; Fri, 15 Sep 2023 15:58:48 +0000 (GMT) Received: from arbab-laptop.localdomain (unknown [9.53.178.221]) by smtpav02.wdc07v.mail.ibm.com (Postfix) with ESMTPS; Fri, 15 Sep 2023 15:58:48 +0000 (GMT) Received: by arbab-laptop.localdomain (Postfix, from userid 152845) id DC08F180F3E; Fri, 15 Sep 2023 10:58:47 -0500 (CDT) From: Reza Arbab To: buildroot@buildroot.org Date: Fri, 15 Sep 2023 10:58:33 -0500 Message-Id: <20230915155835.51140-4-arbab@linux.ibm.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20230915155835.51140-1-arbab@linux.ibm.com> References: <20230915155835.51140-1-arbab@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 5_TDNeuVuE_9B2lbGIdfICMnzPaLdiz9 X-Proofpoint-ORIG-GUID: 5_TDNeuVuE_9B2lbGIdfICMnzPaLdiz9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-09-15_12,2023-09-15_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 priorityscore=1501 mlxlogscore=494 mlxscore=0 clxscore=1015 impostorscore=0 lowpriorityscore=0 malwarescore=0 spamscore=0 bulkscore=0 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2309150138 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=subcyLncRrQcrivvyDyzKPrQDQJHL/fXo23gHME18Zo=; b=WOSqNpOttaou451wmc+b6lTHcnUNJ6ZHM+sBHW18wHmMx2elZyS4Ed0n6REsfg9gPkKV Q7Xr5/uUJ40dhY8OXgpKHi946Zwdzm/nOlmA0BiKlXcyz+QPlyq+lsy5rvNFAX7LGl1o 6KXHH/xE8AxlvsLFPqhHB2Z2xXSoUba/w1/R+8NbEgphphTVVx49ZpwBsFc8Cj3pDH7K CFNnKTMmeqALAmejlkTotR+UJr+OgfqRQYGlh03oKvRCFCVNalGS2WISHL3egJ87NDrb rM4nxy+rSNcw7ef5sDfBl4g+/+2dw9EX+1NAopDrbrEQbMgA0G3mHmQ44SS3GWGrCuNr ng== X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=WOSqNpOt Subject: [Buildroot] [PATCH v2 3/5] package/petitboot: poll removable devices 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: Reza Arbab , Laurent Vivier , Joel Stanley Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Add a udev rule to enable notification of media change events on removable devices, so petitboot can dynamically adapt to them. Signed-off-by: Reza Arbab Reviewed-by: Laurent Vivier Reviewed-by: Joel Stanley --- package/petitboot/petitboot.mk | 2 ++ package/petitboot/removable-event-poll.rules | 3 +++ 2 files changed, 5 insertions(+) create mode 100644 package/petitboot/removable-event-poll.rules diff --git a/package/petitboot/petitboot.mk b/package/petitboot/petitboot.mk index 556d41230237..9326738aa038 100644 --- a/package/petitboot/petitboot.mk +++ b/package/petitboot/petitboot.mk @@ -57,6 +57,8 @@ define PETITBOOT_POST_INSTALL $(TARGET_DIR)/etc/init.d/S15pb-discover $(INSTALL) -D -m 0755 $(PETITBOOT_PKGDIR)/petitboot-console-ui.rules \ $(TARGET_DIR)/etc/udev/rules.d/petitboot-console-ui.rules + $(INSTALL) -D -m 0755 $(PETITBOOT_PKGDIR)/removable-event-poll.rules \ + $(TARGET_DIR)/etc/udev/rules.d/removable-event-poll.rules $(INSTALL) -D -m 0755 $(PETITBOOT_PKGDIR)/sysctl.conf \ $(TARGET_DIR)/etc/sysctl.d/petitboot.conf mkdir -p $(TARGET_DIR)/usr/share/udhcpc/default.script.d/ diff --git a/package/petitboot/removable-event-poll.rules b/package/petitboot/removable-event-poll.rules new file mode 100644 index 000000000000..57bb74d3c00c --- /dev/null +++ b/package/petitboot/removable-event-poll.rules @@ -0,0 +1,3 @@ +# petitboot needs notification for media change events on removable devices, +# which we only get if we've set the poll_msecs sysfs attribute. +ACTION!="remove", ATTR{removable}=="1", ATTR{events_poll_msecs}="2000" From patchwork Fri Sep 15 15:58:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Reza Arbab X-Patchwork-Id: 1835039 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=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (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 4RnJlw2cwKz1yhR for ; Sat, 16 Sep 2023 01:59:24 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 8D68D402AD; Fri, 15 Sep 2023 15:59:22 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 8D68D402AD 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 cp_gp9kdMOlv; Fri, 15 Sep 2023 15:59:21 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 372BC4159C; Fri, 15 Sep 2023 15:59:20 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 372BC4159C X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id E2A8E1BF31E for ; Fri, 15 Sep 2023 15:58:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id BC522403A5 for ; Fri, 15 Sep 2023 15:58:52 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org BC522403A5 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 77n9Pqfjl3Zf for ; Fri, 15 Sep 2023 15:58:52 +0000 (UTC) Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by smtp2.osuosl.org (Postfix) with ESMTPS id B776E40166 for ; Fri, 15 Sep 2023 15:58:51 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org B776E40166 Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38FFZPle002834; Fri, 15 Sep 2023 15:58:50 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3t4su6h61c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Sep 2023 15:58:50 +0000 Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 38FFnmss002352; Fri, 15 Sep 2023 15:58:49 GMT Received: from smtprelay02.wdc07v.mail.ibm.com ([172.16.1.69]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3t158kvr1q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Sep 2023 15:58:49 +0000 Received: from smtpav03.dal12v.mail.ibm.com (smtpav03.dal12v.mail.ibm.com [10.241.53.102]) by smtprelay02.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 38FFwmmT524884 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Sep 2023 15:58:48 GMT Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8CADC5803F; Fri, 15 Sep 2023 15:58:48 +0000 (GMT) Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7332C58064; Fri, 15 Sep 2023 15:58:48 +0000 (GMT) Received: from arbab-laptop.localdomain (unknown [9.53.178.221]) by smtpav03.dal12v.mail.ibm.com (Postfix) with ESMTPS; Fri, 15 Sep 2023 15:58:48 +0000 (GMT) Received: by arbab-laptop.localdomain (Postfix, from userid 152845) id DF5F4180F86; Fri, 15 Sep 2023 10:58:47 -0500 (CDT) From: Reza Arbab To: buildroot@buildroot.org Date: Fri, 15 Sep 2023 10:58:34 -0500 Message-Id: <20230915155835.51140-5-arbab@linux.ibm.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20230915155835.51140-1-arbab@linux.ibm.com> References: <20230915155835.51140-1-arbab@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: VX_-vqv16ipJtqWV96GkPGYGlK68L4WI X-Proofpoint-ORIG-GUID: VX_-vqv16ipJtqWV96GkPGYGlK68L4WI X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-09-15_12,2023-09-15_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 clxscore=1015 mlxlogscore=999 suspectscore=0 mlxscore=0 priorityscore=1501 phishscore=0 malwarescore=0 spamscore=0 adultscore=0 lowpriorityscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2309150138 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=nDpx7ATc4sAQ9tC373hV4jcFteNiPt7Q+7hrHyRuEXE=; b=UVd4U2f8Ist6pz+ClzJuX5Xi3ItP/mZKIh4vbLL1LtqMekv38yvlJhYm31KgcSvx+g/I adKR3jt9Mf0CnvsKqLuJ6fkMbRUT156DChdnoo24/MJw7pvbQa1EmYrOBvu+VBlH4kUA oe/LtAF+Lg2m4z/mGXhYfYWg080w1ceKIEkhqs93WuXiV1Vc91Y8GFMA+LtedSmyfKKT ZdMZV88zWi5F9e45BCKRIub6kdsubOEnJApsKs2L14wB57sZfIakf/d4j7FvRBgrGrKK 4HrEjsQgJevKUHIeY4zPg0eH0YiPr/bQ5LZEFEvb4H99wlAtHwM+9VWKCxjCMl0YoGq3 7g== X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=UVd4U2f8 Subject: [Buildroot] [PATCH v2 4/5] package/petitboot: enable discovery of software RAID devices 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: Reza Arbab , Laurent Vivier , Joel Stanley Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Petitboot can support filesystems on software RAID arrays. If mdadm is selected, install the associated udev rules to assemble the device. Signed-off-by: Reza Arbab Reviewed-by: Laurent Vivier Reviewed-by: Joel Stanley --- package/petitboot/63-md-raid-arrays.rules | 41 ++++++++++++++ package/petitboot/65-md-incremental.rules | 69 +++++++++++++++++++++++ package/petitboot/petitboot.mk | 10 ++++ 3 files changed, 120 insertions(+) create mode 100644 package/petitboot/63-md-raid-arrays.rules create mode 100644 package/petitboot/65-md-incremental.rules diff --git a/package/petitboot/63-md-raid-arrays.rules b/package/petitboot/63-md-raid-arrays.rules new file mode 100644 index 000000000000..92aec36e69d4 --- /dev/null +++ b/package/petitboot/63-md-raid-arrays.rules @@ -0,0 +1,41 @@ +# do not edit this file, it will be overwritten on update + +SUBSYSTEM!="block", GOTO="md_end" + +# handle md arrays +ACTION!="add|change", GOTO="md_end" +KERNEL!="md*", GOTO="md_end" + +# partitions have no md/{array_state,metadata_version}, but should not +# for that reason be ignored. +ENV{DEVTYPE}=="partition", GOTO="md_ignore_state" + +# container devices have a metadata version of e.g. 'external:ddf' and +# never leave state 'inactive' +ATTR{md/metadata_version}=="external:[A-Za-z]*", ATTR{md/array_state}=="inactive", GOTO="md_ignore_state" +TEST!="md/array_state", ENV{SYSTEMD_READY}="0", GOTO="md_end" +ATTR{md/array_state}=="|clear|inactive", ENV{SYSTEMD_READY}="0", GOTO="md_end" +LABEL="md_ignore_state" + +IMPORT{program}="/sbin/mdadm --detail --export $devnode" +ENV{DEVTYPE}=="disk", ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}", OPTIONS+="string_escape=replace" +ENV{DEVTYPE}=="disk", ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}" +ENV{DEVTYPE}=="disk", ENV{MD_DEVNAME}=="?*", SYMLINK+="md/$env{MD_DEVNAME}" +ENV{DEVTYPE}=="partition", ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}-part%n", OPTIONS+="string_escape=replace" +ENV{DEVTYPE}=="partition", ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}-part%n" +ENV{DEVTYPE}=="partition", ENV{MD_DEVNAME}=="*[^0-9]", SYMLINK+="md/$env{MD_DEVNAME}%n" +ENV{DEVTYPE}=="partition", ENV{MD_DEVNAME}=="*[0-9]", SYMLINK+="md/$env{MD_DEVNAME}p%n" + +IMPORT{builtin}="blkid" +OPTIONS+="link_priority=100" +OPTIONS+="watch" +ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" +ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" + +ENV{MD_LEVEL}=="raid[1-9]*", ENV{SYSTEMD_WANTS}+="mdmonitor.service" + +# Tell systemd to run mdmon for our container, if we need it. +ENV{MD_LEVEL}=="raid[1-9]*", ENV{MD_CONTAINER}=="?*", PROGRAM="/usr/bin/readlink $env{MD_CONTAINER}", ENV{MD_MON_THIS}="%c" +ENV{MD_MON_THIS}=="?*", PROGRAM="/usr/bin/basename $env{MD_MON_THIS}", ENV{SYSTEMD_WANTS}+="mdmon@%c.service" + +LABEL="md_end" diff --git a/package/petitboot/65-md-incremental.rules b/package/petitboot/65-md-incremental.rules new file mode 100644 index 000000000000..153d12fe6f7e --- /dev/null +++ b/package/petitboot/65-md-incremental.rules @@ -0,0 +1,69 @@ +# This file causes block devices with Linux RAID (mdadm) signatures to +# automatically cause mdadm to be run. +# See udev(8) for syntax + +# Don't process any events if anaconda is running as anaconda brings up +# raid devices manually +ENV{ANACONDA}=="?*", GOTO="md_end" + +# Also don't process disks that are slated to be a multipath device +ENV{DM_MULTIPATH_DEVICE_PATH}=="?*", GOTO="md_end" + +# We process add events on block devices (since they are ready as soon as +# they are added to the system), but we must process change events as well +# on any dm devices (like LUKS partitions or LVM logical volumes) and on +# md devices because both of these first get added, then get brought live +# and trigger a change event. The reason we don't process change events +# on bare hard disks is because if you stop all arrays on a disk, then +# run fdisk on the disk to change the partitions, when fdisk exits it +# triggers a change event, and we want to wait until all the fdisks on +# all member disks are done before we do anything. Unfortunately, we have +# no way of knowing that, so we just have to let those arrays be brought +# up manually after fdisk has been run on all of the disks. + +# First, process all add events (md and dm devices will not really do +# anything here, just regular disks, and this also won't get any imsm +# array members either) +SUBSYSTEM=="block", ACTION=="add|change", ENV{ID_FS_TYPE}=="linux_raid_member", \ + RUN+="/sbin/mdadm -I --export $env{DEVNAME}" + +# Next, check to make sure the BIOS raid stuff wasn't turned off via cmdline +IMPORT{cmdline}="noiswmd" +IMPORT{cmdline}="nodmraid" +ENV{noiswmd}=="?*", GOTO="md_imsm_inc_end" +ENV{nodmraid}=="?*", GOTO="md_imsm_inc_end" +SUBSYSTEM=="block", ACTION=="add", ENV{ID_FS_TYPE}=="isw_raid_member", \ + RUN+="/sbin/mdadm -I $env{DEVNAME}" +LABEL="md_imsm_inc_end" + +SUBSYSTEM=="block", ACTION=="remove", ENV{ID_PATH}=="?*", \ + RUN+="/sbin/mdadm -If $name --path $env{ID_PATH}" +SUBSYSTEM=="block", ACTION=="remove", ENV{ID_PATH}!="?*", \ + RUN+="/sbin/mdadm -If $name" + +# Next make sure that this isn't a dm device we should skip for some reason +ENV{DM_UDEV_RULES_VSN}!="?*", GOTO="dm_change_end" +ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="dm_change_end" +ENV{DM_SUSPENDED}=="1", GOTO="dm_change_end" +KERNEL=="dm-*", SUBSYSTEM=="block", ENV{ID_FS_TYPE}=="linux_raid_member", \ + ACTION=="change", RUN+="/sbin/mdadm -I $env{DEVNAME}" +LABEL="dm_change_end" + +# Finally catch any nested md raid arrays. If we brought up an md raid +# array that's part of another md raid array, it won't be ready to be used +# until the change event that occurs when it becomes live +KERNEL=="md*", SUBSYSTEM=="block", ENV{ID_FS_TYPE}=="linux_raid_member", \ + ACTION=="change", RUN+="/sbin/mdadm -I $env{DEVNAME}" + +# In case the initramfs only started some of the arrays in our container, +# run incremental assembly on the container itself. Note: we ran mdadm +# on the container in 64-md-raid.rules, and that's how the MD_LEVEL +# environment variable is already set. If that disappears from the other +# file, we will need to add this line into the middle of the next rule: +# IMPORT{program}="/sbin/mdadm -D --export $tempnode", \ + +SUBSYSTEM=="block", ACTION=="add|change", KERNEL=="md*", \ + ENV{MD_LEVEL}=="container", RUN+="/sbin/mdadm -I $env{DEVNAME}" + + +LABEL="md_end" diff --git a/package/petitboot/petitboot.mk b/package/petitboot/petitboot.mk index 9326738aa038..596e801b781c 100644 --- a/package/petitboot/petitboot.mk +++ b/package/petitboot/petitboot.mk @@ -46,6 +46,16 @@ else PETITBOOT_CONF_OPTS += --without-fdt endif +ifeq ($(BR2_PACKAGE_MDADM),y) +define PETITBOOT_POST_INSTALL_MDADM + $(INSTALL) -D -m 0755 $(PETITBOOT_PKGDIR)/63-md-raid-arrays.rules \ + $(TARGET_DIR)/etc/udev/rules.d/63-md-raid-arrays.rules + $(INSTALL) -D -m 0755 $(PETITBOOT_PKGDIR)/65-md-incremental.rules \ + $(TARGET_DIR)/etc/udev/rules.d/65-md-incremental.rules +endef +PETITBOOT_POST_INSTALL_TARGET_HOOKS += PETITBOOT_POST_INSTALL_MDADM +endif + define PETITBOOT_POST_INSTALL $(INSTALL) -D -m 0755 $(@D)/utils/bb-kexec-reboot \ $(TARGET_DIR)/usr/libexec/petitboot/bb-kexec-reboot From patchwork Fri Sep 15 15:58:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Reza Arbab X-Patchwork-Id: 1835038 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=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (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 4RnJlg1sdDz1yhR for ; Sat, 16 Sep 2023 01:59:11 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 959564008B; Fri, 15 Sep 2023 15:59:08 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 959564008B 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 jP1rr__nIuIf; Fri, 15 Sep 2023 15:59:07 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id B3BE74220E; Fri, 15 Sep 2023 15:59:06 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org B3BE74220E 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 3EE411BF995 for ; Fri, 15 Sep 2023 15:58:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 16FBD83CE0 for ; Fri, 15 Sep 2023 15:58:52 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 16FBD83CE0 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 mWzT-Lxd06on for ; Fri, 15 Sep 2023 15:58:51 +0000 (UTC) Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by smtp1.osuosl.org (Postfix) with ESMTPS id 610D283BF1 for ; Fri, 15 Sep 2023 15:58:51 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 610D283BF1 Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38FFKxFL009167; Fri, 15 Sep 2023 15:58:50 GMT Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3t4su6h61b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Sep 2023 15:58:50 +0000 Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 38FFHGrf022958; Fri, 15 Sep 2023 15:58:49 GMT Received: from smtprelay04.wdc07v.mail.ibm.com ([172.16.1.71]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3t141pd50d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Sep 2023 15:58:49 +0000 Received: from smtpav02.wdc07v.mail.ibm.com (smtpav02.wdc07v.mail.ibm.com [10.39.53.229]) by smtprelay04.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 38FFwnjw40370474 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Sep 2023 15:58:49 GMT Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2D6C858059; Fri, 15 Sep 2023 15:58:49 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 169B658058; Fri, 15 Sep 2023 15:58:49 +0000 (GMT) Received: from arbab-laptop.localdomain (unknown [9.53.178.221]) by smtpav02.wdc07v.mail.ibm.com (Postfix) with ESMTPS; Fri, 15 Sep 2023 15:58:49 +0000 (GMT) Received: by arbab-laptop.localdomain (Postfix, from userid 152845) id E2397180FB0; Fri, 15 Sep 2023 10:58:47 -0500 (CDT) From: Reza Arbab To: buildroot@buildroot.org Date: Fri, 15 Sep 2023 10:58:35 -0500 Message-Id: <20230915155835.51140-6-arbab@linux.ibm.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20230915155835.51140-1-arbab@linux.ibm.com> References: <20230915155835.51140-1-arbab@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: frtiBTDkuNKYtUangjwQiU1oVOtjVBUU X-Proofpoint-ORIG-GUID: frtiBTDkuNKYtUangjwQiU1oVOtjVBUU X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-09-15_12,2023-09-15_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 clxscore=1015 mlxlogscore=996 suspectscore=0 mlxscore=0 priorityscore=1501 phishscore=0 malwarescore=0 spamscore=0 adultscore=0 lowpriorityscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2309150138 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=4bcc4tqi6e3Yk6LjY4vP8iFiiHgOeJL+3k0HWybVjZg=; b=s6JSgAXlBgx2AmS+c4okBuOb6OdtprQsDxsrIh6Wr8vne5bEQhn3vN+dS0TDPPjZuf8l s9bp+bI3cSwkOORy0qcQqDfFdth4dPtNvs3AUJmOVour6kvTPmXDZFS94Z+WwfK+KAfn TMRdkKolsXIO4MDiA2ZGMsHY+oO7RSf3gIm/ztID3Uk5YVCNbb/okZQEAFM7EuYEUyaJ 6KN3kjRTLWrS+MnkBwpMix+b2RReosh0m6NCJKKBlR2I+O1uyki034d6DUG4BvarSirf wVhLRAKcBxkVhVYxsfINFXuRrssCOMsaKWUfFudD0upZ3MpDZ59z8pGV4LITs0Vd34vI MQ== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=s6JSgAXl Subject: [Buildroot] [PATCH v2 5/5] package/petitboot: enable discovery of SCSI devices 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: Reza Arbab , Laurent Vivier , Joel Stanley Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" It's likely that the "sg" kernel driver needed to scan SCSI devices is a module. Install a udev rule to load it automatically when devices are present. Signed-off-by: Reza Arbab Reviewed-by: Laurent Vivier Reviewed-by: Joel Stanley --- package/petitboot/66-add-sg-module.rules | 2 ++ package/petitboot/petitboot.mk | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 package/petitboot/66-add-sg-module.rules diff --git a/package/petitboot/66-add-sg-module.rules b/package/petitboot/66-add-sg-module.rules new file mode 100644 index 000000000000..ae18d28c570e --- /dev/null +++ b/package/petitboot/66-add-sg-module.rules @@ -0,0 +1,2 @@ +# load modules to scsi disks, if they aren't in kernel +SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST!="[module/sg]", RUN+="/sbin/modprobe sg" diff --git a/package/petitboot/petitboot.mk b/package/petitboot/petitboot.mk index 596e801b781c..590b58e9c71a 100644 --- a/package/petitboot/petitboot.mk +++ b/package/petitboot/petitboot.mk @@ -63,6 +63,8 @@ define PETITBOOT_POST_INSTALL $(TARGET_DIR)/etc/petitboot/boot.d/01-create-default-dtb $(INSTALL) -D -m 0755 $(@D)/utils/hooks/90-sort-dtb \ $(TARGET_DIR)/etc/petitboot/boot.d/90-sort-dtb + $(INSTALL) -D -m 0755 $(PETITBOOT_PKGDIR)/66-add-sg-module.rules \ + $(TARGET_DIR)/etc/udev/rules.d/66-add-sg-module.rules $(INSTALL) -m 0755 -D $(PETITBOOT_PKGDIR)/S15pb-discover \ $(TARGET_DIR)/etc/init.d/S15pb-discover $(INSTALL) -D -m 0755 $(PETITBOOT_PKGDIR)/petitboot-console-ui.rules \