Last Update: 23.10.2025/bs
| Action |
Default directories |
Comment |
| mount |
directories listed in the environment
variable DIRS_TO_OVERLAY |
|
| diff |
directories listed in the environment
variable DIRS_TO_OVERLAY |
the action is done regardless of the mount
status of the directories use the option --active to process only the mounted overlay filesystems |
| undo |
directories listed in the environment
variable DIRS_TO_OVERLAY |
the action is done regardless of the mount
status of the directories use the option --active to process only the mounted overlay filesystems |
| test |
directories currently mounted with an overlay
filesystem |
|
| umount |
directories currently mounted with an overlay filesystem | |
| remount |
directories currently mounted with an overlay filesystem | |
| get |
directories listed in the environment variable DIRS_TO_OVERLAY | use the option --active to process
only the mounted overlay filesystems This action can also be used for files. |
| restore |
n/a |
there are no default files or directories for
this action This action can also be used for files. |
| list |
n/a |
This action always lists all directories
currently mounted with an overlay filesystem Use the option --details to also list the backend directory and backend disk for each overlay mount |
| mount_only |
n/a |
| Variable |
Usage |
Default value |
Comment |
| IMAGE_FILE | file used for the virtual disk |
/data/local/tmp/image001 |
|
| BASEDIR | the mount point for the virtual disk | /dev/ov |
this parent directory for this directory
(/dev in the default config) must be readable and executable
by any user |
| DIRS_TO_OVERLAY | the directories for which the script creates an overlay mount | /system_ext /product /odm /system |
|
| FILESYSTEM_TO_USE | the filesystem used on the virtual disk |
ext4 |
must be a filesystem known by the running
Android that supports overlay mounts (e.g. ext4 or ext3) The parameter is only used when creating a new filesystem on the virtual disk. |
| FILESYSTEM_SIZE | the size of the virtual disk | 100m |
the value can be any value that is known by
the binary dd for the parameter bs (see the
output of "dd --help") The variable is only used when the virtual disk is created. |
| MKFS_OPTIONS | additional options for the mkfs* command to create the filesysten on the loop device | The variable is only used when the virtual disk is created. | |
| MOUNT_OPTIONS | additional options for the mount command to mount the filesystem on the loop device | ||
| SELINUX_CONTEXT | the SELinux context used for new directories if the script can not read the SELinux context of an existing directory | u:object_r:system_file:s0 |
|
| MOUNT |
mount binary to use |
$( which mount ) |
|
| UMOUNT |
umount binary to use | $( which umount ) | |
| LOSETUP |
losetup binary to use | $( which losetup ) | |
| MKFS |
mkfs binary to use | $( which mkfs.${FILESYSTEM_TO_USE} ) | |
| DD |
dd binary to use | $( which dd ) | |
| UMOUNT_WAIT_TIME |
time in seconds to wait between umounting the
bind mounts and umounting the overlay mounts |
0 |
in some Android versions it's necessary to
wait some time between umounting the bind mount andumounting
the overlay mount. Set this variable to the number of
seconds the script should wait between these umounts. |
| BIND_MOUNT_TARGET_DIR |
target directory for bind mounts |
/data/local/tmp |
see using Magisk and overlay mounts in parallel |
| FILES_TO_KEEP |
list of files for which a bind mount shoud be
created |
see using Magisk and overlay mounts in parallel |
| Environment variable |
Default Value |
Comment |
| HOME |
/data/local/tmp/home/$( id -un ) |
the variable is also set to the default value
if the value is "/" The home directory is created by the script prepare_clang21_environment if it does not yet exist |
| TMPDIR |
/data/local/tmp |
|
| TERMINFO |
/system/etc/terminfo |
the terminfo database is part of the virtual
disk |
| TERM |
vt100 |
|
| SSL_CERT_DIR |
/system/etc/security/cacerts |
|
| SSL_CERT_FILE |
/data/local/tmp/home/ca-certificates.crt |
This file is created by the script
prepare_clang21_environment If the file does not exist the script uses the file /system/etc/security/ca-certificates.crt (That file is part of the virtual disk) |
| CLANG_VERSION |
21 |
|
| CLANG_DIR |
/system/usr/clang${CLANG_VERSION} |
|
| NDK_VERSION |
r29 |
|
| NDK_DIR |
/system/usr/ndk/${NDK_VERSION] |
|
| SYSROOT |
/system/usr/ndk/${NDK_VERSION]/toolchains/llvm/prebuilt/aarch64/sysroot |
|
| API |
31 |
|
| CPU_TYPE |
uname -m |
|
| TARGET_ROOT |
/data/local/tmp/develop/sysroot |
this variable can be used for the parameter
"--prefix" for the configure scripts. The environment variable is only defined if the directory exists (the directory is not created by the script) |
| CFLAGS, CPPFLAGS, CXXFLAGS, LDFLAGS |
mandatory values for using the clang compiler |
|
ASUS_I006D:/data/local/tmp/nano-8.6 # ls -ltr src/nano
-rwxr-xr-x 1 root root 3329704 2025-10-19 13:35 src/nano
ASUS_I006D:/data/local/tmp/nano-8.6 #
ASUS_I006D:/data/local/tmp/nano-8.6 # file src/nano
src/nano: ELF executable, 64-bit LSB arm64, static, for Android
31, built by NDK r29 (14206865), not stripped
ASUS_I006D:/data/local/tmp/nano-8.6 #
ASUS_I006D:/data/local/tmp/nano-8.6 # src/nano --version
GNU nano, version 8.6
(C) 2025 the Free Software Foundation and various
contributors
Compiled options: --disable-libmagic --disable-nls
--enable-utf8
ASUS_I006D:/data/local/tmp/nano-8.6 #
ASUS_I006D:/data/local/tmp/develop/nano-8.5 $ ls
-ltr src/nano
-rwxrwxrwx 1 shell shell 3394288 2025-07-11 13:51
src/nano
ASUS_I006D:/data/local/tmp/develop/nano-8.5 $
ASUS_I006D:/data/local/tmp/develop/nano-8.5 $ file
src/nano
src/nano: ELF executable, 64-bit LSB arm64, static, for
Android 31, built by NDK r27b (12297006), not stripped
ASUS_I006D:/data/local/tmp/develop/nano-8.5 $
ASUS_I006D:/data/local/tmp/develop/nano-8.5
$ src/nano --version
GNU nano, version 8.5
(C) 2025 the Free Software Foundation and various
contributors
Compiled options: --disable-libmagic
--disable-nls --enable-utf8
ASUS_I006D:/data/local/tmp/develop/nano-8.5 $