Gentoo Archives: gentoo-user

From: Pandu Poluan <pandu@××××××.info>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Beta test Gentoo with mdev instead of udev; version 5
Date: Wed, 21 Mar 2012 00:47:24
Message-Id: CAA2qdGWczSCrUnf5hUCXXe-D6LJ+u0xtL+gnSUyhk3_ZwYwTJA@mail.gmail.com
In Reply to: Re: [gentoo-user] Beta test Gentoo with mdev instead of udev; version 5 by covici@ccs.covici.com
1 On Mar 21, 2012 2:52 AM, <covici@××××××××××.com> wrote:
2 >
3 > Daddy <daddy@×××××××××××××××××××××.com> wrote:
4 >
5 > > On March 11, 2012 at 5:09 AM Walter Dnes <waltdnes@××××××××.org> wrote:
6 > >
7 > > > This revision makes 2 changes...
8 > > >
9 > > > A) The removal of udev is now standard instead of optional. udev-181
10 > > > and higher will be pulling in kmod, and anything else that kmod
11 depends
12 > > > on. Removing udev will avoid unnecessary cruft on your machine.
13 > > >
14 > > > B) Splitting up step 3) into 3a) and 3b) for greater clarity as
15 > > > requested in user feedback.
16 > > >
17 > > > The usual warnings apply...
18 > > > * this is a beta
19 > > > * use a spare test machine
20 > > > * if you don't follow the instructions correctly, the result might be
21 > > > an unbootable linux
22 > > > * even if you do follow instructions, the result might be an
23 unbootable
24 > > > linux
25 > > >
26 > > >
27 > > > 1) Set up your kernel to support and automount a devtmpfs filesystem
28 at
29 > > > /dev
30 > > >
31 > > > * If you prefer to edit .config directly, set
32 > > > CONFIG_DEVTMPFS=y and CONFIG_DEVTMPFS_MOUNT=y
33 > > >
34 > > > * If you prefer "make menuconfig", the route is as shown below. Note
35 > > > that the "Autount devtmpfs..." option won't appear until you enable
36 > > > "Maintain a devtmpf..." option.
37 > > >
38 > > > make menuconfig
39 > > > Device Drivers --->
40 > > > Generic Driver Options --->
41 > > > [*] Maintain a devtmpfs filesystem to mount at /dev
42 > > > [*] Automount devtmpfs at /dev, after the kernel mounted the
43 > > rootfs
44 > > >
45 > > > Once you've made the changes, rebuild the kernel.
46 > > >
47 > > >
48 > > > 2) Set up for emerging busybox. busybox requires the "mdev" flag in
49 > > > this situation. The "static" flag is probably also a good idea. In
50 > > > file /etc/portage/package.use add the line
51 > > >
52 > > > sys-apps/busybox static mdev
53 > > >
54 > > > Now, "emerge busybox"
55 > > >
56 > > >
57 > > > 3 a) Create /sbin/linuxrc containing at least
58 > > >
59 > > > #!/bin/busybox ash
60 > > > mount -t proc proc /proc
61 > > > mount -t sysfs sysfs /sys
62 > > > exec /sbin/init
63 > > >
64 > > > This should be enough for most users. If you have an unusual setup,
65 > > > you may need additional stuff in there. Remember to
66 > > > "chmod 744 /sbin/linuxrc" to make it executable.
67 > > >
68 > > > In the bootloader "append" line, include "init=/sbin/linuxrc". If
69 > > > you're using lilo remember to re-run lilo to implement the changes.
70 If
71 > > > you're using another bootloader, make the equivalant initialization.
72 > > >
73 > > >
74 > > > 4) Remove udev from the services list, and replace it with mdev. Type
75 > > > the following 2 commands at the command line
76 > > > rc-update del udev sysinit
77 > > > rc-update add mdev sysinit
78 > > >
79 > > >
80 > > > 5) reboot to your new kernel. You're now running without using udev.
81 > > >
82 > > >
83 > > > 6) Remove udev as per the following instructions...
84 > > >
85 > > > * execute the following command at the commandline
86 > > > emerge --unmerge sys-fs/udev
87 > > >
88 > > > * In file /atc/portage/package.mask, append the line
89 > > > sys-fs/udev
90 > > > Create the file if it doesn't already exist. You now have a totally
91 > > > udev-free machine
92 > > >
93 > > > --
94 > > > Walter Dnes <waltdnes@××××××××.org>
95 > > >
96 > >
97 > > Having personally long considered Lennart Poettering a 'spawn of the
98 devil'
99 > > my question is ... is this your reaction to systemd?
100 > >
101 > > One minor typo to point out:
102 > >
103 > > /atc/portage/package.mask should be /etc/portage/package.mask
104 > >
105 > > I just joined this list last week, but might consider sacrificing some
106 > > hardware to join your endeavor if you need more testers.
107 > OK, I am not seeing mdev in the portage tree -- I would like to learn
108 > more about this before I take the plunge. So where do I get it and does
109 > it create the appropriate device nodes, etc?
110 >
111
112 The creation of device nodes mostly are done by the devtmpfs of the kernel.
113 I recommend the linuxrc to look like this :
114
115 #!/bin/busybox ash
116 mount -t proc proc /proc
117 mount -t sysfs sysfs /sys
118 echo /bin/mdev > /proc/sys/kernel/hotplug
119 /bin/mdev -s
120 exec /sbin/init
121
122 Before booting, ensure /bin/mdev exists and is a symlink to /bin/busybox.
123
124 The rest, just follow the steps outlined by waltdnes
125
126 Rgds,