Skip to content

Commit

Permalink
profiles: Fix working with ugly mkinitcpio configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
ventureoo committed Mar 7, 2024
1 parent 4c8676f commit 8fd2c87
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions profiles/pci/graphic_drivers/profiles.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@ conditional_packages = """
"""
post_install = """
cat <<EOF >/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
"""
Expand Down Expand Up @@ -74,7 +77,11 @@ conditional_packages = """
post_install = """
cat <<EOF >/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
"""
Expand Down Expand Up @@ -155,7 +162,11 @@ post_install = """
else
cat <<EOF >/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
Expand Down

0 comments on commit 8fd2c87

Please sign in to comment.