Merge lp:~liuyq0307/lava-dispatcher/mount-data-partition into lp:lava-dispatcher

Proposed by Yongqin Liu
Status: Merged
Merged at revision: 197
Proposed branch: lp:~liuyq0307/lava-dispatcher/mount-data-partition
Merge into: lp:lava-dispatcher
Diff against target: 148 lines (+43/-15)
4 files modified
lava_dispatcher/client/base.py (+9/-0)
lava_dispatcher/client/master.py (+29/-13)
lava_dispatcher/default-config/lava-dispatcher/device-defaults.conf (+4/-1)
lava_dispatcher/default-config/lava-dispatcher/device-types/panda.conf (+1/-1)
To merge this branch: bzr merge lp:~liuyq0307/lava-dispatcher/mount-data-partition
Reviewer Review Type Date Requested Status
Le Chi Thu (community) Approve
Review via email: mp+89050@code.launchpad.net

Description of the change

modify to mount data mount point with sdcard partition

To post a comment you must log in.
Revision history for this message
Paul Larson (pwlars) wrote :

This is mixed with another branch. Both of these are really important changes though, so we should get them tested, reviewed, and merged before the release if at all possible.

182 - _purge_linaro_android_sdcard(session)
183 +# _purge_linaro_android_sdcard(session)
Why are we not running this now?

Also, you seem to have several commented out code lines, should those just be removed?

This can be in another merge, but...
95 - session.run(
96 - 'sed -i "/mount ext4 \/dev\/block\/mmcblk0p%s/d" init.rc'
97 - % data_part_org)
98 +# session.run(
99 +# 'sed -i "/mount ext4 \/dev\/block\/mmcblk0p%s/d" init.rc'
100 +# % data_part_org)
101 + session.run('sed -i "s/mmcblk0p%s/mmcblk0p%s/g" init.rc'
102 + % (data_part_org, data_part_lava))
103 session.run('sed -i "s/mmcblk0p%s/mmcblk0p%s/g" init.rc'
104 % (sys_part_org, sys_part_lava))
105 - # for snowball the mcvblk1 is used instead of mmcblk0.
106 + # for snowball the mcvblk1 is used instead of mmcblk0.
107 session.run('sed -i "s/mmcblk1p%s/mmcblk1p%s/g" init.rc'
We should probably have a config option for root device rather than hardcode mmcblk device and handle special cases in code like this. I think that would be much nicer.

The important question is - with this change, can you start things with am start? When I was getting the encryption error, I could run monkey, but anything requiring activity manager had problems (0xbench, glmark2, etc)

Revision history for this message
Yongqin Liu (liuyq0307) wrote :

> This is mixed with another branch. Both of these are really important changes
> though, so we should get them tested, reviewed, and merged before the release
> if at all possible.
>
> 182 - _purge_linaro_android_sdcard(session)
> 183 +# _purge_linaro_android_sdcard(session)
> Why are we not running this now?
>
> Also, you seem to have several commented out code lines, should those just be
> removed?
as you have commented in the branch "https://code.launchpad.net/~liuyq0307/lava-dispatcher/fix-873232/+merge/79542",
The current partitioning scheme is:
mmcblk0p1 - boot
mmcblk0p2 - rootfs
mmcblk0p3 - testboot
mmcblk0p4 - [extended]
mmcblk0p5 - testrootfs
mmcblk0p6 - sdcard

the best way is to split sdcard to data and sdcard two, but at now it seems that we don't have much time to do that...
so in this modification I just use the sdcard partition as data partition.
and comment out all source about processing sdcard. like mount and purge

> This can be in another merge, but...
> 95 - session.run(
> 96 - 'sed -i "/mount ext4 \/dev\/block\/mmcblk0p%s/d" init.rc'
> 97 - % data_part_org)
> 98 +# session.run(
> 99 +# 'sed -i "/mount ext4 \/dev\/block\/mmcblk0p%s/d" init.rc'
> 100 +# % data_part_org)
> 101 + session.run('sed -i "s/mmcblk0p%s/mmcblk0p%s/g" init.rc'
> 102 + % (data_part_org, data_part_lava))
> 103 session.run('sed -i "s/mmcblk0p%s/mmcblk0p%s/g" init.rc'
> 104 % (sys_part_org, sys_part_lava))
> 105 - # for snowball the mcvblk1 is used instead of mmcblk0.
> 106 + # for snowball the mcvblk1 is used instead of mmcblk0.
> 107 session.run('sed -i "s/mmcblk1p%s/mmcblk1p%s/g" init.rc'
> We should probably have a config option for root device rather than hardcode
> mmcblk device and handle special cases in code like this. I think that would
> be much nicer.
here I just modified it to mount the data mount point with sdcard partition.
the original source is to delete the line that mount data partition.

> The important question is - with this change, can you start things with am
> start? When I was getting the encryption error, I could run monkey, but
> anything requiring activity manager had problems (0xbench, glmark2, etc)
Yes, It can run 0xbench. I haven't tested glmark2.

sorry, I will make this branch clear for the data partition staff only.

Revision history for this message
Le Chi Thu (le-chi-thu) wrote :

You have to add this line of code in row 45 of master.py

    session.run('sed -i "s/mmcblk1p%s/mmcblk1p%s/g" init.rc'
        % (data_part_org, data_part_lava))

Snow has mmcblk1p instead of mmcblk0p.

review: Needs Fixing
Revision history for this message
Le Chi Thu (le-chi-thu) wrote :

> You have to add this line of code in row 45 of master.py
>
> session.run('sed -i "s/mmcblk1p%s/mmcblk1p%s/g" init.rc'
> % (data_part_org, data_part_lava))
>
> Snow has mmcblk1p instead of mmcblk0p.

I mean for snowball to work the above code need to add.

Revision history for this message
Yongqin Liu (liuyq0307) wrote :

> We should probably have a config option for root device rather than hardcode
> mmcblk device and handle special cases in code like this. I think that would
> be much nicer.
I think this can be done in another BP or BUG.

fix according to the comment of Le Chi Thu (le-chi-thu) .

Revision history for this message
Le Chi Thu (le-chi-thu) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lava_dispatcher/client/base.py'
2--- lava_dispatcher/client/base.py 2012-01-19 08:59:29 +0000
3+++ lava_dispatcher/client/base.py 2012-01-19 11:20:29 +0000
4@@ -339,6 +339,15 @@
5 dev_ip = session.get_default_nic_ip()
6 if dev_ip is None:
7 raise OperationFailed("failed to get board ip address")
8+ try:
9+ ## just disconnect the adb connection in case is remained
10+ ## by last action or last job
11+ ## that connection should be expired already
12+ session.android_adb_disconnect(dev_ip)
13+ except:
14+ ## ignore all exception
15+ ## this just in case of exception
16+ pass
17 session.android_adb_connect(dev_ip)
18 session.wait_until_attached()
19 session.wait_home_screen()
20
21=== modified file 'lava_dispatcher/client/master.py'
22--- lava_dispatcher/client/master.py 2012-01-15 23:37:30 +0000
23+++ lava_dispatcher/client/master.py 2012-01-19 11:20:29 +0000
24@@ -128,6 +128,7 @@
25 data_part_org = session._client.device_option("data_part_android_org")
26 # Sdcard layout in Lava image
27 sys_part_lava = session._client.device_option("sys_part_android")
28+ data_part_lava = session._client.device_option("data_part_android")
29
30 session.run('mkdir -p ~/tmp/')
31 session.run('mv /mnt/lava/boot/uInitrd ~/tmp')
32@@ -140,12 +141,16 @@
33 session.run(
34 'sed -i "/mount ext4 \/dev\/block\/mmcblk0p%s/d" init.rc'
35 % cache_part_org)
36- session.run(
37- 'sed -i "/mount ext4 \/dev\/block\/mmcblk0p%s/d" init.rc'
38- % data_part_org)
39+# session.run(
40+# 'sed -i "/mount ext4 \/dev\/block\/mmcblk0p%s/d" init.rc'
41+# % data_part_org)
42+ session.run('sed -i "s/mmcblk0p%s/mmcblk0p%s/g" init.rc'
43+ % (data_part_org, data_part_lava))
44 session.run('sed -i "s/mmcblk0p%s/mmcblk0p%s/g" init.rc'
45 % (sys_part_org, sys_part_lava))
46- # for snowball the mcvblk1 is used instead of mmcblk0.
47+ # for snowball the mcvblk1 is used instead of mmcblk0.
48+ session.run('sed -i "s/mmcblk1p%s/mmcblk1p%s/g" init.rc'
49+ % (data_part_org, data_part_lava))
50 session.run('sed -i "s/mmcblk1p%s/mmcblk1p%s/g" init.rc'
51 % (sys_part_org, sys_part_lava))
52 session.run(
53@@ -167,7 +172,7 @@
54
55 def _deploy_linaro_android_testrootfs(session, systemtbz2, rootfstype):
56 logging.info("Deploying the test root filesystem")
57- sdcard_part_lava = session._client.device_option("sdcard_part_android")
58+# sdcard_part_lava = session._client.device_option("sdcard_part_android")
59
60 session.run('umount /dev/disk/by-label/testrootfs')
61 session.run(
62@@ -178,10 +183,10 @@
63 'mount /dev/disk/by-label/testrootfs /mnt/lava/system')
64 _deploy_tarball_to_board(session, systemtbz2, '/mnt/lava', timeout=600)
65
66- sed_cmd = "/dev_mount sdcard \/mnt\/sdcard/c dev_mount sdcard /mnt/sdcard %s " \
67- "/devices/platform/omap/omap_hsmmc.0/mmc_host/mmc0" %sdcard_part_lava
68- session.run(
69- 'sed -i "%s" /mnt/lava/system/etc/vold.fstab' % sed_cmd)
70+# sed_cmd = "/dev_mount sdcard \/mnt\/sdcard/c dev_mount sdcard /mnt/sdcard %s " \
71+# "/devices/platform/omap/omap_hsmmc.0/mmc_host/mmc0" % sdcard_part_lava
72+# session.run(
73+# 'sed -i "%s" /mnt/lava/system/etc/vold.fstab' % sed_cmd)
74 session.run('sed -i "s/^PS1=.*$/PS1=\'root@linaro: \'/" /mnt/lava/system/etc/mkshrc')
75 session.run('umount /mnt/lava/system')
76
77@@ -190,6 +195,15 @@
78 session.run('mkfs.vfat /dev/disk/by-label/sdcard -n sdcard')
79 session.run('udevadm trigger')
80
81+def _deploy_linaro_android_data(session, datatbz2):
82+ ##consider the compatiblity, here use the existed sdcard partition
83+ data_label = 'sdcard'
84+ session.run('mkfs.ext4 -q /dev/disk/by-label/%s -L %s' % (data_label, data_label))
85+ session.run('udevadm trigger')
86+ session.run('mkdir -p /mnt/lava/data')
87+ session.run('mount /dev/disk/by-label/%s /mnt/lava/data' % (data_label))
88+ _deploy_tarball_to_board(session, datatbz2, '/mnt/lava', timeout=600)
89+ session.run('umount /mnt/lava/data')
90
91 class PrefixCommandRunner(CommandRunner):
92 """A CommandRunner that prefixes every command run with a given string.
93@@ -317,14 +331,15 @@
94
95 boot_tarball = boot_tbz2.replace(LAVA_IMAGE_TMPDIR, '')
96 system_tarball = system_tbz2.replace(LAVA_IMAGE_TMPDIR, '')
97- #data_tarball = data_tbz2.replace(LAVA_IMAGE_TMPDIR, '')
98+ data_tarball = data_tbz2.replace(LAVA_IMAGE_TMPDIR, '')
99
100 boot_url = '/'.join(u.strip('/') for u in [
101 LAVA_IMAGE_URL, boot_tarball])
102 system_url = '/'.join(u.strip('/') for u in [
103 LAVA_IMAGE_URL, system_tarball])
104- #data_url = '/'.join(u.strip('/') for u in [
105- # LAVA_IMAGE_URL, data_tarball])
106+ data_url = '/'.join(u.strip('/') for u in [
107+ LAVA_IMAGE_URL, data_tarball])
108+
109 if pkg_tbz2:
110 pkg_tarball = pkg_tbz2.replace(LAVA_IMAGE_TMPDIR, '')
111 pkg_url = '/'.join(u.strip('/') for u in [
112@@ -335,7 +350,8 @@
113 try:
114 _deploy_linaro_android_testboot(session, boot_url, pkg_url)
115 _deploy_linaro_android_testrootfs(session, system_url, rootfstype)
116- _purge_linaro_android_sdcard(session)
117+# _purge_linaro_android_sdcard(session)
118+ _deploy_linaro_android_data(session, data_url)
119 except:
120 tb = traceback.format_exc()
121 self.sio.write(tb)
122
123=== modified file 'lava_dispatcher/default-config/lava-dispatcher/device-defaults.conf'
124--- lava_dispatcher/default-config/lava-dispatcher/device-defaults.conf 2012-01-18 00:13:44 +0000
125+++ lava_dispatcher/default-config/lava-dispatcher/device-defaults.conf 2012-01-19 11:20:29 +0000
126@@ -71,7 +71,10 @@
127 # sys partition number in LAVA test image, counting from 1
128 sys_part_android = 5
129 # sdcard partition number in LAVA test image, counting from 1
130-sdcard_part_android = 6
131+#sdcard_part_android = 6
132+
133+# data partition number in LAVA test image, counting from 1
134+data_part_android = 6
135
136 # Master image recognization string
137 MASTER_STR = root@master
138
139=== modified file 'lava_dispatcher/default-config/lava-dispatcher/device-types/panda.conf'
140--- lava_dispatcher/default-config/lava-dispatcher/device-types/panda.conf 2012-01-18 07:41:42 +0000
141+++ lava_dispatcher/default-config/lava-dispatcher/device-types/panda.conf 2012-01-19 11:20:29 +0000
142@@ -14,5 +14,5 @@
143 setenv bootargs "'console=tty0 console=ttyO2,115200n8
144 rootwait rw earlyprintk fixrtc nocompcache vram=48M
145 omapfb.vram=0:24M,1:24M mem=456M@0x80000000 mem=512M@0xA0000000
146- init=/init androidboot.console=ttyO2 no_console_suspend'",
147+ init=/init androidboot.console=ttyO2'",
148 boot

Subscribers

People subscribed via source and target branches