Building LineageOS for FP4



Any ideas where I should upload/share the build?

4 Likes

WET, mega

you might want to take a look at https://androidfilehost.com/

2 Likes

Hi,

I just uploaded mine on github: https://github.com/g4bwy/proprietary-vendor_fairphone_FP4

except it’s just the vendor/fairphone/FP4 subtree and not the whole vendor/fairphone, so I guess it needs to be set like this in repo’s config instead:

<project path="vendor/fairphone/FP4" remote="github" name="g4bwy/proprietary-vendor_fairphone_FP4" />
2 Likes

Looks like I found one source of where the 54 LineageOS installations
comming from, when you search for “FP4” at https://stats.lineageos.org/. :wink:

I am by now sure LOS will find its way onto my brand new FP4 sooner or later. :smiley: I’ll try to be a patient patient by now.
Have fun!

2 Likes

The fall back Stock ROM is available now https://forum.fairphone.com/t/finally-the-fp4-rom-file-is-available/82041. Touch wood and have fun trying.

1 Like

I’ll post it here just for cross refs: FP4 and LineageOS - #162 by g4b

btw, this build was made with test keys. I have another one with custom keys, but I’m concerned about migration whenever an official upstream build becomes available, so I didn’t upload it (also signature verification needs to be bypassed when installing from recovery, and I’m not sure how to fix it)

does anyone here have experience with that ? (I found the migration scripts here, but since I can’t test it with an actual official build I’m not yet confident to start using my custom keys as a daily driver…)

So I’ve been playing with my LOS build and so far I’m very happy with it.

Now I’m a bit disappointed because I intended to do greater things with my FP4 one of them implying cifs filesystem support. Which of course is not enabled by default.
I would not mind starting to mess with custom kernels but I honestly have but a blurry idea how to do that.

  1. I’ve browsed a bunch of threads mentioning cifs support and the only thing valuable I found was

    • add “CONFIG_CIFS=m” in some obscur configuration file named “defconfig” ? I looked at the kernel sources tree and could not find such file
    • I need to incorporate modules md4.ko and cifs.ko to the build. Here again I understood those modules have to be built in a device specific way that I could not figure out
  2. In the event I solved 1. I’d still I need to figure out how to build ONLY the LOS kernel. I mean I could get it by building the entire room but it seems a bit disproportionate.

Anyone here has some knowledge on custom kernel building/patching to share ?

I’m a developer thou I don’t have much experience working with kernels.

Regarding the issue 1:

  • After a quick search in the kernel tree with find I found the following “defconfig” files:
kernel/fairphone/sm7225/arch/nds32/configs/defconfig
kernel/fairphone/sm7225/arch/alpha/defconfig
kernel/fairphone/sm7225/arch/riscv/configs/defconfig
kernel/fairphone/sm7225/arch/s390/defconfig
kernel/fairphone/sm7225/arch/arm64/configs/defconfig
kernel/fairphone/sm7225/scripts/kconfig/tests/inter_choice/defconfig

I guess you should add the CONFIG_CIFS=m flag in kernel/fairphone/sm7225/arch/arm64/configs/defconfig as “arm64” is the ISA the sm7225 chip uses.

  • As far as I understood, those kernel objects do not need to be strictly device specific. A quick search led me to see that you can even load them at runtime with insmod. Although I think you’ll probably need to add a build instruction to add them at build time. But I’m just guessing.

With the issue 2: do not worry about that. Usually, especially in well written software, building instructions and resolution are made so only the objects whose source files have been modified are recompiled again. So, next time you type brunch FP4 after changing the source, you should only see some kernel modules being recompiled (and later repackaged in the zip file).

2 Likes

Btw, I want to thank you all for contributing in this thread on how to build LOS. With your help I managed to build and flash LOS.

For anyone interested, I’ve modified the partner_gms to only include FDroid, the priviledge extensions and the two localization services. While I want a degoogled OS I have avoided using MicroG, at the moment, for security concerns.

If anyone is interested in using such configuration let me know so I’ll post the forked repository with the changes. I still haven’t made them public as I am testing it.

1 Like

This is awesome, thanks a lot I will for sure give a try !

Problem is, for some reason I can’t get “brunch” command recoginized before I proceed to “repo sync”. Which always ends up modifying something (los repo is in constant motion), therefore implies the full rebuild of the entire rom…
Is there anything I’m missing ? How can I initialize brunch command without syncing repo first ?

Edit: it seems the command

source build/envsetup.sh

is the one initializing brunch command

Edit 2:

From what I’ve read it seems you HAVE to build the ko modules specifically for the kernel. But this seems way out of my league for now.

I’m new with android things, but in linux to configure the kernel you can do that:

  • cd into the kernel directory.
$ cd /path/to/kernel
  • Generate a default config with most drivers built into the kernel.
$ make defconfig
  • Open an interactive menu to edit the generated .config (needs ncurses).
    Find CIFS inside the menu (</> for Search) and enable as a module <M> not <Y>.
$ make menuconfig
  • Build The Kernel
$ make
  • Install Kernel Modules (Modules are installed to /path/to/somewhere.).
$ make INSTALL_MOD_PATH="/path/to/somewhere" INSTALL_MOD_STRIP=1 modules_install

If there is not much difference (between android and linux), it should be the same or similar.

3 Likes

Thank you this is very usefull, my main struggle being how to find the source of said modules. But this will already definitely help !

If it’s a kernel module, the source it’s the kernel itself. In that case: link

2 Likes

Reporting back in case other people were interested.
@eudaldgr thanks for your very clear instructions.

After some struggle I realized one step was missing which was actually saving deconfig:
After:

make menuconfig

I was required to run:

make savedefconfig

then

mv defconfig arch/arm64/configs/

2 Likes

I builded LineageOS-18.1 + microG + stock FPCamera succesfully :tada: (I’m trying poshul pull requests 1, 2).

Built and signed the build with the lineageos4microg docker image.
Following the instructions given by @Error :heart_eyes:.
Here you can find my proprietary blobs + FPCamera. All extracted from device, no iode things.

I can launch the “pro”, “video” and “selfie” modes, but if I launch the normal application, it crashes, logcat.

If someone wants to try this, build or download. Any feedback will help.

5 Likes

Let me ask you a question, even if it is a stupid one
Why is there no official LOS?
No maintainer?
Other problems?

The building of the image itself seems to work.

Is there any information about this?

There is already a GSI image of LeOS. So the AOSP seems to be already ported.

I guess the answer can be found in the parallel thread:https://forum.fairphone.com/t/fp4-and-lineageos/77347/84

5 Likes

Then download the iodé rom linked above (file iode-2.3-20220121-FP4.zip). Extract the zip and follow this tutorial 2 on how to extract the proprietary files from payload.bin file.

I just do use the iode zip to extract the payload.bin file, right?

1 Like