xref: /netbsd-src/share/examples/emul/linux/etc/LINUX_MAKEDEV (revision 25666bcae7676639b3f4987741c5c917939825fc)
1*25666bcaSchristos#!/bin/sh -
2*25666bcaSchristos#	$NetBSD: LINUX_MAKEDEV,v 1.1 2006/09/22 15:33:08 christos Exp $
3*25666bcaSchristos#
4*25666bcaSchristos# Copyright (c) 1995 Christos Zoulas
5*25666bcaSchristos# All rights reserved.
6*25666bcaSchristos#
7*25666bcaSchristos# Redistribution and use in source and binary forms, with or without
8*25666bcaSchristos# modification, are permitted provided that the following conditions
9*25666bcaSchristos# are met:
10*25666bcaSchristos# 1. Redistributions of source code must retain the above copyright
11*25666bcaSchristos#    notice, this list of conditions and the following disclaimer.
12*25666bcaSchristos# 2. Redistributions in binary form must reproduce the above copyright
13*25666bcaSchristos#    notice, this list of conditions and the following disclaimer in the
14*25666bcaSchristos#    documentation and/or other materials provided with the distribution.
15*25666bcaSchristos# 3. The names of the authors may not be used to endorse or promote products
16*25666bcaSchristos#    derived from this software without specific prior written permission
17*25666bcaSchristos#
18*25666bcaSchristos# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19*25666bcaSchristos# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20*25666bcaSchristos# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21*25666bcaSchristos# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22*25666bcaSchristos# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23*25666bcaSchristos# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24*25666bcaSchristos# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25*25666bcaSchristos# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26*25666bcaSchristos# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27*25666bcaSchristos# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28*25666bcaSchristos#
29*25666bcaSchristos# Device "make" file.  Valid arguments:
30*25666bcaSchristos#	all	everything
31*25666bcaSchristos# Terminal devices:
32*25666bcaSchristos#	ptmx		pty master multiplexer
33*25666bcaSchristos#
34*25666bcaSchristosPATH=/sbin:/bin/:/usr/bin:/usr/sbin:/usr/etc
35*25666bcaSchristosumask 77
36*25666bcaSchristos
37*25666bcaSchristosfor i
38*25666bcaSchristosdo
39*25666bcaSchristos
40*25666bcaSchristoscase $i in
41*25666bcaSchristos
42*25666bcaSchristosall)
43*25666bcaSchristos	sh LINUX_MAKEDEV ptmx
44*25666bcaSchristos	;;
45*25666bcaSchristos
46*25666bcaSchristosptmx)
47*25666bcaSchristos	rm -f $i
48*25666bcaSchristos	mknod $i		c 165 2
49*25666bcaSchristos	chown root.wheel $i
50*25666bcaSchristos	chmod 666 $i
51*25666bcaSchristos	;;
52*25666bcaSchristos
53*25666bcaSchristos*)
54*25666bcaSchristos	echo $i: unknown device 2>&1
55*25666bcaSchristos	exit 1
56*25666bcaSchristos	;;
57*25666bcaSchristosesac
58*25666bcaSchristosdone
59