Skip to content

Instantly share code, notes, and snippets.

View simons-public's full-sized avatar

Chris Simons simons-public

View GitHub Profile
@simons-public
simons-public / conan.sh
Created July 21, 2023 07:12
Conan Exiles FreeBSD rc script
#!/bin/sh
#
# PROVIDE: conan
# REQUIRE: networking
# KEYWORD:
. /etc/rc.subr
name="conan"
@simons-public
simons-public / flatpak-pid.path
Last active February 16, 2024 17:26
Auto-maximize flatpaks launched on steam deck
# /home/deck/.config/systemd/user/flatpak-pid.path
#
# Enable with
# systemctl --user enable --now flatpak-pid.path
#
[Unit]
Description=Monitor for flatpak pids to maximize them in gamescope
[Path]
@simons-public
simons-public / bindmounts.service
Last active June 17, 2023 23:51
Steam Deck Services
# bindmounts.service
[Unit]
Description=Bind mount files over readonly steamos system
After=local-fs.target
Requires=home.mount -.mount
Before=multi-user.target
[Service]
Type=oneshot
@simons-public
simons-public / sd_squeeze.sh
Last active August 20, 2022 00:41
Squeeze Space on Steam Deck
# Proton leaves behind proton_dist.tar files that are not needed after extraction to ./dist
# Clear proton_dist.tar files
find /home/deck/.local/share/Steam/steamapps/common -name 'proton_dist.tar' -delete
# Logs are kept on the /home partition in /home/.steamos/offload/var/log
# Set max logsize to 10M
# Force reloading of journald configuration
# Force rotation and clear any archived logs over 10M
sed -i'' -e 's/^#SystemMaxUse=/SystemMaxUse=10M/' /etc/systemd/journald.conf
systemctl force-reload systemd-journald
@simons-public
simons-public / dedup-compatdata.service
Created August 13, 2022 04:31
SteamDeck compatdata deduplication
# /home/deck/.config/systemd/user/dedup-compatdata.service
[Unit]
Description=Use hardlink(1) to dedup Steam compatdata
[Service]
Type=oneshot
ExecStart=hardlink -v /home/deck/.steam/steam/steamapps/compatdata
[Install]
WantedBy=default.target
@simons-public
simons-public / remove-install-ff.sh
Created August 13, 2022 01:25
remove Install Firefox on Steam Deck
#!/bin/sh
sudo steamos-readonly disable
sudo rm /usr/share/applications/org.mozilla.firefox.desktop
sudo steamos-readonly enable
@simons-public
simons-public / toggle_rw.sh
Last active August 20, 2022 01:25
Steam Deck toggle rw/ro
#!/bin/sh
if btrfs property get -ts / ro | grep -q true; then
#sudo btrfs property set -ts / ro false
sudo steamos-readonly disable
echo "Filesystem set to read/write"
else
#sudo btrfs property set -ts / ro true
sudo steamos-readonly enable
echo "Filesystem set to read only"
@simons-public
simons-public / instructions.sh
Created August 11, 2022 22:02
FreeBSD 12.2-RELEASE Kavita Installation
# https://github.com/dotnet/runtime/blob/main/docs/workflow/requirements/freebsd-requirements.md#running-on-freebsd
# https://github.com/Thefrank/dotnet-freebsd-native-binaries/releases
# Create Jail (With allow_mlock=1 for dotnet)
iocage create -n Kavita -r 12.2-RELEASE ip4_addr="vnet0|10.1.0.44/8" defaultrouter=10.0.0.1 vnet=on allow_raw_sockets=1 boot=on allow_mlock=1
# Install required packages (lttng-ust is in release_2 for fbsd 12)
pkg install --yes libunwind icu libinotify lttng-ust krb5 openssl ncurses bash git npm-node14 node14
# note: had to build node14 from ports on release_2
# This rule is needed for basic functionality of the controller in Steam and keyboard/mouse emulation
SUBSYSTEM=="usb", ATTRS{idVendor}=="28de", MODE:="0666"
# This rule is necessary for gamepad emulation; make sure you replace 'pgriffais' with a group that the user that runs Steam belongs to
#KERNEL=="uinput", MODE:="0660", GROUP="steamcontroller", OPTIONS+="static_node=uinput"
KERNEL=="uinput", MODE="0660", GROUP="steamcontroller", OPTIONS+="static_node=uinput"
# DualShock 4 wired
SUBSYSTEM=="usb", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="05c4", MODE:="0666"
# DualShock 4 wireless adapter

WIP

Prerequisites

  • A Goke GK710x-based device(uname -r === 3.4.43-gk)
  • Ubuntu 18.04 as a build environment

Set up the toolchain

  • Install crosstool-ng
$ wget http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-1.24.0.tar.xz
$ tar xvf http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-1.24.0.tar.xz