Penguin
Blame: EliminateInitrd
EditPageHistoryDiffInfoLikePages
Annotated edit history of EliminateInitrd version 3, including all changes. View license author blame.
Rev Author # Line
1 KevinCroft 1 How to eliminate the need for initrd in red hat enterprise linux 4 or Centos 4.
2
2 KevinCroft 3 !!! Background
1 KevinCroft 4
5 Initrd is normally reserved for modules used to bring up the root filesystem that cannot be linked into the kernel, such as a propriety SCSI or RAID drivers. Once the root filesystem is readable any number of modules can be loaded from disk instead of initrd.
6
7 Red Hat Enterprise Linux uses initrd to create temporary device nodes '''/dev/console''' and '''/dev/null''' on a ram disk which is used to handle console IO when the kernel hands control to init, at which point udev kicks in and creates its own virtual device nodes.
8
9 The trouble is, the console and null devices never exist as real file objects inside the /dev directory, and without them a non-initrd kernel will fail with the dreaded "Warning: no initial console found" message.
10
2 KevinCroft 11 !!! The Solution
1 KevinCroft 12 Create the '''console''' and '''null''' devices as real files inside /dev.
13
14 Boot using the default initrd-based kernel, for me this is:
3 KevinCroft 15 <verbatim>
1 KevinCroft 16 title Centos-4 i386 (2.6.9-11.EL)
17 root (hd0,1)
18 kernel /vmlinuz-2.6.9-11.EL ro root=LABEL=/ rhgb quiet
19 initrd /initrd-2.6.9-11.EL.img
3 KevinCroft 20 </verbatim>
1 KevinCroft 21
22 Log in as root, re-mount your root file-system to a new area (/mnt/root), and copy the console and null device nodes:
3 KevinCroft 23 <verbatim>
1 KevinCroft 24 mkdir -p /mnt/root
25 mount /dev/hda3 /mnt/root
26 cd /dev
27 cp -a console null tty1 tty2 tty3 /mnt/root/dev
3 KevinCroft 28 </verbatim>
1 KevinCroft 29
30 The '''console''', '''null''', and '''tty''' devices are now real files inside the /dev directory and will survive a reboot - unlike the devices created by udev and initrd.
31
32 You can also do this by booting the install CD, mounting your root partition, and creating the device files.
33
2 KevinCroft 34 !!! etc files
1 KevinCroft 35
36 If you created three TTY nodes in the above, edit /etc/inittab to match by removing all but one of the tty's. (the init scripts will launch an additional 2 tty's).
37
3 KevinCroft 38 <verbatim>
1 KevinCroft 39 # Run gettys in standard runlevels
40 1:2345:respawn:/sbin/mingetty tty1
41 # - remove the other 5
3 KevinCroft 42 </verbatim>
1 KevinCroft 43
2 KevinCroft 44 !!! Kernel Settings
1 KevinCroft 45
46 You can now create a lean and mean kernel without ram disk support, initrd, /dev/pts, or /dev.
47 Details:
48
2 KevinCroft 49 !!! Device Drivers/Block Devices
3 KevinCroft 50 <verbatim>
1 KevinCroft 51 < > Normal floppy disk support
52 < > Compaq SMART2 support
53 < > Compaq Smart Array 5xxx support
54 < > Mylex DAC960/DAC1100 PCI RAID Controller support
55 < > Micro Memory MM5415 Battery Backed RAM support (EXPERIMENTAL)
56 <*> Loopback device support
57 < > Cryptoloop Support (NEW)
58 < > Network block device support
59 < > Promise SATA SX8 support
60 < > RAM disk support
61 () Initramfs source file(s)
62 [*] Support for Large Block Devices
63 < > Packet writing on CD/DVD media
64 IO Schedulers ---> (only anticipatory)
65 < > ATA over Ethernet support
3 KevinCroft 66 </verbatim>
1 KevinCroft 67
2 KevinCroft 68 !!! Device Drivers/Character Devices
3 KevinCroft 69 <verbatim>
1 KevinCroft 70 [ ] Non-standard serial port support
71 Serial drivers --->
72 [ ] Legacy (BSD) PTY support
73 IPMI --->
74 Watchdog Cards --->
75 < > Intel/AMD/VIA HW Random Number Generator support
76 < > /dev/nvram support
77 < > Enhanced Real Time Clock Support
78 < > Generic /dev/rtc emulation
79 < > Double Talk PC internal speech card support
80 < > Siemens R3964 line discipline
81 < > Applicom intelligent fieldbus card support
82 < > Sony Vaio Programmable I/O Control Device support (EXPERIMENTAL)
83 Ftape, the floppy tape device driver --->
84 <*> /dev/agpgart (AGP Support)
85 < > ALI chipset support
86 < > ATI chipset support
87 < > AMD Irongate, 761, and 762 chipset support
88 < > AMD Opteron/Athlon64 on-CPU GART support
89 < > Intel 440LX/BX/GX, I8xx and E7x05 chipset support
90 <*> NVIDIA nForce/nForce2 chipset support
91 < > SiS chipset support
92 < > Serverworks LE/HE chipset support
93 < > VIA chipset support
94 < > Transmeta Efficeon support
95 < > Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)
96 < > ACP Modem (Mwave) support
97 < > RAW driver (/dev/raw/rawN) (OBSOLETE)
3 KevinCroft 98 </verbatim>
1 KevinCroft 99
2 KevinCroft 100 !!! Filesystems/Pseudo Filesystems
3 KevinCroft 101 <verbatim>
1 KevinCroft 102 [*] /proc file system support
103 [ ] /proc/kcore support
104 [ ] /dev file system support (OBSOLETE)
105 [ ] /dev/pts Extended Attributes
106 [*] Virtual memory file system support (former shm fs)
107 [ ] tmpfs Extended Attributes
108 [ ] HugeTLB file system support
3 KevinCroft 109 </verbatim>
1 KevinCroft 110
2 KevinCroft 111 !!! Grub Config
1 KevinCroft 112 remember grub's ''(hdx,y)'' syntax is zero based.
3 KevinCroft 113 <verbatim>
1 KevinCroft 114 splashimage=(hd0,1)/grub/splash.xpm.gz
115 timeout 10
116 default 0
117 fallback 1
118
119 title RHEL-4 (2.6.12.3)
120 kernel (hd0,1)/bzImage-2.6.13 root=/dev/hda3
121
122 title Gentoo (2.6.12.13)
123 kernel (hd0,1)/bzImage-2.6.13 root=/dev/hda9
3 KevinCroft 124 </verbatim>
1 KevinCroft 125
2 KevinCroft 126 !!! It's working, but udev fails
1 KevinCroft 127 This is a false positive. Chances are you've built a static or mostly-static kernel but the '''/sbin/startudev''' script assumes a module-ladden kernel and fails to load scsi and ide modules (which you've probably builtin).
128
129 Edit the script and comment out some of the statements near the end:
3 KevinCroft 130 <verbatim>
1 KevinCroft 131 kill_udevd
132
133 # scsi_replay ... -\
134 # ret=$[$ret + $?] \ comment out these 4 lines if you've builtin SCSI and IDE drivers.
135 # kill_udevd ... /
136 # ide_scan ... -/
137
138 /sbin/udevstart
3 KevinCroft 139 </verbatim>
1 KevinCroft 140
141 Now reboot and you should see '''OK''' in green letters.

PHP Warning

lib/blame.php:177: Warning: Invalid argument supplied for foreach()