MAKDEV script changes, drafts submit.

Michel Hermier michel.hermier at
Sat Feb 8 01:38:06 PST 2003

Here follow the changes that I think are necessary for the MAKEDEV script.
All the options names submited are (I think) quite well chosen and changes for 
improvement of any order are welcome.
If the changes are to numerous to be included to the LFS MAKEDEV script, and I 
get some positive feedback, I'll probably make a fork of the script.

I) Structural changes:
Reoganise the code in the swich to follow this:
    - options part
    - alias part
    - device creation part ( contains also devices specific aliases )

II) Oraginisation inside the described parts:

II-1 ) Parameters:
Device action parameters:
Used to 

--create [device_list]
This paramenter influence the MAKEDEV behaviour of the script. All the 
operation made to the devices listed are creations. This is the default 
behaviour for the script.
ex: MAKEDEV all
should create all the devices.

--delete [device_list]
This parameter switch is the complement of the --create parameter switch. All 
the listed devices are deleted instead of being created.
note: this parameter exist in the current version with a different 
ex: MAKEDEV all --delete scsi ide
should create all the devices and the remove the scsi devices and ide devices.

--test [device_list]
This test the presence of all the listed devices.
ex: MAKEDEV --test all
should test that all the devices are builded.

Device selection parameters:
For the devices that have a range of devices, this paramenters controls the 
bounds for the device creation.

--mindevnum number
This parameter should be mostly used for deletion to fix the minimal value of 
the device we want to select. The selection should be applied on devices with 
numerous number like hd[a-b]xx.
ex: MAKEDEV --delete --mindevnum 5 hda
should only remove the devices hdaxx where xx is greater or equal to 5

--maxdevnum number
This parameter should be mostly used for creation to fix the maximum value of 
the device we want to select. The selection should be applied on devices with 
numerous number like hd[a-b]xx.
ex: MAKEDEV --maxdevnum 5 hda
should only create the devices hdaxx where xx is less or equal to 5

II-2) The alias part:
This part should be ordered:
    - first by all the standard way of build the devices profile.
        ex: minmal, generic, all...

    - Useful alias.
        Some devices are available througth separated major number.
        This aliases should be used to group them.
        ex: hd could be an alias for the hd[a-d] familly of devices.

II-3) The device creation part:
This part should be orderer as in the linux/Documentation/devices.txt kernel 
file. This allow to follow more easily the changes that could occurs in the 

Paramenters switch for the group of the same major, could be named like this:
 - MAJ is the major number of the device.
 - [BC] is the type of device Block or Character.

Calling this parameter switch should create all the devices for the number 
selection (see min and max devnum).
This name could be also aliased, using one name remebering the one's that can 
be found in the devices.txt.

A more precice creation can be done using parameters switch:
 - MIN is the minor number of the device.
case 1:
      dev_1_C | memory_devices
            recursive call to dev_1_C_xx device creation
      dev_1_C_1 | memory_devices_mem
      dev_1_C_2 | memory_devices_kmem
      dev_1_C_10 | memory_devices_aio
      dev_1_C_xx (xx>10)-> fall in the default unknown parameter switch.

case 2:
     dev_1_B | ram_disk
            recursive call to dev_1_B_xx device creation
            get minor
            depending of the minor do the device creation

III) Architectures specific devices (Very Optional)
Some devices are specific to one architecture (ex: /dev/kdb wich is Spark 
only). This kind off devices should be enabled depending on the machine type.

Unsubscribe: send email to listar at
and put 'unsubscribe lfs-dev' in the subject header of the message

More information about the lfs-dev mailing list