How to add additional apps to the /e/ OS image?

According to the build instructions here

https://doc.e.foundation/support-topics/build-e

additional applications for the /e/ OS image can be added by copying the apk files to a special directory and adding another environment variable for the docker command:

if you want to add extra applications to the default applications: add your APK to the android_prebuilts_prebuiltapks/ directory, and set the CUSTOM_APPS environment variable accordingly in the Docker image, before building.

But there is no directory android_prebuilts_prebuiltapks in the directory tree for /e/.

The docker command I use to build the image is

docker run \
    -e "BRANCH_NAME=v2.8-t" \
    -e "DEVICE_LIST=sake" \
    -e "DEVICE=ASUS_I006D" \
    -e "SIGN_BUILDS=true" \
    -e "SIGNATURE_SPOOFING=true" \
    -e "WITH_SU=true" \
    -e "CUSTOM_PACKAGES=GmsCore GsfProxy FakeStore MozillaNlpBackend NominatimNlpBackend com.google.android.maps.jar FDroid FDroidPrivilegedExtension" \
    -e "RELEASE_TYPE=UNOFFICIAL" \
    -e "CLEAN_OUTDIR=false" \
    -e "CLEAN_AFTER_BUILD=false" \
    -e "DELETE_OLD_LOGS=5" \
    -e "DELETE_OLD_ZIPS=5" \
    -v "/devpool001/develop/e/src:/srv/src" \
    -v "/devpool001/develop/e/zips:/srv/zips" \
    -v "/devpool001/develop/e/logs:/srv/logs" \
    -v "/devpool001/develop/e/tmp:/srv/tmp" \
    -v "/devpool001/develop/e/ccache:/srv/ccache" \
    -v "/devpool001/develop/e/keys:/srv/keys" \
    -v "/devpool001/develop/e/local_manifests:/srv/local_manifests" \
    -e "REPO=https://gitlab.e.foundation/e/os/releases.git" \
    registry.gitlab.e.foundation:5000/e/os/docker-lineage-cicd:community

Where must this directory be created?

Are there other requirements for the .apk files (owner, permissions)?

I have already tested it with the apk files in /devpool001/develop/e/src and in /devpool001/develop/e/src/T, but in both cases the apks were not added to the OS image

the “git lfs pull” in the build-community.sh script will fetch android_prebuilts_prebuiltapks_lfs (recently moved from Makefiles to blueprint .bp files) into prebuilts/prebuiltapks/

The lfs folders should give you templates how to create your own apk folder/.bp/permission files.

Have look in /vendor/eos/

I’m still trying to add two packages to the /e/ OS image, but it hasn’t worked.

I added two new apks to the prebuildapks directory:

[ OmniRom 15 (devpool) - xtrnaw7@t15g /devpool001/develop/e ] $ ls -l src/T/prebuilts/prebuiltapks/SMMI_TEST/
total 26094
-rw-r--r--. 1 root root      312 Mar 17 13:08 Android.mk
-rw-r--r--. 1 root root 31675875 Mar 15 21:17 SMMI_TEST.apk
[ OmniRom 15 (devpool) - xtrnaw7@t15g /devpool001/develop/e ]


[ OmniRom 15 (devpool) - xtrnaw7@t15g /devpool001/develop/e ] $ cat src/T/prebuilts/prebuiltapks/SMMI_TEST//Android.mk 
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := SMMI_TEST
LOCAL_CERTIFICATE := platform
LOCAL_SRC_FILES := SMMI_TEST.apk 
LOCAL_MODULE_CLASS := APPS
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
LOCAL_PRIVILEGED_MODULE := true
include $(BUILD_PREBUILT)
[ OmniRom 15 (devpool) - xtrnaw7@t15g /devpool001/develop/e ] $ 


[ OmniRom 15 (devpool) - xtrnaw7@t15g /devpool001/develop/e ] $ ls -l src/T/prebuilts/prebuiltapks/ASUSCalculator/
total 3400
-rw-r--r--. 1 root root     290 Mar 17 11:42 Android.mk
-rw-r--r--. 1 root root 5252280 Mar 15 21:18 AsusCalculator.apk
[ OmniRom 15 (devpool) - xtrnaw7@t15g /devpool001/develop/e ] $ 


[ OmniRom 15 (devpool) - xtrnaw7@t15g /devpool001/develop/e ] $ cat src/T/prebuilts/prebuiltapks/ASUSCalculator/Android.mk 
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := ASUSCalculator
LOCAL_CERTIFICATE := platform
LOCAL_SRC_FILES := AsusCalculator.apk 
LOCAL_MODULE_CLASS := APPS
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
include $(BUILD_PREBUILT)
[ OmniRom 15 (devpool) - xtrnaw7@t15g /devpool001/develop/e ] $

I added the packages to the file common.mk:

[ OmniRom 15 (devpool) - xtrnaw7@t15g /devpool001/develop/e ] $ grep -B3 -A3  SMMI src/T/vendor/eos/config/common.mk

PRODUCT_PACKAGES += \
   ASUSCalculator \
   SMMI_TEST

# Removes proprietary apps
PRODUCT_PACKAGES += \
[ OmniRom 15 (devpool) - xtrnaw7@t15g /devpool001/develop/e ] $

The command to build the image is

docker run \
    -e "BRANCH_NAME=v2.8-t" \
    -e "DEVICE_LIST=sake" \
    -e "DEVICE=ASUS_I006D_Test" \
    -e "SIGN_BUILDS=true" \
    -e "SIGNATURE_SPOOFING=true" \
    -e "WITH_SU=true" \
    -e "CUSTOM_PACKAGES=ASUSCalculator SMMI GmsCore GsfProxy FakeStore MozillaNlpBackend NominatimNlpBackend com.google.android.maps.jar FDroid FDroidPrivilegedExtension" \
    -e "RELEASE_TYPE=UNOFFICIAL" \
    -e "CLEAN_OUTDIR=false" \
    -e "CLEAN_AFTER_BUILD=false" \
    -e "DELETE_OLD_LOGS=5" \
    -e "DELETE_OLD_ZIPS=5" \
    -v "/devpool001/develop/e/src:/srv/src" \
    -v "/devpool001/develop/e/zips:/srv/zips" \
    -v "/devpool001/develop/e/logs:/srv/logs" \
    -v "/devpool001/develop/e/tmp:/srv/tmp" \
    -v "/devpool001/develop/e/ccache:/srv/ccache" \
    -v "/devpool001/develop/e/keys:/srv/keys" \
    -v "/devpool001/develop/e/local_manifests:/srv/local_manifests" \
    -e "REPO=https://gitlab.e.foundation/e/os/releases.git" \
    registry.gitlab.e.foundation:5000/e/os/docker-lineage-cicd:community

The build scripts create a new OS image but without the new packages.

In the output messages of the docker command there are only these messages for the new apks:

Starting ninja...
[ 39% 470/1188] build out/target/product/sake/obj/APPS/ASUSCalculator_intermediates/ASUSCalculator.meta_lic
[ 39% 471/1188] build out/target/product/sake/obj/APPS/SMMI_TEST_intermediates/SMMI_TEST.meta_lic
[ 39% 472/1188] ASUSCalculator dexpreopt.config
[ 39% 473/1188] SMMI_TEST dexpreopt.config
[ 39% 474/1188] build out/target/product/sake/obj/PACKAGING/system_build_prop_intermediates/buildinfo.prop
[ 39% 475/1188] //vendor/lineage/build/soong:generated_kernel_includes generate
FAILED: out/soong/.intermediates/vendor/lineage/build/soong/generated_kernel_includes/gen/.dummy_dep
out/host/linux-x86/bin/sbox --sandbox-path out/soong/.temp --output-dir out/soong/.intermediates/vendor/lineage/build/soong/generated_kernel_includes/gen --manifest out/soong/.intermediates/vendor/lineage/build/soong/generated_kernel_includes/generator.sbox.textproto
The failing command was run inside an sbox sandbox in temporary directory
out/soong/.temp/sbox/d70d848a3b8a933053bf9ef22fb54ea8346307e4
The failing command line can be found in
out/soong/.temp/sbox/d70d848a3b8a933053bf9ef22fb54ea8346307e4/sbox_command.0.bash
make: Entering directory '/srv/src/T'
make: *** kernel/asus/sm8350: No such file or directory.  Stop.
make: Leaving directory '/srv/src/T'
exit status 2
[ 40% 476/1188] Copy: out/target/product/sake/dexpreopt_config/SMMI_TEST_dexpreopt.config
[ 40% 477/1188] Copy: out/target/product/sake/dexpreopt_config/ASUSCalculator_dexpreopt.config
[ 40% 478/1188] build out/target/product/sake/gen/META/lic_intermediates/out/target/product/sake/system/etc/linker.config.pb.meta_lic
[ 40% 479/1188] Verifying uses-libraries: prebuilts/prebuiltapks/SMMI_TEST/SMMI_TEST.apk
[ 40% 480/1188] build out/target/product/sake/gen/META/lic_intermediates/out/target/product/sake/system_other.img.meta_lic
[ 40% 481/1188] Verifying uses-libraries: prebuilts/prebuiltapks/ASUSCalculator/AsusCalculator.apk
[ 40% 482/1188] SMMI_TEST dexpreopt gen
[ 40% 483/1188] ASUSCalculator dexpreopt gen
[ 40% 484/1188] Building out/target/product/sake/system/build.prop
[ 40% 485/1188] //system/sepolicy:vendor_sepolicy.cil Versioning mapping file vendor_sepolicy.cil [common]
[ 40% 486/1188] APK certs list: out/target/product/sake/obj/PACKAGING/apkcerts_intermediates/lineage_sake-apkcerts-eng.root.txt
[ 40% 487/1188] //system/sepolicy:sepolicy.recovery Compiling cil files for sepolicy.recovery [common]
ninja: build stopped: subcommand failed.
15:46:12 ninja failed with: exit status 1

#### failed to build some targets (02:19 (mm:ss)) ####

>> [Mon Mar 17 15:46:12 UTC 2025] Starting signing target-files-package

The contents of the file out/soong/.temp/sbox/d70d848a3b8a933053bf9ef22fb54ea8346307e4/sbox_command.0.bash mentioned in the messages are:

OmniRom 15 (devpool) - xtrnaw7@t15g /devpool001/develop/e ] $ find src/T/out/soong/.temp/sbox/d70d848a3b8a933053bf9ef22fb54ea8346307e4/ -ls
  4982811      1 drwxr-xr-x   3 root     root            4 Mar 17 16:45 src/T/out/soong/.temp/sbox/d70d848a3b8a933053bf9ef22fb54ea8346307e4/
  4982814      2 -rw-r--r--   1 root     root         1326 Mar 17 16:45 src/T/out/soong/.temp/sbox/d70d848a3b8a933053bf9ef22fb54ea8346307e4/sbox_command.0.bash
  4982813      1 drwxr-xr-x   2 root     root            2 Mar 17 16:45 src/T/out/soong/.temp/sbox/d70d848a3b8a933053bf9ef22fb54ea8346307e4/out
[ OmniRom 15 (devpool) - xtrnaw7@t15g /devpool001/develop/e ] $ 

[ OmniRom 15 (devpool) - xtrnaw7@t15g /devpool001/develop/e ] $ cat src/T/out/soong/.temp/sbox/d70d848a3b8a933053bf9ef22fb54ea8346307e4/sbox_command.0.bash
PERL5LIB=/srv/src/T/prebuilts/tools-lineage/common/perl-base PATH=/srv/src/T/prebuilts/tools-lineage/linux-x86/bin:/srv/src/T/prebuilts/clang/host/linux-x86/clang-r450784d/bin:/srv/src/T/prebuilts/build-tools/path/linux-x86:/srv/src/T/out/.path BISON_PKGDATADIR=/srv/src/T/prebuilts/build-tools/common/bison /srv/src/T/prebuilts/build-tools/linux-x86/bin/make -j16 HOSTCFLAGS="--sysroot=/srv/src/T/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.17-4.8/sysroot -I/srv/src/T/prebuilts/kernel-build-tools/linux-x86/include" HOSTLDFLAGS="--sysroot=/srv/src/T/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.17-4.8/sysroot -Wl,-rpath,/srv/src/T/prebuilts/kernel-build-tools/linux-x86/lib64 -L /srv/src/T/prebuilts/kernel-build-tools/linux-x86/lib64 -fuse-ld=lld --rtlib=compiler-rt" LLVM=1 LLVM_IAS=1 LZ4=/srv/src/T/prebuilts/kernel-build-tools/linux-x86/bin/lz4 LEX=/srv/src/T/prebuilts/build-tools/linux-x86/bin/flex YACC=/srv/src/T/prebuilts/build-tools/linux-x86/bin/bison M4=/srv/src/T/prebuilts/build-tools/linux-x86/bin/m4 PAHOLE=/srv/src/T/prebuilts/kernel-build-tools/linux-x86/bin/pahole -C kernel/asus/sm8350 O=/srv/src/T/out/soong/.intermediates/vendor/lineage/build/soong/generated_kernel_includes/gen ARCH=arm64  headers_install && touch out/soong/.temp/sbox/d70d848a3b8a933053bf9ef22fb54ea8346307e4/out/.dummy_dep[ OmniRom 15 (devpool) - xtrnaw7@t15g /devpool001/develop/e ] $ 
[ OmniRom 15 (devpool) - xtrnaw7@t15g /devpool001/develop/e ] $ 
[ OmniRom 15 (devpool) - xtrnaw7@t15g /devpool001/develop/e ] $

How can I add these two packages the /e/ OS image?

but you had a successful build already without adding the 2 packages? because that error is within the kernel compile

yes, the build without the 2 packages was successfull.

The build with the 2 packages was also successfull but I can not find the apps – not in /system/app, /system/priv-app, /system_ext/app, nor /system_ext/app

[ OmniRom 15 (devpool) - xtrnaw7@t15g /devpool001/develop/e ] $ ls -l zips/sake/
total 8718354
-rw-r--r--. 1 root root 1490443623 Mar 15 22:31 e-2.8-t-20250315-UNOFFICIAL-ASUS_I006D_Test.zip
-rw-r--r--. 1 root root        114 Mar 15 22:31 e-2.8-t-20250315-UNOFFICIAL-ASUS_I006D_Test.zip.sha256sum
-rw-r--r--. 1 root root 1490443619 Mar 15 21:08 e-2.8-t-20250315-UNOFFICIAL-ASUS_I006D.zip
-rw-r--r--. 1 root root        109 Mar 15 21:08 e-2.8-t-20250315-UNOFFICIAL-ASUS_I006D.zip.sha256sum
-rw-r--r--. 1 root root 1490446879 Mar 15 17:33 e-2.8-t-20250315-UNOFFICIAL-.zip
-rw-r--r--. 1 root root         99 Mar 15 17:34 e-2.8-t-20250315-UNOFFICIAL-.zip.sha256sum
-rw-r--r--. 1 root root 1490443623 Mar 16 19:32 e-2.8-t-20250316-UNOFFICIAL-ASUS_I006D_Test.zip
-rw-r--r--. 1 root root        114 Mar 16 19:32 e-2.8-t-20250316-UNOFFICIAL-ASUS_I006D_Test.zip.sha256sum
-rw-r--r--. 1 root root 1490443623 Mar 17 17:08 e-2.8-t-20250317-UNOFFICIAL-ASUS_I006D_Test.zip
-rw-r--r--. 1 root root        114 Mar 17 17:08 e-2.8-t-20250317-UNOFFICIAL-ASUS_I006D_Test.zip.sha256sum
-rw-r--r--. 1 root root 1470188824 Mar 15 07:46 e-2.9-t-20250315-UNOFFICIAL-.zip
-rw-r--r--. 1 root root         99 Mar 15 07:46 e-2.9-t-20250315-UNOFFICIAL-.zip.sha256sum
[ OmniRom 15 (devpool) - xtrnaw7@t15g /devpool001/develop/e ] $

I’m slightly unnerved by the mixture of all caps, underscores and CamelCase … but yeah… weird? But you’re still on the branch that doesn’t go for .bp instead of Makefiles?

Isn’t DEVICE redundant when there is DEVICE_LIST in the docker invoke? as in, “sake” is sufficient, no “ASUS_I006D” or “…_Test”.

Sorry I’m not very helpful atm, last build is a year ago+ and not the docker method

But you’re still on the branch that doesn’t go for .bp instead of Makefiles?

I don’t know that (I’m using the branch v2.8-t.

Isn’t DEVICE redundant when there is DEVICE_LIST in the docker invoke? as in, “sake” is sufficient, no “ASUS_I006D” or “…_Test”.

the parameter “DEVICE=ASUS_I006D_Test” seems to be only used for the name of the final zip file, e.g.

e-2.8-t-20250317-UNOFFICIAL-ASUS_I006D_Test.zip

Without that parameter the name of the ZIP file is

e-2.8-t-20250317-UNOFFICIAL-.zip

(but it can be installed on the phone without problems)

Sorry I’m not very helpful atm, last build is a year ago+ and not the docker method

I see, but I suspect the method for adding additional apks is the same for both methods of creating the OS image