Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
cc1946b
framework rootfs: when APA is in use, override package list [b/c it'l…
tabrisnet Dec 10, 2025
89c2702
framework: skip parts of desktop configs when APA is active
tabrisnet Dec 10, 2025
542bf54
framework: explicitly add linux-image to armbian-bsp-cli pkg dependen…
tabrisnet Dec 10, 2025
0895c53
framework: questing and resolute use APA, so strip back the package l…
tabrisnet Dec 10, 2025
a5bf0ef
config/cli: make the use of APA more obvious/intentional
tabrisnet Dec 10, 2025
4ebd844
config/desktop: make the use of APA more obvious/intentional
tabrisnet Dec 10, 2025
1974abf
framework APA: split post_armbian_repo_customize_image__install_from_…
tabrisnet Dec 10, 2025
ebe903f
move the APA hook before apt autoremove & debsums
tabrisnet Dec 11, 2025
dd76186
rename install_apa_hook to post_debootstrap_install_additional_packages
tabrisnet Dec 15, 2025
c0b5d16
extensions/apa: add some temporary packages to unblock testing
tabrisnet Dec 11, 2025
028c786
framework APA: move the parted and fdisk dependency
tabrisnet Dec 12, 2025
5341315
try to remove/reorganize APA_IS_ACTIVE checks
tabrisnet Dec 15, 2025
ba6c45c
APA: skip building armbian-desktop and armbian-bsp-desktop packages
tabrisnet Dec 11, 2025
d060fe6
don't use this commit - boot-time verbosity
tabrisnet Dec 11, 2025
142a15a
don't use this commit - APA uses more space, so give it more
tabrisnet Dec 11, 2025
0bbb8b6
remove APA_IS_ACTIVE check
tabrisnet Dec 17, 2025
e1790b2
framework rootfs/create-cache: add call_extension_method "rootfs_cust…
tabrisnet Dec 17, 2025
0e606d6
extensions/apa: new hook rootfs_customize_package_list
tabrisnet Dec 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/bootenv/sun50iw9.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
verbosity=1
verbosity=7
console=both
disp_mode=1080p60
fb0_width=1280
Expand Down
2 changes: 1 addition & 1 deletion config/bootenv/sunxi.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
verbosity=1
verbosity=7
bootlogo=false
console=both
disp_mode=1920x1080p60
1 change: 1 addition & 0 deletions config/cli/apa/debootstrap/components
2 changes: 2 additions & 0 deletions config/cli/apa/debootstrap/packages
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
locales
apt
1 change: 1 addition & 0 deletions config/cli/apa/main/config_desktop
1 change: 1 addition & 0 deletions config/cli/apa/main/packages
1 change: 1 addition & 0 deletions config/cli/questing
1 change: 1 addition & 0 deletions config/cli/resolute
1 change: 1 addition & 0 deletions config/desktop/apa/appgroups
1 change: 1 addition & 0 deletions config/desktop/apa/environments/cinnamon/architectures
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
arm64, amd64
1 change: 1 addition & 0 deletions config/desktop/apa/environments/cinnamon/armbian
1 change: 1 addition & 0 deletions config/desktop/apa/environments/cinnamon/debian
1 change: 1 addition & 0 deletions config/desktop/apa/environments/cinnamon/support
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
supported
1 change: 1 addition & 0 deletions config/desktop/apa/environments/gnome/architectures
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
arm64, amd64
1 change: 1 addition & 0 deletions config/desktop/apa/environments/gnome/armbian
2 changes: 2 additions & 0 deletions config/desktop/apa/environments/gnome/config_base/packages
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
locales
apt
1 change: 1 addition & 0 deletions config/desktop/apa/environments/gnome/debian
1 change: 1 addition & 0 deletions config/desktop/apa/environments/gnome/support
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
supported
1 change: 1 addition & 0 deletions config/desktop/apa/environments/i3-wm/architectures
1 change: 1 addition & 0 deletions config/desktop/apa/environments/i3-wm/armbian
1 change: 1 addition & 0 deletions config/desktop/apa/environments/i3-wm/debian
1 change: 1 addition & 0 deletions config/desktop/apa/environments/i3-wm/support
1 change: 1 addition & 0 deletions config/desktop/apa/environments/kde-plasma-mobile
1 change: 1 addition & 0 deletions config/desktop/apa/environments/kde-plasma/architectures
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
arm64, amd64
1 change: 1 addition & 0 deletions config/desktop/apa/environments/kde-plasma/debian
1 change: 1 addition & 0 deletions config/desktop/apa/environments/kde-plasma/support
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
csc
1 change: 1 addition & 0 deletions config/desktop/apa/environments/xfce/architectures
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
arm64, amd64, armhf, riscv64
1 change: 1 addition & 0 deletions config/desktop/apa/environments/xfce/armbian
1 change: 1 addition & 0 deletions config/desktop/apa/environments/xfce/debian
1 change: 1 addition & 0 deletions config/desktop/apa/environments/xfce/support
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
supported
1 change: 1 addition & 0 deletions config/desktop/questing
1 change: 1 addition & 0 deletions config/desktop/resolute
39 changes: 37 additions & 2 deletions extensions/apa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@ function custom_apt_repo__add_apa() {
run_host_command_logged echo "deb [signed-by=${APT_SIGNING_KEY_FILE}] http://github.armbian.com/apa current main" "|" tee "${SDCARD}"/etc/apt/sources.list.d/armbian-apa.list
}

function post_armbian_repo_customize_image__install_from_apa() {
# this variable is a temporary hack, remove as soon as it's not needed
declare -g apa_additional_packages="libpam-systemd dbus-user-session curl iw less locales"
function post_debootstrap_install_additional_packages__install_from_apa_stage1() { #FIXME: we need a better hook name that fits into the extensions system
[[ $APA_IS_ACTIVE ]] || return 0

# do not install armbian recommends for minimal images
[[ "${BUILD_MINIMAL,,}" =~ ^(true|yes)$ ]] && INSTALL_RECOMMENDS="no-install-recommends" || INSTALL_RECOMMENDS="install-recommends"
chroot_sdcard_apt_get install --$INSTALL_RECOMMENDS armbian-common armbian-bsp
display_alert "installing armbian-common and friends" "APA: armbian-common $apa_additional_packages" "info"
chroot_sdcard_apt_get install --$INSTALL_RECOMMENDS armbian-common $apa_additional_packages
chroot_sdcard rm -f /etc/apt/sources.list.d/armbian-apa.list.inactive

# install desktop environment if requested
Expand All @@ -23,3 +28,33 @@ function post_armbian_repo_customize_image__install_from_apa() {
;;
esac
}

#FIXME: still need a better name, this implies it is possible to delete pkgs
# NOTE: this is only used for hashing, so it probably isn't that important
# to delete pkgs from any lists as much as indicate they won't be present.
# NOTE: /tmp/rootfs_customize_package_list.txt is a special file that all
# callers of this hook need to append to, as there is no mechanism for
# returning data from hooks.
function rootfs_customize_package_list__get_apa_packages() {
[[ $APA_IS_ACTIVE ]] || return 0

local apa_package_list=""

# do not install armbian recommends for minimal images
[[ "${BUILD_MINIMAL,,}" =~ ^(true|yes)$ ]] && INSTALL_RECOMMENDS="no-install-recommends" || INSTALL_RECOMMENDS="install-recommends"
apa_package_list+= "${INSTALL_RECOMMENDS} armbian-common $apa_additional_packages"

case ${DESKTOP_ENVIRONMENT^^} in
XFCE|KDE|GNOME)
apa_package_list+= "armbian-desktop-${DESKTOP_ENVIRONMENT,,}"
;;
esac
echo $apa_package_list >> "/tmp/rootfs_customize_package_list.txt"
}

function post_armbian_repo_customize_image__install_from_apa_stage2() {
# do not install armbian recommends for minimal images
[[ "${BUILD_MINIMAL,,}" =~ ^(true|yes)$ ]] && INSTALL_RECOMMENDS="no-install-recommends" || INSTALL_RECOMMENDS="install-recommends"
display_alert "installing armbian-bsp" "APA" "info"
chroot_sdcard_apt_get install --$INSTALL_RECOMMENDS armbian-bsp
}
2 changes: 1 addition & 1 deletion lib/functions/bsp/armbian-bsp-cli-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ function reversion_armbian-bsp-cli_deb_contents() {
depends_base_files=""
fi
cat <<- EOF >> "${control_file_new}"
Depends: bash, linux-base, u-boot-tools, initramfs-tools, lsb-release, fping, device-tree-compiler${depends_base_files}
Depends: bash, fdisk, parted, linux-base, linux-image, u-boot-tools, initramfs-tools, lsb-release, fping, device-tree-compiler${depends_base_files}
Replaces: zram-config, armbian-bsp-cli-${BOARD}${EXTRA_BSP_NAME} (<< ${REVISION})
Breaks: armbian-bsp-cli-${BOARD}${EXTRA_BSP_NAME} (<< ${REVISION})
Provides: armbian-bsp-cli
Expand Down
3 changes: 3 additions & 0 deletions lib/functions/image/partitioning.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ function prepare_partitions() {
# stage: calculate rootfs size
declare -g -i rootfs_size
rootfs_size=$(du --apparent-size -sm "${SDCARD}"/ | cut -f1) # MiB
if [[ $APA_IS_ACTIVE ]]; then # FIXME: APA takes up more space
rootfs_size=$(($rootfs_size*11/10))
fi
display_alert "Current rootfs size" "$rootfs_size MiB" "info"

call_extension_method "prepare_image_size" "config_prepare_image_size" <<- 'PREPARE_IMAGE_SIZE'
Expand Down
2 changes: 1 addition & 1 deletion lib/functions/main/build-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function determine_artifacts_to_build_for_image() {
artifacts_to_build+=("armbian-bsp-cli")

# Userspace, RELEASE-specific artifacts.
if [[ -n "${RELEASE}" ]]; then
if [[ -n "${RELEASE}" && ! $APA_IS_ACTIVE ]]; then
if [[ -n "${DESKTOP_ENVIRONMENT}" ]]; then
artifacts_to_build+=("armbian-desktop")
artifacts_to_build+=("armbian-bsp-desktop")
Expand Down
6 changes: 4 additions & 2 deletions lib/functions/main/config-prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ function prep_conf_main_build_single() {

LOG_SECTION="do_main_configuration" do_with_conditional_logging do_main_configuration # This initializes the extension manager among a lot of other things, and call extension_prepare_config() hook

interactive_desktop_main_configuration
interactive_finish # cleans up vars used for interactive
if [[ ! $APA_IS_ACTIVE ]]; then
interactive_desktop_main_configuration
interactive_finish # cleans up vars used for interactive
fi

LOG_SECTION="do_extra_configuration" do_with_conditional_logging do_extra_configuration

Expand Down
13 changes: 13 additions & 0 deletions lib/functions/rootfs/create-cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ function calculate_rootfs_cache_id() {

declare -i short_hash_size=6

call_extension_method "rootfs_customize_package_list" <<- ROOTFS_CUSTOMIZE_PACKAGE_LIST
expected to append arbitrary data about package list
modifications to /tmp/rootfs_customize_package_list.txt.
NOTE: hook implementations that do not write to this
file will have no effect on the rootfs hashing.
ROOTFS_CUSTOMIZE_PACKAGE_LIST
local rootfs_customize_package_list_hash=""
if [[ -e '/tmp/rootfs_customize_package_list.txt' ]]; then
rootfs_customize_package_list_hash=$(sha256sum /tmp/rootfs_customize_package_list.txt)
rm /tmp/rootfs_customize_package_list.txt
fi

# get the hashes of the lib/ bash sources involved...
declare hash_files="undetermined"
calculate_hash_for_files "${SRC}"/lib/functions/rootfs/create-cache.sh "${SRC}"/lib/functions/rootfs/rootfs-create.sh
Expand All @@ -29,6 +41,7 @@ function calculate_rootfs_cache_id() {
declare -a extension_hooks_hashed=("$(dump_extension_method_sources_functions "${extension_hooks_to_hash[@]}")")
declare hash_hooks="undetermined"
declare legacy_debootstrap="${LEGACY_DEBOOTSTRAP:-"no"}"
extension_hooks_hashed+=("rootfs_customize_package_list=${rootfs_customize_package_list_hash}")
hash_hooks="$(echo "${extension_hooks_hashed[@]}" LDB=${legacy_debootstrap,,} | sha256sum | cut -d' ' -f1)"
declare hash_hooks_short="${hash_hooks:0:${short_hash_size}}"

Expand Down
2 changes: 1 addition & 1 deletion lib/functions/rootfs/distro-agnostic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ function install_distribution_agnostic() {
install_artifact_deb_chroot "armbian-bsp-cli"

# install armbian-desktop
if [[ $BUILD_DESKTOP == yes ]]; then
if [[ ! $APA_IS_ACTIVE && $BUILD_DESKTOP == yes ]]; then
install_artifact_deb_chroot "armbian-desktop"
install_artifact_deb_chroot "armbian-bsp-desktop"
# install display manager and PACKAGE_LIST_DESKTOP_FULL packages if enabled per board
Expand Down
18 changes: 16 additions & 2 deletions lib/functions/rootfs/rootfs-create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,19 @@ function create_new_rootfs_cache_via_debootstrap() {
declare -ga debootstrap_arguments=(
"--variant=minbase" # minimal base variant. go ask Debian about it.
"--arch=${ARCH}" # the arch
"'--include=${AGGREGATED_PACKAGES_DEBOOTSTRAP_COMMA}'" # from aggregation.py
"'--components=${AGGREGATED_DEBOOTSTRAP_COMPONENTS_COMMA}'" # from aggregation.py
)
if [[ ! -z "${AGGREGATED_PACKAGES_DEBOOTSTRAP_COMMA}" ]]; then
# from aggregation.py
debootstrap_arguments+=("'--include=${AGGREGATED_PACKAGES_DEBOOTSTRAP_COMMA}'")
else
#FIXME: push the locales-gen stuff into extensions/apa.sh ?
# if apt isn't part of minbase, the above feels like the wrong solution.
debootstrap_arguments+=("'--include=locales,apt'")
fi
if [[ ! -z "${AGGREGATED_DEBOOTSTRAP_COMPONENTS_COMMA}" ]]; then
# from aggregation.py
debootstrap_arguments+=("'--components=${AGGREGATED_DEBOOTSTRAP_COMPONENTS_COMMA}'")
fi
if [[ "${LEGACY_DEBOOTSTRAP,,}" == "no" ]]; then
debootstrap_arguments+=("'--skip=check/empty'") # skips check if the rootfs dir is empty at start
fetch_distro_keyring "$RELEASE"
Expand Down Expand Up @@ -300,6 +310,10 @@ function create_new_rootfs_cache_via_debootstrap() {
chroot_sdcard_apt_get_install "${AGGREGATED_PACKAGES_DESKTOP[@]}"
fi

call_extension_method "post_debootstrap_install_additional_packages" <<- 'POST_DEBOOTSTRAP_INSTALL_ADDITIONAL_PACKAGES'
*installs packages not handled by aggregation/debootstrap*
POST_DEBOOTSTRAP_INSTALL_ADDITIONAL_PACKAGES

# stage: check md5 sum of installed packages. Just in case. @TODO: rpardini: this should also be done when a cache is used, not only when it is created
# lets check only for supported targets only unless forced
if [[ "${DISTRIBUTION_STATUS}" == "supported" && "${FORCE_CHECK_MD5_PACKAGES:-"no"}" == "yes" ]]; then
Expand Down