Copying the /dev directory

We can create every single file that we need to be in the $LFS/dev directory using the mknod command, but that just takes up a lot of time. I choose to just simply copy the current /dev directory to the $LFS partition. Use this command to copy the entire directory while preserving original rights, symlinks and ownerships:



root:~# cp -av /dev $LFS
root:~# chown root $LFS/dev/*

I'm aware that this isn't the best way to create the files. I know of a MAKEDEV script but I choose not to use it. I'm actually waiting for the 2.4 Linux kernel to be released. The kernel has a stable version of the devfs which this book will use in the future. Devfs is a dynamic file system which makes the static files in /dev obsolete. You mount the dev file system to a mount point (kind of like the way the proc file system works) and the kernel will create the files in /dev you need on-the-fly. So the waiting is for the next stable kernel to be released.