From 8fd2c879ff12bd01ea057f57452d59853f819dcb Mon Sep 17 00:00:00 2001 From: Vasiliy Stelmachenok Date: Fri, 8 Mar 2024 00:02:44 +0300 Subject: [PATCH] profiles: Fix working with ugly mkinitcpio configurations --- profiles/pci/graphic_drivers/profiles.toml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/profiles/pci/graphic_drivers/profiles.toml b/profiles/pci/graphic_drivers/profiles.toml index 86b8a4a..5bf3305 100644 --- a/profiles/pci/graphic_drivers/profiles.toml +++ b/profiles/pci/graphic_drivers/profiles.toml @@ -36,8 +36,11 @@ conditional_packages = """ """ post_install = """ cat </etc/mkinitcpio.conf.d/10-chwd.conf -# This file is automatically generated by chwd. PLEASE DO NOT EDIT IT. -MODULES+=(nvidia nvidia_modeset nvidia_uvm nvidia_drm) +if [[ "$(declare -p MODULES)" =~ "declare -a" ]]; then + MODULES+=(nvidia nvidia_modeset nvidia_uvm nvidia_drm) +else + MODULES=($MODULES nvidia nvidia_modeset nvidia_uvm nvidia_drm) +fi EOF mkinitcpio -P """ @@ -74,7 +77,11 @@ conditional_packages = """ post_install = """ cat </etc/mkinitcpio.conf.d/10-chwd.conf # This file is automatically generated by chwd. PLEASE DO NOT EDIT IT. -MODULES+=(nvidia nvidia_modeset nvidia_uvm nvidia_drm) +if [[ "$(declare -p MODULES)" =~ "declare -a" ]]; then + MODULES+=(nvidia nvidia_modeset nvidia_uvm nvidia_drm) +else + MODULES=($MODULES nvidia nvidia_modeset nvidia_uvm nvidia_drm) +fi EOF mkinitcpio -P """ @@ -155,7 +162,11 @@ post_install = """ else cat </etc/mkinitcpio.conf.d/10-chwd.conf # This file is automatically generated by chwd. PLEASE DO NOT EDIT IT. -MODULES+=(virtio virtio_blk virtio_pci virtio_net) +if [[ "$(declare -p MODULES)" =~ "declare -a" ]]; then + MODULES+=(virtio virtio_blk virtio_pci virtio_net) +else + MODULES=($MODULES virtio virtio_blk virtio_pci virtio_net) +fi EOF mkinitcpio -P fi