File: genrommkdev

package info (click to toggle)
genromfs 0.5.1-3.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 108 kB
  • ctags: 84
  • sloc: ansic: 636; makefile: 66; sh: 18
file content (22 lines) | stat: -rwxr-xr-x 415 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

# this is a sample device list file converter

# $ cat devices.lst
# /dev/hda1 b 3 1
# /dev/tty1 c 4 1
# $ genrommkdev <devices.lst
# touch dev/@hda1,b,3,1
# touch dev/@tty1,c,4,1
# genrommkdev <devices.lst|sh

while read a; do
  set $a
  node=$1
  type=$2
  major=$3
  minor=$4
  node=`echo $node|sed 'sX^/XXg'`
  node=`echo $node|sed 'sX/\([^/]\+\)X/@\1Xg'`
  echo touch $node,$type,$major,$minor
done