Merge lp:~dpigott/lava-master-image-scripts/deployment-improvements into lp:lava-master-image-scripts

Proposed by Dave Pigott
Status: Merged
Merged at revision: 58
Proposed branch: lp:~dpigott/lava-master-image-scripts/deployment-improvements
Merge into: lp:lava-master-image-scripts
Diff against target: 237 lines (+78/-19)
11 files modified
README (+7/-1)
boards.d/beagle.conf (+1/-1)
boards.d/imx53.conf (+1/-1)
boards.d/origen.conf (+1/-1)
boards.d/panda.conf (+1/-1)
boards.d/snowball.conf (+1/-1)
boards.d/vexpress.conf (+1/-1)
contrib/lava-partition-disk (+57/-11)
contrib/preEnv.txt (+1/-0)
lava-create-master (+1/-1)
master-rootfs-extras/lib/lava/lava-master-init (+6/-0)
To merge this branch: bzr merge lp:~dpigott/lava-master-image-scripts/deployment-improvements
Reviewer Review Type Date Requested Status
Michael Hudson-Doyle (community) Approve
Zygmunt Krynicki Pending
Review via email: mp+104539@code.launchpad.net

Description of the change

Add patch to apply fix for panda streaming bug on first boot

Make reference to rootfs and hwpack only have to be set once

Changes to lava-partition-disk use board type to set number of partitions, and to add preEnv.txt to TI boards so that bootdelay is set

Update documentation on new lava-partition-disk

To post a comment you must log in.
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Lots of changes, good stuff, two comments:

0) Bzr workflow is sucky verbose, meh

1) The fix for panda is wrong, the first boot will still experience all the issues that line prevents. After changing sysctl config reload it (I don't recall the command not but it's probably sysctl -p

2) Can we move the partition step to happen at first boot please? It should be easily doable now. I know it's a lot to ask for so this can go in (noting that 1) needs to be fixed).

Revision history for this message
Dave Pigott (dpigott) wrote :

1) Sort of - we always reboot before doing anything, so the fix gets loaded
2) Completely agree. It's doable and I shall do it. :)

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

I think I agree with Zygmunt that having a sysctl -p would be a bit cleaner although it's not really necessary. Doing the partitioning at first boot would be awesome but that can be in another branch :-)

WRT the streaming errors, it feels like we're stepping around a kernel bug really. Have we talked to any kernel people about it?

Anyway, add sysctl -p and merge please!

review: Approve
Revision history for this message
Spring Zhang (qzhang) wrote :

134 +case $1 in
135 + beagle)
136 + PRE_ENV=Y
137 + SCHEME=2part;;
138 +
139 + imx53)
140 + SCHEME=3part;;
141 +
142 + origen)
143 + SCHEME=3part;;
144 +
145 + panda)
146 + PRE_ENV=Y
147 + SCHEME=2part;;
148 +
149 + snowball)
150 + SCHEME=2part;;
151 +
152 + vexpress)
153 + SCHEME=2part;;

You can use:
imx53|origen)
SCHEME=3part;;
snowball|vexpress)
SCHEME=2part;;
beagle|panda)
PRE_ENV=Y
SCHEME=2part;;

to decrease duplication.

Revision history for this message
Dave Pigott (dpigott) wrote :

Spring: I tend to not like doing that, because at some point we may well want to add some more board specific stuff and then we end up having to split them anyway.

57. By Dave Pigott

Add sysctl refresh after load

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README'
2--- README 2012-03-22 09:47:48 +0000
3+++ README 2012-05-14 07:10:24 +0000
4@@ -36,12 +36,18 @@
5 LAVA dispatcher. To finish the process copy the image to an SD card as instructed
6 by the tool and run:
7
8- $ ./contrib/lava-partition-disk <device path>
9+ $ ./contrib/lava-partition-disk <board type> <device path> <boot mount>
10+
11+Replace <board type> with one of: beagle, imx53, origen, panda, snowball
12+or vexpress.
13
14 Replace <device path> with the name of the system device that represents your
15 SD card, typically this is /dev/sdX or /dev/mmcblkX (with X being a number or
16 letter representing subsequent devices in your system).
17
18+Replace <boot mount> with the mount point for the boot partition, typically on
19+Ubuntu this will be /media/boot.
20+
21 This step will be integrated into the tool in the future. At this time the card
22 is now ready and can be cloned (like a template). The first boot of a device
23 with this card is special. It will initialize the master image and will likely
24
25=== modified file 'boards.d/beagle.conf'
26--- boards.d/beagle.conf 2012-03-22 09:53:58 +0000
27+++ boards.d/beagle.conf 2012-05-14 07:10:24 +0000
28@@ -8,7 +8,7 @@
29 ROOTFS_PARTITION=2
30 # Hardware Pack
31 HWPACK=hwpack_linaro-omap3_20120221-1_armel_supported.tar.gz
32-HWPACK_URL=http://releases.linaro.org/12.02/ubuntu/oneiric-images/nano/hwpack_linaro-omap3_20120221-1_armel_supported.tar.gz
33+HWPACK_URL=http://releases.linaro.org/12.02/ubuntu/oneiric-images/nano/$HWPACK
34 HWPACK_MD5=b979df84e892d7112cc5b3feb96d9a8c
35 # Device name for linaro-media-create
36 LMC_DEV=beagle
37
38=== modified file 'boards.d/imx53.conf'
39--- boards.d/imx53.conf 2012-03-22 09:53:58 +0000
40+++ boards.d/imx53.conf 2012-05-14 07:10:24 +0000
41@@ -11,7 +11,7 @@
42 ROOTFS_PARTITION=3
43 # Hardware Pack
44 HWPACK=hwpack_linaro-lt-mx5_20120221-1_armel_supported.tar.gz
45-HWPACK_URL=http://releases.linaro.org/12.02/ubuntu/oneiric-images/nano/hwpack_linaro-lt-mx5_20120221-1_armel_supported.tar.gz
46+HWPACK_URL=http://releases.linaro.org/12.02/ubuntu/oneiric-images/nano/$HWPACK
47 HWPACK_MD5=e074159ae4e453dab027a6faed2a0af3
48 # Device name for linaro-media-create
49 LMC_DEV=mx53loco
50
51=== modified file 'boards.d/origen.conf'
52--- boards.d/origen.conf 2012-03-22 09:53:58 +0000
53+++ boards.d/origen.conf 2012-05-14 07:10:24 +0000
54@@ -8,7 +8,7 @@
55 ROOTFS_PARTITION=3
56 # Hardware Pack
57 HWPACK=hwpack_linaro-leb-origen_20120221-1_armel_supported.tar.gz
58-HWPACK_URL=http://releases.linaro.org/12.02/ubuntu/oneiric-images/nano/hwpack_linaro-leb-origen_20120221-1_armel_supported.tar.gz
59+HWPACK_URL=http://releases.linaro.org/12.02/ubuntu/oneiric-images/nano/$HWPACK
60 HWPACK_MD5=c3a3e23d5abf7d3913d9378466b91ee0
61 # Device name for linaro-media-create
62 LMC_DEV=origen
63
64=== modified file 'boards.d/panda.conf'
65--- boards.d/panda.conf 2012-03-22 09:53:58 +0000
66+++ boards.d/panda.conf 2012-05-14 07:10:24 +0000
67@@ -8,7 +8,7 @@
68 ROOTFS_PARTITION=2
69 # Hardware Pack
70 HWPACK=hwpack_linaro-lt-panda_20120221-1_armel_supported.tar.gz
71-HWPACK_URL=http://releases.linaro.org/12.02/ubuntu/oneiric-images/nano/hwpack_linaro-lt-panda_20120221-1_armel_supported.tar.gz
72+HWPACK_URL=http://releases.linaro.org/12.02/ubuntu/oneiric-images/nano/$HWPACK
73 HWPACK_MD5=67da422b8ed81b6dba80fd57882d3ac0
74 # Device name for linaro-media-create
75 LMC_DEV=panda
76
77=== modified file 'boards.d/snowball.conf'
78--- boards.d/snowball.conf 2012-03-21 16:49:37 +0000
79+++ boards.d/snowball.conf 2012-05-14 07:10:24 +0000
80@@ -8,7 +8,7 @@
81 ROOTFS_PARTITION=2
82 # Hardware Pack
83 HWPACK=hwpack_linaro-lt-snowball_20120221-1_armel_supported.tar.gz
84-HWPACK_URL=http://releases.linaro.org/12.02/ubuntu/oneiric-images/nano/hwpack_linaro-lt-snowball_20120221-1_armel_supported.tar.gz
85+HWPACK_URL=http://releases.linaro.org/12.02/ubuntu/oneiric-images/nano/$HWPACK
86 HWPACK_MD5=f392883d5ab4df726ed5e2e308afd68a
87 # Device name for linaro-media-create
88 LMC_DEV=snowball_sd
89
90=== modified file 'boards.d/vexpress.conf'
91--- boards.d/vexpress.conf 2012-03-22 15:01:10 +0000
92+++ boards.d/vexpress.conf 2012-05-14 07:10:24 +0000
93@@ -8,7 +8,7 @@
94 ROOTFS_PARTITION=2
95 # Hardware Pack
96 HWPACK=hwpack_linaro-lt-vexpress-a9_20120221-1_armel_supported.tar.gz
97-HWPACK_URL=http://releases.linaro.org/12.02/ubuntu/oneiric-images/nano/hwpack_linaro-lt-vexpress-a9_20120221-1_armel_supported.tar.gz
98+HWPACK_URL=http://releases.linaro.org/12.02/ubuntu/oneiric-images/nano/$HWPACK
99 HWPACK_MD5=3c5562d100c669b6bc951f8565fe1988
100 # Device name for linaro-media-create
101 LMC_DEV=vexpress-a9
102
103=== modified file 'contrib/lava-partition-disk'
104--- contrib/lava-partition-disk 2012-04-18 22:32:26 +0000
105+++ contrib/lava-partition-disk 2012-05-14 07:10:24 +0000
106@@ -1,31 +1,77 @@
107 #!/bin/bash
108
109-if [ "$1" = "" ]
110+show_usage() {
111+ echo "Usage: $0 <board type> <device path> <boot mount> {testrootfs partition size}"
112+ echo "Where <board typei> is one of: beagle, imx53, origen, panda,"
113+ echo " snowball or vexpress"
114+ echo
115+ echo "<device path> is the path to your sd card (e.g. /dev/sdb)"
116+ echo "<boot mount> is where the boot partition of the sd card is (e.g. /media/boot"
117+ echo
118+ echo "The testrootfs partition size is optional and defauts to 4G."
119+ echo "Make sure you specify the \"G\" in uppercase"
120+}
121+
122+if [ "$3" = "" ]
123 then
124- echo "Usage: $0 DEVICE"
125+ show_usage
126 exit 1
127-else
128- DEVICE=$1
129 fi
130
131-if [ "$2" = "" ]
132+PRE_ENV=
133+
134+case $1 in
135+ beagle)
136+ PRE_ENV=Y
137+ SCHEME=2part;;
138+
139+ imx53)
140+ SCHEME=3part;;
141+
142+ origen)
143+ SCHEME=3part;;
144+
145+ panda)
146+ PRE_ENV=Y
147+ SCHEME=2part;;
148+
149+ snowball)
150+ SCHEME=2part;;
151+
152+ vexpress)
153+ SCHEME=2part;;
154+
155+ *)
156+ echo "Board type \"$1\" not recognised"
157+ exit 1;;
158+esac
159+
160+DEVICE=$2
161+
162+BOOT_MOUNT=$3
163+
164+if [ "$4" = "" ]
165 then
166 # SIZE is the size of the testrootfs partition. On an 8G sd you can fit
167 # 4G - put it up to 8G on a 16GB. The rest is allocated to sdcard for
168 # android
169 SIZE="4G"
170 else
171- SIZE=$2
172+ SIZE=$4
173 fi
174
175-if [ "$3" = "" ]
176+if [ "$PRE_ENV" = "Y" ]
177 then
178- SCHEME="2part"
179-else
180- SCHEME=$3
181+ cp ./contrib/preEnv.txt $BOOT_MOUNT
182+ if [ "$?" != "0" ]
183+ then
184+ echo "Failed to copy preEnv.txt. Is the disk read only?"
185+ exit 1
186+ fi
187 fi
188
189-# origen has a different original layout with 3 partitions - all others are the same (so far)
190+# origen and imx53 have a different original layout with 3 partitions
191+# all others are the same (so far)
192
193 if [ $SCHEME = "2part" ]
194 then
195
196=== added file 'contrib/preEnv.txt'
197--- contrib/preEnv.txt 1970-01-01 00:00:00 +0000
198+++ contrib/preEnv.txt 2012-05-14 07:10:24 +0000
199@@ -0,0 +1,1 @@
200+bootdelay=10
201
202=== modified file 'lava-create-master'
203--- lava-create-master 2012-05-04 11:42:33 +0000
204+++ lava-create-master 2012-05-14 07:10:24 +0000
205@@ -7,7 +7,7 @@
206
207 # Common root filesystem that is the base for all boards
208 COMMON_ROOTFS=linaro-o-nano-tar-20120221-0.tar.gz
209-COMMON_ROOTFS_URL=http://releases.linaro.org/12.02/ubuntu/oneiric-images/nano/linaro-o-nano-tar-20120221-0.tar.gz
210+COMMON_ROOTFS_URL=http://releases.linaro.org/12.02/ubuntu/oneiric-images/nano/$COMMON_ROOTFS
211 COMMON_ROOTFS_MD5=0d98d935488b56bbd8b291315944bb7d
212
213 # When non-empty the tool is verbose
214
215=== modified file 'master-rootfs-extras/lib/lava/lava-master-init'
216--- master-rootfs-extras/lib/lava/lava-master-init 2012-03-22 17:46:56 +0000
217+++ master-rootfs-extras/lib/lava/lava-master-init 2012-05-14 07:10:24 +0000
218@@ -16,6 +16,7 @@
219 # Set of packages to install on first boot
220 LAVA_PKGS="wget dosfstools u-boot-tools bzip2 python ntpdate"
221
222+DEVICE_TYPE=`lava-device-info --device-type`
223
224 # First boot startup function
225 # 1) Initializes APT
226@@ -53,6 +54,11 @@
227 echo "Unable to synchronize time" >&2
228 return 1
229 fi
230+ if [ "$DEVICE_TYPE" = "lava:panda" ]; then
231+ echo "Applying sysctl fix for streaming errors on Panda" >> "$LAVA_FIRST_BOOT_LOG"
232+ echo vm.min_free_kbytes = 32768 >> /etc/sysctl.conf
233+ sysctl -p
234+ fi
235 # Generate LAVA first-boot UUID
236 echo "Generating first-boot UUID" >> "$LAVA_FIRST_BOOT_LOG"
237 LAVA_FIRST_BOOT_UUID="$(python -c 'import uuid; print uuid.uuid1()')"

Subscribers

People subscribed via source and target branches