Skip to content

Commit

Permalink
Merge branch 'release/1.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Daisuke Baba committed Nov 22, 2017
2 parents 9259155 + 262f293 commit 0392e7a
Show file tree
Hide file tree
Showing 10 changed files with 144 additions and 15 deletions.
15 changes: 6 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ sudo: required

language: generic

# Run only on tagged branch
branches:
only:
- /^[0-9]/

services:
- docker

Expand All @@ -10,12 +15,4 @@ before_script:

script:
- ./scripts/build_img.sh

deploy:
provider: releases
api_key: ${GITHUB_OAUTH_TOKEN}
file_glob: true
file: "./deps/pi-gen/deploy/*.zip"
skip_cleanup: true
on:
tags: true
- ./scripts/deploy_zip.sh
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
candy-pi-lite-os-image
===

Raspbian OS image builder for [CANDY Pi Lite Board](https://translate.google.com/translate?sl=auto&tl=en&js=y&prev=_t&hl=en&ie=UTF-8&u=https%3A%2F%2Fwww.candy-line.io%2F製品一覧%2Fcandy-pi-lite%2F&edit-text=&act=url)

# Supported Raspberry Pi

ARMv7+ boards are available for this image.

- [Raspberry Pi2 Model B](https://www.raspberrypi.org/products/raspberry-pi-2-model-b/)
- [Raspberry Pi3 Model B](https://www.raspberrypi.org/products/raspberry-pi-3-model-b/)

# Raspbian OS Version

- Raspbian Stretch Version 2017-09-07 (Kernel v4.9) with some library updates at the time of the image creation

# Features

- [Raspbian OS Lite (RASPBIAN STRETCH LITE)](https://www.raspberrypi.org/downloads/raspbian/) based image with software updates
- [CANDY Pi Lite Board Service](https://github.com/CANDY-LINE/candy-pi-lite-service) is installed
- [CANDY RED](https://github.com/CANDY-LINE/candy-red), a Node-RED based software dedicated to [CANDY Pi Lite Board](https://translate.google.com/translate?sl=auto&tl=en&js=y&prev=_t&hl=en&ie=UTF-8&u=https%3A%2F%2Fwww.candy-line.io%2F製品一覧%2Fcandy-pi-lite%2F&edit-text=&act=url) and [CANDY EGG Cloud Service](https://translate.google.com/translate?hl=en&sl=ja&tl=en&u=https%3A%2F%2Fwww.candy-line.io%2F製品一覧%2Fcandy-red-egg%2F), is installed
- ufw is enabled (denying from all traffic on `ppp0` and `wwan0`)
- Hardware watchdog is enabled
- Node.js v6 is installed (in Maintenance LTS)
- `ssh` is **DISABLED** by default. Place am empty file to `/boot/ssh` to enable ssh
- Extra Packages
- `git`
- `screen`
- `fswebcam`

## Distributions

- `*-en_US` suffix image contains US Keyboard Layout with UTC timezone and en_US.UTF-8 locale
- `*-ja_JP` suffix image contains Japanese Keyboard Layout with JST timezone and ja_JP.UTF-8 locale

# How to flash the image

Use [Etcher](https://etcher.io) for burning the image, which is a cross-platform app.

# Revision History

* 1.0.0
- Initial Release
1 change: 1 addition & 0 deletions overlay/stage2-1-en_US/00-install-packages/00-packages
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
git
screen
fswebcam
2 changes: 1 addition & 1 deletion overlay/stage2-1-en_US/01-configuration/01-run-chroot.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# on_chroot

rm -f /etc/localtime
ln -s /usr/share/zoneinfo/Japan /etc/localtime
ln -s /usr/share/zoneinfo/UTC /etc/localtime

locale-gen
2 changes: 0 additions & 2 deletions overlay/stage2-1-en_US/99-candy-pi-lite/00-run-chroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ CANDY_PI_LITE_VERSION=master

curl -sL \
https://raw.githubusercontent.com/CANDY-LINE/candy-pi-lite-service/${CANDY_PI_LITE_VERSION}/install.sh | \
ENABLE_WATCHDOG=1 \
BOARD=RPi \
FORCE_INSTALL=1 \
bash
2 changes: 1 addition & 1 deletion overlay/stage2-2-ja_JP/00-configuration/files/keyboard
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Consult the keyboard(5) manual page.

XKBMODEL="OADG109A"
XKBMODEL="jp106"
XKBLAYOUT="jp"
XKBVARIANT=""
XKBOPTIONS="lv3:ralt_switch"
Expand Down
8 changes: 6 additions & 2 deletions scripts/before_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
DEPS_DIR=$(pwd)/deps
PIGEN_DIR=${DEPS_DIR}/pi-gen

function update_sibmodules {
function clean_setup {
git submodule update --init --recursive
pushd ${PIGEN_DIR}
git reset --hard HEAD
git clean -f -d
popd
}

function create_config {
Expand Down Expand Up @@ -32,7 +36,7 @@ function configure_scripts {
cp -f $(pwd)/scripts/common ${PIGEN_DIR}/scripts
}

update_sibmodules
clean_setup
create_config
configure_stages
configure_scripts
14 changes: 14 additions & 0 deletions scripts/clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

DEPS_DIR=$(pwd)/deps
PIGEN_DIR=${DEPS_DIR}/pi-gen

function clean_setup {
git submodule update --init --recursive
pushd ${PIGEN_DIR}
git reset --hard HEAD
git clean -f -d
popd
}

clean_setup
65 changes: 65 additions & 0 deletions scripts/deploy_zip.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/usr/bin/env bash

if [ -z "${TAG_NAME}" ]; then
echo "TAG_NAME is required"
exit 1
fi

function fetch_upload_url {
cp -f ../../scripts/release-template.json release.json
if [ "$?" != "0" ]; then
echo "release-template.json is missing on $(pwd)/../../scripts/"
exit 1
fi
for e in TAG_NAME \
RELEASE_NAME \
RELEASE_DESCRIPTION; do
sed -i -e "s/%${e}%/${!e//\//\\/}/g" release.json
done
rm -f release.json-e
RESP=$(curl -sSL \
-H "Authorization: token ${GITHUB_OAUTH_TOKEN}" \
-d @release.json \
"https://api.github.com/repos/${REPO}/releases")
UPLOAD_URL=`echo ${RESP} | jq -r '.upload_url'`
UPLOAD_URL="${UPLOAD_URL%\{*}"
}

function upload_info_files {
for INFO in `ls ./deploy/*.info`; do
echo "Uploading [${INFO}]..."
FILENAME=`basename ${INFO}`
curl -v -s \
-H "Authorization: token ${GITHUB_OAUTH_TOKEN}" \
-H "Content-Type: text/plain" \
--data-binary @${INFO} \
"${UPLOAD_URL}?name=${FILENAME}"
done
echo "INFO Upload done"
}

function upload_zip_files {
for ZIP in `ls ./deploy/*.zip`; do
echo "Uploading [${ZIP}]..."
FILENAME=`basename ${ZIP}`
curl -v -s \
-H "Authorization: token ${GITHUB_OAUTH_TOKEN}" \
-H "Content-Type: application/zip" \
--data-binary @${ZIP} \
"${UPLOAD_URL}?name=${FILENAME}"
done
echo "ZIP Upload done"
}

# main
cd ./deps/pi-gen
RASPBIAN_TAG=`git describe --tags HEAD`
TYPICAL_IMAGE_INFO=`ls ./deploy/*en_US.info`
BUILT_ON=${TYPICAL_IMAGE_INFO:9:10}
REPO=CANDY-LINE/candy-pi-lite-os-image
RELEASE_NAME="v${TAG_NAME}"
RELEASE_DESCRIPTION="${RELEASE_DESCRIPTION:-[${RASPBIAN_TAG}](https://github.com/RPi-Distro/pi-gen/releases/tag/${RASPBIAN_TAG}) dedicated to [CANDY Pi Lite](https://github.com/CANDY-LINE/candy-pi-lite-service) board built on ${BUILT_ON}}"

fetch_upload_url
upload_info_files
upload_zip_files
7 changes: 7 additions & 0 deletions scripts/release-template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"tag_name": "%TAG_NAME%",
"name": "%RELEASE_NAME%",
"body": "%RELEASE_DESCRIPTION%\n\n- `en_US` image contains US Keyboard Layout setting with UTC timezone and en_US.UTF-8 locale.\n- `ja_JP` イメージファイルには、日本語106キーボート、日本時間のタイムゾーン、それに日本語UTF-8の設定が含まれます。[SDへの焼き込みについてはこちらをご覧ください。](http://candy-line.tumblr.com/)",
"draft": false,
"prerelease": false
}

0 comments on commit 0392e7a

Please sign in to comment.