status: use partuuid-based path in mkfs instruction

fixes https://github.com/gokrazy/gokrazy/issues/12
This commit is contained in:
Michael Stapelberg 2020-05-30 18:47:48 +02:00
parent b93a58e5c8
commit 2398e37f70
4 changed files with 11 additions and 1 deletions

View File

@ -64,7 +64,13 @@ unaccounted
<h2>storage</h2>
{{ if eq .PermAvail 0 }}
{{ if ne .PARTUUID "" }}
No permanent storage mounted. To create a filesystem for permanent storage, plug the SD card into a Linux computer and use <code>mkfs.ext4 /dev/disk/by-partuuid/{{ .PARTUUID }}-04</code>.
{{ else }}
No permanent storage mounted. To create a filesystem for permanent storage, plug the SD card into a Linux computer and, if your SD card is <code>/dev/sdb</code>, use <code>mkfs.ext4 /dev/sdb4</code>.
{{ end }}
{{ else }}
<strong>{{ .PermDev }}</strong>: {{ gigabytes .PermTotal }} total, {{ gigabytes .PermUsed }} used, {{ gigabytes .PermAvail }} avail<br>
{{ end }}

2
go.mod
View File

@ -14,3 +14,5 @@ require (
golang.org/x/sys v0.0.0-20200406155108-e3b113bbe6a4
rsc.io/goversion v1.2.0
)
replace github.com/gokrazy/internal => /home/stream/gohack/github.com/gokrazy/internal

File diff suppressed because one or more lines are too long

View File

@ -231,6 +231,7 @@ func initStatus(services []*service) {
Meminfo map[string]int64
Hostname string
Model string
PARTUUID string
}{
Services: services,
PermDev: rootdev.Partition(rootdev.Perm),
@ -243,6 +244,7 @@ func initStatus(services []*service) {
Meminfo: parseMeminfo(),
Hostname: hostname,
Model: model,
PARTUUID: rootdev.PARTUUID(),
}); err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return