Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Reza Arbab <arbab@linux.ibm.com>
To: buildroot@buildroot.org
Cc: Reza Arbab <arbab@linux.ibm.com>,
	Laurent Vivier <laurent@vivier.eu>, Joel Stanley <joel@jms.id.au>
Subject: [Buildroot] [PATCH 5/5] package/petitboot: enable discovery of SCSI devices
Date: Wed,  6 Sep 2023 14:46:09 -0500	[thread overview]
Message-ID: <20230906194609.74080-6-arbab@linux.ibm.com> (raw)
In-Reply-To: <20230906194609.74080-1-arbab@linux.ibm.com>

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 <arbab@linux.ibm.com>
---
 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 \
-- 
2.39.3

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2023-09-06 19:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-06 19:46 [Buildroot] [PATCH 0/5] package/petitboot: misc enhancement Reza Arbab
2023-09-06 19:46 ` [Buildroot] [PATCH 1/5] package/petitboot: fix HOST_PROG_SHUTDOWN value Reza Arbab
2023-09-07  8:48   ` Laurent Vivier
2023-09-25  5:30   ` Peter Korsgaard
2023-09-06 19:46 ` [Buildroot] [PATCH 2/5] package/petitboot: run pb-console at boot Reza Arbab
2023-09-07  8:51   ` Laurent Vivier
2023-09-07 19:41     ` Reza Arbab
2023-09-13 15:54       ` Reza Arbab
2023-09-06 19:46 ` [Buildroot] [PATCH 3/5] package/petitboot: poll removable devices Reza Arbab
2023-09-07  8:53   ` Laurent Vivier
2023-09-06 19:46 ` [Buildroot] [PATCH 4/5] package/petitboot: enable discovery of software RAID devices Reza Arbab
2023-09-07  8:54   ` Laurent Vivier
2023-09-06 19:46 ` Reza Arbab [this message]
2023-09-07  8:55   ` [Buildroot] [PATCH 5/5] package/petitboot: enable discovery of SCSI devices Laurent Vivier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230906194609.74080-6-arbab@linux.ibm.com \
    --to=arbab@linux.ibm.com \
    --cc=buildroot@buildroot.org \
    --cc=joel@jms.id.au \
    --cc=laurent@vivier.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox