Raspberry Pi 3 - Browser Client

From Alpine Linux
Revision as of 08:45, 19 May 2020 by Alpineuser (talk | contribs)

This is a guide for setting up a RAM based RPI3 which is able to run X, and firefox. This tutorial will go through setting up auto login for Alpine, and starting X on boot without user interaction. It is a type of kiosk machine.

This Guide is a Work-in-Progress

Overview

This guide uses the following:

  • aarch64 img
  • RPI3
  • community repo is used.

It is based off of this guide: Raspberry_Pi. Due to the dependencies required to run X and FF, there is very little RAM disk space for the user to operate in, after this tutorial is complete. Take this into consideration. It's possible that the RPI4 with its additional RAM, may fare better.

Steps

setup-alpine
lbu_commit -d

For X and FF:

apk add libx11-dev libxft-dev libxinerama-dev ncurses adwaita-gtk2-theme adwaita-icon-theme ttf-dejavu

Note that the fonts/icon theme are required for FF to display correctly

Uncomment the community repo in /etc/apk/repos.conf for firefox-esr

apk add firefox-esr

It's firefox-esr, not firefox

Installing X:

setup-xorg-base

The RPI also requires for X:

apk add xf86-video-fbdev

AutoLogin, Startx automatically on Boot

At this point, you should be able to login as root, and run startx manually. Now, we will add a number of configuration files that allow this to happen without user interaction.

/root/ doesn't save any files, so it's necessary to edit files in /etc/ and lbu_commit -d after all changes. First let's add a file that will call firefox.

create a file named /etc/startup.sh:

#!/bin/ash
firefox http://somewebsite.com

We have to edit xinitrc, and the profile configs. Normally, this would be done in the user's directory, but here we will use the globals for simplicity.

mv /etc/X11/xinit/xinitrc /etc/X11/xinit/xinitrc_BAK
nano /etc/X11/xinit/xinitrc

In this file put:

/etc/startup.sh

At the end of /etc/profile (leave the existing file) append

startx

And remember to: lbu_commit -d For autologin, alpine uses busybox, which has an alias to /sbin/getty as well as /bin/login. It's possible to navigate to /sbin/ or /bin/ and run /sbin/getty -h to see what settings are available. To have root auto login upon boot, put the following in inittab:

# Set up a couple of getty's
#tty1::respawn:/sbin/getty 38400 tty1
tty2::respawn:/sbin/getty 38400 tty2
tty3::respawn:/sbin/getty 38400 tty3
tty4::respawn:/sbin/getty 38400 tty4
tty5::respawn:/sbin/getty 38400 tty5
tty6::respawn:/sbin/getty 38400 tty6

tty1::respawn:/bin/login -f root