Merge lp:~liuyq0307/lava-dispatcher/update-mount-partitions into lp:lava-dispatcher

Proposed by Yongqin Liu
Status: Merged
Merged at revision: 473
Proposed branch: lp:~liuyq0307/lava-dispatcher/update-mount-partitions
Merge into: lp:lava-dispatcher
Diff against target: 56 lines (+16/-10)
2 files modified
lava_dispatcher/config.py (+3/-0)
lava_dispatcher/device/master.py (+13/-10)
To merge this branch: bzr merge lp:~liuyq0307/lava-dispatcher/update-mount-partitions
Reviewer Review Type Date Requested Status
Andy Doan (community) Approve
Review via email: mp+137106@code.launchpad.net

This proposal supersedes a proposal from 2012-11-29.

Description of the change

 update the source for mount partitions for aosp build and JB4.2 build
Updated according to the review comment.

To post a comment you must log in.
Revision history for this message
Andy Doan (doanac) wrote : Posted in a previous version of this proposal

This approach is actually a nice improvement from what we have now. Some
small comments:

On 11/29/2012 05:01 AM, Yongqin Liu wrote:
> === modified file 'lava_dispatcher/config.py'
> --- lava_dispatcher/config.py 2012-11-16 00:47:20 +0000
> +++ lava_dispatcher/config.py 2012-11-29 11:00:29 +0000
> @@ -66,6 +66,7 @@
> sys_part_android_org = schema.IntOption()
> val = schema.StringOption()
> sdcard_mountpoint_path = schema.StringOption(default="/storage/sdcard0")
> + possible_partitions_files = schema.StringOption(default="init.rc")

Since this is an array, you should declare like:
   possible_partitions_files = schema.ListOption(default = [
       "init.partitions.rc", "fstab.partitions", "init.rc"])

> simulator_version_command = schema.StringOption()
> simulator_command = schema.StringOption()
>
> === modified file 'lava_dispatcher/default-config/lava-dispatcher/device-defaults.conf'
> --- lava_dispatcher/default-config/lava-dispatcher/device-defaults.conf 2012-11-15 14:51:05 +0000
> +++ lava_dispatcher/default-config/lava-dispatcher/device-defaults.conf 2012-11-29 11:00:29 +0000
> @@ -122,3 +122,8 @@
>
> # how long the disablesuspend script should take to complete
> #disablesuspend_timeout = 240
> +
> +# the possible partition files need to be modified for android
> +possible_partitions_files = init.partitions.rc,
> + fstab.partitions,
> + init.rc

Because of my change to config.py above the change to this file isn't
needed now.

> === modified file 'lava_dispatcher/device/master.py'
> --- lava_dispatcher/device/master.py 2012-11-21 22:07:45 +0000
> +++ lava_dispatcher/device/master.py 2012-11-29 11:00:29 +0000
> @@ -619,15 +619,24 @@
>
> # The mount partitions have moved from init.rc to init.partitions.rc
> # For backward compatible with early android build, we update both rc files
> - _update_uInitrd_partitions(session, 'init.rc')
> - _update_uInitrd_partitions(session, 'init.partitions.rc')
> + # For omapzoom and aosp and JB4.2 the operation for mounting partitions are
> + # in init.omap4pandaboard.rc and fstab.* files
> + possible_partitions_files = string_to_list(
> + session._client.config.possible_partitions_files)
> +

due to the config.py change I suggested, you don't need to
"string_to_list" call now.

> + for f in possible_partitions_files:
> + if session.is_file_exist(f):
> + _update_uInitrd_partitions(session, f)
> + # Will update the PS1 in init.rc in the following
> + # So will not cat the file here
> + if f != 'init.rc':
> + session.run("cat %s" % f, failok=True)
Why the conditional, seems like you should just print it out here and
then delete the call below that always tries to cat it?
>
> session.run(
> 'sed -i "/export PATH/a \ \ \ \ export PS1 \'%s\'" init.rc' %
> target.ANDROID_TESTER_PS1)
>
> session.run("cat init.rc")
> - session.run("cat init.partitions.rc", failok=True)
Why are you keeping the call to "cat init.rc"?

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote : Posted in a previous version of this proposal

Yongqin Liu <email address hidden> writes:

> Yongqin Liu has proposed merging lp:~liuyq0307/lava-dispatcher/update-mount-partitions into lp:lava-dispatcher.
>
> Requested reviews:
> Linaro Validation Team (linaro-validation)
>
> For more details, see:
> https://code.launchpad.net/~liuyq0307/lava-dispatcher/update-mount-partitions/+merge/136902
>
> update the source for mount partitions for aosp build and JB4.2 build
> --
> https://code.launchpad.net/~liuyq0307/lava-dispatcher/update-mount-partitions/+merge/136902
> You are subscribed to branch lp:lava-dispatcher.
> === modified file 'lava_dispatcher/config.py'
> --- lava_dispatcher/config.py 2012-11-16 00:47:20 +0000
> +++ lava_dispatcher/config.py 2012-11-29 11:00:29 +0000
> @@ -66,6 +66,7 @@
> sys_part_android_org = schema.IntOption()
> val = schema.StringOption()
> sdcard_mountpoint_path = schema.StringOption(default="/storage/sdcard0")
> + possible_partitions_files = schema.StringOption(default="init.rc")

I'm a little confused, isn't this something that is more likely to vary
by build than by target board?

Cheers,
mwh

Revision history for this message
Yongqin Liu (liuyq0307) wrote : Posted in a previous version of this proposal

> > + for f in possible_partitions_files:
> > + if session.is_file_exist(f):
> > + _update_uInitrd_partitions(session, f)
> > + # Will update the PS1 in init.rc in the following
> > + # So will not cat the file here
> > + if f != 'init.rc':
> > + session.run("cat %s" % f, failok=True)
> Why the conditional, seems like you should just print it out here and
> then delete the call below that always tries to cat it?
Like the comment just above the condition,
Here is a modification about the PS1 below, so keep the condition there.
Now I deleted the condition by moving the PS1 modification before this

> > session.run(
> > 'sed -i "/export PATH/a \ \ \ \ export PS1 \'%s\'" init.rc' %
> > target.ANDROID_TESTER_PS1)
> >
> > session.run("cat init.rc")
> > - session.run("cat init.partitions.rc", failok=True)
> Why are you keeping the call to "cat init.rc"?

Revision history for this message
Yongqin Liu (liuyq0307) wrote : Posted in a previous version of this proposal

> schema.StringOption(default="/storage/sdcard0")
> > + possible_partitions_files = schema.StringOption(default="init.rc")
>
> I'm a little confused, isn't this something that is more likely to vary
> by build than by target board?
Yes, actually it varies by build, like ICS, JB, or others.
but will also varies by board because bhoj says that "we will be adding a cleanup to look at fstab.<ro.hardware> which would map to fstab.omap4pandaboard fstab.origen etc ."

and for us, we just need to list all the possible file there, and it will be OK I think.

Revision history for this message
Andy Doan (doanac) wrote :

i think its better than what we had in the first place

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lava_dispatcher/config.py'
2--- lava_dispatcher/config.py 2012-11-16 00:47:20 +0000
3+++ lava_dispatcher/config.py 2012-11-30 02:13:19 +0000
4@@ -66,6 +66,9 @@
5 sys_part_android_org = schema.IntOption()
6 val = schema.StringOption()
7 sdcard_mountpoint_path = schema.StringOption(default="/storage/sdcard0")
8+ possible_partitions_files = schema.ListOption(default=["init.partitions.rc",
9+ "fstab.partitions",
10+ "init.rc"])
11
12 simulator_version_command = schema.StringOption()
13 simulator_command = schema.StringOption()
14
15=== modified file 'lava_dispatcher/device/master.py'
16--- lava_dispatcher/device/master.py 2012-11-21 22:07:45 +0000
17+++ lava_dispatcher/device/master.py 2012-11-30 02:13:19 +0000
18@@ -592,7 +592,7 @@
19 data_part_lava = session._client.config.data_part_android
20
21 session.run(
22- 'sed -i "/mount ext4 \/dev\/block\/mmcblk0p%s/d" %s'
23+ 'sed -i "/\/dev\/block\/mmcblk0p%s/d" %s'
24 % (cache_part_org, rc_filename), failok=True)
25
26 session.run('sed -i "s/mmcblk0p%s/mmcblk0p%s/g" %s'
27@@ -617,17 +617,20 @@
28 session.run('mv uInitrd.data ramdisk.cpio.gz')
29 session.run('gzip -d -f ramdisk.cpio.gz; cpio -i -F ramdisk.cpio')
30
31+ session.run(
32+ 'sed -i "/export PATH/a \ \ \ \ export PS1 \'%s\'" init.rc' %
33+ target.ANDROID_TESTER_PS1)
34+
35 # The mount partitions have moved from init.rc to init.partitions.rc
36 # For backward compatible with early android build, we update both rc files
37- _update_uInitrd_partitions(session, 'init.rc')
38- _update_uInitrd_partitions(session, 'init.partitions.rc')
39-
40- session.run(
41- 'sed -i "/export PATH/a \ \ \ \ export PS1 \'%s\'" init.rc' %
42- target.ANDROID_TESTER_PS1)
43-
44- session.run("cat init.rc")
45- session.run("cat init.partitions.rc", failok=True)
46+ # For omapzoom and aosp and JB4.2 the operation for mounting partitions are
47+ # in init.omap4pandaboard.rc and fstab.* files
48+ possible_partitions_files = session._client.config.possible_partitions_files
49+
50+ for f in possible_partitions_files:
51+ if session.is_file_exist(f):
52+ _update_uInitrd_partitions(session, f)
53+ session.run("cat %s" % f, failok=True)
54
55 session.run('cpio -i -t -F ramdisk.cpio | cpio -o -H newc | \
56 gzip > ramdisk_new.cpio.gz')

Subscribers

People subscribed via source and target branches