/dev question

/dev it typically populated by the kernel, basically when hardware is found and a device driver is loaded for it, one or more entries are created in /dev, devd is related (man devd). /etc/devd has config files, /etc/devfs.conf and /etc/devd.conf are related, don't forget /usr/local/etc/devd for more config files.

No, you should not have to copy /dev to a new install.
 
/dev contains symbolic files to your hardwares. NO you dont need to copy them. They are being generated by kernel and removed by kernel. I dont think copying /dev files will affect anything on new system. Like copying /dev/da0a or /dev/mem to new system? Why to do something like that? Copying memory? maybe lol
 
make_dev stuff is usually called from within a device driver, devfs usually reacts to the creation of a device node and then applies rules. The most common operation is on a device node from devfs or devd is change permissions or group ownership.

It's a maze of twisty passages, all alike but is much better than the original "mknod" and static devices you used to do.
 
That seems to be specific to Linux-from-scratch. A modern Linux version has a similar devfs(5) construction as we do and has done so for many years.
 
It's interesting to see the difference with linux,
Those lines are necessary to create a working chroot environment since the udev software isn't built prior to entering the chroot. Otherwise you'll be missing all sorts of things in your /dev directory when you enter the chroot. The mount --bind lines for Linux are similar to using mount_nullfs(8) on FreeBSD, so similar lines might also be used on FreeBSD if you're not using a jail for whatever reason.

Aside: The LFS 6.1 book you linked hasn't been updated in 15+ years. Unless you have a need to rely on such an old version of the book, 10.1 and 10.1-systemd are the latest stable releases and should be preferred.
 
In the old days, /dev was just a directory, usually part of the root file system. The "files" in that directory were all device special files (which are a type of file system entry, as are real files, directories, soft links, and a few other bizarre things). And the system administrator had to manually create entries in there, using the mknod command. Which in turn required knowing the major/minor numbers for all possible devices. Obviously, this was tedious, error prone, and required expertise. It also has problems during installation on new hardware (what if the only physical console is connected via serial port /dev/ttyX0, but the root file system image was built for /dev/ttya0).

Fortunately, with automated device file systems, this is all a thing of the past.
 
  • Thanks
Reactions: mtu
Back
Top