check_binfmt_misc: print more helpful error
Instead of letting the mount -t binfmt_misc … command fail, and simply telling the user that the command failed: rely on the following check that prints a better error message on error. If it fails at this point, the kernel option isn't enabled. Add two comments explaining why check=False is used in this function while at it. Reviewed-by: Luca Weiss <luca@z3ntu.xyz> Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230123064516.1607-1-ollieparanoid@postmarketos.org%3E
This commit is contained in:
parent
9975d373b0
commit
e8a2ab2e98
|
@ -54,9 +54,12 @@ def check_binfmt_misc(args):
|
|||
if os.path.exists(path):
|
||||
return
|
||||
|
||||
# check=False: this might be built-in instead of being a module
|
||||
pmb.helpers.run.root(args, ["modprobe", "binfmt_misc"], check=False)
|
||||
|
||||
# check=False: we check it below and print a more helpful message on error
|
||||
pmb.helpers.run.root(args, ["mount", "-t", "binfmt_misc", "none",
|
||||
"/proc/sys/fs/binfmt_misc"])
|
||||
"/proc/sys/fs/binfmt_misc"], check=False)
|
||||
|
||||
if not os.path.exists(path):
|
||||
link = "https://postmarketos.org/binfmt_misc"
|
||||
|
|
Loading…
Reference in New Issue