devfs support code(was Re: kernel dev patches)
Ben Collins wrote:
> If you are really interesed in writing some code, I'de like to see a
> smallish library that interprets things in /dev of a devfs mounted
> filesystem. query things like drives, partitions, devices, etc.. Devfs is
> definitely going to be the way to go in woody.
Yea, ill have a go at this, it shouldnt be too hard, devfs lays things
out pretty well by the looks of it.
I think there are a couple of basic goals of early hardware detection
which could use /dev and /proc or other code.
1) Memmory detection
- busybox can check available memory, or from /proc/meminfo.
2) Identifying local block devices
- Identifying local drives/partitions, including removable drives, md
drives, ramdisks, ramfs etc.
3) Gather drive/partition info.
- Get info from /proc/filesystems to enable us test and identify the
filesystems needed to access the block devices identified in 2)
- Find available space on each device
- Determine if a drive/partition is read-only or read-write
4) Classify posible use of each drive/parition (e.g. cdrom would be a
source not a target)
- possible source of deb archive
- possible target to install to.
5) Network connections
- This would commonly require user input at some stage, so i guess its
best done seperatly or at a later stage, could try bootp/dhcp here
We could consider using libdetect or kudzu, but i think these two might
be overkill at this early stage. We can initially only concern ourselves
with where we get the rest of the installer from and where we are going
to put it. This should make things more flexible.
(i assume we want something simple for early on)