35 Commits

Author SHA1 Message Date
Michael Stapelberg 9c06b898c1 status: display running EEPROM bootloader build-timestamp
This is more user-friendly compared to the raw SHA256 checksums.
Those can still be obtained by querying the status via JSON.

fixes https://github.com/gokrazy/gokrazy/issues/343
2025-11-20 08:13:35 +01:00
Michael Stapelberg 63b2aa82de fix displaying firmware EEPROM version on Pi 5
The Pi 5 firmware does not rename recovery.bin anymore,
so the check we did to figure out if the updated succeeded
only works on the Pi 4.

related to https://github.com/gokrazy/gokrazy/issues/332
2025-11-16 09:05:06 +01:00
Michael Stapelberg 23c47dcb0c do not read any password file when /etc/gokr-pw.txt is missing
See the comment for rationale. This makes it harder to take over a
gokrazy instance when having write access to /perm.

Whether the password should be read from /perm at all is another
valid question to ask. I am not sure anyone has such a setup?
If you are reading this and you do, please e-mail me.
2025-02-23 09:57:27 +01:00
Michael Stapelberg d4899e240e gokrazy: introduce WaitFor("clock") as replacement for WaitForClock
related to https://github.com/gokrazy/gokrazy/issues/168
2025-02-22 11:04:27 +01:00
Michael Stapelberg 4015d44102 website: re-generate for previous commit 2024-09-09 18:01:43 +02:00
Brad Fitzpatrick 6826c723ab Only permit HTTP access over unix socket when password unset (#268)
Updates gokrazy/gokrazy#265

Signed-off-by: Brad Fitzpatrick <brad@danga.com>
2024-06-29 16:20:36 +02:00
Michael Stapelberg ee9d56c794 wire up SIGTERM, SIGUSR1, SIGUSR2 to reboot, halt, poweroff
related to https://github.com/gokrazy/gokrazy/issues/223
2024-06-04 19:30:53 +02:00
Michael Stapelberg cda8d13b04 boot: automatically load pwm_fan module for Pi 5
related to https://github.com/gokrazy/gokrazy/issues/223
2024-06-03 21:15:30 +02:00
Darshil Chanpura a764954142 fix waitforclock condition when creating a new service (#198) 2023-04-17 17:18:44 +02:00
Michael Stapelberg 7e14fb215c fix panic by initializing service in NewService, not supervise()
fixes https://github.com/gokrazy/gokrazy/issues/189
2023-04-03 09:00:37 +02:00
Michael Stapelberg 23115bd89a listen for power button events and power off
fixes #142
2023-03-07 20:43:05 +01:00
Michael Stapelberg c4490d7822 /update/features: include EEPROM version in JSON requests
This handler (despite being named just /features) should supply all the
information that the updater package needs in a single request/response.
2023-02-15 18:28:26 +01:00
Anmol Khirbat 7a70646dfe serial console: enable job control (#161) 2023-01-09 18:27:43 +01:00
Michael Stapelberg 1c3bb23654 create /dev/ttyAMA0 compatibility symlink
related to https://github.com/gokrazy/gokrazy/issues/49
2022-03-19 10:53:08 +01:00
Michael Stapelberg a4240967b6 create /dev/serial0 symlink
On current kernels:

/tmp/breakglass3180421852 # ls -l /dev/serial0
lrwxrwxrwx    1 0        0               12 Jan  1  1970 /dev/serial0 -> /dev/ttyAMA0

On future kernels when Bluetooth is enabled:

/tmp/breakglass1740469836 # ls -l /dev/serial0
lrwxrwxrwx    1 0        0               10 Jan  1  1970 /dev/serial0 -> /dev/ttyS0

related to https://github.com/gokrazy/gokrazy/issues/49
2022-03-19 10:26:19 +01:00
Darshil Chanpura ca0fa41749 supervise: added optional configuration to wait for clock (#105)
gokrazy.go: added a NewWaitForClockService() which enables waitForClock configuration
supervise.go: added waitForClock boolean in service{} and changed the behaviour from environment variable to flag

Signed-off-by: Darshil Chanpura <darshil@thatwebsite.xyz>
2022-01-13 09:19:25 +01:00
Anup Chenthamarakshan e42cbd86b3 update: support device-specific update handlers (#102)
Useful to update devices which expect blobs at fixed locations
2022-01-11 20:29:31 +01:00
Michael Stapelberg 3f026adfcb add SuperviseServices entry point, allow creating stopped services 2021-12-18 19:47:43 +01:00
Michael Stapelberg 0e70ad8c1d transparently add service when diverting an unknown service
This allows running “gok run” for prototyping, even for software you have not
included in the currently running gokrazy image.

fixes https://github.com/gokrazy/gokrazy/issues/88
2021-12-18 19:09:17 +01:00
Michael Stapelberg ce299fc4a5 fix: set up signal handler before supervising services
See the comment for rationale.
2021-08-29 16:29:45 +02:00
Michael Stapelberg e6c441f631 switch to inactive root partition if gokrazy.try_boot_inactive=1
related to https://github.com/gokrazy/gokrazy/issues/75
2021-01-30 18:53:24 +01:00
andig 067330db55 Honor https-port when redirecting (#79) 2021-01-08 09:10:39 +01:00
andig 5fc5d0ab5d Load runtime port configuration from http(s)-port file (#77) 2021-01-06 22:27:29 +01:00
Matt Layher caded46676 gokrazy: import and use github.com/mdlayher/watchdog (#72)
Signed-off-by: Matt Layher <mdlayher@gmail.com>
2020-10-06 17:11:15 +02:00
Janis Streib 17bec15432 Added proof of concept TLS support (#7) (#53)
If there is a certificate and key in /etc/ssl/gokrazy-web.{pem,key.pem},
the webinterface will serve and redirect to https.
2020-05-31 21:58:03 +02:00
Michael Stapelberg 727ba0f371 serial console: also try /tmp/serial-busybox/ash
This path is provided by the github.com/gokrazy/serial-busybox package.

related to https://github.com/gokrazy/gokrazy/issues/54
2020-05-21 23:12:15 +02:00
Michael Stapelberg 6beb2e16aa implement remote syslog as a platform feature
To configure, run the following command in an interactive shell (e.g. via
breakglass, or when mounting the permanent partition of the SD card on the
host):

  mkdir /perm/remote_syslog
  echo 10.0.0.76:514 > /perm/remote_syslog/target

I recommend using a (static) IP address for increased reliability, so that
remote syslog works even when DNS does not.

fixes #50
2019-12-10 22:15:42 +01:00
Michael Stapelberg 107f6fe098 start /perm/sh if it exists upon any byte on the serial console
This allows debugging when the network is down.
2019-02-19 07:46:07 +01:00
Michael Stapelberg 63803ab95e update listeners when netlink reports an address change
related to issue #21
2018-11-01 18:41:57 +01:00
Michael Stapelberg 4a126f13af init+dhcp changes for Squashfs root file systems
We can do away with a bunch of hacks now, but we’ll keep them around for a
little while to make updates easier (i.e. to boot with old and new gokr-packer
versions, just in case people don’t update both at the same time).
2018-06-21 23:21:51 +02:00
Michael Stapelberg 238bbfa55e init: update listeners when pressing <ENTER> on the serial console
This is useful when the network doesn’t come up correctly: you can connect a
network cable between your computer and the gokrazy machine, press <ENTER> on
the serial console and connect to gokrazy via its IPv6 link-local address (to
find the address, use ping6 ff02::1%eth0).
2018-06-12 22:22:47 +02:00
Tobias Klauser ffa8ce0e42 use WDIOC_KEEPALIVE from golang.org/x/sys/unix (#35)
...now that it was added there.
2017-10-28 12:55:27 +02:00
Michael Stapelberg 2e60d5b8c8 ping hardware watchdog every 1s
In case gokrazy gets stuck for whichever reason, the hardware watchdog will
reset the Raspberry Pi 3.
2017-10-21 20:05:26 +02:00
Michael Stapelberg 3999a60a05 WaitForClock: give up after 1 year, not 1 minute
related to issue #21
2017-03-25 20:47:47 +01:00
Michael Stapelberg 38af7fd18d Initial commit 2017-03-04 11:22:48 +01:00