From 7b92b773375ba8225c99b6c1566bcd44b3e5ea9b Mon Sep 17 00:00:00 2001 From: Paul Sherwood Date: Thu, 2 Oct 2014 05:52:08 +0000 Subject: Add cycle script for build+deploy to self --- clusters/jetson-upgrade.morph | 2 +- scripts/cycle.sh | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100755 scripts/cycle.sh diff --git a/clusters/jetson-upgrade.morph b/clusters/jetson-upgrade.morph index 59f7155f..f44e597a 100644 --- a/clusters/jetson-upgrade.morph +++ b/clusters/jetson-upgrade.morph @@ -12,6 +12,6 @@ systems: KERNEL_ARGS: console=ttyS0,115200n8 no_console_suspend=1 lp0_vec=2064@0xf46ff000 video=tegrafb mem=1862M@2048M memtype=255 ddr_die=2048M@2048M section=256M pmuboard=0x0177:0x0000:0x02:0x43:0x00 vpr=151M@3945M tsec=32M@3913M otf_key=c75e5bb91eb3bd94560357b64422f85 usbcore.old_scheme_first=1 core_edp_mv=1150 core_edp_ma=4000 tegraid=40.1.1.0.0 debug_uartport=lsport,3 power_supply=Adapter audio_codec=rt5640 modem_id=0 android.kerneltype=normal usb_port_owner_info=0 fbcon=map:1 commchip_id=0 usb_port_owner_info=0 lane_owner_info=6 emc_max_dvfs=0 touch_id=0@0 tegra_fbmem=32899072@0xad012000 board_info=0x0177:0x0000:0x02:0x43:0x00 tegraboot=sdmmc gpt FSTAB_SRC: LABEL=src /src auto defaults,rw,noatime 0 2 deploy: - jetson: + self: type: ssh-rsync location: root@localhost diff --git a/scripts/cycle.sh b/scripts/cycle.sh new file mode 100755 index 00000000..8fab43b7 --- /dev/null +++ b/scripts/cycle.sh @@ -0,0 +1,43 @@ +#!/bin/sh +# Copyright (C) 2014 Codethink Limited +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +usage() { + echo "Usage: cycle.sh some-system some-cluster" + echo + echo "This builds and deploys the current checked out version of" + echo "some-system, applying it as a self-upgrade to the system you" + echo "are working in, using configuration from some-cluster." + echo "The upgrade is labelled TEST, and is set to be the default for" + echo "next boot." +} + +if [ -z "$1" ] || [ -z "$2" ] ; then + usage + exit 1 +fi + +set -e +set -v + +morph gc +morph build $1 +system-version-manager set-default factory +if [ `system-version-manager list | grep ^TEST$` ]; then + system-version-manager remove TEST +fi + +sed -i "s|^- morph: .*$|- morph: $1|" $2 +morph deploy --upgrade $2 self.HOSTNAME=$(hostname) self.VERSION_LABEL=TEST -- cgit v1.2.1