Trying to adapt Google Pixel 3a XL but NETFILTER_XT_MATCH_QTAGUID module is missing from kernel

Hi,

I’m trying to create a port for Google Pixel 3a XL using a Lineage OS 19.1 branch as the base. However, I ran into some problems with building the kernel as well as the building the .spec.

I’ve been following this guide and I’m stuck on section 7.2.1 of the accompanying PDF. Here is what I’m getting:

$ rpm/dhd/helpers/build_packages.sh --droid-hal

* Building rpm/droid-hal-bonito.spec 
WARNING: CONFIG_LBDAF is invalid
It is unset
Allowed values : y, !
Comment says: ext4 filesystem requires this in order to support filesysetms with huge_file feature, which is enabled by default by mke2fs.ext4, not needed for 64bit architectures

ERROR: CONFIG_NETFILTER_XT_MATCH_QTAGUID is invalid
It is unset
Allowed values : y, m, <=4.13.0
Comment says: connman: for iptables owner/qtaguid match, deprecated after Android Q, non-mainline feature https://android.googlesource.com/kernel/configs/+/189cbab05f8680af3778b82a0b899485773e42e9%5E%21/android-4.14/android-base.config

WARNING: CONFIG_FW_LOADER_USER_HELPER is invalid
Value is: y
Allowed values : n, !
Comment says: it's actually needed by some Lollipop based devices; systemd(optional): https://github.com/systemd/systemd/blob/v238/README

error: Bad exit status from /var/tmp/rpm-tmp.QiJ4aV (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.QiJ4aV (%build)
* Check /home/bud/hadk/droid-hal-bonito.log for full log. 
!! building of package failed 

I do realize that CONFIG_NETFILTER_XT_MATCH_QTAGUID is needed when I built the kernel but according to this, it seems that this module was removed from the kernel.

My question is, is there any way to bypass this error and continue with the build?

3 Likes

Ok, so I think I found a workaround.

In “rpm/dhd/droid-hal-device.inc”, I changed:

hybris/mer-kernel-check/mer_verify_kernel_config \
    %{android_root}/out/target/product/%{device}/obj/*/.config

to

hybris/mer-kernel-check/mer_verify_kernel_config \
    %{android_root}/out/target/product/%{device}/obj/*/.config || true

but I’m still getting errors in completing the build which seem to involve adding the directories for the needed header files. I seem to get a little farther by changing

pushd %{dhd_path}/helpers
make ANDROID_ROOT=$ANDROID_ROOT IMG2SIMG_SOURCES="$IMG2SIMG_SOURCES" SIMG2IMG_SOURCES="$SIMG2IMG_SOURCES"
popd

to

mycwd=$(pwd)
pushd %{dhd_path}/helpers
make ANDROID_ROOT=$ANDROID_ROOT IMG2SIMG_SOURCES="$IMG2SIMG_SOURCES" SIMG2IMG_SOURCES="$SIMG2IMG_SOURCES" CPPFLAGS="$CPPFLAGS -I${mycwd}/system/libbase/include -I${mycwd}/system/libbase/include -I${mycwd}/system/core/libsparse/include -I${mycwd}/system/core/libcutils/include -I${mycwd}/system/ziparchive"
popd

and I also had to change

    IMG2SIMG_SOURCES="backed_block.c output_file.c sparse.c sparse_crc32.c sparse_err.c sparse_read_fix.cpp img2simg.c ../base/stringprintf.cpp"
    SIMG2IMG_SOURCES="backed_block.c output_file.c sparse.c sparse_crc32.c sparse_err.c sparse_read_fix.cpp simg2img.c ../base/stringprintf.cpp"

to

    IMG2SIMG_SOURCES="backed_block.c output_file.c sparse.c sparse_crc32.c sparse_err.c sparse_read_fix.cpp img2simg.c ${mycwd}/system/libbase/stringprintf.cpp"
    SIMG2IMG_SOURCES="backed_block.c output_file.c sparse.c sparse_crc32.c sparse_err.c sparse_read_fix.cpp simg2img.c ${mycwd}/system/libbase/stringprintf.cpp"

but I’m getting this error

/srv/mer/toolings/SailfishOS-4.4.0/opt/cross/bin/aarch64-meego-linux-gnu-ld: output_file.o: in function `write_fd_chunk':
/home/budrz/hadk/system/core/libsparse/output_file.cpp:653: undefined reference to `android::base::MappedFile::FromFd(android::base::borrowed_fd, long, unsigned long, int)'
/srv/mer/toolings/SailfishOS-4.4.0/opt/cross/bin/aarch64-meego-linux-gnu-ld: output_file.o: in function `std::default_delete<android::base::MappedFile>::operator()(android::base::MappedFile*) const':
/srv/mer/toolings/SailfishOS-4.4.0/opt/cross/aarch64-meego-linux-gnu/include/c++/8.3.0/bits/unique_ptr.h:81: undefined reference to `android::base::MappedFile::~MappedFile()'
/srv/mer/toolings/SailfishOS-4.4.0/opt/cross/bin/aarch64-meego-linux-gnu-ld: /srv/mer/toolings/SailfishOS-4.4.0/opt/cross/aarch64-meego-linux-gnu/include/c++/8.3.0/bits/unique_ptr.h:81: undefined reference to `android::base::MappedFile::~MappedFile()'
collect2: error: ld returned 1 exit status

I tried adding “zip_archive_private.h” header file but it failed with

zip_archive_private.h:19:10: fatal error: ziparchive/zip_archive.h: No such file or directory
 #include <ziparchive/zip_archive.h

so I changed “-I${mycwd}/system/ziparchive” to “-I${mycwd}/system” but I’m still getting an error

fatal error: zip_archive_private.h: No such file or directory
 #include <zip_archive_private.h>

Any help will be appreciated.

You will likely find more help on the sfos-porters IRC channel.

They said that lineage-19.1 is not supported yet so I switched to the lineage-18.1 branch.

Plus, I wasn’t using the correct repo init (lineage-19.1) when I should be using hybris/mer repo, among other things.

Maybe one day there will be a hybris-19.1 or 19.0 repo…