Continuing the discussion from Lineage-16.0 (Android Pie) Nightly:
so split it.
May you want to share some experience before doing all the research from scratch?
Continuing the discussion from Lineage-16.0 (Android Pie) Nightly:
so split it.
May you want to share some experience before doing all the research from scratch?
At the beginning of the short “build hiatus” of LineageOS for the FP2 I created a virtual machine based an Ubuntu and followed the build instructions like a dumb script kiddie line by line. Maybe I can learn or contribute something?
Several hours and a single obstacle later (The blob extraction script somehow expected a “different” recovery image and failed. I ignored and circumvented this error.) the build completed successfully. But wait - huh? - it should fail, right?
I tried to locate the “app permissions”-bug inside the code and was quickly lost in a haze of python scripts and code snippets (AOSP apps, CyanogenMod apps, FP2 apps…) which are a complete mystery to me.
I deleted the virtual machine.
Android is - possibly like any other commercial or open source OS out there - a complete mess.
I am even more grateful now for the work of chrmhoffmann, z3ntu and others.
@chrmhoffmann and @z3ntu the post is collecting likes and there have been attempts to do the same by at least @thc and who knows who else.
Would you mind to enlighten us a bit?
My impression is, that there could be a third contributor by @thc, couldn’t be?
This may be still working:
LineageOS has automatically generated build pages for the supported devices for a start …
https://wiki.lineageos.org/devices/FP2/build
And how to compile TWRP (according to https://twrp.me/faq/howtocompiletwrp.html) starts here …
https://forum.xda-developers.com/showthread.php?p=32965365#post32965365
I haven’t done this myself yet, but that’s where I would start.
thx but it is quite old, will see if it still works
I know that. I’m wondering when your device isn’t listed yet.
Build instructions haven’t changed that much. It probably works as is, otherwise it’d only need minor changes. Have fun!
ok but it is still unclear to me how to start from scratch, if a device is not supported (officially or unofficially), means no LOS port available.
First try to build one that is supported. Learn the build process. Inpect Makefiles, get familiar with them.
Then the thing gets a lot difficult. Locate a supported device with similar hardware than the one you want to build for. Copy the device tree. Go each Makefile at a time making the appropiate changes. Try to build a functional recovery for it.
Then try to make it boot. Inspect logcats. And then make the rest work.
Easy peasy (nope).
Hi,
I switched from Fairphone OS to LineageOS 16.0 a week ago and I think it’s great!
Now, I’m trying to build it for myself on Ubuntu to learn how it works. Not sure I’m knowledgeable enough to contribute yet, but I guess I have to start somewhere .
I’ve followed the instructions here: https://wiki.lineageos.org/devices/FP2/build
but I am getting errors when running ./extract-files.sh
and then breakfast FP2
. There are a number of files missing (see below). Am I missing something? Any help greatly appreciated .
No device is online. Waiting for one…
Please connect USB and/or enable USB debugging
Device Found.
Cleaning output directory (./…/…/…/vendor/fairphone/FP2/proprietary)…
Extracting 121 files in ./proprietary-files-qc.txt from adb:
Those are supposed to be extracted from a FP2 running official Fairphone OS, but I think you’re trying to get them from LineageOS. That may be the cause, I guess.
I recall seeing a way to extract them from an upgrade ZIP (for Firefox OS builds, maybe?)
Thanks for your help @Roboe and @Volker . Yes, I was trying to extract from the latest LineageOS zip as it says in the instructions.
I managed to do the same with the latest Fairphone OS build and ./extract_files.sh
finds more files. This time it finds some that were missing from the LineageOS zip, but also can’t find some that were present in the LineageOS zip. Also, there are a couple of files missing from both.
This time breakfast FP2
runs without error, but brunch FP2
fails with a missing file error quoting one of the files missing from ./extract_files.sh
. Is there anywhere I can download the missing vendor files from?
Did you check at
https://code.fairphone.com/projects/fp-osos/dev/fp2-blobs-download-page.html
?
(But don’t extract them onto the Lineage OS source code!!!)
Hi @Roboe. Why is that? I think I’ve managed to find all the files the extract script needs from a combination of the LineageOS, FPOS and blob zips. Should I not build using those files?
Fairphone provides an official way to get the blobs, the thing @Volker linked above. But it’s meant to be extracted right inside the Fairphone Open OS source code. I meant you shouldn’t unpack the official blobs on the LOS source tree directly, since it modifies other things outside of the vendor
folder.
One issue with the basic research from scratch (eg. XDA) is, that one is flooded by detailed data that seems cyptic as long as the basic understanding is not there. If there is some introductionary read about the basics of alternative OS buidling that would be a marvel for all interested parties.
I find most things seem trivial once one has found out - however, before they might be huge hurdles. For me (and maybe other people familiar with IT but not Android development) its more about basic concepts than detailed procedures. I did check out several books. There are many with great info about how Android apps work and how to program them. That stuff is mostly useless for someone looking at porting an alternative OS to another hardware or maintaining an alternative OS.
Just to give some examples of what I mean here some typical questions about basic concepts.
In a perfect world, the same kernel source could be used on all devices with only the dts/dtb (device tree source/device tree binary - it’s a structured way of describing the hardware so the kernel knows what’s there) being different and maybe a different kernel configuration where different drivers are built.
Unfortunately that’s not the case and most kernel trees have a bunch of ugly hacks in them that only work for one specific device (and hardware drivers are likely missing in trees for other devices).
Rooting the device = getting root access (a.k.a superuser) in the existing Android install (e.g. by using Magisk)
Unlocked bootloader = necessary in most cases for rooting, but you can for example flash a completely different operating system onto the device
Yes
Again, vendor kernels are ugly so it’s not a good idea - and FP3 kernel sources have been released (although I’m not sure they’re complete). Big parts of Android system builds are also userspace drivers which are usually extracted either from a running system or a factory image (“proprietary blobs”).
In LineageOS there are always patches to apply for getting newer versions working, at least Android 9 → 10 has been relatively simple compared to previous versions in my experience.
Again, the kernels running on Android phones are heavily patched and vendors usually don’t care to merge newer linux-stable releases into the kernel sources but only cherry-pick “important” patches. On x86 PCs the hardware is relatively standard and doesn’t change much - e.g. a mouse is a USB HID device and the protocol is fixed since USB exists (or something like that). The release cadence on mobile phone parts is currently much quicker and there aren’t many standard protocols for the kernel to communicate with hardware parts and hardware vendors usually release a driver which the OEM just takes and uses in their specific kernel.