1 |
commit: 398d7ba5acf5ca5d3c9777aff108b3897649822c |
2 |
Author: Peter Hjalmarsson <xake <AT> rymdraket <DOT> net> |
3 |
AuthorDate: Mon Feb 7 15:02:41 2011 +0000 |
4 |
Commit: Sebastian Pipping <sping <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Feb 7 18:44:43 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=398d7ba5 |
7 |
|
8 |
Use tmpfs if devtmpfs is not available |
9 |
|
10 |
This makes the ramdisk always mount some kind of /dev, |
11 |
and then try to move it to the new root. |
12 |
This unbreaks handling of nodes created pre-udev likefor example lvm does. |
13 |
|
14 |
--- |
15 |
defaults/initrd.scripts | 12 +++++++----- |
16 |
defaults/linuxrc | 4 ++-- |
17 |
2 files changed, 9 insertions(+), 7 deletions(-) |
18 |
|
19 |
diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts |
20 |
index ee26918..1fda57d 100755 |
21 |
--- a/defaults/initrd.scripts |
22 |
+++ b/defaults/initrd.scripts |
23 |
@@ -308,13 +308,15 @@ run_shell() { |
24 |
|
25 |
runmdev() { |
26 |
# Use devtmpfs if enabled in kernel, |
27 |
- # else busybox udev replacement |
28 |
+ # else tmpfs. Always run mdev just in case |
29 |
+ devfs=tmpfs |
30 |
if grep -qs devtmpfs /proc/filesystems ; then |
31 |
- # Options copied from /etc/init.d/udev-mount, should probably be kept in sync |
32 |
- mount -t devtmpfs -o "exec,nosuid,mode=0755,size=10M" udev /dev |
33 |
- else |
34 |
- mdev -s |
35 |
+ devfs=devtmpfs |
36 |
fi |
37 |
+ |
38 |
+ # Options copied from /etc/init.d/udev-mount, should probably be kept in sync |
39 |
+ mount -t $devfs -o "exec,nosuid,mode=0755,size=10M" udev /dev |
40 |
+ mdev -s |
41 |
} |
42 |
|
43 |
test_success() { |
44 |
|
45 |
diff --git a/defaults/linuxrc b/defaults/linuxrc |
46 |
index b42070c..f1e124b 100755 |
47 |
--- a/defaults/linuxrc |
48 |
+++ b/defaults/linuxrc |
49 |
@@ -727,11 +727,11 @@ echo -ne "${BOLD}.${NORMAL}" |
50 |
|
51 |
# If devtmpfs is mounted, try move it to the new root |
52 |
# If that fails, try to unmount all possible mounts of devtmpfs as stuff breaks otherwise |
53 |
-if grep -qs devtmpfs /proc/mounts |
54 |
+if grep -qs "/dev " /proc/mounts |
55 |
then |
56 |
if ! mount --move /dev "${CHROOT}"/dev |
57 |
then |
58 |
- umount -t devtmpfs || echo '*: Failed to move and unmount the devtmpfs /dev!' |
59 |
+ umount /dev || echo '*: Failed to move and unmount the ramdisk /dev!' |
60 |
fi |
61 |
fi |