Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elphel-udev-rules
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
elphel-udev-rules
Commits
95919854
Commit
95919854
authored
Aug 12, 2016
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
autogeneration of mknod
parent
3f29764c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
89 additions
and
46 deletions
+89
-46
.gitignore
.gitignore
+6
-0
Makefile
Makefile
+11
-23
.project
eclipse_project_setup/.project
+17
-0
generate_mknods.py
generate_mknods.py
+55
-0
static.sh
static.sh
+0
-23
No files found.
.gitignore
0 → 100644
View file @
95919854
.project
.cproject
.pydevproject
.settings
*.directory
generated*
Makefile
View file @
95919854
TARGETDIR
=
$(DESTDIR)
/lib/udev/devices
X393_DEVICES
=
$(STAGING_DIR_HOST)
/usr/include-uapi/elphel/x393_devices.h
include
generated_include
generated_include
:
$(X393_DEVICES) generate_mknods.py
@
echo
"running make all"
@
echo
$(STAGING_DIR_HOST)
@
echo
$(X393_DEVICES)
./generate_mknods.py
$(X393_DEVICES)
>
generated_include
install
:
install
:
generated_include
install
-d
$(DESTDIR)
/etc/udev/rules.d
install
-m
644 90-elphel-automount.rules
$(DESTDIR)
/etc/udev/rules.d
install
-d
$(TARGETDIR)
mknod
-m
0622
$(TARGETDIR)/circbuf0
c
135
32
mknod
-m
0622
$(TARGETDIR)/circbuf1
c
135
33
mknod
-m
0622
$(TARGETDIR)/circbuf2
c
135
34
mknod
-m
0622
$(TARGETDIR)/circbuf3
c
135
35
mknod
-m
0622
$(TARGETDIR)/jpeghead0
c
135
48
mknod
-m
0622
$(TARGETDIR)/jpeghead1
c
135
49
mknod
-m
0622
$(TARGETDIR)/jpeghead2
c
135
50
mknod
-m
0622
$(TARGETDIR)/jpeghead3
c
135
51
mknod
-m
0622
$(TARGETDIR)/exif_exif0
c
125
16
mknod
-m
0622
$(TARGETDIR)/exif_exif1
c
125
17
mknod
-m
0622
$(TARGETDIR)/exif_exif2
c
125
18
mknod
-m
0622
$(TARGETDIR)/exif_exif3
c
125
19
mknod
-m
0622
$(TARGETDIR)/exif_meta0
c
125
32
mknod
-m
0622
$(TARGETDIR)/exif_meta1
c
125
33
mknod
-m
0622
$(TARGETDIR)/exif_meta2
c
125
34
mknod
-m
0622
$(TARGETDIR)/exif_meta3
c
125
35
mknod
-m
0622
$(TARGETDIR)/exif_template
c
125
2
mknod
-m
0622
$(TARGETDIR)/exif_metadir
c
125
3
@$(mknodes)
clean
:
rm
-f
generated_include
eclipse_project_setup/.project
0 → 100644
View file @
95919854
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>
elphel-udev-rules
</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>
org.python.pydev.PyDevBuilder
</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>
org.python.pydev.pythonNature
</nature>
</natures>
</projectDescription>
generate_mknods.py
0 → 100755
View file @
95919854
#!/usr/bin/env python
# encoding: utf-8
'''
# Copyright (C) 2016, Elphel.inc.
# Generate static device nodes from the header file with drivers/devices definitions
# This program is free software: 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 3 of the License, or
# (at your option) any later version.
#
# This program 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 program. If not, see <http://www.gnu.org/licenses/>.
@author: Andrey Filippov
@copyright: 2016 Elphel, Inc.
@license: GPLv3.0+
@contact: andrey@elphel.coml
@deffield updated: Updated
'''
from
__future__
import
division
from
__future__
import
print_function
#from __builtin__ import str
import
sys
import
re
__author__
=
"Andrey Filippov"
__copyright__
=
"Copyright 2015, Elphel, Inc."
__license__
=
"GPL"
__version__
=
"3.0+"
__maintainer__
=
"Andrey Filippov"
__email__
=
"andrey@elphel.com"
__status__
=
"Development"
def
process_header
():
print
(
"define mknodes ="
)
# files = []
pat
=
re
.
compile
(
r'#define\s+(\w+)\s+\(\s*"([^"]+)"\s*,\s*"([^"]+)"\s*,\s*(\w*)\s*,\s*(\w*)\s*,\s*"([^"]+)"\s*,\s*"([^"]+)"\s*\)(.*)'
)
f
=
open
(
sys
.
argv
[
1
],
"r"
)
line
=
f
.
readline
()
while
line
:
fs
=
pat
.
search
(
line
)
if
fs
:
print
(
"mknod -m
%
s $(TARGETDIR)/
%-20
s
%
s
%3
s
%3
s #
%
s"
%
(
fs
.
group
(
6
),
fs
.
group
(
2
),
fs
.
group
(
7
),
fs
.
group
(
4
),
fs
.
group
(
5
),
fs
.
group
(
8
)
.
strip
(
"
\t
/<*"
)))
# files.append(fs.group(2))
line
=
f
.
readline
()
# for f in files:
# print("chown root:root $(TARGETDIR)/%-20s"%(f))
print
(
"endef"
)
# mknod -m 0622 $(TARGETDIR)/circbuf0 c 135 32
if
__name__
==
"__main__"
:
process_header
()
static.sh
deleted
100755 → 0
View file @
3f29764c
#!/bin/sh
mknod
-m
0622
$1
/circbuf0 c 135 32
mknod
-m
0622
$1
/circbuf1 c 135 33
mknod
-m
0622
$1
/circbuf2 c 135 34
mknod
-m
0622
$1
/circbuf3 c 135 35
mknod
-m
0622
$1
/jpeghead0 c 135 48
mknod
-m
0622
$1
/jpeghead1 c 135 49
mknod
-m
0622
$1
/jpeghead2 c 135 50
mknod
-m
0622
$1
/jpeghead3 c 135 51
mknod
-m
0622
$1
/exif_exif0 c 125 16
mknod
-m
0622
$1
/exif_exif1 c 125 17
mknod
-m
0622
$1
/exif_exif2 c 125 18
mknod
-m
0622
$1
/exif_exif3 c 125 19
mknod
-m
0622
$1
/exif_meta0 c 125 32
mknod
-m
0622
$1
/exif_meta1 c 125 33
mknod
-m
0622
$1
/exif_meta2 c 125 34
mknod
-m
0622
$1
/exif_meta3 c 125 35
mknod
-m
0622
$1
/exif_template c 125 2
mknod
-m
0622
$1
/exif_metadir c 125 3
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment