5.3 KiB
Image setup
Baseline setup
Replace $TAG with whatever version is being built, e.g. v1.2.
-
Flash your SD card (assuming OS X):
- Get Ubuntu MATE 16.04 and decompress into an
.imgfile $ diskutil listto check correct device$ diskutil unmountDisk /dev/disk2to prepare it for imaging$ sudo dd bs=1m if=ubuntu-mate-16.04-desktop-armhf-raspberry-pi.img of=/dev/rdisk2(will take a while)
- Get Ubuntu MATE 16.04 and decompress into an
-
Boot your Raspberry Pi using the SD card (the setup should be done on a Pi 3, but the resulting image will work on Pi 2 as well)
-
Answer basic questions (timezone, keyboard layout, default user, etc)
- Set hostname to
chilipie-kiosk - Set username/password to
pi:raspberry(or whatever you want) - Log in automatically after boot
- Set hostname to
-
At this point you can already SSH onto the Pi and do the rest of the setup remotely
-
$ sudo visudoand addpi ALL=(ALL) NOPASSWD: ALLto allow sudo without password prompt -
Disable MATE's default desktop with
$ sudo graphical disable(though later nodm will boot directly to matchbox anyway) -
Clean up MATE's desktop cruft with
$ rm -rf ~/* -
Remove some packages we don't need:
$ sudo apt-get purge -y $(dpkg --get-selections 'sonic*' 'thunderbird*' 'libreoffice*' 'minecraft*' 'scratch*' 'shotwell*' 'simple-scan*' 'hexchat*' 'pidgin*' 'transmission*' 'youtube-dl*' 'atril*' 'idle*' 'brasero*' 'omxplayer*' 'rhythmbox*' 'supercollider*' 'vlc*' | cut -f 1 | tr '\n' ' ') -
Install some packages we'll need:
$ sudo apt-get update && sudo apt-get install -y vim nodm matchbox-window-manager unclutter mailutils nitrogen jq- When mailutils prompts about its setup, "local only" is fine (we install mailutils so that you can check
mailfor cronjob output)
- When mailutils prompts about its setup, "local only" is fine (we install mailutils so that you can check
-
For the time being, the Chromium from Ubuntu repo's keeps segfaulting, so use the alternate installation method instead of installing the
chromium-browserpackage directly -
Remove unnecessary packages with
$ sudo apt-get autoremove -y && sudo apt-get clean -
Make sure automatic software updates are disabled, in
/etc/apt/apt.conf.d/10periodic:APT::Periodic::Unattended-Upgrade "0"; APT::Periodic::Update-Package-Lists "0"; APT::Periodic::Download-Upgradeable-Packages "0"; APT::Periodic::AutocleanInterval "0"; -
In
/etc/default/nodm, set:NODM_ENABLED=true NODM_USER=pi NODM_FIRST_VT=8 -
In
/usr/share/plymouth/themes/ubuntu-mate-text/ubuntu-mate-text.plymouth, set:[ubuntu-text] title=chilipie-kiosk black=0x000000 -
In
/usr/share/plymouth/themes/ubuntu-mate-logo/ubuntu-mate-logo.script, set:Window.SetBackgroundTopColor (0, 0, 0); Window.SetBackgroundBottomColor (0, 0, 0); -
Replace the Plymouth theme logos with
$ cd /usr/share/plymouth/themes/ubuntu-mate-logo && sudo rm ubuntu-mate-logo{,16}.png && sudo ln -s /home/pi/background.png ubuntu-mate-logo.png && sudo ln -s /home/pi/background.png ubuntu-mate-logo16.png -
Check that the version in
.chilipie-kiosk-versionmatches$TAG, and it's on GitHub -
Get default scripts with
$ wget "https://github.com/futurice/chilipie-kiosk/archive/master.zip" && unzip master.zip && cp -v $(find chilipie-kiosk-master/home/ -type f) . && rm -rf chilipie-kiosk-master/ master.zip -
Put in the example crontab with
$ crontab -e:# m h dom mon dow command # 0 7 * * 1-5 ~/display-on.sh # turn display on weekdays at 7 AM # 0 19 * * 1-5 ~/display-off.sh # turn display off weekdays at 7 PM -
Disable overscan for HDMI output (as this is rarely needed on modern displays) by uncommenting
disable_overscan=1in/boot/config.txt -
Set up WiFi (for Raspberry Pi 3 only):
-
Check the interface name with
$ ifconfig, e.g.wlan0 -
Append to
/etc/network/interfaces:Internal WiFi adapter
allow-hotplug wlan0 iface wlan0 inet dhcp wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf iface default inet dhcp
-
In
/etc/wpa_supplicant/wpa_supplicant.conf:network={ ssid="networkname" psk="secretpassword" }
-
Symlink the file, for convenience:
$ ln -s /etc/wpa_supplicant/wpa_supplicant.conf wlan.conf
-
-
Disable SSH access (because the default credentials aren't very secure):
$ sudo systemctl disable ssh.service -
Reboot (should land you in Chromium)
-
Tell Chromium "Don't ask again" about being the default browser
-
Configure Chromium to start from "where you left off", and navigate to https://github.com/futurice/chilipie-kiosk/blob/$TAG/first-boot.md
-
Unpower the Pi
Dumping the image
Assuming OS X:
$ diskutil listto check correct device$ diskutil unmountDisk /dev/disk2to prepare it for imaging$ sudo dd bs=1m count=7680 if=/dev/disk2 of=chilipie-kiosk-$TAG.img(only dump the relevant first ~8 GB, matching the originalubuntu-mateimage size)$ openssl sha1 chilipie-kiosk-$TAG.imgand include hash in release notes$ zip chilipie-kiosk-$TAG.img.zip chilipie-kiosk-$TAG.img