Closed Bug 1132837 Opened 9 years ago Closed 9 years ago

[Nexus 5] phone cannot startup correctly when flashing pvt "User" build

Categories

(Firefox OS Graveyard :: General, defect)

ARM
Gonk (Firefox OS)
defect
Not set
critical

Tracking

(blocking-b2g:2.2+, firefox36 wontfix, firefox37 wontfix, firefox38 fixed, b2g-v2.2 verified, b2g-master verified)

VERIFIED FIXED
2.2 S6 (20feb)
blocking-b2g 2.2+
Tracking Status
firefox36 --- wontfix
firefox37 --- wontfix
firefox38 --- fixed
b2g-v2.2 --- verified
b2g-master --- verified

People

(Reporter: hcheng, Assigned: seinlin)

References

Details

Attachments

(2 files)

*Description:
When I flash "user" build from pvt, my device cannot startup correctly.

*pvt link:
https://pvtbuilds.mozilla.org/pvt/mozilla.org/b2gotoro/nightly/mozilla-central-nexus-5-l/latest/

*flash log:
finished. total time: 0.001s
erasing 'cache'...
OKAY [  0.640s]
formatting 'cache' partition...
Creating filesystem with parameters:
    Size: 734003200
    Block size: 4096
    Blocks per group: 32768
    Inodes per group: 7472
    Inode size: 256
    Journal blocks: 2800
    Label: 
    Blocks: 179200
    Block groups: 6
    Reserved block group size: 47
Created filesystem with 11/44832 inodes and 5813/179200 blocks
sending 'cache' (13348 KB)...
writing 'cache'...
OKAY [  1.917s]
finished. total time: 2.558s
erasing 'userdata'...
OKAY [  8.562s]
formatting 'userdata' partition...
Creating filesystem with parameters:
    Size: 13725835264
    Block size: 4096
    Blocks per group: 32768
    Inodes per group: 8144
    Inode size: 256
    Journal blocks: 32768
    Label: 
    Blocks: 3351034
    Block groups: 103
    Reserved block group size: 823
Created filesystem with 11/838832 inodes and 93654/3351034 blocks
sending 'userdata' (137318 KB)...
writing 'userdata'...
OKAY [ 13.935s]
finished. total time: 22.497s
target reported max download size of 1073741824 bytes
erasing 'userdata'...
OKAY [  7.194s]
sending 'userdata' (137322 KB)...
OKAY [  4.531s]
writing 'userdata'...
OKAY [  9.175s]
finished. total time: 20.900s
target reported max download size of 1073741824 bytes
erasing 'cache'...
OKAY [  0.557s]
sending 'cache' (13348 KB)...
OKAY [  0.640s]
writing 'cache'...
OKAY [  1.078s]
finished. total time: 2.275s
target reported max download size of 1073741824 bytes
sending 'boot' (8784 KB)...
OKAY [  0.497s]
writing 'boot'...
OKAY [  0.745s]
finished. total time: 1.242s
target reported max download size of 1073741824 bytes
erasing 'system'...
OKAY [  0.723s]
sending 'system' (226948 KB)...
OKAY [  7.411s]
writing 'system'...
OKAY [ 16.535s]
finished. total time: 24.669s
rebooting...
The phone hangs on this screenshot.
Blocks: 1111890
blocking-b2g: --- → 2.2?
Component: Releases → General
Product: Release Engineering → Firefox OS
QA Contact: rail
James, I'm not sure if you're the right person to help here, but you probably know who is.
Flags: needinfo?(jlal)
I verified that my local build (user images) does work properly; But after flash pvt build (user images) I can see the same error.
I found the difference, in my local build VARIANT=userdebug, and in pvt build VARIANT=user. When VARIANT=user, disable selinux is not allowed and we doesn't have sepolicy for b2g.
nhirata, could you review this patch?
Attachment #8565298 - Flags: review?(nhirata.bugzilla)
Assignee: nobody → kli
Flags: needinfo?(jlal)
An alternative solution is allow disable Selinux in [1] when VARIANT=user.

[1] https://github.com/mozilla-b2g/platform_system_core/blob/b2g-5.0.0_r6/init/Android.mk#L27
Jed, How do you think about the alternative solution in comment 6? Thanks!
Flags: needinfo?(jld)
(In reply to Kai-Zhen Li [:kli][:seinlin] from comment #6)
> An alternative solution is allow disable Selinux in [1] when VARIANT=user.
> 
> [1]
> https://github.com/mozilla-b2g/platform_system_core/blob/b2g-5.0.0_r6/init/
> Android.mk#L27

I'd much prefer that we just created a policy - even if it doesn't restrict b2g at all it could be useful to protect from other compromised processes. Once SELinux is turned off it will hard to get it turned back on again (as we saw in the past with Seccomp-bpf)
we could have an selinux domain for b2g and b2g-related processes that is unrestricted, so that we get the default android policy for the other processes.
if useful, we can then improve the policy for b2g over time.
I tend to agree with comment #8 and comment #9.
Flags: needinfo?(jld)
Comment on attachment 8565298 [details] [diff] [review]
User VARIANT=userdebug for nexus-5-l.

lgtm.
Attachment #8565298 - Flags: review?(nhirata.bugzilla) → review+
Comment on attachment 8565298 [details] [diff] [review]
User VARIANT=userdebug for nexus-5-l.

Review of attachment 8565298 [details] [diff] [review]:
-----------------------------------------------------------------

https://bugzilla.mozilla.org/show_bug.cgi?id=1121577#c36 might be a blocker though.
Thanks! I think we can use VARIANT=userdebug for pvt build. But for VARIANT=user, it would be better to have a policy for b2g.
Comment on attachment 8565298 [details] [diff] [review]
User VARIANT=userdebug for nexus-5-l.

NOTE: Please see https://wiki.mozilla.org/Release_Management/B2G_Landing to better understand the B2G approval process and landings.

[Approval Request Comment]
Bug caused by (feature/regressing bug #): disable selinux is not allowed in user build
User impact if declined: pvt user build will not work
Testing completed: verified on m/c
Risk to taking this patch (and alternatives if risky): low, use 'userdebug' instead of 'user'.
String or UUID changes made by this patch: none
Attachment #8565298 - Flags: approval-mozilla-b2g37?
Used b2g-inbound build : it boots up! \o/
20150219023005
blocking-b2g: 2.2? → 2.2+
Attachment #8565298 - Flags: approval-mozilla-b2g37? → approval-mozilla-b2g37+
https://hg.mozilla.org/mozilla-central/rev/74874130dd25
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2.2 S6 (20feb)
Verified that the Nexus 5 L master nightly build can be flashed on a Nexus device, after which the device reboots successfully into Firefox OS.

Steps to Reproduce
1. Take a Nexus device and use the Taiwan QA flashing tool to full flash the latest nightly master build:
https://github.com/Mozilla-TWQA/B2G-flash-tool
$ ./flash_pvt -w
Flashing paramaters: nexus-5-l, mozilla-central, User, images, latest 
https://pvtbuilds.mozilla.org/pvt/mozilla.org/b2gotoro/nightly/mozilla-central-nexus-5-l/latest/

2. Verify that after flashing the phone reboots into Firefox OS.

3. Run the check_versions.sh script to determine the test environment:
$ ./check_versions.sh

This is the output:
Gaia-Rev        e4f7c67378e33e83f88d38ddb4a6c2cabf1423c3
Gecko-Rev       https://hg.mozilla.org/mozilla-central/rev/1b4c5daa7b7a
Build-ID        20150220010206
Version         38.0a1
Device-Name     hammerhead
FW-Release      5.0
FW-Incremental  eng.cltbld.20150220.043517
FW-Date         Fri Feb 20 04:35:32 EST 2015
Bootloader      HHZ11n
Status: RESOLVED → VERIFIED
verify v2.2

Gaia-Rev        ca64f2fe145909f31af266b1730874051ba76c78
Gecko-Rev       https://hg.mozilla.org/releases/mozilla-b2g37_v2_2/rev/16804008c29f
Build-ID        20150224162516
Version         37.0
Device-Name     hammerhead
FW-Release      5.0
FW-Incremental  eng.cltbld.20150224.201252
FW-Date         Tue Feb 24 20:13:07 EST 2015
Bootloader      HHZ12d
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: