Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kernel-hardening-checker
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fact-depend
kernel-hardening-checker
Commits
b7c4e0c7
Commit
b7c4e0c7
authored
5 years ago
by
Jörg Thalheim
Committed by
Alexander Popov
5 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add script to download linux kernel configs from nix
parent
953f4621
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
get-nix-kconfig.py
contrib/get-nix-kconfig.py
+29
-0
No files found.
contrib/get-nix-kconfig.py
0 → 100644
View file @
b7c4e0c7
#!/usr/bin/env python
import
json
import
os
import
shutil
import
subprocess
import
sys
from
tempfile
import
TemporaryDirectory
def
main
()
->
None
:
proc
=
subprocess
.
run
(
[
"nix"
,
"search"
,
"-u"
,
"--json"
,
"^nixpkgs.linux_"
],
capture_output
=
True
)
data
=
json
.
loads
(
proc
.
stdout
)
with
TemporaryDirectory
()
as
temp
:
for
pkg
in
data
.
keys
():
symlink
=
os
.
path
.
join
(
temp
,
pkg
)
res
=
subprocess
.
run
([
"nix"
,
"build"
,
f
"{pkg}.configfile"
,
"-o"
,
symlink
])
if
res
.
returncode
!=
0
:
print
(
f
"failed to get configuration for {pkg}"
,
file
=
sys
.
stderr
)
continue
name
=
f
"{pkg.replace('.', '-')}-config"
with
open
(
name
,
"w"
)
as
dst
,
open
(
symlink
)
as
src
:
shutil
.
copyfileobj
(
src
,
dst
)
if
__name__
==
"__main__"
:
main
()
This diff is collapsed.
Click to expand it.
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