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
bd952e0a
Commit
bd952e0a
authored
Aug 12, 2016
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor cleanup
parent
d9a10c29
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
Makefile
Makefile
+1
-0
generate_mknods.py
generate_mknods.py
+10
-7
No files found.
Makefile
View file @
bd952e0a
...
...
@@ -9,5 +9,6 @@ install:generated_include
install
-m
644 90-elphel-automount.rules
$(DESTDIR)
/etc/udev/rules.d
install
-d
$(TARGETDIR)
@
$(mknodes)
clean
:
rm
-f
generated_include
generate_mknods.py
View file @
bd952e0a
...
...
@@ -35,21 +35,24 @@ __maintainer__ = "Andrey Filippov"
__email__
=
"andrey@elphel.com"
__status__
=
"Development"
def
process_header
():
print
(
"# --- This is an auto-generated file, see
%
s ---"
%
(
sys
.
argv
[
0
]))
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*\)(.*)'
)
""" Example of a string to match:
#define DEV393_I2C_ENABLE ("xi2cenable", "fpga_xi2c", 134, 7, "0666", "c") ///< enable(/protect)...
groups: 1 2 3 4 5 6 7 8
"""
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))
comment
=
fs
.
group
(
8
)
.
strip
(
"
\t
/<*"
)
if
comment
:
comment
=
" # "
+
comment
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
),
comment
))
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
()
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