Hi,
Le mercredi 17 février 2016 15:33:18 UTC+1, [email protected] a écrit :
>
> I'm interested in what you have found about this phone. I want to have FOS
> 2.5 on this phone and be able to get the SMS (French Free carrier) because it
> does'nt work well with alcatel build.
>
> Thank you !
Allright, let's go.
There are two ways to get FxOS 2.5 running on Fire E: rebuilding everything
from source or upgrading selected components. I'll detail this last approach
now, as rebuilding everything from source requires information that I'm still
lacking at the moment.
Prerequisite is that you _need_ OEM FxOS 2.0 build [1] installed and running
before going further. There's _no_ way to go without it. Indeed, OEM FxOS 1.3
build is based on Android Jelly Bean 4.3 r3 (build JLS36C) whereas OEM FxOS 2.0
build is based on newer Android Kitkat (KK) 4.4.2 r2 (build KVT49L). The reason
is that we'll upgrade Gecko/Gaia component whereas Gonk layer will be kept
untouched. And since we'll be using Gecko/Gaia component from Mozilla Flame, we
must ensure that we're running the same Gonk layer to prevent issues as much as
possible.
But why use Gecko/Gaia component from Mozilla Flame, may you ask? Well, because
as Mozilla's reference phone, Flame has probably the best FxOS support, with
FxOS builds readily available. And also because, luckily enough, Flame and Fire
E seem close siblings. Indeed, they're designed/manufactured by the same
company: TCL. More exactly T2Mobile for Flame and TCT (standing for TCL
Communication Technology) Mobile Limited for Fire E, both 100% subsidiaries of
TCL. As another evidence of this close relationships, Flame is provided with
Alcatel OneTouch-branded battery pack. And Alcatel OneTouch is the brand
TCT-manufactured phones are sold under (e.g. Alcatel OneTouch 6015X for Fire
E). So, I _think_ that Fire E can be seen as the consumer version of Flame
(targeted at developers). Hardware seems very close too, with the exception of
smaller 512MB (fixed) RAM on Fire E vs. 256MB-1GB (adjustable) on Flame, NFC
support on Flame (none on Fire E) and bigger qHD (960x540 pixels) display on
Fire E vs. FWVGA (854x480 pixels) on Flame. Here, we're lucky again as pixel
ratio is the same (GAIA_DEV_PIXELS_PER_PX 1.5) between Flame and Fire E, so
Gaia component from Flame can be used as-is.
Now, why KK-based Gonk is important? Well, because FxOS 2.x builds for Flame
are KK-based. In fact, FxOS 2.0 v18D base image for Flame [2] was built on Dec.
15, 2014 while OEM FxOS 2.0 for Fire E was built on Dec. 12, 2014 so only 3
days earlier. And both are based on same Android KK KVT49L build. Pretty close,
isn't it? BTW, size of /system partition on eMMC is exactly the same between
Flame and Fire E, though located at different sectors. Additionally, partition
names and numbering are also the same.
Ready for action? I assume that you have an external SD inserted in your Fire
E. I assume that you're comfortable with Linux, familiar with adb and fastboot
and that you know how to backup and unbrick your phone. I also assume that you
already have backup copies of /boot, /system and /custpack partitions. For
this, you need to get ClockWorkMod (CWM) recovery [3] of Alcatel OneTouch 6014X
"Idol 2 Mini L" phone (Fire E's Android variant). Using CWM recovery, you can
gain root access with adb when required. Upgrading Gecko/Gaia while keeping
Gonk untouched will require altering /system and /custpack partitions (and
/boot in one occasion). While most (all?) FxOS phones are hosting FxOS files on
unique /system partition, these are spread across two distinct /system and
/custpack partitions on Fire E, with symlinks from /system to /custpack for
some of them. In short, Gonk/Gecko is hosted on /system on Fire E, whereas Gaia
is hosted on /custpack. This is a major difference from FxOS standard layout,
hence the reason I still don't have a working build configuration to rebuild
everything from source and why we cannot use shallow-flash.sh script [4] as-is.
Disclaimer: Once upgraded to FxOS > 2.0, you'll lose time keeping between
reboots or resume when SIM is locked and WiFi disconnected. You'll probably
also lose A-GPS feature and probably other things that I didn't noticed yet ;-)
Indeed, /system/b2g/distribution/bundles folder contains four... bundles:
b2g_time, location, settings and telephony, the exact purpose isn't known to
me. I know for sure that b2g_time bundle normally helps in keeping time while
SIM is locked and WiFi disconnected. But on Fire E, this isn't sufficient:
b2g_time bundle works in conjunction with telephony bundle to achieve this
successfully. telephony bundle is probably used for other things
telephony-related, but I don't know exactly what. location bundle is probably
related to A-GPS. settings is perhaps related to customization in OEM FxOS
build, such as integrated Application Manager, Torch webapp, etc. All these
bundles rely on proprietary binaries by Qualcomm, compatible with Gecko 32 API
only, as found in FxOS 2.0. As soon as you upgrade to FxOS > 2.0, these
binaries won't work anymore as Gecko API evolves.
The upgrade procedure I'll now describe is adapted from shallow-flash.sh
script. It doesn't require unlocking your device :-)
Warning: This procedure will wipe everything on your phone. So don't keep
contacts, media or important data there. You've been warned.
Upgrade to FxOS 2.1 (Gecko 34):
- get Gecko/Gaia component from Flame KK device [5];
- get Fira font update [6];
- loop mount your OEM FxOS 2.0 /custpack partition image backup. This is
MOUNT_DIR from now on;
- extract gaia.zip: this creates gaia folder with profile subfolder.
gaia/profile is GAIA_DIR from now on;
- remove MOUNT_DIR/webapps folder and replace it with GAIA_DIR/webapps;
- overwrite MOUNT_DIR/b2g/defaults/pref/user.js with
GAIA_DIR/defaults/pref/user.js;
- overwrite MOUNT_DIR/b2g/defaults/settings.js with
GAIA_DIR/defaults/settings.js;
- overwrite MOUNT_DIR/b2g/user.js with GAIA_DIR/user.js;
- ensure that MOUNT_DIR/b2g and MOUNT_DIR/webapps are owned (recursively) by
root:root;
- unmount the updated /custpack partition image in MOUNT_DIR.
That's all for Gaia. Now, go for Gecko:
- extract b2g-34.0.en-US.android-arm.tar.gz; it expands in b2g folder. This is
B2G_DIR from now on;
- loop mount your OEM FxOS 2.0 /system partition image backup. This is
MOUNT_DIR from now on;
- optionally remove MOUNT_DIR/b2g/distribution folder; as explained earlier,
bundles therein won't work anymore with Gecko 34;
- overwrite (without erasing to keep the symlinks to /custpack partition
untouched) MOUNT_DIR/b2g with B2G_DIR;
- extract Fira font update: it expands in fira-font-update folder. There's
fonts subfolder therein. fira-font-update/fonts is FONT_DIR from now on;
- copy all files from FONT_DIR to MOUNT_DIR/fonts;
- ensure that MOUNT_DIR/b2g and MOUNT_DIR/fonts are owned (recursively) by
root:root;
- optionally remove MOUNT_DIR/media/audio and MOUNT_DIR/media/video folders;
- unmount the updated /system partition image in MOUNT_DIR.
Let's flash everything to the phone:
- adb reboot bootloader to put Fire E in fastboot mode;
- sudo fastboot flash custpack custpack.img to update Gaia. I assume here that
the OEM FxOS 2.0 backup copy of /custpack partition we've just updated was
named custpack.img. Adjust accordingly if that wasn't the case;
- I never had luck flashing /system partition image with fastboot flash. So,
still from fastboot mode, boot CWM recovery: sudo fastboot boot recovery.img.
Wait until CWM screen is displayed on phone;
- send updated /system partition image to external SD card in phone: adb push
system.img /sd-ext. I assume here that the OEM FxOS 2.0 backup copy of /system
partition we've just updated was named system.img. Adjust accordingly if that
wasn't the case;
- run adb shell and "flash" updated /system partition. This operation requires
root access, that's why we've booted from CWM recovery: cat /sd-ext/system.img
> /dev/block/platform/msm_sdcc.1/by_name/system;
- once done, chose factory reset/wipe all partitions from CWM recovery;
- still from CWM recovery, chose reboot system now.
Fire E should restart, happily running FxOS 2.1. Don't panic if FxOS boot
animation logo hangs. You should ultimately be welcomed by FxOS first-launch
customization process :-)
Upgrade to FxOS 2.2r (_not_ 2.2 it doesn't work on Fire E) (Gecko 37):
- get Gecko/Gaia component from Flame KK device [7];
- get mkbootimg tools [8];
- follow steps above to create updated /custpack and /system partition images;
Bluetooth has been put in a separate process between FxOS 2.1 and 2.2, so
there's some work here:
- loop mount your /system partition image. This is MOUNT_DIR from now on;
- loop mount Flame's v18D /system partition image (you need to convert it from
sparse image to image file format using simg2img first). This is V18D_DIR;
- copy V18D_DIR/bin/bluetoothd to MOUNT_DIR/bin. Ensure it's owned by root:2000;
- copy V18D_DIR/lib/libfdio.so to MOUNT_DIR/lib. Ensure it's owned by root:root;
- unmount both v18D /system partition image in V18D_DIR and updated /system
partition image in MOUNT_DIR;
- extract Flame's v18D /boot partition image using mkboot from mkbootimg tools:
mkboot boot.img boot. The created boot folder is FLAME_BOOT_DIR from now on;
- extract your OEM FxOS 2.0 backup copy of /boot partition using mkboot from
mkbootimg tools: mkboot boot.img boot. I assume here that the OEM FxOS 2.0
backup copy of /system partition was named system.img. Adjust accordingly if
that wasn't the case. The created boot folder is FIRE_BOOT_DIR from now on;
- copy FLAME_BOOT_DIR/ramdisk/init.bluetooth.rc to FIRE_BOOT_DIR/ramdisk;
ensure it's owned by root:root;
- edit FIRE_BOOT_DIR/ramdisk/init.qcom.rc file, look for service hciattach
section and replace root by bluetooth (user root -> user bluetooth; group
bluetooth net_bt_admin root -> group bluetooth net_bt_admin bluetooth);
- edit FIRE_BOOT_DIR/ramdisk/init.rc file and add import /init.bluetooth.rc
directive, just after import /init.trace.rc one;
- repack boot.img, still using mkboot from mkbootimg tools: mkboot
FIRE_BOOT_DIR boot.img;
- adb reboot bootloader to put Fire E in fastboot mode;
- sudo fastboot flash boot boot.img to flash the updated /boot partition we've
just created above;
- flash /custpack and /system partitions as described in FxOS 2.1 upgrade.
Fire E should restart, happily running FxOS 2.2. Frames of FxOS boot animation
aren't sized correctly, so you'll now noticed a one-pixel white border in the
top, bottom and right edges [9]. This is harmless functionally-wise, but may
have an impact performance-wise.
Upgrade to FxOS 2.5 (Gecko 44):
- get Gecko/Gaia component from Flame KK device [10];
- steps are identical to upgrade to 2.2r above.
Upgrade to FxOS 2.6 (Gecko 46):
- get Gecko/Gaia component from Flame KK device [11];
- steps are identical to upgrade to 2.2r/2.5 above.
Hope this helps,
Émeric
[1] http://4pda.ru/forum/index.php?showtopic=656329
[2] http://cds.w5v8t3u9.hwcdn.net/v18D.zip
[3]
https://github.com/cookiengineer/alcatel-6015x/blob/master/custom/recovery.img
[4] https://github.com/Mozilla-TWQA/B2G-flash-tool/blob/master/shallow_flash.sh
[5]
http://ftp.mozilla.org/pub/b2g/nightly/2015/07/2015-07-24-00-12-07-mozilla-b2g34_v2_1-flame-kk/
[6] https://people.mozilla.org/~mwu/fira-font-update.zip
[7] http://ftp.mozilla.org/pub/b2g/nightly/latest-mozilla-b2g37_v2_2r-flame-kk/
[8] https://github.com/xiaolu/mkbootimg_tools.git
[9] https://groups.google.com/forum/#!topic/mozilla.dev.fxos/dzh6KxWTw7I
[10] http://ftp.mozilla.org/pub/b2g/nightly/latest-mozilla-b2g44_v2_5-flame-kk/
[11] http://ftp.mozilla.org/pub/b2g/nightly/latest-mozilla-central-flame-kk/
_______________________________________________
dev-fxos mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-fxos