makedev script - up to date?

r.floers at web.de r.floers at web.de
Tue Oct 17 10:26:11 PDT 2000


On 17-Oct-2000 r.floers at web.de wrote:
> Hi LFS-MAILINGLIST,
> 
> i've just installed my 2nd lfs-system (no problems this time),
> and i was not satisfied with the MAKEDEV-scipt.
> 
> does lfs still usr MAKEDEV-2.5 (i'm not up to date with lfs books and stuff)
> 
> anyway, i've written my own make_device_files script, 
> it's not intelligent or something like that, but it creates
> the needed device files and links (--> documentation of kernel 2.2.14)
> please have a look at it (i'm not sure if everything is ok, but my sys 
> works just fine with the devices created by my script) :-)
> 
> 


just forgot to actually attach the script :-%

well here it is:


___________________________________

# Begin devicefiles
# This srcipt creates devicefiles in /dev
# 
#
# To understand what is happening here read "devices.txt"
#
# "devices.txt" can usually be found in the kernel source tree
# --> /usr/src/linux/Documentation/devices.txt
#
# I have written this script for _my_ system. (kernel 2.2.14)
# You will need to modify it for _your_ system
#
# The mknod command
# e.g.  mknod /dev/null c 1 3
# this would create the devicefile /dev/null char major-1 minor-3
# device can only be char or block
# with major numbers from 0 to 255
# and minor numbers from 0 to 255 
#
#
#!/bin/sh

mkdir dev -p
cd dev

#block devices

#scsi-disk-a
mknod sda b 8 0
mknod sda1 b 8 1
mknod sda2 b 8 2
mknod sda3 b 8 3
mknod sda4 b 8 4
chown root.disk sda*
chmod 660 sda*

#scsi-cdrom-0
mknod scd0 b 11 0
chown root.disk scd0
chmod 660 scd0

#floppy-drive-0
mknod fd0 b 2 0
mknod fd0u1440 b 2 28
mknod fd0u1722 b 2 60
chown root.floppy fd0*
chmod 660 fd0*

#I've got one scsi-disk and one scsi-cdrom, so this is enough


#Char devices

#Memory 
mknod mem c 1 1
mknod kmem c 1 2 
mknod null c 1 3
mknod port c 1 4
mknod zero c 1 5
mknod full c 1 7
mknod random c 1 8
chown root.kmem mem kmem port
chown root.sys full null zero random
chmod 660 mem kmem port random
chmod 666 full zero null

#tty 
for i in 0 1 2 3 4 5 6 7 8 9 10 11 12; do mknod tty$i c 4 $i; done
chown root.tty tty*
chmod 666 tty*

#serial ports
mknod ttyS0 c 4 64
mknod ttyS1 c 4 65
chown root.uucp ttyS*
chmod 666 ttyS*

#alternate ttys
mknod tty c 5 0
mknod console c 5 1
mknod ptmx c 5 2
chown root.tty tty console ptmx
chmod 666 tty ptmx
chmod 622 console

#parallel printer
mknod lp0 c 6 0
mknod lp1 c 6 1
chown root.sys lp*
chmod 666 lp*

#virtual console capture devices
mknod vcs c 7 0
for i in 0 1 2 3 4 5 6 7 8 9 10 11 12; do mknod vcs$i c 7 $i; done
mknod vcsa c 7 128 
for i in 0 1 2 3 4 5 6 7 8 9 10 11 12; do mknod vcsa$i c 7 $i; done
chown root.sys vcs*
chmod 660 vcs*

#misc
mknod psaux c 10 1
chown root.sys psaux
chmod 666 psaux

#links
ln -s ../proc/self/fd fd
ln -s fd/0 stdin
ln -s fd/1 stdou
ln -s fd/2 stderr
ln -s ../proc/kcore core
ln -s psaux mouse
ln -s sda3 swap
ln -s sda1 root
ln -s ttyS1 modem

#pts directory
mkdir pts
chown root.tty pts
chmod 777 pts

#note: i do not use ptyp# and ttyp# but
#ptmx and pts/ - using ptmx and pts/ is the new-UNIX98/SystemV-style :-)



#End make_device_files
exit 0



________________________________________


maybe it could help some newbie.


cu

RF


-- 
Unsubscribe: send email to lfs-discuss-request at linuxfromscratch.org
and put unsubscribe in the subject header of the message




More information about the lfs-dev mailing list