Skip to content

Commit

Permalink
build(bootstrap): add dtoverlay=gpio-fan,gpiopin=22,temp=60000 to `…
Browse files Browse the repository at this point in the history
…/boot/firmware/config.txt` to make the fan run if CPU temperature passes 60℃ #64
  • Loading branch information
sassanh committed Apr 16, 2024
1 parent efeae6c commit 5f14178
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
## Version 0.12.7

- feat(notification): make the extra information screen scrollable
- build(bootstrap): add `dtoverlay=gpio-fan,gpiopin=22,temp=60000` to `/boot/config.txt`
to make the fan run if CPU temperature passes 60℃ #64

## Version 0.12.6

Expand Down
8 changes: 8 additions & 0 deletions ubo_app/system/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@ def enable_services() -> None:
)


def configure_fan() -> None:
"""Configure the behavior of the fan."""
with Path('/boot/config.txt').open('a') as config_file:
config_file.write('dtoverlay=gpio-fan,gpiopin=22,temp=60000\n')


def setup_polkit() -> None:
"""Create the polkit rules file."""
with Path('/etc/polkit-1/rules.d/50-ubo.rules').open('w') as file:
Expand Down Expand Up @@ -223,6 +229,8 @@ def bootstrap(*, with_docker: bool = False, for_packer: bool = False) -> None:
check=True,
)

configure_fan()

reload_daemon()
enable_services()

Expand Down
1 change: 1 addition & 0 deletions ubo_app/system/install_wm8960.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ cp wm8960-soundcard /usr/bin/
chmod -x wm8960-soundcard.service
cp wm8960-soundcard.service /lib/systemd/system/
systemctl enable wm8960-soundcard.service
#systemctl start wm8960-soundcard

cd ..
rm -rf WM8960-Audio-HAT
Expand Down

0 comments on commit 5f14178

Please sign in to comment.