[readonly/geninitrd: 426/1068] - create /dev entries also for dmraid - made initrd_gen_devices() as function
draenog
draenog at pld-linux.org
Sat Nov 2 19:48:10 CET 2013
commit 2ffb173487459025cdd45e25f14be66e9260b5c0
Author: Elan Ruusamäe <glen at pld-linux.org>
Date: Fri Oct 5 13:37:32 2007 +0000
- create /dev entries also for dmraid
- made initrd_gen_devices() as function
svn-id: @8783
geninitrd | 30 ++++++++++++++++++++++--------
1 file changed, 22 insertions(+), 8 deletions(-)
---
diff --git a/geninitrd b/geninitrd
index ab9d6e3..6f3d919 100755
--- a/geninitrd
+++ b/geninitrd
@@ -1161,6 +1161,11 @@ initrd_gen_dmraid() {
cat <<-EOF >> "$s"
mount -t proc none /proc
mount -t sysfs none /sys
+EOF
+
+ initrd_gen_devices
+
+ cat <<-EOF >> "$s"
# 2 secs was enough for my system to initialize. but really this is udev issue?
usleep 2000000
: 'Activating Device-Mapper RAID(s)'
@@ -1170,6 +1175,21 @@ initrd_gen_dmraid() {
EOF
}
+# generates /dev nodes based on /proc/partitions information
+# needs /proc mounted
+initrd_gen_devices() {
+ cat <<-EOF >> "$s"
+ : 'Making device nodes'
+ # ignore first two lines, header, empty line and process rest
+ cat /proc/partitions | (read b; read b; while read major minor blocks dev rest; do
+ node=/dev/\$dev
+ mkdir -p \${node%/*}
+ mknod \$node b \$major \$minor
+ done
+ )
+EOF
+}
+
initrd_gen_softraid() {
debug "Setting up mdadm..."
@@ -1311,15 +1331,9 @@ initrd_gen_lvm() {
lvm dumpconfig | awk '/filter=/' >> "$MNTIMAGE/etc/lvm.conf"
echo "}" >> "$MNTIMAGE/etc/lvm.conf"
+ initrd_gen_devices
+
cat <<-EOF >> "$s"
- : 'Making device nodes'
- # ignore first two lines, header, empty line and process rest
- cat /proc/partitions | (read b; read b; while read major minor blocks dev rest; do
- node=/dev/\$dev
- mkdir -p \${node%/*}
- mknod \$node b \$major \$minor
- done
- )
# disable noise from lvm accessing devices that aren't ready.
printk=\$(cat /proc/sys/kernel/printk)
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/readonly/geninitrd.git/commitdiff/147754ca159d40ca5eb541074dc043d8cbd92090
More information about the pld-cvs-commit
mailing list