1
0
mirror of https://github.com/SerenityOS/serenity synced 2024-07-09 12:00:49 +00:00

Ports: Add bind mount automatically for Quake3

We need a `wxallowed` bind mount for the `ioquake3` binary to be able to
compile and run its executable scripts in memory. Instead of instructing
the user how to do so in `/etc/fstab`, we can now use the fancy
`/etc/fstab.d` facility :^)
This commit is contained in:
Jelle Raaijmakers 2023-02-01 21:38:44 +01:00 committed by Andreas Kling
parent 69b94e4235
commit dcf33f9b8f

View File

@ -12,23 +12,28 @@ launcher_category="Games"
launcher_command=/usr/local/games/quake3/ioquake3
icon_file="misc/quake3.png"
install_dir='/usr/local/games/quake3'
install() {
run make COPYDIR=${SERENITY_INSTALL_ROOT}/usr/local/games/quake3/ copyfiles
run make COPYDIR=${SERENITY_INSTALL_ROOT}${install_dir}/ copyfiles
}
post_install() {
# Let's create a more Serenity friendly `autoexec.cfg` file :^)
cat <<- 'EOF' > ${SERENITY_INSTALL_ROOT}/usr/local/games/quake3/baseq3/autoexec.cfg
# Allow ioquake3 to use anonymous executable memory
bin_path="${install_dir}/ioquake3"
mkdir -p "${SERENITY_INSTALL_ROOT}/etc/fstab.d"
echo "${bin_path} ${bin_path} bind bind,nodev,nosuid,wxallowed" > "${SERENITY_INSTALL_ROOT}/etc/fstab.d/${port}"
# Let's create a more Serenity friendly `autoexec.cfg` file :^)
cat <<- 'EOF' > ${SERENITY_INSTALL_ROOT}${install_dir}/baseq3/autoexec.cfg
set cl_renderer "opengl1"
set r_fullscreen "0"
set cg_drawfps "1"
EOF
echo ""
echo ""
echo "==== Post installation instructions ===="
echo "Please remember to install baseq3 from your Quake3 install"
echo "into /usr/local/games/quake3/"
echo "Don't forget to add the following to Base/etc/fstab/:"
echo "/usr/local/games/quake3 /usr/local/games/quake3 bind bind,nodev,nosuid,wxallowed"
echo
echo
echo '==== Post installation instructions ===='
echo 'Please remember to install baseq3 from your Quake3 install'
echo "into ${install_dir}/"
}