This guide is not intended for end users, who should download and flash officially released OpenTPCast images from https://github.com/OpenTPCast/Docs/releases
- Overview
- Preparation
- Flashing a stock Raspbian Stretch image to MicroSD card
- Upgrading the Raspbian Stretch image to OpenTPCast
- Shrinking the OpenTPCast image
- Saving the OpenTPCast image to an image file for distribution
- Compressing the OpenTPCast image for distribution
This guide provides instructions for OpenTPCast image maintainers on how to upgrade a Raspbian Stretch Lite image to an OpenTPCast image, and how to prepare the image for distribution to end users.
- A USB ethernet adapter is required to connect the TPCast power box to an internet connected router to perform the image preparation process.
- Disconnect the battery from the TPCast power box before removing or inserting the MicroSD card.
- Disconnect the USB and power cables from the TPCast power box, and connect a USB ethernet adapter into the USB port of the TPCast power box, with an ethernet cable connected to an internet connected router.
- Download and install Win32 Disk Imager on your local machine, which will be used to back up and restore images to and from a MicroSD card.
- Download and install Putty SSH client on your local machine, which will be used to connect to your TPCast power box.
- Download and install 7-Zip on your local machine, which will be used to compress the OpenTPCast image.
- Download and install VirtualBox, and download the latest image of Linux Mint, which will be used to shrink the OpenTPCast image.
- Launch Virtualbox, create a new Ubuntu virtual machine with default settings, and load the Linux Mint image as an optical disk, then power up the virtual machine to boot the Linux Mint live environment.
- Download the latest Raspbian Stretch Lite image, which will be the base image that OpenTPCast is built on top of.
- Connect the MicroSD card to your computer using a MicroSD card reader.
- Launch Win32 Disk Imager.
- In the
Image File
field, select the Raspbian Stretch Lite image file. - Select the MicroSD drive from the
Device
drop down list. - Click
Write
to flash the image to your MicroSD card. - In Windows Explorer, navigate to the MicroSD card's boot partition, and create an empty file called
ssh
.
- Insert the Raspbian Stretch flashed MicroSD card into the TPCast power box.
- Power up the TPCast power box by plugging in the battery and wait a few minutes, then launch Putty and connect with the following details:
- Hostname: Locate the IP address of the TPCast power box by checking your router's connected client list (e.g. 192.168.XXX.XXX).
- Port: 22
- Username: pi
- Password: raspberry
- In the Putty terminal, run the following command to begin the upgrade process:
sudo wget -e check_certificate=off https://rawgit.com/OpenTPCast/Docs/master/files/prepareimage/opentpcast-prepareimage && sudo chmod +x ./opentpcast-prepareimage && sudo ./opentpcast-prepareimage
- Once the upgrade has completed, wait a few seconds to allow the TPCast power box enough time to shut down (the green indicator light on the TPCast power box will stop flashing once complete), then unplug the battery from the TPCast power box to power it off.
- Remove the upgraded MicroSD card from the TPCast power box.
- Connect the OpenTPCast flashed MicroSD card to your computer using a MicroSD card reader.
- Launch VirtualBox and load the Linux Mint virtual machine.
- On the virtual machine window, navigate to
Devices
>USB
and select the MicroSD card reader. - Inside the Linux Mint virtual machine, launch GParted from the Menu.
- In GParted, select the MicroSD card (e.g. /dev/sdb) from the device drop down list.
- Right click the ext4 partition and select
Unmount
. - Right click the ext4 partition and select
Resize/Move
. - Drag the slider bar or adjust the
New Size (MiB)
field to an appropriate size (e.g. 2600), then clickResize/Move
to apply the change. - Select
Edit
>Apply All Operations
to finalize the changes. - Close GParted, and on the virtual machine window, navigate to
Devices
>USB
and deselect the MicroSD card reader to eject it from the virtual machine.
- Connect the OpenTPCast flashed MicroSD card to your computer using a MicroSD card reader.
- Launch Win32 Disk Imager.
- In the
Image File
field, select a file path and enter a file name that will become your backup image. (e.g. C:/opentpcast.img). - Select the MicroSD drive from the
Device
drop down list. - Check
Read Only Allocated Partitions
. - Click
Read
to back up the image to your computer.
- Right click the OpenTPCast image file and navigate to
7-Zip
>Add to archive...
- Use the following settings to compress the image:
- Archive format: 7z
- Compression level: Ultra
- Click
OK
to compress the image.