stapelberg
Repos
244
Followers
1255

A tiling window manager

C
7722
676

a Linux distribution to research fast package management

487
25

turn your Go program(s) into an appliance running on the Raspberry Pi 3 or 4 (or on amd64 PCs!)

2542
87

a small home internet router completely written in Go

2523
102

RobustIRC - IRC without netsplits

157
6

source code of Debian Code Search (codesearch.debian.net)

168
34

Events

issue comment
ubuntu repo notice for i386

cc @sur5r

Created at 2 hours ago
issue comment
Please provide an option to lock the screen only a while after blanking

Seems like a reasonable request. But, to make it clear to users what’s happening (even i3lock users who unknowingly sit in front of a machine with this feature enabled), we need to force the unlock indicator and make it describe how many seconds until the screen will be locked. This is similar to what we already have when i3lock can’t grab the X11 server (yet).

Created at 20 hours ago
issue comment
i3 session does not activate systemd graphical-session.target

As I wrote previously:

Pull requests for this change are welcome, but I most likely won’t work on this myself.

Created at 3 days ago
issue comment
Showing Telegram's notifications on the lock screen

I don’t recall if there are better workarounds, but you can wrap i3lock in a script that kills the compositor, invokes i3lock, then restarts the compositor.

Created at 3 days ago
issue comment
Showing Telegram's notifications on the lock screen

Are you using a compositor like xcompmgr, compton, picom or others? If so, try turning it off.

Created at 4 days ago
issue comment
DNS issue with go 1.19.3?

Hey, thanks for reporting this issue.

There were changes in Go 1.19 in the DNS resolution regarding EDNS: https://go.dev/doc/go1.19 (paragraph “net”).

Can you check if the issue starts with Go 1.19, or with Go 1.19.3 specifically please?

You could also try reproducing the issue in a standalone minimal program. Try running it with GODEBUG=netdns=cgo or GODEBUG=netdns=go to narrow it down further.

Once you know which version introduces the problem, you can use git bisection (google “git bisection” for tutorials) to figure out the specific git commit between Go 1.18 and Go 1.19 that causes the issue, in just a few steps. (Go compiles really quickly, so this shouldn’t take too long.)

Thanks

Created at 5 days ago
issue comment
Fix: add NFTA_RULE_COMPAT attribute

cc @thediveo — does this look good to you?

Created at 1 week ago
issue comment
“instance-centric” config re-design

As the design mentions, we could add a hook that gok calls

Ah, I should have updated this comment, too. Since then, I updated the design to remove the hook concept.

I have come to realize that “gokrazy reads the files as they are” is an important principle that allows for introspection/debugging by using “cat config.json && gok …”, for example in CI pipelines.

Running any required custom tools manually before invoking gok shouldn’t be too much trouble. If a shell wrapper script turns out to be complicated, we can look into adding functionality to make that easier, but ideally not in the form of running a hook.

Created at 1 week ago
issue comment
“instance-centric” config re-design

Seems something's odd:

go install github.com/gokrazy/tools/cmd/gok@config-redesign

No, you can’t use go install like that unfortunately. You really need to check out internal and tools on local disk, switch to the config-redesign branch, add a replace directive, and use go install.

Created at 1 week ago
issue comment
Local package repository

See distri help, specifically distri export, and possibly also distri mirror.

For installing a package, distri only needs the squashfs file itself (e.g. i3-amd64-4.18.1-12.squashfs) and the accompanying metadata file (i3-amd64-4.18.1-12.meta.textproto). Just make them available via HTTP, with any webserver you want. That’s all distri export does*.

For use-cases like debugfs, you also need a meta.binaryproto that combines the metadata of all packages. That’s what distri mirror produces. But if all you need is installing packages, you can skip this step.

[*] For performance, you can optionally serve the .squashfs files gzip-compressed (or zstd once #77 is done). distri export serves these files if you manually create them (e.g. using parallel gzip -9 --keep ::: *.squashfs), but if you use a different HTTP server you probably need to enable that explicitly.

Created at 1 week ago
issue comment
fbstatus does not render correctly on all monitor resolutions

I was trying to see if the boot sequence for the Pi4 was logged somewhere, but I am guessing I would need to setup the writable partition first?

With -serial_console=disabled, all boot output ends up on the HDMI console (if you include fbstatus, that will obviously clear the screen).

As the HDMI console can scroll past pretty quickly, my preferred solution to see (and potentially capture) the full logs is to use a USB-to-serial adapter connected to the Raspberry Pi’s RX/TX pins (remove the -serial_console=disabled flag of course).

The permanent partition won’t help, as nothing is logged to it by default.

You can optionally enable remote syslog, but that only covers application logs, not kernel logs.

I had a look at the fb code, but couldn't see anything obviously different with the logo rendering

I’m pretty certain the relevant difference is the screen resolution. Maybe best for development would be to render to some other place (a PNG file?) and try a couple of typical screen resolutions.

Created at 1 week ago
closed issue
Restart fails

Coming from https://github.com/gokrazy/gokrazy/issues/154.

Restarting doesn't work when run through qemu. This is stderr:

2022/11/20 18:01:38 gokrazy: attempt 0, starting ["/user/mkfs"]
2022/11/20 18:01:38 Found mountpoint "/"
2022/11/20 18:01:38 Found mountpoint "/dev"
2022/11/20 18:01:38 Found mountpoint "/tmp"
2022/11/20 18:01:38 Found mountpoint "/dev/pts"
2022/11/20 18:01:38 Found mountpoint "/dev/shm"
2022/11/20 18:01:38 Found mountpoint "/run"
2022/11/20 18:01:38 Found mountpoint "/proc"
2022/11/20 18:01:38 Found mountpoint "/sys"
2022/11/20 18:01:38 Found mountpoint "/sys/fs/cgroup"
2022/11/20 18:01:38 No /perm mountpoint found. Creating file system on /dev/vda4
2022/11/20 18:01:38 Writing self-contained mke2fs to /tmp/gokrazy-mkfs-204447501
2022/11/20 18:01:38 [/tmp/gokrazy-mkfs-204447501/mke2fs -t ext4 /dev/vda4]
mke2fs 1.46.5 (30-Dec-2021)
Post "http://localhost/reboot": dial tcp [::1]:80: connect: connection refused
2022/11/20 18:01:43 gokrazy: process should not be supervised, stopping
2022/11/20 18:01:43 gokrazy: exit status 125

@stapelberg I guess that's because I have moved the host application to :80 (and gokrazy is on :443). Would you like a PR for a command line option to change the port of mkfs or do you see a better approach?

Created at 1 week ago
issue comment
Restart fails

Fixed with PR #4

Created at 1 week ago
issue comment
Use configured http port

Do you want to move to Go 1.18, too?

I don’t mind in general, but it won’t make a difference here I think :)

Created at 1 week ago

Upgrade go-cmp, obliterate xerrors

Use configured http port

Created at 1 week ago
pull request closed
Use configured http port
  • Upgrade go-cmp, obliterate xerrors
  • Use configured http port
Created at 1 week ago
issue comment
“instance-centric” config re-design

I just pushed a new version of the config-redesign branches:

  • https://github.com/gokrazy/internal/commits/config-redesign
  • https://github.com/gokrazy/tools/commits/config-redesign

(To test: clone both, check out the correct branch in both, in tools, add a replace directive pointing to your internal checkout, then go install ./cmd/...)

Notably, gok add is now implemented, which enables the following workflow, for local or remote packages:

# Create 'rw' instance
gok -i rw new

# Include the Go program living in ~/regelwerk
gok -i rw add ~/regelwerk

# Write to an SD card:
gok -i rw overwrite -full=/dev/sdx

Still missing: integration tests, a documentation reference for the config.json format, and updating the website for the new commands. It might take a few weeks until I get to the remaining parts, as I’ll be traveling soon.

But if you’re feeling adventurous, feel free to give this a shot and report back if it worked for you :)

Created at 1 week ago

implement gok new

implement gok edit

move left-over flags

implement gok add

Created at 1 week ago

go.mod migration: don’t incorrectly absolutize non-path replace

fixes https://github.com/gokrazy/gokrazy/issues/148

update remaining outdated messages regarding supported devices

related to https://github.com/gokrazy/gokrazy/issues/157

implement gok --version

register --instance flag on root command for --help

implement writing/reading config.json

related to https://github.com/gokrazy/gokrazy/issues/147

refactor packer code into internal/packer, add gok update entrypoint

related to https://github.com/gokrazy/gokrazy/issues/147

add gok overwrite subcommand

make package config overrideable in config.json

related to https://github.com/gokrazy/gokrazy/issues/147

move config package to gokrazy/internal

wire up gok version

gok: long help output

remove hook calling TODO (design doc has been updated)

It is cleaner to have this happen outside of the gok tool. That way, users can see the config, as the tool will read it, using cat config.json before calling gok.

implement gok new

implement gok edit

move left-over flags

implement gok add

Created at 1 week ago

implement support for instance configuration

related to https://github.com/gokrazy/gokrazy/issues/147

Created at 1 week ago
issue comment
Testing best practices

I'm unsure how to stop the qemu instance and (Ctrl-C doesn't work)

Try Ctrl-a x

Created at 1 week ago
issue comment
Restart fails

@stapelberg I guess that's because I have moved the host application to :80 (and gokrazy is on :443). Would you like a PR for a command line option to change the port of mkfs or do you see a better approach?

There is a better approach indeed: like breakglass, we should read the parameters for loopback gokrazy API requests from the file system: https://github.com/gokrazy/breakglass/blob/2c1eed342dd4dc5ee4f00bbc1f7bd62fd49171c4/breakglass.go#L118

Feel free to copy this into mkfs and send a PR for now, but we should eventually have a package in gokrazy/internal which helps with this.

Created at 1 week ago
closed issue
[Question] Is it possible to write to the HDMI console?

I tried

package main

import (
	"fmt"
	"log"
	"os"
)

func main() {
	log.Println("Hello, world!")
	fmt.Println("Hello, world")
	console, err := os.Open("/dev/console")
	if err != nil {
		log.Fatal(err)
	}
	defer console.Close()
	fmt.Fprintln(console, "Hello World, console")
}

but nothing appears on the HDMI console:

gokrazy

Created at 1 week ago
issue comment
[Question] Is it possible to write to the HDMI console?

Thank you very much for your help, I think I have enough to start developing. Great project, btw.

Thanks! Let us know what comes out of your development, or if you get stuck somewhere :)

Created at 1 week ago
issue comment
[Question] Is it possible to write to the HDMI console?

I also tried github.com/gokrazy/hello; no hellos either

That package prints to stdout, which goes to gokrazy’s ring buffer that’s exposed in the web interface. It doesn’t log to the console.

console, err := os.Open("/dev/console")

I think os.Open is not sufficient, as it opens the file read-only. If you add error checking to your write calls, you’ll probably get an error message.

Here’s what I’m using: https://github.com/rtr7/router7/blob/b39b137e20a71f3afd52ee353b873111129706f0/internal/teelogger/teelogger.go#L48

Created at 1 week ago
issue comment
gokr-packer doesn't seem to accept local packages

EDIT: gok works with SD cards through the https://docs.google.com/document/d/1AUDmc8lygLR59O29Oc4ckv-Buk2R9zrvPDO9JbPOts8/edit proposal.

Yes. If you want to give that (work in progress) a shot, you’ll need the config-redesign branch of the internal and tools repository:

  • https://github.com/gokrazy/internal/commits/config-redesign
  • https://github.com/gokrazy/tools/tree/config-redesign
Created at 1 week ago