English

How to build LineageOS

Tags: #<Tag:0x00007f05d99fcd48>

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.

4 Likes

@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?

1 Like

This may be still working:

1 Like

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.

1 Like

thx but it is quite old, will see if it still works :grin:

I know that. I’m wondering when your device isn’t listed yet.

1 Like

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.

2 Likes

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).

5 Likes

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 :slight_smile:.

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 :slight_smile:.

Output of extract-files.sh

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:

  • vendor/bin/adsprpcd
  • vendor/bin/fm_qsoc_patches
  • vendor/bin/hci_qcomm_init
    !! vendor/bin/hci_qcomm_init: file not found in source
  • vendor/bin/irsc_util
  • vendor/bin/loc_launcher
  • /vendor/bin/mm-pp-daemon
  • vendor/bin/mpdecision
  • vendor/bin/netmgrd
  • vendor/bin/qmuxd
  • vendor/bin/qseecomd
  • vendor/bin/radish
  • vendor/bin/rfs_access
  • vendor/bin/rmt_storage
  • vendor/bin/sensors.qcom
  • vendor/bin/time_daemon
  • vendor/etc/data/dsi_config.xml
  • vendor/etc/data/netmgr_config.xml
  • vendor/firmware/a330_pfp.fw
    !! vendor/firmware/a330_pfp.fw: file not found in source
  • vendor/firmware/a330_pm4.fw
    !! vendor/firmware/a330_pm4.fw: file not found in source
  • vendor/firmware/venus.b00
    !! vendor/firmware/venus.b00: file not found in source
  • vendor/firmware/venus.b01
    !! vendor/firmware/venus.b01: file not found in source
  • vendor/firmware/venus.b02
    !! vendor/firmware/venus.b02: file not found in source
  • vendor/firmware/venus.b03
    !! vendor/firmware/venus.b03: file not found in source
  • vendor/firmware/venus.b04
    !! vendor/firmware/venus.b04: file not found in source
  • vendor/firmware/venus.mbn
    !! vendor/firmware/venus.mbn: file not found in source
  • vendor/firmware/venus.mdt
    !! vendor/firmware/venus.mdt: file not found in source
  • vendor/etc/permissions/qcnvitems.xml
  • vendor/etc/permissions/qcrilhook.xml
  • vendor/framework/qcnvitems.jar
    Checking if system is odexed and locating boot.oats…
  • vendor/framework/qcrilhook.jar
  • vendor/lib/libmdmdetect.so
  • vendor/bin/thermal-engine
  • vendor/lib/egl/eglsubAndroid.so
  • vendor/lib/egl/libEGL_adreno.so
  • vendor/lib/egl/libGLESv1_CM_adreno.so
  • vendor/lib/egl/libGLESv2_adreno.so
  • vendor/lib/egl/libq3dtools_adreno.so
  • vendor/lib/hw/activity_recognition.msm8974.so
  • vendor/lib/hw/flp.default.so
  • vendor/lib/hw/sensors.msm8974.so
  • vendor/lib/libC2D2.so
  • vendor/lib/libCB.so
  • vendor/lib/libOmxAacDec.so
  • vendor/lib/libOmxAmrwbplusDec.so
  • vendor/lib/libOmxEvrcDec.so
  • vendor/lib/libOmxQcelp13Dec.so
  • vendor/lib/libOmxWmaDec.so
  • vendor/lib/libOpenCL.so
  • vendor/lib/libQSEEComAPI.so
  • vendor/lib/libRSDriver_adreno.so
  • vendor/lib/libacdbloader.so
  • vendor/lib/libacdbrtac.so
  • vendor/lib/libadiertac.so
  • vendor/lib/libadreno_utils.so
  • vendor/lib/libadsprpc.so
  • vendor/lib/libaudcal.so
  • vendor/lib/libbccQTI.so
  • vendor/lib/libbtnv.so
  • vendor/lib/libc2d30-a3xx.so
  • vendor/lib/libconfigdb.so
  • vendor/lib/libdisp-aba.so
  • vendor/lib/libdrmfs.so
  • vendor/lib/libdrmtime.so
  • vendor/lib/libdsi_netctrl.so
  • vendor/lib/libfastcvadsp_stub.so
  • vendor/lib/libfastcvopt.so
  • vendor/lib/libflp.so
  • vendor/lib/libgeofence.so
  • vendor/lib/libgsl.so
  • vendor/lib/libizat_core.so
  • vendor/lib/liblbs_core.so
  • vendor/lib/liblistenhardware.so
  • vendor/lib/liblistenjni.so
  • vendor/lib/liblistensoundmodel.so
  • vendor/lib/libllvm-qcom.so
  • vendor/lib/libloc_api_v02.so
  • vendor/lib/liblqe.so
  • vendor/lib/libmm-abl-oem.so
  • vendor/lib/libmm-abl.so
  • vendor/lib/libnetmgr.so
  • vendor/lib/libperipheral_client.so
  • vendor/lib/libqc-opt.so
  • vendor/lib/libqdi.so
  • vendor/lib/libqdp.so
  • vendor/lib/libqmi_cci.so
  • vendor/lib/libqmi_client_helper.so
  • vendor/lib/libqmi_common_so.so
  • vendor/lib/libqmi_csi.so
  • vendor/lib/libqmi_encdec.so
  • vendor/lib/libqti-perfd-client.so
  • vendor/lib/libril-qc-qmi-1.so
  • vendor/lib/libril-qcril-hook-oem.so
  • vendor/lib/librpmb.so
  • vendor/lib/librs_adreno.so
  • vendor/lib/librs_adreno_sha1.so
  • vendor/lib/libsc-a3xx.so
  • vendor/lib/libscale.so
  • vendor/lib/libsensor1.so
  • vendor/lib/libsensor_reg.so
  • vendor/lib/libsmemlog.so
  • vendor/lib/libssd.so
  • vendor/lib/libsystem_health_mon.so
  • vendor/lib/libthermalclient.so
  • vendor/lib/libthermalioctl.so
  • vendor/lib/libxml.so
  • vendor/lib/soundfx/libqcbassboost.so
  • vendor/lib/soundfx/libqcreverb.so
  • vendor/lib/soundfx/libqcvirt.so
  • vendor/app/TimeService/TimeService.apk
  • vendor/app/shutdownlistener/shutdownlistener.apk
  • priv-app/qcrilmsgtunnel/qcrilmsgtunnel.apk
  • vendor/lib/libTimeService.so
  • vendor/lib/libdiag.so
  • vendor/lib/libdsutils.so
  • vendor/lib/libidl.so
  • vendor/lib/liblisten.so
  • vendor/lib/libqcci_legacy.so
  • vendor/lib/libqmi.so
  • vendor/lib/libqmi_client_qmux.so
  • vendor/lib/libqmiservices.so
  • vendor/lib/libtime_genoff.so
    Extracting 195 files in ./proprietary-files.txt from adb:
  • vendor/bin/mm-qcamera-daemon
  • vendor/firmware/cpp_firmware_v1_2_0.fw
    !! vendor/firmware/cpp_firmware_v1_2_0.fw: file not found in source
  • vendor/lib/libchromatix_imx135_liveshot.so
  • vendor/bin/senread
  • vendor/lib/libactuator_dw9714.so
  • vendor/lib/libactuator_dw9714_camcorder.so
  • vendor/lib/libactuator_dw9714_camera.so
  • vendor/lib/libactuator_dw9716.so
  • vendor/lib/libactuator_dw9716_camcorder.so
  • vendor/lib/libactuator_dw9716_camera.so
  • vendor/lib/libactuator_dw9800W.so
  • vendor/lib/libactuator_dw9800W_camcorder.so
  • vendor/lib/libactuator_dw9800W_camera.so
  • vendor/lib/libactuator_iu074.so
  • vendor/lib/libactuator_iu074_camcorder.so
  • vendor/lib/libactuator_iu074_camera.so
  • vendor/lib/libactuator_ov12830.so
  • vendor/lib/libactuator_ov12830_camcorder.so
  • vendor/lib/libactuator_ov12830_camera.so
  • vendor/lib/libactuator_ov8825.so
  • vendor/lib/libactuator_ov8825_camcorder.so
  • vendor/lib/libactuator_ov8825_camera.so
  • vendor/lib/libactuator_rohm_bu64243gwz.so
  • vendor/lib/libactuator_rohm_bu64243gwz_camcorder.so
  • vendor/lib/libactuator_rohm_bu64243gwz_camera.so
  • vendor/lib/libchromatix_SKUAA_ST_gc0339_common.so
  • vendor/lib/libchromatix_SKUAA_ST_gc0339_default_video.so
  • vendor/lib/libchromatix_SKUAA_ST_gc0339_preview.so
  • vendor/lib/libchromatix_SKUAB_ST_s5k4e1_common.so
  • vendor/lib/libchromatix_SKUAB_ST_s5k4e1_default_video.so
  • vendor/lib/libchromatix_SKUAB_ST_s5k4e1_hfr_120fps.so
  • vendor/lib/libchromatix_SKUAB_ST_s5k4e1_hfr_60fps.so
  • vendor/lib/libchromatix_SKUAB_ST_s5k4e1_hfr_90fps.so
  • vendor/lib/libchromatix_SKUAB_ST_s5k4e1_liveshot.so
  • vendor/lib/libchromatix_SKUAB_ST_s5k4e1_preview.so
  • vendor/lib/libchromatix_SKUAB_ST_s5k4e1_snapshot.so
  • vendor/lib/libchromatix_SKUAB_ST_s5k4e1_video_hd.so
  • vendor/lib/libchromatix_SKUAB_ST_s5k4e1_zsl.so
  • vendor/lib/libchromatix_imx132_common.so
  • vendor/lib/libchromatix_imx132_default_video.so
  • vendor/lib/libchromatix_imx132_liveshot.so
  • vendor/lib/libchromatix_imx132_preview.so
  • vendor/lib/libchromatix_imx132_snapshot.so
  • vendor/lib/libchromatix_imx134_common.so
  • vendor/lib/libchromatix_imx134_default_video.so
  • vendor/lib/libchromatix_imx134_hfr_120.so
  • vendor/lib/libchromatix_imx134_hfr_60.so
  • vendor/lib/libchromatix_imx134_preview.so
  • vendor/lib/libchromatix_imx134_snapshot.so
  • vendor/lib/libchromatix_imx135_common.so
  • vendor/lib/libchromatix_imx135_default_video.so
  • vendor/lib/libchromatix_imx135_hfr_120.so
  • vendor/lib/libchromatix_imx135_hfr_60.so
  • vendor/lib/libchromatix_imx135_hfr_90.so
  • vendor/lib/libchromatix_imx135_preview.so
  • vendor/lib/libchromatix_imx135_snapshot.so
  • vendor/lib/libchromatix_imx135_video_hd.so
  • vendor/lib/libchromatix_ov12870_common.so
  • vendor/lib/libchromatix_ov12870_default_video.so
  • vendor/lib/libchromatix_ov12870_preview.so
  • vendor/lib/libchromatix_ov12870_snapshot.so
  • vendor/lib/libchromatix_ov2685_common.so
  • vendor/lib/libchromatix_ov2685_default_video.so
  • vendor/lib/libchromatix_ov2685_preview.so
  • vendor/lib/libchromatix_ov2685_snapshot.so
  • vendor/lib/libchromatix_ov2720_common.so
  • vendor/lib/libchromatix_ov2720_default_video.so
  • vendor/lib/libchromatix_ov2720_hfr.so
  • vendor/lib/libchromatix_ov2720_liveshot.so
  • vendor/lib/libchromatix_ov2720_preview.so
  • vendor/lib/libchromatix_ov2720_zsl.so
  • vendor/lib/libchromatix_ov5648_oty5f03_common.so
  • vendor/lib/libchromatix_ov5648_oty5f03_default_video.so
  • vendor/lib/libchromatix_ov5648_oty5f03_preview.so
  • vendor/lib/libchromatix_ov5648_oty5f03_snapshot.so
  • vendor/lib/libchromatix_ov5648_oty5f03_zsl.so
  • vendor/lib/libchromatix_ov5670_common.so
  • vendor/lib/libchromatix_ov5670_preview.so
  • vendor/lib/libchromatix_ov5670_snapshot.so
  • vendor/lib/libchromatix_ov5670_video.so
  • vendor/lib/libchromatix_ov8825_common.so
  • vendor/lib/libchromatix_ov8825_default_video.so
  • vendor/lib/libchromatix_ov8825_hfr_120fps.so
  • vendor/lib/libchromatix_ov8825_hfr_60fps.so
  • vendor/lib/libchromatix_ov8825_hfr_90fps.so
  • vendor/lib/libchromatix_ov8825_liveshot.so
  • vendor/lib/libchromatix_ov8825_liveshot_hd.so
  • vendor/lib/libchromatix_ov8825_preview.so
  • vendor/lib/libchromatix_ov8825_preview_hd.so
  • vendor/lib/libchromatix_ov8825_snapshot.so
  • vendor/lib/libchromatix_ov8825_snapshot_hd.so
  • vendor/lib/libchromatix_ov8825_video_hd.so
  • vendor/lib/libchromatix_ov8825_zsl.so
  • vendor/lib/libchromatix_ov8865_q8v18a_common.so
  • vendor/lib/libchromatix_ov8865_q8v18a_default_video.so
  • vendor/lib/libchromatix_ov8865_q8v18a_hfr_120fps.so
  • vendor/lib/libchromatix_ov8865_q8v18a_hfr_60fps.so
  • vendor/lib/libchromatix_ov8865_q8v18a_hfr_90fps.so
  • vendor/lib/libchromatix_ov8865_q8v18a_liveshot.so
  • vendor/lib/libchromatix_ov8865_q8v18a_preview.so
  • vendor/lib/libchromatix_ov8865_q8v18a_snapshot.so
  • vendor/lib/libchromatix_ov8865_q8v18a_video_hd.so
  • vendor/lib/libchromatix_ov8865_q8v18a_zsl.so
  • vendor/lib/libchromatix_ov9724_common.so
  • vendor/lib/libchromatix_ov9724_default_video.so
  • vendor/lib/libchromatix_ov9724_liveshot.so
  • vendor/lib/libchromatix_ov9724_preview.so
  • vendor/lib/libchromatix_s5k3l1yx_common.so
  • vendor/lib/libchromatix_s5k3l1yx_default_video.so
  • vendor/lib/libchromatix_s5k3l1yx_hfr_120fps.so
  • vendor/lib/libchromatix_s5k3l1yx_hfr_60fps.so
  • vendor/lib/libchromatix_s5k3l1yx_hfr_90fps.so
  • vendor/lib/libchromatix_s5k3l1yx_liveshot.so
  • vendor/lib/libchromatix_s5k3l1yx_preview.so
  • vendor/lib/libchromatix_s5k3l1yx_snapshot.so
  • vendor/lib/libchromatix_s5k3l1yx_video_hd.so
  • vendor/lib/libchromatix_s5k3l1yx_zsl.so
  • vendor/lib/libchromatix_skuab_shinetech_gc0339_common.so
  • vendor/lib/libchromatix_skuab_shinetech_gc0339_default_video.so
  • vendor/lib/libchromatix_skuab_shinetech_gc0339_liveshot.so
  • vendor/lib/libchromatix_skuab_shinetech_gc0339_preview.so
  • vendor/lib/libchromatix_skuab_shinetech_gc0339_snapshot.so
  • vendor/lib/libchromatix_skuab_shinetech_gc0339_zsl.so
  • vendor/lib/libchromatix_skuf_ov12830_p12v01c_common.so
  • vendor/lib/libchromatix_skuf_ov12830_p12v01c_default_video.so
  • vendor/lib/libchromatix_skuf_ov12830_p12v01c_hfr_120fps.so
  • vendor/lib/libchromatix_skuf_ov12830_p12v01c_hfr_60fps.so
  • vendor/lib/libchromatix_skuf_ov12830_p12v01c_hfr_90fps.so
  • vendor/lib/libchromatix_skuf_ov12830_p12v01c_preview.so
  • vendor/lib/libchromatix_skuf_ov12830_p12v01c_snapshot.so
  • vendor/lib/libchromatix_skuf_ov12830_p12v01c_video_hd.so
  • vendor/lib/libchromatix_skuf_ov12830_p12v01c_zsl.so
  • vendor/lib/libchromatix_skuf_ov5648_p5v23c_common.so
  • vendor/lib/libchromatix_skuf_ov5648_p5v23c_default_video.so
  • vendor/lib/libchromatix_skuf_ov5648_p5v23c_preview.so
  • vendor/lib/libchromatix_skuf_ov5648_p5v23c_snapshot.so
  • vendor/lib/libcneapiclient.so
  • vendor/lib/libjpegdhw.so
  • vendor/lib/libjpegehw.so
  • vendor/lib/libmmcamera2_c2d_module.so
  • vendor/lib/libmmcamera2_cpp_module.so
  • vendor/lib/libmmcamera2_frame_algorithm.so
  • vendor/lib/libmmcamera2_iface_modules.so
  • vendor/lib/libmmcamera2_imglib_modules.so
  • vendor/lib/libmmcamera2_is.so
  • vendor/lib/libmmcamera2_isp_modules.so
  • vendor/lib/libmmcamera2_pproc_modules.so
  • vendor/lib/libmmcamera2_sensor_modules.so
  • vendor/lib/libmmcamera2_stats_algorithm.so
  • vendor/lib/libmmcamera2_stats_modules.so
  • vendor/lib/libmmcamera2_vpe_module.so
  • vendor/lib/libmmcamera2_wnr_module.so
  • vendor/lib/libmmcamera_SKUAA_ST_gc0339.so
  • vendor/lib/libmmcamera_SKUAB_ST_s5k4e1.so
  • vendor/lib/libmmcamera_faceproc.so
  • vendor/lib/libmmcamera_hdr_gb_lib.so
  • vendor/lib/libmmcamera_hdr_lib.so
  • vendor/lib/libmmcamera_hi256.so
  • vendor/lib/libmmcamera_imglib.so
  • vendor/lib/libmmcamera_imx132.so
  • vendor/lib/libmmcamera_imx134.so
  • vendor/lib/libmmcamera_imx135.so
  • vendor/lib/libmmcamera_mt9m114.so
  • vendor/lib/libmmcamera_ofilm_oty5f03_eeprom.so
  • vendor/lib/libmmcamera_ov12870.so
  • vendor/lib/libmmcamera_ov12870_gt24p64a_eeprom.so
  • vendor/lib/libmmcamera_ov2685.so
  • vendor/lib/libmmcamera_ov2720.so
  • vendor/lib/libmmcamera_ov5648_oty5f03.so
  • vendor/lib/libmmcamera_ov5670.so
  • vendor/lib/libmmcamera_ov8825.so
  • vendor/lib/libmmcamera_ov8865_q8v18a.so
  • vendor/lib/libmmcamera_ov9724.so
  • vendor/lib/libmmcamera_s5k3l1yx.so
  • vendor/lib/libmmcamera_skuab_shinetech_gc0339.so
  • vendor/lib/libmmcamera_skuf_ov12830_p12v01c.so
  • vendor/lib/libmmcamera_skuf_ov5648_p5v23c.so
  • vendor/lib/libmmcamera_sp1628.so
  • vendor/lib/libmmcamera_sunny_p12v01m_eeprom.so
  • vendor/lib/libmmcamera_sunny_p5v23c_eeprom.so
  • vendor/lib/libmmcamera_sunny_q8v18a_eeprom.so
  • vendor/lib/libmmcamera_tintless_algo.so
  • vendor/lib/libmmcamera_tintless_bg_pca_algo.so
  • vendor/lib/libmmcamera_truly_cm7700_eeprom.so
  • vendor/lib/libmmcamera_wavelet_lib.so
  • vendor/lib/libmmipl.so
  • vendor/lib/libmmjpeg.so
  • vendor/lib/libmmqjpeg_codec.so
  • vendor/lib/liboemcamera.so
  • vendor/lib/libqomx_jpegdec.so
  • vendor/lib/libqomx_jpegenc.so
  • vendor/lib/libril-qc-radioconfig.so
  • vendor/lib/libsensor_test.so
  • vendor/lib/libwcnss_qmi.so
  • vendor/lib/mediadrm/libwvdrmengine.so
    Extracting 9 files in ./proprietary-files-twrp.txt from adb:
  • recovery/root/sbin/qseecomd
    !! recovery/root/sbin/qseecomd: file not found in source
  • recovery/root/vendor/lib/hw/keystore.default.so
    !! recovery/root/vendor/lib/hw/keystore.default.so: file not found in source
  • recovery/root/vendor/lib/hw/keystore.qcom.so
    !! recovery/root/vendor/lib/hw/keystore.qcom.so: file not found in source
  • recovery/root/vendor/lib/libQSEEComAPI.so
  • recovery/root/vendor/lib/libdiag.so
  • recovery/root/vendor/lib/libdrmfs.so
  • recovery/root/vendor/lib/libdrmtime.so
  • recovery/root/vendor/lib/librpmb.so
  • recovery/root/vendor/lib/libssd.so
    sed: can’t read ./…/…/…/vendor/fairphone/FP2/proprietary/recovery/root/sbin/qseecomd: No such file or directory

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?)

2 Likes

So you mean https://wiki.lineageos.org/extracting_blobs_from_zips.html ?

2 Likes

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?

1 Like

Did you check at
https://code.fairphone.com/projects/fp-osos/dev/fp2-blobs-download-page.html
?

1 Like

(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?

2 Likes

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.

5 Likes

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.

  • which parts of LineageOS are device specific which not. My assumptions are
    • Linux kernel is the same for each CPU type, e.g. Snapdragon
    • Android Subsystem is the same
    • Device drivers are different per device
  • What is the difference between being able to install TWRP (and thus being able to flash an image) and rooting the device. E.g. for FP3 unlockable bootloader should allow to install TWRP. Could I flash an alternative Image on the partitions, then?
  • With TWRP could I backup the default image and save it as backup?
  • Is there any reason why a Lineage build with partial device drivers would not run?. For example when the basics Screen, Touch, USB, GPIO, Lighting, speaker, mike, WLAN are there but modem, camera are not. I could not phone with it, but could I use it like a tablet? Or in other words, knowing the FP3 component versions and finding some of them used in other Lineage phones, could one come up with a partial running LineageOS even when the device specific sources are not released yet by Fairphone?
  • When I had all device specifc drivers in place, could that part considered to be stable for future updates (say LineageOS 19.0->20.0 etc)? Or, in other words, what is the typical percentage of effort for the first setup vs. updates?
  • Safety updates: Desktop linux does kernel updates every few weeks, Wouldn’t that be possible with an Android OS as well? Except for major releases the kernel changes shoudl be mostly transparent to the rest - or why is it different with Android?
4 Likes

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.

8 Likes