Wachalarm-Monitor/image-setup.md
2018-08-05 18:10:50 +03:00

3.9 KiB

Image setup

Baseline setup

Replace $TAG with whatever version is being built, e.g. v2.0.0.

  1. Check that the version in .chilipie-kiosk-version matches $TAG, and it's on GitHub
  2. Get Raspbian Lite (2018-06-27-raspbian-stretch-lite.zip)
  3. Flash it onto an SD card (use Etcher or dd)
  4. Re-mount the card
  5. Update the file /Volumes/boot/cmdline.txt on the card:
    -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=tty1 root=PARTUUID=4d3ee428-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet
    
  6. Boot your Pi from the SD card
  7. Run sudo raspi-config and:
    1. Set localization options
    2. Set hostname to chilipie-kiosk
    3. Join a WiFi (if wired network isn't available for setup)
    4. Enable SSH
    5. Set automatic CLI login after boot
  8. At this point you can already SSH onto the Pi and do the rest of the setup remotely
  9. Resize the root partition to make space for additional software
    1. sudo fdisk /dev/mmcblk0
    2. p
    3. Make note of the "Start" value of the 2nd partition (e.g. 98304)
    4. d
    5. 2
    6. n
    7. p
    8. 2
    9. For "First sector", enter the "Start" value from above (e.g. 98304)
    10. For "Last sector", enter +3G
    11. If asked if you want to remove the existing "ext4" signature, say y
    12. w
    13. sudo shutdown -r now
    14. sudo resize2fs /dev/mmcblk0p2
    15. df -h
  10. 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
    • If nodm prompts whether it should be enabled by default, say "yes"
    • TODO TODO TODO: nodm NOT NEEDED ANYMORE?
    • If mailutils prompts about its setup, "local only" is fine (we install mailutils so that you can check mail for cronjob output)
  11. Disable overscan (as it's rarely needed on modern displays) in /boot/config.txt with:
    -#disable_overscan=1
    +disable_overscan=1
    
  12. 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
  13. Customize Plymouth boot theme:
    1. sudo cp background.png /usr/share/plymouth/themes/pix/splash.png
    2. In /boot/config.txt, append disable_splash=1
    3. In /boot/cmdline.txt:
    -TODO
    +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=0
    
  14. Put in the example crontab with crontab crontab.example
  15. Disable SSH access again (because the default credentials aren't very secure) with sudo raspi-config
  16. Reboot (should land you in Chromium)
  17. Tell Chromium "Don't ask again" about being the default browser
  18. Configure Chromium to start from "where you left off", and navigate to https://github.com/futurice/chilipie-kiosk/blob/$TAG/first-boot.md
  19. Unpower the Pi

Dumping the image

Assuming OS X:

  1. diskutil list to check correct device
  2. diskutil unmountDisk /dev/disk3 to prepare it for imaging
  3. sudo dd bs=1m count=3500 if=/dev/disk3 of=chilipie-kiosk-$TAG.img (only dump the relevant first ~4 GB; takes around 15 minutes)
  4. COPYFILE_DISABLE=1 tar -zcvf chilipie-kiosk-$TAG.img.tar.gz chilipie-kiosk-$TAG.img
  5. openssl sha1 chilipie-kiosk-$TAG.img* and include hash in release notes