Skip to content

Commit 58ee1ee

Browse files
committed
extensions/apa: new hook rootfs_customize_package_list
1 parent 1cb0a8a commit 58ee1ee

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

extensions/apa.sh

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function custom_apt_repo__add_apa() {
1111

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

1717
# do not install armbian recommends for minimal images
@@ -29,6 +29,29 @@ function post_debootstrap_install_additional_packages__install_from_apa_stage1()
2929
esac
3030
}
3131

32+
#FIXME: still need a better name, this implies it is possible to delete pkgs
33+
# NOTE: this is only used for hashing, so it probably isn't that important
34+
# to delete pkgs from any lists as much as indicate they won't be present.
35+
# NOTE: /tmp/rootfs_customize_package_list.txt is a special file that all
36+
# callers of this hook need to append to, as there is no mechanism for
37+
# returning data from hooks.
38+
function rootfs_customize_package_list__get_apa_packages() {
39+
[[ $APA_IS_ACTIVE ]] || return 0
40+
41+
local apa_package_list=""
42+
43+
# do not install armbian recommends for minimal images
44+
[[ "${BUILD_MINIMAL,,}" =~ ^(true|yes)$ ]] && INSTALL_RECOMMENDS="no-install-recommends" || INSTALL_RECOMMENDS="install-recommends"
45+
apa_package_list+= "${INSTALL_RECOMMENDS} armbian-common $apa_additional_packages"
46+
47+
case ${DESKTOP_ENVIRONMENT^^} in
48+
XFCE|KDE|GNOME)
49+
apa_package_list+= "armbian-desktop-${DESKTOP_ENVIRONMENT,,}"
50+
;;
51+
esac
52+
echo $apa_package_list >> "/tmp/rootfs_customize_package_list.txt"
53+
}
54+
3255
function post_armbian_repo_customize_image__install_from_apa_stage2() {
3356
# do not install armbian recommends for minimal images
3457
[[ "${BUILD_MINIMAL,,}" =~ ^(true|yes)$ ]] && INSTALL_RECOMMENDS="no-install-recommends" || INSTALL_RECOMMENDS="install-recommends"

0 commit comments

Comments
 (0)