Specifications

# rm -f random
# ln -s urandom random
Solution:
The correct solution for the problem is of course to feed sufficient entropy into /dev/random. To
do so you can modify one or more appropriate device drivers on your system; for example if you
know that there is sufficient traffic on network or on a serial port than adding SA_SAMPLE_RANDOM
to the 3rd argument when calling the request_irq() function in your ethernet and/or serial
driver(s) will cause the inter-interrupt times to be used to build up entropy for /dev/random.
14.3.30. Swapping over NFS
In case that the available memory is not sufficient, i.e. for compiling the X.org server, and no hard-drive can
be attached to the system it is possible to swap over NFS, although it is not quite straightforward.
Usually one would create a blank file, mkswap it and simply do a swapon swapfile. Doing this on a filesystem
mounted over NFS, i.e. the ELDK root filesystem, fails however.
With one level of indirection we can trick the kernel into doing it anyway. First we create a filesystem image
(ext2 will do) on the NFS filesystem and mount it with the aid of the loopback device. Then we create a blank
swapfile inside of this filesystem and turn on swapping:
bash-2.05b# mount
/dev/nfs on / type nfs (rw)
none on /proc type proc (rw)
bash-2.05b# cd /tmp
bash-2.05b# dd if=/dev/zero of=ext2.img bs=1M count=66
66+0 records in
66+0 records out
bash-2.05b# mkfs.ext2 ext2.img
mke2fs 1.27 (8-Mar-2002)
ext2.img is not a block special device.
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
16920 inodes, 67584 blocks
3379 blocks (5.00%) reserved for the super user
First data block=1
9 block groups
8192 blocks per group, 8192 fragments per group
1880 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 26 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
bash-2.05b# for i in `seq 0 9` ; do mknod /dev/loop$i b 7 $i ; done
bash-2.05b# mkdir /mnt2
bash-2.05b# mount -o loop ext2.img /mnt2
bash-2.05b# cd /mnt2
bash-2.05b# dd if=/dev/zero of=swapfile bs=1M count=62
62+0 records in
62+0 records out
bash-2.05b# mkswap swapfile
Setting up swapspace version 1, size = 65007 kB
14.3.30. Swapping over NFS 196