Gentoo Archives: gentoo-user

From: waltdnes@××××××××.org
To: Gentoo Users List <gentoo-user@l.g.o>
Subject: [gentoo-user] Re: Beta test Gentoo with mdev instead of udev; version 2
Date: Mon, 21 Nov 2011 10:49:29
Message-Id: 20111121104724.GC7461@waltdnes.org
In Reply to: [gentoo-user] Anybody want to beta test Gentoo with mdev instead of udev? by waltdnes@waltdnes.org
1 Based on feedback, I've changed step 6, to get a modified ebuild for
2 virtual/dev-manager to properly check for busybox with the "mdev" USE
3 flag. Steps 1-through-5 are unchanged.
4
5 The usual warnings apply...
6 * this is a beta
7 * use a spare test machine
8 * if you don't follow the instructions correctly, the result might be
9 an unbootable linux
10 * even if you do follow instructions, the result might be an unbootable
11 linux
12
13
14 1) Set up your kernel to support and automount a devtmpfs filesystem at
15 /dev
16
17 * If you prefer to edit .config directly, set
18 CONFIG_DEVTMPFS=y and CONFIG_DEVTMPFS_MOUNT=y
19
20 * If you prefer "make menuconfig", the route is as shown below. Note
21 that the "Autount devtmpfs..." option won't appear until you enable
22 "Maintain a devtmpf..." option.
23
24 make menuconfig
25 Device Drivers --->
26 Generic Driver Options --->
27 [*] Maintain a devtmpfs filesystem to mount at /dev
28 [*] Automount devtmpfs at /dev, after the kernel mounted the rootfs
29
30 Once you've made the changes, rebuild the kernel.
31
32
33 2) Set up for emerging busybox, there are 2 items to change
34
35 A) It appears that there may be an mdev bug in older versions of
36 busybox. To avoid that bug, keyword busybox-1.19.2 in
37 /etc/portage/package.keywords E.g. if you're using 32-bit Gentoo on
38 Intel, the incantation is...
39
40 =sys-apps/busybox-1.19.2 ~x86
41
42 Change the "~x86" to reflect your architecture, etc.
43
44 B) busybox requires the "mdev" flag in this situation. The "static"
45 flag is probably also a good idea. In file /etc/portage/package.use
46 add the line
47
48 sys-apps/busybox static mdev
49
50 Now, "emerge busybox"
51
52
53 3) In the bootloader append line, include "init=/sbin/linuxrc" where
54 the file /sbin/linuxrc consists of *AT LEAST*...
55
56 #!/sbin/busybox ash
57 mount -t proc proc /proc
58 mount -t sysfs sysfs /sys
59 exec /sbin/init
60
61 This should be enough for most users. If you have an unusual setup,
62 you may need additional stuff in there. If you're using lilo remember
63 to re-run lilo to implement the changes.
64
65 4) Remove udev from the services list, and replace it with mdev. Type
66 the following 2 commands at the command line
67 rc-update del udev sysinit
68 rc-update add mdev sysinit
69
70
71 5) reboot to your new kernel. You're now running without using udev.
72
73
74 6) ***THIS STEP IS OPTIONAL*** This is only to alay any suspicion that
75 udev is still in use. udev is pulled in by virtual/dev-manager,
76 which in turn is pulled in by the kernel.
77
78 * If you don't already have an overlay, create one, and implement it in
79 /etc/make.conf. In the following example, I'll use my setup, which has
80 the overlay in /usr/local/portage
81
82 * copy the contents of /usr/portage/virtual/dev-manager/ to
83 /usr/local/portage/virtual/dev-manager/
84
85 * cd /usr/local/portage/virtual/dev-manager/
86
87 * Edit the dev-manager-0.ebuild in the overlay to include
88 "sys-apps/busybox[mdev]" as one option in RDEPEND. And also include
89 "EAPI=2" at the top of the ebuild, which is required for this syntax.
90 The revised ebuild is shown below.
91
92 ############################################
93 EAPI=2
94
95 DESCRIPTION="Virtual for the device filesystem manager"
96 HOMEPAGE=""
97 SRC_URI=""
98
99 LICENSE=""
100 SLOT="0"
101 KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~spar
102 c-fbsd ~x86-fbsd"
103 IUSE=""
104
105 DEPEND=""
106 RDEPEND="|| ( sys-fs/udev
107 sys-apps/busybox[mdev]
108 sys-fs/devfsd
109 sys-fs/static-dev
110 sys-freebsd/freebsd-sbin )"
111 ############################################
112
113 * execute the following 3 commands at the commandline
114 ebuild dev-manager-0.ebuild digest
115 emerge -1 dev-manager
116 emerge --unmerge sys-fs/udev
117
118 * In file /atc/portage/package.mask, append the line
119 sys-fs/udev
120 Create the file if it doesn't already exist. You now have a totally
121 udev-free machine
122
123
124 --
125 Walter Dnes <waltdnes@××××××××.org>

Replies

Subject Author
Re: [gentoo-user] Re: Beta test Gentoo with mdev instead of udev; version 2 Pandu Poluan <pandu@××××××.info>
[gentoo-user] Re: Beta test Gentoo with mdev instead of udev; version 3 Walter Dnes <waltdnes@××××××××.org>