summaryrefslogtreecommitdiffstats
path: root/sys-apps/mkinitrd/files/mkinitrd-6.0.93-ds.diff
blob: a9fcd0afc580a99aee9653061abe185f4c8753df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
diff -dPNur mkinitrd-6.0.93-patched/functions mkinitrd-6.0.93-patched-ds/functions
--- mkinitrd-6.0.93-patched/functions	2012-11-19 23:57:17.000000000 +0100
+++ mkinitrd-6.0.93-patched-ds/functions	2012-11-19 23:59:42.000000000 +0100
@@ -347,6 +347,15 @@
     resolved="$items"
 }
 
+get_numeric_dev() {
+(
+    fmt="%d:%d"
+    if [ "$1" = "hex" ]; then
+        fmt="%x:%x"
+    fi
+    ls -lH "$2" | awk '{ sub(/,/, "", $5); printf("'"$fmt"'", $5, $6); }'
+) 2>/dev/null
+}
 
 
 # vim:ts=8:sw=4:sts=4:et
diff -dPNur mkinitrd-6.0.93-patched/mkinitrd mkinitrd-6.0.93-patched-ds/mkinitrd
--- mkinitrd-6.0.93-patched/mkinitrd	2012-11-19 23:57:17.000000000 +0100
+++ mkinitrd-6.0.93-patched-ds/mkinitrd	2012-11-20 00:05:55.000000000 +0100
@@ -48,8 +48,6 @@
 PATH=/sbin:/usr/sbin:/bin:/usr/bin:$PATH
 export PATH
 
-. /etc/rc.d/init.d/functions
-
 # Set the umask. For iscsi, the initrd can contain plaintext
 # password (chap secret), so only allow read by owner.
 umask 077
@@ -111,6 +109,7 @@
     fi
 
     $cmd "usage: `basename $0` [--version] [--help] [-v] [-f] [--preload <module>]"
+    $cmd "       [--omit-ata-modules] [--busybox]"
     $cmd "       [--force-scsi-probe | --omit-scsi-modules]"
     $cmd "       [--omit-ide-modules]"
     $cmd "       [--image-version] [--force-raid-probe | --omit-raid-modules]"
@@ -315,6 +314,7 @@
     if echo $PWD | grep -q /virtio-pci/ ; then
         findmodule virtio_pci
     fi
+
     while [ "$PWD" != "/sys/devices" ]; do
         deps=
         if [ -f modalias ]; then
@@ -325,7 +325,8 @@
             moduledep $MODALIAS
             unset MODALIAS
         fi
-
+        
+        if [ -z "$noata" ] ; then
         [ -z "$deps" -a -L driver/module ] && \
             deps=$(basename $(readlink driver/module))
         for driver in $deps ; do
@@ -335,6 +336,7 @@
             [ "$driver" = "ata_piix" ] && findmodule ahci
             [ "$driver" = "ahci" ] && findmodule ata_piix
         done
+        fi
         cd ..
     done
 }
@@ -883,6 +885,12 @@
             fi
             PREMODS="$PREMODS $modname"
             ;;
+        --omit-ata-modules)
+            noata=1
+            ;;
+        --busybox)
+            busybox=1
+            ;;
         --omit-scsi-modules)
             PRESCSIMODS=""
             noscsi=1
@@ -1289,9 +1297,14 @@
 vecho "Building initrd in $MNTIMAGE"
 inst /sbin/nash "$MNTIMAGE" /bin/nash
 inst /sbin/modprobe "$MNTIMAGE" /bin/modprobe
-inst /sbin/rmmod "$MNTIMAGE" /bin/rmmod
+#inst /sbin/rmmod "$MNTIMAGE" /bin/rmmod
 inst /bin/ln "$MNTIMAGE"
 
+if [ -n "$busybox" ]; then
+    inst /bin/bb "$MNTIMAGE"
+    inst /bin/busybox "$MNTIMAGE"
+fi
+
 if [ -e /etc/fstab.sys ]; then
     inst /etc/fstab.sys "$MNTIMAGE"
 fi
@@ -1599,10 +1612,12 @@
 /bin/ln -s fb0 /dev/fb
 EOF
 
+if [ -x /bin/plymouthd ]; then
 emit "/bin/plymouthd --attach-to-session"
 
 emit "echo Setting up hotplug."
 emit "hotplug"
+fi
 
 # If we have drm loaded, include modesetting drivers
 if [ "x$PROBE" == "xyes" ]; then
@@ -1622,9 +1637,13 @@
 EOF
 fi
 
+if [ -x /lib/udev/console_init ]; then
 [ -n "$I18N" ] && emit "/lib/udev/console_init tty0"
+fi
 
+if [ -x /bin/plymouthd ]; then
 emit "plymouth --show-splash"
+fi
 
 if [ -x /usr/libexec/plymouth/plymouth-populate-initrd ]; then
     /usr/libexec/plymouth/plymouth-populate-initrd $(get_verbose) -t "$MNTIMAGE"
@@ -1699,7 +1718,10 @@
     emit "echo waiting for encrypted device $1 to appear (timeout 1min)"
     emit "waitdev --timeout=60000000 $1"
     emit "mkblkdevs"
+
+    if [ -x /bin/plymouthd ]; then
     emit "plymouth ask-for-password --command \$LUKSUUID"
+    fi
 }
 
 for cryptdev in ${!cryptopart@} ; do
@@ -1750,7 +1772,10 @@
 
 emit "echo Mounting root filesystem."
 emit "mount /sysroot"
+
+if [ -x /bin/plymouthd ]; then
 emit "cond -ne 0 plymouth --hide-splash"
+fi
 
 if [ -n "$loopfs" ]; then
      emit "Cleaning up loop mount."
@@ -1766,7 +1791,9 @@
 fi
 
 emit "loadpolicy"
+if [ -x /bin/plymouthd ]; then
 emit "plymouth --newroot=/sysroot"
+fi
 emit "echo Switching to new root and running init."
 
 if [ ! -z "$BOOTCHART" ]; then
@@ -1792,6 +1819,10 @@
     emit "/bin/sleep 1s"
 fi
 
+if [ -n "$busybox" ]; then
+    emit "/bin/bb"
+fi
+
 emit "switchroot"
 emit "echo Booting has failed."
 emit "sleep -1"