Merge lp:~sil2100/phablet-tools/citrain_custom_distro into lp:phablet-tools

Proposed by Łukasz Zemczak
Status: Merged
Approved by: Oliver Grawert
Approved revision: 329
Merged at revision: 329
Proposed branch: lp:~sil2100/phablet-tools/citrain_custom_distro
Merge into: lp:phablet-tools
Diff against target: 42 lines (+13/-5)
1 file modified
citrain (+13/-5)
To merge this branch: bzr merge lp:~sil2100/phablet-tools/citrain_custom_distro
Reviewer Review Type Date Requested Status
Oliver Grawert Approve
Review via email: mp+237935@code.launchpad.net

Commit message

Allow the citrain script to be passed a custom distribution to use during device-upgrade.

Description of the change

Allow the citrain script to be passed a custom distribution to use during device-upgrade. This will be useful for the new modes in CI Train dual-landing.

To post a comment you must log in.
Revision history for this message
Oliver Grawert (ogra) wrote :

looks good

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'citrain'
2--- citrain 2014-09-25 16:10:08 +0000
3+++ citrain 2014-10-10 10:17:30 +0000
4@@ -16,7 +16,7 @@
5
6 usage () {
7 cat <<EOF
8-usage: $0 COMMAND SILO-NUMBER [DEVICE-PASSWORD]
9+usage: $0 COMMAND SILO-NUMBER [DEVICE-PASSWORD] [DISTRIBUTION]
10
11 COMMANDS:
12 host-install Deprecated. Please use host-upgrade instead.
13@@ -28,6 +28,10 @@
14
15 SILO-NUMBER:
16 1..20
17+
18+DISTRIBUTION: (optional)
19+ ubuntu
20+ ubuntu-rtm
21 EOF
22 exit 1
23 }
24@@ -79,10 +83,14 @@
25
26 set -x
27 adb shell egrep ^deb /etc/apt/sources.list.d/\*.list
28- if adb shell system-image-cli -i | grep -q ubuntu-rtm; then
29- DISTRO="ubuntu-rtm"
30- else
31- DISTRO="ubuntu"
32+ DISTRO="$1"
33+ if [ -z $DISTRO ]; then
34+ # In case no distro specified, guess
35+ if adb shell system-image-cli -i | grep -q ubuntu-rtm; then
36+ DISTRO="ubuntu-rtm"
37+ else
38+ DISTRO="ubuntu"
39+ fi
40 fi
41 phablet-config writable-image -r $PASSWORD --ppa $PPA/$DISTRO/$SILO
42 adb shell "echo -e '#\x21/bin/sh\necho $PASSWORD' >/tmp/askpass.sh"

Subscribers

People subscribed via source and target branches