Skip to content

Commit

Permalink
Merge branch 'release/10.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Daisuke Baba committed Aug 6, 2020
2 parents b6c3ee8 + 368828d commit 57d4616
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 37 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Revision History

* 10.0.0
- CANDY Pi Lite Board Service 10.0.1
- CANDY RED 9.6.0
- Raspberry Pi OS Firmware v[1.20200723](https://github.com/raspberrypi/firmware/tree/1.20200723)
- Linux Kernel 5.4

* 9.4.1
- Fix the image script

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Use [balenaEtcher](https://www.balena.io/etcher/) for burning the image, which i
```
# create a tag for the version then push it to remote
RELEASE_VERSION=9.4.1
RELEASE_VERSION=10.0.0
# using IIJ Mobile
FIRST_USER_NAME="pi" \
Expand Down
4 changes: 0 additions & 4 deletions overlay/stage0/02-firmware/01-run-chroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
FIRMWARE_DIR=/tmp/firmware
pushd ${FIRMWARE_DIR}

# ref: https://github.com/monome/norns-image/pull/76/commits/a62b057daefbabc6f5f4fc1a11a740e34fa38692
# install specific version of Raspberry firmware and userland tools
RPI_FIRMWARE_VERSION="1.20200601-1"

for PACKAGE_DEB in `ls *.deb`
do
dpkg -i ${PACKAGE_DEB}
Expand Down
2 changes: 1 addition & 1 deletion overlay/stage0/02-firmware/01-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RPI_FIRMWARE_PACKAGES=( raspberrypi-bootloader raspberrypi-kernel raspberrypi-ke
i=0
for PACKAGE in "${RPI_FIRMWARE_PACKAGES[@]}"
do
DEB="${PACKAGE}_${RPI_FIRMWARE_VERSION}_armhf.deb"
DEB="${PACKAGE}_${RPI_FIRMWARE_VERSION}-1_armhf.deb"
curl -sSLO "https://archive.raspberrypi.org/debian/pool/main/r/raspberrypi-firmware/${DEB}"
mv -f ${DEB} ${FIRMWARE_DIR}/${i}_${DEB}
let i=i+1
Expand Down
57 changes: 31 additions & 26 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 @@ -2,34 +2,39 @@

# CANDY Pi Lite and CANDY RED

CANDY_PI_LITE_VERSION=master
CANDY_RED_HASH=latest
CANDY_PI_LITE_VERSION=
CANDY_RED_HASH=
BOOT_APN=iijmobile.biz-ipv4v6
BUTTON_EXT=0

if [ "${CANDY_RED_HASH}" = "latest" ]; then
curl -vsL https://raw.githubusercontent.com/CANDY-LINE/candy-pi-lite-service/${CANDY_PI_LITE_VERSION}/install.sh | BUTTON_EXT=${BUTTON_EXT} BOOT_APN="${BOOT_APN}" BOARD=RPi FORCE_INSTALL=1 CANDY_PI_LITE_APT_GET_UPDATED=1 bash
if [ "$?" != "0" ]; then
echo "FAILED TO INSTALL candy-pi-lite-service@${CANDY_PI_LITE_VERSION}"
exit 1
if [ ! -f "/opt/candy-line/candy-pi-lite/uninstall.sh" ]; then
if [ "${CANDY_RED_HASH}" = "latest" ]; then
curl -vsL https://raw.githubusercontent.com/CANDY-LINE/candy-pi-lite-service/${CANDY_PI_LITE_VERSION}/install.sh | BUTTON_EXT=${BUTTON_EXT} BOOT_APN="${BOOT_APN}" BOARD=RPi FORCE_INSTALL=1 CANDY_PI_LITE_APT_GET_UPDATED=1 bash
if [ "$?" != "0" ]; then
echo "FAILED TO INSTALL candy-pi-lite-service@${CANDY_PI_LITE_VERSION}"
exit 1
fi
else
# CANDY RED@${CANDY_RED_HASH} with development dependencies
curl -vsL https://raw.githubusercontent.com/CANDY-LINE/candy-pi-lite-service/${CANDY_PI_LITE_VERSION}/install.sh | BUTTON_EXT=${BUTTON_EXT} BOOT_APN="${BOOT_APN}" CANDY_RED=0 BOARD=RPi FORCE_INSTALL=1 CANDY_PI_LITE_APT_GET_UPDATED=1 bash
if [ "$?" != "0" ]; then
echo "FAILED TO INSTALL candy-pi-lite-service@${CANDY_PI_LITE_VERSION}"
exit 1
fi
CANDY_RED_APT_GET_UPDATED=1 LOCAL_INSTALL=0 npm install -g --unsafe-perm --production https://github.com/CANDY-LINE/candy-red/archive/${CANDY_RED_HASH}.tar.gz
if [ "$?" != "0" ]; then
echo "FAILED TO INSTALL candy-red@${CANDY_RED_HASH}"
exit 1
fi
pushd /usr/lib/node_modules/candy-red
# Install all dependencies and run prepare stage script
LOCAL_INSTALL=0 DEVEL=true npm install --unsafe-perm
popd
fi
else
# CANDY RED@${CANDY_RED_HASH} with development dependencies
curl -vsL https://raw.githubusercontent.com/CANDY-LINE/candy-pi-lite-service/${CANDY_PI_LITE_VERSION}/install.sh | BUTTON_EXT=${BUTTON_EXT} BOOT_APN="${BOOT_APN}" CANDY_RED=0 BOARD=RPi FORCE_INSTALL=1 CANDY_PI_LITE_APT_GET_UPDATED=1 bash
if [ "$?" != "0" ]; then
echo "FAILED TO INSTALL candy-pi-lite-service@${CANDY_PI_LITE_VERSION}"
exit 1
fi
CANDY_RED_APT_GET_UPDATED=1 LOCAL_INSTALL=0 npm install -g --unsafe-perm --production https://github.com/CANDY-LINE/candy-red/archive/${CANDY_RED_HASH}.tar.gz
if [ "$?" != "0" ]; then
echo "FAILED TO INSTALL candy-red@${CANDY_RED_HASH}"
exit 1
fi
pushd /usr/lib/node_modules/candy-red
# Install all dependencies and run prepare stage script
LOCAL_INSTALL=0 DEVEL=true npm install --unsafe-perm
popd
fi

# Always Enable UFW
sed -i -e "s/ENABLED=no/ENABLED=yes/g" /etc/ufw/ufw.conf
# Always Enable UFW
sed -i -e "s/ENABLED=no/ENABLED=yes/g" /etc/ufw/ufw.conf

# Clean cache files
npm cache clean --force
fi
16 changes: 11 additions & 5 deletions scripts/before_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
DEPS_DIR=$(pwd)/deps
PIGEN_DIR=${DEPS_DIR}/pi-gen
MOVIDIUS=${MOVIDIUS:-0}
RPI_FIRMWARE_VERSION=${RPI_FIRMWARE_VERSION:-"1.20200601-1"}
CANDY_PI_LITE_VERSION=${CANDY_PI_LITE_VERSION:-"10.0.1"}
CANDY_RED_HASH=${CANDY_RED_HASH:-"9.6.0"}
RPI_FIRMWARE_VERSION=${RPI_FIRMWARE_VERSION:-"1.20200723"}
BOOT_APN=${BOOT_APN:-""}
BUTTON_EXT=${BUTTON_EXT:-""}
BASE_ROOT_MARGIN=${BASE_ROOT_MARGIN:-"400"}

function clean_setup {
if [ "${NO_CLEAN}" != "1" ]; then
Expand Down Expand Up @@ -48,13 +53,14 @@ function configure_stages {
sed -i -e "s/RPI_FIRMWARE_VERSION=/RPI_FIRMWARE_VERSION=${RPI_FIRMWARE_VERSION}/g" ${PIGEN_DIR}/stage0/02-firmware/01-run.sh
sed -i -e "s/libraspberrypi-bin libraspberrypi0 raspi-config/raspi-config/g" ${PIGEN_DIR}/stage1/03-install-packages/00-packages
sed -i -e "s/libraspberrypi-dev libraspberrypi-doc libfreetype6-dev/libfreetype6-dev/g" ${PIGEN_DIR}/stage2/01-sys-tweaks/00-packages
rm -f ${PIGEN_DIR}/**/*/*-e
sed -i -e "s/RPI_FIRMWARE_VERSION=/RPI_FIRMWARE_VERSION=${RPI_FIRMWARE_VERSION}/g" ${PIGEN_DIR}/stage0/02-firmware/01-run-chroot.sh
sed -i -e "s/raspberrypi-kernel/device-tree-compiler/g" ${PIGEN_DIR}/stage0/02-firmware/01-packages
sed -i -e "s/ 0\.2 \+ 200 \* 1024 \* 1024/ 0.2 + ${BASE_ROOT_MARGIN} * 1024 * 1024/g" ${PIGEN_DIR}/export-image/prerun.sh
}

function configure_scripts {
if [ -n "${CANDY_RED_HASH}" ]; then
sed -i -e "s/CANDY_RED_HASH=latest/CANDY_RED_HASH=${CANDY_RED_HASH}/g" ${PIGEN_DIR}/stage2-1-en_US/99-candy-pi-lite/00-run-chroot.sh
fi
sed -i -e "s/CANDY_PI_LITE_VERSION=/CANDY_PI_LITE_VERSION=${CANDY_PI_LITE_VERSION}/g" ${PIGEN_DIR}/stage2-1-en_US/99-candy-pi-lite/00-run-chroot.sh
sed -i -e "s/CANDY_RED_HASH=/CANDY_RED_HASH=${CANDY_RED_HASH}/g" ${PIGEN_DIR}/stage2-1-en_US/99-candy-pi-lite/00-run-chroot.sh
if [ -n "${BOOT_APN}" ]; then
sed -i -e "s/BOOT_APN=iijmobile.biz-ipv4v6/BOOT_APN=${BOOT_APN}/g" ${PIGEN_DIR}/stage2-1-en_US/99-candy-pi-lite/00-run-chroot.sh
echo "[INFO] BOOT_APN => ${BOOT_APN}"
Expand Down
1 change: 1 addition & 0 deletions scripts/clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function clean_setup {
git clean -f -d
popd
docker rm -f pigen_work
docker volume prune -f
}

clean_setup

0 comments on commit 57d4616

Please sign in to comment.