mirror of
https://github.com/FEX-Emu/FEX.git
synced 2024-12-17 02:47:48 +00:00
84379b5fdf
Check for qemu and box binfmt_misc file conflicts before the `binfmt_misc` install command. This ensures if you're building from source that you won't inadvertently install conflicting binfmt_misc files, breaking program execution.
35 lines
845 B
Bash
Executable File
35 lines
845 B
Bash
Executable File
#!/bin/sh
|
|
for binfmt in "$@"
|
|
do
|
|
result=0
|
|
if command -v update-binfmts>/dev/null; then
|
|
update-binfmts --find "$binfmt" 1>&- 2>&-
|
|
if [ $? -eq 0 ]
|
|
then
|
|
# If we found the binfmt_misc file passed in then error
|
|
result=1
|
|
fi
|
|
fi
|
|
|
|
if [ $result -eq 0 ]
|
|
then
|
|
if [ -f "$binfmt" ]; then
|
|
# If the binfmt_misc file exists then error
|
|
result=1
|
|
fi
|
|
fi
|
|
|
|
if [ $result -eq 1 ]
|
|
then
|
|
echo "==============================================================="
|
|
echo "$binfmt binfmt file is installed!"
|
|
echo "This conflicts with FEX-Emu's binfmt_misc!"
|
|
echo "This will cause issues when running FEX-Emu through binfmt_misc"
|
|
echo "Not installing until you uninstall this binfmt_misc file!"
|
|
echo "==============================================================="
|
|
exit 1
|
|
fi
|
|
done
|
|
|
|
exit 0
|