HighWayToHell - Tag - initrd花园里, 篱笆下2023-08-13T10:38:15+08:00Druggourn:md5:79dfcacdbfd6434dfc57423d51240051Dotclearunpack initrd, initramfs, igzurn:md5:69c8add7cfc66c0ad1db1df063ddddb62006-08-23T11:24:00+08:002006-08-23T12:40:51+08:00admin计算机cpioigzinitrdlinuxunpack <p>一般的 initrd文件用下面命令就可以解开了</p>
<blockquote><p>$zcat initrd |cpio -div</p>
</blockquote>但是有些不行,是2个合起来的,可以用下面这个脚本来解<br />http://blog.druggo.org/public/script/unpack<br />
<p>当你做完修改以后,可以用下面命令来重建</p>
<blockquote><p># cd irfs-dir
<br />
# find . -print | cpio -o -H newc > ../initramfs
<br />
# cd ..
<br />
(if you want)
<br />
# gzip initramfs</p>
</blockquote>还有一个perl的脚本,虽然有报错,但是还是可以用的<br />http://blog.druggo.org/public/script/unigz<br /><br />from: http://forums.gentoo.org/viewtopic-t-429263.html<br /> http://forums.gentoo.org/viewtopic-t-383198.html<br />http://blog.druggo.org/post/2006/08/23/unpack-initrdigz#comment-formhttp://blog.druggo.org/feed/atom/comments/38从 initrd 到 Initramfsurn:md5:3a1ed9b81dbaf228a643064c1ab088872006-08-23T11:09:00+08:002006-08-23T11:12:39+08:00admin计算机cpiohowtoinitrdlinuxramfs <blockquote><div id="qhide_592321" style="display: block;" class="qt">Jim Gifford wrote: <br /> > Question: Initramfs is going to replace initrd, but I haven't seen <br /> > anyone explain how to copy modules that are built during the build <br /> > process moved into the initramfs archive. Has somebody done, this or is <br /> > this still a work in progress? <br /> </div><p>Easy. </p>
<p>1) Unpack a vanilla kernel and build and install it as you usually do for a <br /> system that doesn't need initramfs. </p>
<p>make menuconfig <br /> make <br /> make modules_install <br /> cp arch/i386/boot/bzimage /boot/linux-2.6 </p>
<p>2) Make a temporary directory (say, "initramfs") and put all files that you <br /> want to go to your initramfs there. Don't forget the "/init" file, it is <br /> used as a starting point for initramfs. </p>
<p>3) Make the initramfs image: </p>
<p>cd initramfs <br /> find . | cpio -o -H newc | gzip -9 >/boot/initramfs-2.6.cpio.gz </p>
<p>4) Add /boot/linux-2.6 and /boot/initramfs-2.6.cpio.gz to your LILO or GRUB <br /> as you would normally do with a kernel image and the initrd: </p>
<p>image=/boot/linux-2.6 <br /> label="Linux" <br /> initrd=/boot/initramfs-2.6.cpio.gz <br /> root=/dev/hda1 # if your initramfs "/init" script understands this <br /> read-only # if your initramfs "/init" script understands this </p>
<p>5) Upon reboot, the kernel will automatically determine that the image is <br /> really an initramfs, not an initrd. </p>
<p>-- <br /> Alexander E. Patrakov<br /><br />from: http://groups.google.com/group/linux.kernel/msg/f78cf557a5c0b602 </p>
</blockquote>http://blog.druggo.org/post/2006/08/23/initrd-Initramfs#comment-formhttp://blog.druggo.org/feed/atom/comments/37