root@192.168.30.68:tmp# mkdir initrd
root@192.168.30.68:tmp# cd initrd/
root@192.168.30.68:initrd# ls
root@192.168.30.68:initrd# cp /boot/initrd.img-2.6.18-6-amd64 .
root@192.168.30.68:initrd# ls
initrd.img-2.6.18-6-amd64
2.将initrd文件名改为.gz文件,将其解压缩.
代码如下:
root@192.168.30.68:initrd# file initrd.img-2.6.18-6-amd64 #发现该文件是一个gzip压缩过的文件
initrd.img-2.6.18-6-amd64: gzip compressed data, from Unix, last modified: Thu Sep 24 18:21:40 2009
root@192.168.30.68:initrd# mv initrd.img-2.6.18-6-amd64 initrd.img-2.6.18-6-amd64.gz
root@192.168.30.68:initrd# file initrd.img-2.6.18-6-amd64.gz
initrd.img-2.6.18-6-amd64.gz: gzip compressed data, from Unix, last modified: Thu Sep 24 18:21:40 2009
root@192.168.30.68:initrd# gunzip initrd.img-2.6.18-6-amd64.gz
# Note that this only becomes /dev on the real filesystem if udev's scripts
# are used; which they will be, but it's worth pointing out
tmpfs_size="10M"
if [ -e /etc/udev/udev.conf ]; then
. /etc/udev/udev.conf
fi
mount -t tmpfs -o size=$tmpfs_size,mode=0755 udev /dev
[ -e /dev/console ] || mknod -m 0600 /dev/console c 5 1
[ -e /dev/null ] || mknod /dev/null c 1 3
> /dev/.initramfs-tools
mkdir /dev/.initramfs
代码如下:
# Export the dpkg architecture
export DPKG_ARCH=
. /conf/arch.conf