Skip to content

CustomPiOS internals

Guy Sheffer edited this page Feb 9, 2026 · 3 revisions

CustomPiOS internals

This page is to document internal logic of CustomPiOS. Things that happen under the hood. Not stuff needed for building distributions.

Execution scripts order

When CustomPiOS is called, there is a mix of python and bash scripts. The reason is because Bash scripts can export better the shell and interact with the modules scripts better.

It does create an order of bash scripts that execute each other, this is the order (indentation of 4 spaces means the script calls the other):

nightly_build_scripts/custompios_nightly_build
    ${CUSTOM_PI_OS_PATH}/build_custom_os "${WORKSPACE_SUFFIX}"
        ${DIR}/build "$1"
            source ${CUSTOM_PI_OS_PATH}/config "${1}" "${EXTRA_BOARD_CONFIG}" ${@}
                source ${DISTRO}/config ${@}
            source ${CUSTOM_OS_PATH}/custompios ${@}

More detailed order would be:

nightly_build_scripts/custompios_nightly_build
    ${CUSTOM_PI_OS_PATH}/build_custom_os "${WORKSPACE_SUFFIX}"
        ${DIR}/build "$1"
            source ${DIST_PATH}/config                                    # pre-seed env
            generate_board_config.py → EXTRA_BOARD_CONFIG                 # BASE_BOARD not set yet → wrong default
            source ${CUSTOM_PI_OS_PATH}/config "${1}" "${EXTRA_BOARD_CONFIG}" ${@}
                source "${CONFIG_DIR}/config.local"                       # CustomPiOS-level config.local
                source ${DIST_PATH}/config                                # dist config
                source "${VARIANT_CONFIG}"                                # variant config (sets BASE_ARCH=aarch64)
                source "${FLAVOR_CONFIG}"                                 # flavor config
                source "${DIST_PATH}/config.local"                        # dist config.local ← user overrides HERE
                source "${EXTRA_BAORD_CONFIG}"                            # generated board config ← OVERRIDES config.local!
                source "${REMOTE_AND_META_CONFIG}"                        # remote/meta modules
                load_module_config "${MODULES_LIST}"                      # module configs (base, network, etc.)
            source ${CUSTOM_OS_PATH}/custompios ${@}

Clone this wiki locally