4.2 KiB
4.2 KiB
Image setup
Baseline setup
- Set the version we're building, e.g.
export TAG=v2.0.0-rc2 - Update version file with
echo -e "$TAG\n\nhttps://github.com/futurice/chilipie-kiosk" > home/.chilipie-kiosk-version - Run
./md-to-html.sh - Check that all changes have been pushed to GitHub
- Get Raspbian Lite (
2018-06-27-raspbian-stretch-lite.zip) - Flash it onto an SD card (use Etcher or
dd) - Re-mount the card
- Update the file
/Volumes/boot/cmdline.txton the card:
The removal of-dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=4d3ee428-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet init=/usr/lib/raspi-config/init_resize.sh +dwc_otg.lpm_enable=0 console=serial0,115200 console=tty3 root=PARTUUID=4d3ee428-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash quiet plymouth.ignore-serial-consoles logo.nologo vt.global_cursor_default=0init=/usr/lib/raspi-config/init_resize.shdisables the automatic expansion of the root FS to cover the whole SD card on first boot; the rest is for customizing the Plymouth boot theme - Disable overscan (as it's rarely needed on modern displays) in
/Volumes/boot/config.txtwith:-#disable_overscan=1 +disable_overscan=1 - In the same file, append
disable_splash=1 - Safely unmount the card
- Boot your Pi from the SD card
- Run
sudo raspi-configand:- Set localization options
- Set hostname to
chilipie-kiosk - Join a WiFi (if wired network isn't available for setup)
- Enable SSH
- Set automatic CLI login after boot
- At this point you can already SSH onto the Pi and do the rest of the setup remotely
- Resize the root partition to make space for additional software
sudo fdisk /dev/mmcblk0p- Make note of the "Start" value of the 2nd partition (e.g.
98304) d2np2- For "First sector", enter the "Start" value from above (e.g.
98304) - For "Last sector", enter
+2500M(we only need about ~2.5G of space; any extra just makes dumping the image more tedious) - If asked if you want to remove the existing "ext4" signature, say
y w- If you get an error about "Re-reading the partition table failed.: Device or resource busy", it's fine
sudo rebootsudo resize2fs /dev/mmcblk0p2df -h
- Install some packages we'll need:
sudo apt-get update && sudo apt-get install -y vim matchbox-window-manager unclutter mailutils nitrogen jq chromium-browser xserver-xorg xinit rpd-plym-splash xdotool- We install mailutils so that you can check
mailfor cronjob output
- We install mailutils so that you can check
- 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 - Customize Plymouth boot theme graphics with
sudo rm /usr/share/plymouth/themes/pix/splash.png && sudo ln -s /home/pi/background.png /usr/share/plymouth/themes/pix/splash.png - Put in the example crontab with
crontab crontab.example - Disable SSH access again (because the default credentials aren't very secure) with
sudo raspi-config - Reboot (should land you in Chromium)
- Tell Chromium we don't want to sign in
- Configure Chromium to start from "where you left off", and navigate to
file:///home/pi/first-boot.html - Gracefully shut down the Pi
Dumping the image
Assuming OS X:
diskutil listto check correct devicediskutil unmountDisk /dev/disk3to prepare it for imagingTAG=2.0.0-dev(or whatever the current version is)sudo dd bs=1m count=3000 if=/dev/disk3 of=chilipie-kiosk-$TAG.img(only dump the relevant first 3 GB)COPYFILE_DISABLE=1 tar -zcvf chilipie-kiosk-$TAG.img.tar.gz chilipie-kiosk-$TAG.imgopenssl sha1 chilipie-kiosk-$TAG.img*and include hash in release notes