diff --git a/assets/overview.tmpl b/assets/overview.tmpl index 299983a..422d271 100644 --- a/assets/overview.tmpl +++ b/assets/overview.tmpl @@ -66,7 +66,7 @@ unaccounted {{ if eq .PermAvail 0 }} 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 /dev/sdb, use mkfs.ext4 /dev/sdb4. {{ else }} -/dev/mmcblk0p4: {{ gigabytes .PermTotal }} total, {{ gigabytes .PermUsed }} used, {{ gigabytes .PermAvail }} avail
+{{ .PermDev }}: {{ gigabytes .PermTotal }} total, {{ gigabytes .PermUsed }} used, {{ gigabytes .PermAvail }} avail
{{ end }}

private network addresses

@@ -87,4 +87,4 @@ No permanent storage mounted. To create a filesystem for permanent storage, plug -{{ template "footer" . }} \ No newline at end of file +{{ template "footer" . }} diff --git a/internal/bundled/GENERATED_bundled.go b/internal/bundled/GENERATED_bundled.go index 49178f8..1d22f40 100644 --- a/internal/bundled/GENERATED_bundled.go +++ b/internal/bundled/GENERATED_bundled.go @@ -9,5 +9,5 @@ var assets = map[string][]byte{ } var assets_0 = []byte("\n\n{{ .Hostname }} — gokrazy\n\n\n\n\n \n\n
\n") var assets_1 = []byte("\n
\n\n\n\n\n") -var assets_2 = []byte("{{ template \"header\" . }}\n\n
\n
\n\n

services

\n\n\n\n\n\n\n\n{{ range $idx, $svc := .Services }}\n\n\n\n\n{{ end }}\n\n
pathlast log line
\n{{ $svc.Name }}\n{{ if restarting $svc.Started }}\nrestarting\n{{ end }}\n{{ if $svc.Stopped }}\nstopped\n{{ end }}\n\n{{ last $svc.Stdout.Lines $svc.Stderr.Lines }}\n
\n
\n
\n

memory

\n{{ megabytes (index .Meminfo \"MemTotal\") }} total, {{ megabytes (index .Meminfo \"MemAvailable\") }} available
\nresident set size (RSS) by service:\n
\n\n{{ with $rss := initRss }}\n
\n\ninit\n
\n{{ end }}\n\n{{ range $idx, $svc := .Services }}\n{{ with $rss := $svc.RSS }}\n
\n\n{{ baseName $svc.Name }}\n
\n{{ end }}\n{{ end }}\n
\n\nunaccounted\n
\n
\n
\n\n
\n\n\n

storage

\n\n{{ if eq .PermAvail 0 }}\nNo permanent storage mounted. To create a filesystem for permanent storage, plug the SD card into a Linux computer and, if your SD card is /dev/sdb, use mkfs.ext4 /dev/sdb4.\n{{ else }}\n/dev/mmcblk0p4: {{ gigabytes .PermTotal }} total, {{ gigabytes .PermUsed }} used, {{ gigabytes .PermAvail }} avail
\n{{ end }}\n\n

private network addresses

\n\n\n

public network addresses

\n\n\n\n
\n
\n\n{{ template \"footer\" . }}") +var assets_2 = []byte("{{ template \"header\" . }}\n\n
\n
\n\n

services

\n\n\n\n\n\n\n\n{{ range $idx, $svc := .Services }}\n\n\n\n\n{{ end }}\n\n
pathlast log line
\n{{ $svc.Name }}\n{{ if restarting $svc.Started }}\nrestarting\n{{ end }}\n{{ if $svc.Stopped }}\nstopped\n{{ end }}\n\n{{ last $svc.Stdout.Lines $svc.Stderr.Lines }}\n
\n
\n
\n

memory

\n{{ megabytes (index .Meminfo \"MemTotal\") }} total, {{ megabytes (index .Meminfo \"MemAvailable\") }} available
\nresident set size (RSS) by service:\n
\n\n{{ with $rss := initRss }}\n
\n\ninit\n
\n{{ end }}\n\n{{ range $idx, $svc := .Services }}\n{{ with $rss := $svc.RSS }}\n
\n\n{{ baseName $svc.Name }}\n
\n{{ end }}\n{{ end }}\n
\n\nunaccounted\n
\n
\n
\n\n
\n\n\n

storage

\n\n{{ if eq .PermAvail 0 }}\nNo permanent storage mounted. To create a filesystem for permanent storage, plug the SD card into a Linux computer and, if your SD card is /dev/sdb, use mkfs.ext4 /dev/sdb4.\n{{ else }}\n{{ .PermDev }}: {{ gigabytes .PermTotal }} total, {{ gigabytes .PermUsed }} used, {{ gigabytes .PermAvail }} avail
\n{{ end }}\n\n

private network addresses

\n\n\n

public network addresses

\n\n\n\n
\n
\n\n{{ template \"footer\" . }}\n") var assets_3 = []byte("{{ template \"header\" . }}\n\n
\n
\n\n\n\n\n\n\n\n\n\n\n\n
NameStartedActions
{{ .Service.Name }}{{ .Service.Started }}
\n\n

stdout

\n
\n  {{ range $idx, $line := .Service.Stdout.Lines -}}\n    {{ $line }}\n  {{ end }}\n  
\n\n

stderr

\n
\n  {{ range $idx, $line := .Service.Stderr.Lines -}}\n    {{ $line }}\n  {{ end }}\n  
\n
\n
\n\n{{ template \"footer\" . }}") diff --git a/mount.go b/mount.go index 407dd70..b0046bc 100644 --- a/mount.go +++ b/mount.go @@ -77,8 +77,9 @@ func mountfs() error { } } - if err := syscall.Mount("/dev/mmcblk0p4", "/perm", "ext4", 0, ""); err != nil { - log.Printf("Could not mount permanent storage partition: %v", err) + dev := mustFindRootDevice() + "4" + if err := syscall.Mount(dev, "/perm", "ext4", 0, ""); err != nil { + log.Printf("Could not mount permanent storage partition %s: %v", dev, err) } return nil diff --git a/status.go b/status.go index 2decb33..a422e70 100644 --- a/status.go +++ b/status.go @@ -135,6 +135,7 @@ func initStatus(services []*service) { var buf bytes.Buffer if err := overviewTmpl.Execute(&buf, struct { Services []*service + PermDev string PermUsed int64 PermAvail int64 PermTotal int64 @@ -145,6 +146,7 @@ func initStatus(services []*service) { Hostname string }{ Services: services, + PermDev: mustFindRootDevice() + "4", PermUsed: int64(st.Bsize) * int64(st.Blocks-st.Bfree), PermAvail: int64(st.Bsize) * int64(st.Bavail), PermTotal: int64(st.Bsize) * int64(st.Blocks),