Commençons par créer un petit système de fichiers. Faisons un répertoire
~/initrd et copions les
fichiers suivants dans ce répertoire:
drwxr-xr-x
drwxr-cx-x -rwxr-xr-x -rwxr-xr-x drwxr-xr-x crw-r-r- crw-r-r- crw-r-r- crw-r-r- crw-r-r- crw-r-r- crw-r-r- drwxr-xr-x drwxr-xr-x -rwxr-xr-x drwxr-xr-x |
7 root
2 root 1 root 1 root 2 root 1 root 1 root 1 root 1 root 1 root 1 root 1 root 2 root 2 root 1 root 2 root |
root
root root root root root root root root root root root root root root root |
1024 Sep 14 20:12 initrd/
1024 Sep 14 20:12 initrd/bin/ 436328 Sep 14 20:12 initrd/bin/insmod 424680 Sep 14 20:12 initrd/bin/sash 1024 Sep 14 20:12 initrd/dev/ 5, 1 Sep 14 20:12 initrd/dev/console 1, 3 Sep 14 20:12 initrd/dev/null 4, 0 Sep 14 20:12 initrd/dev/systty 4, 1 Sep 14 20:12 initrd/dev/tty1 4, 1 Sep 14 20:12 initrd/dev/tty2 4, 1 Sep 14 20:12 initrd/dev/tty3 4, 1 Sep 14 20:12 initrd/dev/tty4 1024 Sep 14 20:12 initrd/etc/ 1024 Sep 14 20:12 initrd/lib/ 76 Sep 14 20:12 initrd/linuxrc 1024 Sep 14 20:12 initrd/loopfs/ |
A présent, dans le répertoire initrd/lib,
copiez les modules SCSI dont vous avez besoin . Par exemple, si vous
avez un adaptateur SCSI Adaptec AIC-7850, vous devez disposer du module
aix7xxx.o qui se trouve dans le répertoire
/lib/modules/<version>/scsi/. Alors, placez-le
dans le répertoire initrd/lib:
-rw-r-r-
|
1 root
|
root
|
129448 Sep 27 1999 initrd/lib/aic7xxx.o
|
#!/bin/sash
aliasall echo ``Loading aic7xxx module'' insmod /lib/aic7xxx.o |
chroot ~/initrd /bin/bash
/linuxrc |
dd if=/dev/zero of=~/file-inird
count=2500 bs=1024
losetup /dev/loop0 ~file-inird mke2fs /dev/loop0 mkdir ~/mnt mount /dev/loop0 ~/mnt cp -a initrd/* ~/mnt/ umount ~/mnt losetup -d /dev/loop0 |
gzip -c ~/file-inird
> initrd-<version_noyau>
|