]> git.ipfire.org Git - people/ms/ipfire-3.x.git/commitdiff
MAKEDEV: New package.
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 10 Nov 2011 22:30:01 +0000 (23:30 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 10 Nov 2011 22:30:01 +0000 (23:30 +0100)
MAKEDEV/MAKEDEV.nm [new file with mode: 0644]
MAKEDEV/makedev.d.5 [new file with mode: 0644]

diff --git a/MAKEDEV/MAKEDEV.nm b/MAKEDEV/MAKEDEV.nm
new file mode 100644 (file)
index 0000000..7d82cab
--- /dev/null
@@ -0,0 +1,63 @@
+###############################################################################
+# IPFire.org    - An Open Source Firewall Solution                            #
+# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
+###############################################################################
+
+name       = MAKEDEV
+version    = 3.24
+release    = 1
+
+groups     = System/Base
+url        = 
+license    = GPLv2
+summary    = A program used for creating device files in /dev.
+
+description
+       This package contains the MAKEDEV program, which makes it easier to create
+       and maintain the files in the /dev directory.  /dev directory files
+       correspond to a particular device supported by Linux (serial or printer
+       ports, scanners, sound cards, tape drives, CD-ROM drives, hard drives,
+       etc.) and interface with the drivers in the kernel.
+
+       You should install the MAKEDEV package because the MAKEDEV utility makes
+       it easy to manage the /dev directory device files.
+end
+
+sources    = %{thisapp}-1.tar.gz
+
+build
+       requires
+               libselinux-devel
+       end
+
+       make_build_targets += OPTFLAGS="%{CFLAGS}" SELINUX=1
+       make_install_targets += devdir=/dev makedevdir=/sbin
+
+       install_cmds
+               rm -f %{BUILDROOT}/dev/MAKEDEV
+               mkdir -pv %{BUILDROOT}/usr/share/man/man5
+               install -m 644 -p %{DIR_SOURCE}/makedev.d.5 \
+                       %{BUILDROOT}/usr/share/man/man5
+               mkdir -pv %{BUILDROOT}/lib/udev/devices
+               ln -svf ../../../sbin/MAKEDEV \
+                       %{BUILDROOT}/lib/udev/devices/MAKEDEV
+       end
+end
+
+packages
+       package %{name}
+               groups += Base
+
+               prerequires = shadow-utils
+               requires += udev
+
+               script prein
+                       # Add the floopy group and the vcsa user.
+                       getent group floppy >/dev/null || groupadd -g 19 -r -f floppy
+                       getent group vcsa >/dev/null || groupadd -g 69 -r -f vcsa
+                       getent passwd vcsa >/dev/null || \
+                               useradd -r -g vcsa -d /dev -s /sbin/nologin -u 69 \
+                               -c "virtual console memory owner" vcsa 2>/dev/null
+               end
+       end
+end
diff --git a/MAKEDEV/makedev.d.5 b/MAKEDEV/makedev.d.5
new file mode 100644 (file)
index 0000000..290334c
--- /dev/null
@@ -0,0 +1,180 @@
+.\" Copyright (c) 2002 Thierry Vignaud <tvignaud@mandrakesoft.com>
+.\" Copyright (c) 2010 Hans de Goede <hdegoede@redhat.com>
+.\"
+.\" This is free documentation; you can redistribute it and/or
+.\" modify it under the terms of the GNU General Public License as
+.\" published by the Free Software Foundation; either version 2 of
+.\" the License, or (at your option) any later version.
+.\"
+.\" The GNU General Public License's references to "object code"
+.\" and "executables" are to be interpreted as the output of any
+.\" document formatting or typesetting system, including
+.\" intermediate and printed output.
+.\"
+.\" This manual is distributed in the hope that it will be useful,
+.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
+.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+.\" GNU General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU General Public
+.\" License along with this manual; if not, write to the Free
+.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
+.\" USA.
+.\"
+.\"
+.TH makedev.d 5 "1 June 2010" "Red Hat Linux" "Linux System Administrator's Manual"
+.SH NAME
+makedev.d \- configuration files for devices creation through MAKEDEV
+.\".SH SYNOPSIS
+.SH DESCRIPTION
+The behavior of
+.B MAKEDEV
+is instrumented by the configuration files in
+.I /etc/makedev.d/
+directory. They're read and "executed" by
+.BR MAKEDEV(8)
+on post installation of the MAKEDEV package.
+.PP
+These configuration file consists of a set of lines.
+.PP
+All empty lines, and all text on a line after a '#', will be ignored.
+.PP
+The remaining lines should all conform to one of the following formats:
+.SH SYNTAX
+This is a description of the four basic legal directives.
+.TP
+.B =NAME expanded text
+this define a macro. eg: 
+.I =BURNER   660 root cdwriter
+will make 
+.B MAKEDEV
+expand
+.I $BURNER
+when encountered.
+.TP
+.B b mask owner group   major minor  minor_step dev_number root_name base
+this directive define some
+.I block
+(``b'') device(s) creation.  They will be owned by
+.I owner
+and
+.I group
+and will have the
+.I major
+and
+.I minor
+as major and minor numbers.
+.br
+The
+.I dev_number
+arguments define how many devices will be created. If 
+.I dev_number
+is different from 1, then
+.I dev_number
+devices will be created, their minor number being incremented by
+.I minor_step
+at each step.
+.br
+If only one device is created, it will be named \fIroot_name\fP.  Else,
+the devices will be named with regards to the following rules :
+.RS 7
+.IP \(bu
+If 
+.I root_name
+does not contains ``%d'', then ```\fI%d\fP'' is appended to its end.
+.IP \(bu
+If 
+.I base
+is not set, it is initialized to zero.
+.IP \(bu
+Then, at each step, the name of the device we have to created is obtained
+by incrementing
+.I base
+and replacing ``%d'' by \fI base\fP. This is equivament to these statements :
+.NF
+$base++; $file = sprintf($name, $base);
+.FI
+.\" If several devices have to be created and if 
+.RE
+.TP
+.B c mask owner group   major minor  minor_step dev_number root_name base
+is quite the same directive as the previous one, exept its purpose is
+.I character
+devices (``c'') creation.
+.TP
+.B l destination source
+will make
+.B makdev
+symlink
+.I source
+on \fIdestination\fP.
+.\" .TP
+.\" .B s mask owner group root_name
+.\" will make
+.\" .B makdev
+.\" creating a node like the \fBb\fP and the \fBc\fP directives, but as a regular
+.\" file with the sticky bit positionned.
+.SH CUSTOMIZATION
+Since there is currently no standardization in what names are used for
+system users and groups, it is possible that you may need to modify
+\fBMAKEDEV\fR's configuration files to reflect your site's settings.
+.SH EXAMPLES
+.RS
+.sp
+.nf
+.ne 7
+# /etc/makedev.d/test sample
+#
+
+# the following line create (```\fBc\fP'') the famous \fI/dev/null\fP entry
+# with 666 mask (file access permissions), with 1 as major and
+# 3 as minor
+c 666 root root         1   3  1  1 null
+
+
+# the following line define the STORAGE macro that specify a 660
+# mask for file permissions, root as owner and disk as group
+=STORAGE  660 root disk
+
+# the following line create 16 \fI/dev/hdaX\fP entries (/dev/hda0 to
+# /dev/hda15) with the permissions and ownership defined above,
+# and with 22 as major
+b $STORAGE             22   0  1 16 hda%d
+
+# this one link /dev/snd on alsa entry in procfs
+# (usually mounted in /proc)
+l snd ../proc/asound/dev
+.fi
+.sp
+.RE
+.PP
+.SH NOTES
+The name of the file may contain some ``\fI/\fP'' characters :
+.B makdev
+will create the necessary directories if the node to create must be
+in a sub directory.
+.br
+Comments must begin on first line character.
+.br
+Files are parsed one by one, after having been sorted by name in alphabetical order.
+.SH FILES
+The
+.IR /etc/makedev.d/*
+files contains instructions that instrument
+.B makdev
+to create the device files in /dev.  Especially,
+.IR /etc/makedev.d/00macros
+define most frequently used macros.
+.SH "SEE ALSO"
+Linux Allocated Devices
+.br
+It can be found in
+.IR /usr/share/doc/kernel-doc-<VERSION>/Documentation/devices.txt
+if the kernel-doc package is installed. <VERSION> is the version number
+of the installed kernel (eg: 2.6.32).
+.PP
+.BR MAKEDEV (8)
+.SH AUTHOR
+.RI "Thierry Vignaud <" tvignaud@mandrakesoft.com ">, 2002"
+.br
+.RI "Hans de Goede <" hdegoede@redhat.com ">, 2010"