In reference to errno, the errno variable is set in the C library. For syscalls, the value that gets set comes from the kernel. Some C library functions set errno without calling into the kernel. For the read example, check out the read function where it makes a syscall to the kernel. The syscall_cp macro is here. The return value from the Linux kernel is put into errno via the syscall_ret function. Note that the references are to Musl C. The GNU C library is used in the kiosk system, but it should be similar and I find Musl C source code easier to read.
As for what’s really wrong with the kiosk systems, I don’t know. The ones on the nerves-web-kiosk were abandoned long ago. You’ll see commits from me when they were maintained, but I haven’t used them for years. I have been heard of people getting them working again in forks, but I’ve yet to convince some one to maintain them.
I have not used this, but I believe @elcritch has the most promising public fork. See:
I’ll try to fix one of the kiosk systems but that will take some time and I’m not sure if I can do it.
Right now I’m trying to understand how nerves works under the hood and I’m writing a detailed guide along the way. Maybe you or someone else of the nerves core team can spare some time to proofread it. When I’m finished I hope I can also help people better in the forum.
I think until someone comes around and fixes it, the kiosk repos should be archived or at least a note should be added to the readme.
I finally got nerves_rpi4_webkiosk_playground to build and I can log into it using ssh. That’s the good news.
The less good news is that it when boots I get a white screen on the hdmi and the following on serial console.
=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2021.12.10 11:54:43 =~=~=~=~=~=~=~=~=~=~=~=
[ 0.250929] spi-bcm2835 fe204000.spi: could not get clk: -517
[ 0.654821] F2FS-fs (mmcblk0p3): Can't find valid F2FS filesystem in 1th superblock
[ 0.663121] F2FS-fs (mmcblk0p3): Can't find valid F2FS filesystem in 2th superblock
erlinit: The shell will be launched on tty 'tty1'.
erlinit: If you would like the shell to be on this tty,
erlinit: configure erlinit with '-c ttyS0'.
erlinit: The hostname is 'nerves-a53e'.
[ 2.471692] F2FS-fs (mmcblk0p3): Can't find valid F2FS filesystem in 1th superblock
[ 2.480049] F2FS-fs (mmcblk0p3): Can't find valid F2FS filesystem in 2th superblock
I will post a set of build instructions later. But first of all are the white screen and the error messages normal. Any ideas anyone?
The spi-bcm2835 one occurs in other Pi 4 systems. I’ve never tracked it down, but it doesn’t seem to affect anything.
The F2FS warnings are from this being a first time boot off your MicroSD card. They’re a side effect of Nerves identifying that the data partition hasn’t been initialized yet and then initializing it. You shouldn’t see it on reboots or when you update over ssh. If you burn a new MicroSD card, the default is to reset the data partition and you’ll see it again. See Frequently-Asked Questions — nerves v1.7.12.
The erlinit warnings are due to erlinit being configured to send the console terminal to the HDMI output (tty) and you’re looking at ttyS0. You can make it go away by adding config :nerves, :erlinit, ctty: "ttyS0" to your config.exs.
Just rebooted the system. No error messages. I can see that the webengine_kiosk process is running.
382 root 1844m S /srv/erlang/lib/webengine_kiosk-0.4.0/priv/kiosk --background_color black --fullscreen true --virtualkeyb
The white screen is a suspicious see a there is --background)color black parameter in the command line.
I have forked the kiosk_playground to my rogerajmes99 account on github. I will push any changes up there shortly.
The main changes are to the instructions. You need to be version 24 of elixir and erlang (the latest) and your MIX_TARGET must be set to rpi4_kiosk. The only change I make to mix.exs is to pull the webengine_kiosk from github rather than a local file. To get past the virtualkeyboard you need to have qtvirtualkeyboard-plugin install on your host system along with all the other qt5 stuff. It took me a while to work out what was going on. The firmware build is running qmake on your host system and using qmake’s own cross compilation facilties to build for the target. I suspect you can get away with just the libqt5virtualkeyboard5-dev package, as it is building arm7 binaries. Here is the change to mix.exs.