Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pmbootstrap
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
postmarketOS
pmbootstrap
Commits
57b45a47
Commit
57b45a47
authored
7 years ago
by
Alexander
Committed by
Oliver Smith
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add a check for binfmt_misc (#1236)
Closes
#1223
.
parent
886d1962
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pmb/chroot/binfmt.py
+2
-0
2 additions, 0 deletions
pmb/chroot/binfmt.py
pmb/helpers/other.py
+17
-0
17 additions, 0 deletions
pmb/helpers/other.py
with
19 additions
and
0 deletions
pmb/chroot/binfmt.py
+
2
−
0
View file @
57b45a47
...
...
@@ -20,6 +20,7 @@ import os
import
logging
import
pmb.helpers.run
import
pmb.helpers.other
import
pmb.parse
import
pmb.parse.arch
...
...
@@ -35,6 +36,7 @@ def register(args, arch):
arch_debian
=
pmb
.
parse
.
arch
.
alpine_to_debian
(
arch
)
if
is_registered
(
arch_debian
):
return
pmb
.
helpers
.
other
.
check_binfmt_misc
(
args
)
pmb
.
chroot
.
apk
.
install
(
args
,
[
"
qemu-user-static-repack
"
,
"
qemu-user-static-repack-binfmt
"
])
info
=
pmb
.
parse
.
binfmt_info
(
args
,
arch_debian
)
...
...
This diff is collapsed.
Click to expand it.
pmb/helpers/other.py
+
17
−
0
View file @
57b45a47
...
...
@@ -61,6 +61,23 @@ def check_grsec(args):
"
more details: <
"
+
link
+
"
>
"
)
def
check_binfmt_misc
(
args
):
"""
Check if the
'
binfmt_misc
'
module is loaded by checking, if
/proc/sys/fs/binfmt_misc/ exists. If it exists, then do nothing.
Otherwise, raise an exception pointing to user to the Wiki.
"""
path
=
"
/proc/sys/fs/binfmt_misc/
"
if
os
.
path
.
exists
(
path
):
return
link
=
"
https://postmarketos.org/binfmt_misc
"
raise
RuntimeError
(
"
It appears that your system has not loaded the
"
"
module
'
binfmt_misc
'
. This is required to run
"
"
foreign architecture programs with QEMU (eg.
"
"
armhf on x86_64):
\n
See: <
"
+
link
+
"
>
"
)
def
migrate_success
(
args
):
logging
.
info
(
"
Migration done
"
)
with
open
(
args
.
work
+
"
/version
"
,
"
w
"
)
as
handle
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment