diff --git a/diskimage_builder/elements/gentoo/environment.d/00-gentoo-envars.bash b/diskimage_builder/elements/gentoo/environment.d/00-gentoo-envars.bash index f2641552..f25b9333 100644 --- a/diskimage_builder/elements/gentoo/environment.d/00-gentoo-envars.bash +++ b/diskimage_builder/elements/gentoo/environment.d/00-gentoo-envars.bash @@ -22,4 +22,8 @@ for (( i=0; i<${#GENTOO_EMERGE_ENV[@]}; i++ )); do eval export "${GENTOO_EMERGE_ENV[i]}" done -export DIB_INIT_SYSTEM=systemd +if [[ "${GENTOO_PROFILE}" == *"systemd"* ]]; then + export DIB_INIT_SYSTEM=${DIB_INIT_SYSTEM:-'systemd'} +else + export DIB_INIT_SYSTEM=${DIB_INIT_SYSTEM:-'openrc'} +fi