News:

Registered a URL and setup a forum as the IPCam stuff really needed its own site vs my irregular blog posts about IPCam hacking at http://www.computersolutions.cn/blog

Author Topic: Making a default set of device nodes  (Read 6216 times)

  • No avatar
  • *****
June 11, 2011, 11:56:18 pm
I've made a small shell script to assist in creating the default set of device nodes and folders for a romfs.

May be of use to others.

To use, go to the dev folder you want to create the nodes and folders in, and run the script.


Code: [Select]
#!/bin/bash

#----
#To be run from the folder that you want to create the dev nodes for your filesystem to be created in.
#Lawrence@openipcam.com
#June 2011
#-----

pause()
{
 OLDCONFIG=`stty -g`
stty -icanon -echo min 1 time 0
dd count=1 2>/dev/null
stty $OLDCONFIG
}

genlp()
{
declare -i j=0

while [ $j != 10 ]
do
        mknod --m=777 lp$j c 18 $j
        j=$j+1
done

}

echo This will create a default set of device nodes for a romfs
echo To use copy into your romfs dev folder, and run.
echo eg
echo
echo cd myromfsdir/dev
echo ./genfs_dev.sh
echo
echo Press any key to begin creating the nodes or control C to quit.
pause


mknod console c 5 1
mknod display c 196 1
mknod dsp0  c 14 3
mknod dsp1 c 14 19
mknod dsp2  c 14 35
ln -s dsp1 dsp
mknod fb0        c 29 0
mknod hda    b 3 0
mknod hda1 b 3 1
mknod hda2 b 3 2
mknod hdb b 3 64
mknod i2c0 c 89 0
mknod i2c1 c 89 1
mknod key c 191 1
mknod keypad c 192 0
mknod lp0 c 6 0
mknod mixer0 c 14 0
mknod mixer1 c 14 16
mknod mixer2 c 14 32
ln -s mixer1 mixer
mknod mouse c 10 1
mknod mtd0 c 90 0
mknod mtd1 c 90 2
mknod mtdblock0 b 30 0
mknod mtdblock1 b 30 1
mknod nftla b 93 0
mknod nftla1 b 93 1
mknod null c 1 3
mknod ppp c 108 0
mknod ppp1 c 108 1
mknod ptmx c 5 2
mkdir pts
mknod ptyp0 c 2 0
mknod ptyp1 c 2 1
mknod ptyp2 c 2 2
mknod ptyp3 c 2 3
mknod ptyp4 c 2 4
mknod ptyp5 c 2 5
mknod ptyp6 c 2 6
mknod ptyp7 c 2 7
mknod ptyp8 c 2 8
mknod ptyp9 c 2 9
mknod ptz0 c 200 0
mknod rom0 b 31 0
mknod rom1 b 31 1
mknod rom2 b 31 2
mknod sda b 8 0
mknod sda1 b 8 1
mknod sda2 b 8 2
mknod sdb b 8 16
mknod sdb1 b 8 17
mknod sdb2 b 8 18
mknod smartcard0 c 124 0
mknod smartcard1 c 124 1
mknod tty c 5 0
mknod tty1 c 4 1
mknod ttyp0 c 3 0
mknod ttyp1 c 3 1
mknod ttyp2 c 3 2
mknod ttyp3 c 3 3
mknod ttyp4 c 3 4
mknod ttyp5 c 3 5
mknod ttyp6 c 3 6
mknod ttyp7 c 3 7
mknod ttyp8 c 3 8
mknod ttyp9 c 3 9
mknod ttyS0 c 4 64
mknod ttyS1 c 4 65
mknod ttyS2 c 4 66
mknod ttyS3 c 4 67
mknod urandom c 1 9
mkdir usb
mknod usi c 231 0
mknod video0 c 81 0
mknod video1 c 81 1

#Create USB lp0-lp9
cd usb
genlp


cd ..