Jump to content

[DEV][ROM][1.8.] CAF Firefox OS - B2G


Guest KonstaT

Recommended Posts

Guest itorres

First of all, thanks a lot KonstaT. I didn't expect you to release another update after your accurate comment pointing that the efforts should concentrate on msm8909.

 

-ported seccomp support to kernel (if someone wants to test shallow flashing B2G >2.0)

 

Tested it with 2.0, 2.1, 2.2 and mozilla-central nightlies from http://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/

 

2.0 and 2.1 flash and work correctly

 

There's a change in 2.2+ that produces a registered bug 1148324 fixed in 1151787 but it implies modifying some gonk elements.
 

root@falcon_umts:/ # /system/bin/b2g.sh
[1848] WARNING: Tried to RegisterCallback without an AtExitManager: file ../../../gecko/ipc/chromium/src/base/at_exit.cc, line 40
*****************************************************************
***
*** This is stdout. Most of the useful output will be in logcat.
***
*****************************************************************
11|root@falcon_umts:/ #

I'm trying to understand all the elements that are part of a build to be able to patch things like the camera and this. Not create the actual patches but at least apply them. Any pointers will be welcome. :)

Edited by itorres
Link to comment
Share on other sites

Guest KonstaT

There's a change in 2.2+ that produces a registered bug 1148324 fixed in 1151787 but it implies modifying some gonk elements.

root@falcon_umts:/ # /system/bin/b2g.sh
[1848] WARNING: Tried to RegisterCallback without an AtExitManager: file ../../../gecko/ipc/chromium/src/base/at_exit.cc, line 40
*****************************************************************
***
*** This is stdout. Most of the useful output will be in logcat.
***
*****************************************************************
11|root@falcon_umts:/ #

I'm trying to understand all the elements that are part of a build to be able to patch things like the camera and this. Not create the actual patches but at least apply them. Any pointers will be welcome. :)

I haven't looked into what's wrong with shallow flashing B2G 2.2. There could be some useful info in logcat though (stdout is empty here and doesn't give any info - warnings we can usually ignore). 
 
Issue you linked is only present on hammerhead l-mr1 builds. This translates to Nexus 5 running Android 5.1 based build. This build is based on KitKat (Android 4.4).
 
There's some patches that you need to manually apply in B2G-CAF local_manifest's patches directory. Copy patches to the respective project directory (e.g. frameworks_av to frameworks/av, hardware_qcom_wlan to hardware/qcom/wlan, and so on). Change into the directory and apply with:
git am -3 patchname.patch

There's more patches for gaia/gecko in b2g_common device directory but build system applies this patches automatically.

Link to comment
Share on other sites

Guest KonstaT

The moto g I have came with LP 5.02 can I just flash B2G on top of it or I must downgrade to KK first?

I'd expect you to experience 'screen flickering' issue if you have a Lollipop bootloader.
 
Downgrading a bootloader isn't possible anyway, so...
Link to comment
Share on other sites

Guest celrau

 

I'd expect you to experience 'screen flickering' issue if you have a Lollipop bootloader.
 
Downgrading a bootloader isn't possible anyway, so...

 

Already downgraded to 4.4.4 and yes, I have the screen flickering but it goes away with lock/unlock the device so it's not an issue. I'll flash B2G later on see how it goes.

Link to comment
Share on other sites

Guest celrau

Already downgraded to 4.4.4 and yes, I have the screen flickering but it goes away with lock/unlock the device so it's not an issue. I'll flash B2G later on see how it goes.

 

Something went wrong (flashed twice), settings are not saved, storage is not found, camera doesn't work, wi-fi doesn't work. I flashed the latest + kernel/camera fix. Note that all of the above work with Android. Also I'm doing this without a sim card but that shouldn't matter I imagine. Where could I post a logcat if needed?

Link to comment
Share on other sites

Guest celrau

Here's a

 

Something went wrong (flashed twice), settings are not saved, storage is not found, camera doesn't work, wi-fi doesn't work. I flashed the latest + kernel/camera fix. Note that all of the above work with Android. Also I'm doing this without a sim card but that shouldn't matter I imagine. Where could I post a logcat if needed?

Here's the logcat KonstaT, hope it will give you some idea what went wrong:

Link to comment
Share on other sites

Guest KonstaT

Something went wrong (flashed twice), settings are not saved, storage is not found, camera doesn't work, wi-fi doesn't work. I flashed the latest + kernel/camera fix. Note that all of the above work with Android. Also I'm doing this without a sim card but that shouldn't matter I imagine. Where could I post a logcat if needed?

 

Here's a

 

Here's the logcat KonstaT, hope it will give you some idea what went wrong:

What recovery did you use? Did you wipe/factory reset and format /system?
 
Could be something related to the fact that your device is recognized as GPE variant (/data formatted as ext4). I think someone confirmed everything working on xt1033 converted to GPE but I've never tested that myself of course. Can you check if /data is mounted ('mount' in adb shell)?
Link to comment
Share on other sites

Guest celrau

Neve

 

 

What recovery did you use? Did you wipe/factory reset and format /system?
 
Could be something related to the fact that your device is recognized as GPE variant (/data formatted as ext4). I think someone confirmed everything working on xt1033 converted to GPE but I've never tested that myself of course. Can you check if /data is mounted ('mount' in adb shell)?

 

KonstaT, hard to tell what happened, the KK I used to downgrade from LP was a Google rom (?), I flashed a 4.4.4 moto g stock afterwards, your B2G rom and everything is OK now. Don't know why. My device is xt1032 and I use philz-touch recovery.

Link to comment
Share on other sites

Guest celrau

I've started building B2G but towards the end it stopped with:

 

make: *** No rule to make target `out/target/product/falcon/obj/SHARED_LIBRARIES/libbtnv_intermediates/export_includes', needed by `out/target/product/falcon/obj/SHARED_LIBRARIES/libbt-vendor_intermediates/import_includes'.  Stop.

 

You have any idea where that comes from?

 

Forgot a patch :)

Edited by celrau
Link to comment
Share on other sites

Guest celrau

After building B2G I have a lot of .img in /out/target/product/falcon/ (boot,cache,dt,persist,ramdisk,ramdisk-recovery,system,userdata,recovery), must I flash all those in fastboot? Your .zip archive has only the system folder and boot .img.

Link to comment
Share on other sites

Guest KonstaT

After building B2G I have a lot of .img in /out/target/product/falcon/ (boot,cache,dt,persist,ramdisk,ramdisk-recovery,system,userdata,recovery), must I flash all those in fastboot? Your .zip archive has only the system folder and boot .img.

fastboot flash boot boot.img
fastboot flash system system.img

Wipe data/factory reset in recovery first if you want to keep files on your internal sdcard (otherwise 'fastboot erase userdata' works too).

 
B2G build system doesn't have java so building a flashable zip fails with signing the package. This can be worked around by manually copying signapk.jar into out/host/linux-x86/framework/ and running
make otapackage

This creates a flashable zip like the one in the OP.

 
Or you could also just 'winzip' it. :P Replace system folder and boot.img in the old flashable zip with the ones in your out directory.
Link to comment
Share on other sites

  • 2 weeks later...
Guest KonstaT

Any reason this rom would not run on xt1039 (LTE)?

Plenty. It won't work, don't even try it.
 
Kernel needs to be compiled with different config to get the correct dtb for peregrine. There's also differences in at least in storage layout and sensors. Should be pretty easy to bring up peregrine, though. Diff CM's device/kernel/vendor trees between falcon and peregrine and see what needs to be changed.
Link to comment
Share on other sites

Guest celrau

Hey KonstaT, when I'm on a call the other person hears an echo of his own voice, I flashed KK and the echo disapeared. Have any idea where that might come from? It was suggested to me on b2g forum that it might be a missing blob for echo cancelation or something...

Link to comment
Share on other sites

Guest KonstaT

Hey KonstaT, when I'm on a call the other person hears an echo of his own voice, I flashed KK and the echo disapeared. Have any idea where that might come from? It was suggested to me on b2g forum that it might be a missing blob for echo cancelation or something...

Yeah, it seems I've forgot to define audio calibration data properties. This is needed because Motorola doesn't keep the data in the default location.
 
Add these to /system/build.prop.
persist.audio.calfile0=/etc/Bluetooth_cal.acdb
persist.audio.calfile1=/etc/General_cal.acdb
persist.audio.calfile2=/etc/Global_cal.acdb
persist.audio.calfile3=/etc/Handset_cal.acdb
persist.audio.calfile4=/etc/Hdmi_cal.acdb
persist.audio.calfile5=/etc/Headset_cal.acdb
persist.audio.calfile6=/etc/Speaker_cal.acdb
This also fixes adjusting in-call volume that didn't work previously IIRC.
Link to comment
Share on other sites

Guest celrau

One other thing, v2.0 doesn't support MTP (as stated on first post) but v2.1 does and I'm running 2.1. Still, I cannot mount internal storage on my Linux box, is there any way to fix that? Here's a part of logcat:

I/AutoMounter(  217): Changing mode from 'Enable-UMS' to 'Enable-MTP'
I/AutoMounter(  217): AutoMounter state changed from UMS_CONFIGURED to MTP_CONFIGURING
I/AutoMounter(  217): SetUsbFunction(mtp) sys.usb.config to 'mtp,adb'
I/AutoMounter(  217): UpdateState: ums:A1C1E0 mtp:A1C0E1 mode:3 usb:1 tryToShare:0 state:MTP_CONFIGURING
Link to comment
Share on other sites

Guest KonstaT

 

One other thing, v2.0 doesn't support MTP (as stated on first post) but v2.1 does and I'm running 2.1. Still, I cannot mount internal storage on my Linux box, is there any way to fix that? Here's a part of logcat:

I checked Nexus 5 sources I don't see any change related to MTP there. Storage should be already configured correctly on the device side AFAICT.

 

Likely something in the gonk/gecko/gaia then. Did you shallow flash or build it yourself? Did you update both gecko and gaia to 2.1?

Link to comment
Share on other sites

Guest celrau

I checked Nexus 5 sources I don't see any change related to MTP there. Storage should be already configured correctly on the device side AFAICT.

 

Likely something in the gonk/gecko/gaia then. Did you shallow flash or build it yourself? Did you update both gecko and gaia to 2.1?

I built everything myself and flashed both @ 2.1. It tries to mount but I get notices from my desktop os that it can't mount the device, one after another since it keeps on trying. I've also looked at dmesg and didn't see anything unusual. Will keep looking for hints. Didn't mount on OSX either.

Link to comment
Share on other sites

Guest celrau

Here's the relevant part in dmesg after plugging in the phone with USB storage (MTP) enabled:

[  891.310736] usb 2-8: new high-speed USB device number 5 using ehci-pci
[  891.524348] usb-storage 2-8:1.5: USB Mass Storage device detected
[  891.524929] scsi6 : usb-storage 2-8:1.5
[  891.525059] usbcore: registered new interface driver usb-storage
[  891.536972] usbcore: registered new interface driver uas
[  891.595005] usbcore: registered new interface driver cdc_wdm
[  891.609388] qmi_wwan 2-8:1.4: cdc-wdm0: USB WDM device
[  891.609946] qmi_wwan 2-8:1.4 wwan0: register 'qmi_wwan' at usb-0000:00:02.1-8, WWAN/QMI device, 06:9c:4d:b8:22:b4
[  891.610043] usbcore: registered new interface driver qmi_wwan
[  891.635123] audit: type=1701 audit(1431516896.478:4): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=469 comm="systemd-udevd" exe="/usr/lib/systemd/systemd-udevd" sig=6
[  891.701101] usb 2-8: USB disconnect, device number 5
[  891.702015] qmi_wwan 2-8:1.4 wwp0s2f1u8i4: unregister 'qmi_wwan' usb-0000:00:02.1-8, WWAN/QMI device
[  891.954481] usb 2-8: new high-speed USB device number 6 using ehci-pci
[  897.857833] usb 2-8: USB disconnect, device number 6
[  898.115319] usb 2-8: new high-speed USB device number 7 using ehci-pci
Link to comment
Share on other sites

Guest celrau

Here's the output from mtp-detect if it's of any help (notice vendor/product id are different from what one finds on Google for Moto G):

libmtp version: 1.1.9

Listing raw device(s)
Device 0 (VID=05c6 and PID=9039) is a Qualcomm (for PhiComm) C230w (MTP).
   Found 1 device(s):
   Qualcomm (for PhiComm): C230w (MTP) (05c6:9039) @ bus 2, dev 36
Attempting to connect device(s)
Android device detected, assigning default bug flags
Error 1: Get Storage information failed.
Error 2: PTP Layer error 02fe: get_handles_recursively(): could not get object handles.
Error 2: Error 02fe: PTP: Protocol error, data expected
USB low-level info:
   bcdUSB: 512
   bDeviceClass: 0
   bDeviceSubClass: 0
   bDeviceProtocol: 0
   idVendor: 05c6
   idProduct: 9039
   IN endpoint maxpacket: 512 bytes
   OUT endpoint maxpacket: 512 bytes
   Raw device info:
      Bus location: 2
      Device number: 36
      Device entry info:
         Vendor: Qualcomm (for PhiComm)
         Vendor id: 0x05c6
         Product: C230w (MTP)
         Vendor id: 0x9039
         Device flags: 0x18008106
Configuration 0, interface 0, altsetting 0:
   Interface description contains the string "MTP"
   Device recognized as MTP, no further probing.
Device info:
   Manufacturer: motorola
   Model: Moto G
   Device version: 1.0
   Serial number: TA8830PFJW
   Vendor extension ID: 0x00000006
   Vendor extension description: microsoft.com: 1.0; android.com: 1.0;
   Detected object size: 64 bits
   Extensions:
        microsoft.com: 1.0
        android.com: 1.0

Edited by celrau
Link to comment
Share on other sites

Guest celrau

Flashed Android KK 4.4.4 and the vendor/product ID reverted to normal:

lsusb
Bus 001 Device 037: ID 22b8:2e76 Motorola PCS 

Flashed b2g-20150104-falcon.zip and they changed:

lsusb
Bus 001 Device 091: ID 05c6:9039 Qualcomm, Inc. 

How does that happen???

Link to comment
Share on other sites

Guest KonstaT

Flashed Android KK 4.4.4 and the vendor/product ID reverted to normal:

lsusb
Bus 001 Device 037: ID 22b8:2e76 Motorola PCS 

Flashed b2g-20150104-falcon.zip and they changed:

lsusb
Bus 001 Device 091: ID 05c6:9039 Qualcomm, Inc. 

How does that happen???

Because for some reason I haven't imported Motorola USB configs. :P Default qcom USB modes were used instead. This didn't cause any issues before and I'm not sure if it'll make MTP work either.

 

Sync your sources to get this change and rebuild boot image.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.