mirror of
https://github.com/basecamp/omarchy.git
synced 2026-02-17 15:25:37 +00:00
Rework migration
This commit is contained in:
@@ -1,24 +1,11 @@
|
|||||||
echo "Adding thunderbolt module to mkinitcpio"
|
echo "Add thunderbolt support to boot image"
|
||||||
|
|
||||||
OMARCHY_HOOKS="/etc/mkinitcpio.conf.d/omarchy_hooks.conf"
|
omarchy-pkg-add bolt
|
||||||
RUN_MKINITCPIO=false
|
|
||||||
|
|
||||||
if ! grep -q '^MODULES=' $OMARCHY_HOOKS; then
|
if [[ ! -f /etc/mkinitcpio.conf.d/thunderbolt_module.conf ]]; then
|
||||||
# Add a new MODULES line with thunderbolt
|
sudo tee /etc/mkinitcpio.conf.d/thunderbolt_module.conf <<EOF >/dev/null
|
||||||
sudo sed -i '1iMODULES=(thunderbolt)' $OMARCHY_HOOKS
|
MODULES+=(thunderbolt)
|
||||||
RUN_MKINITCPIO=true
|
EOF
|
||||||
elif grep -q '^MODULES=' $OMARCHY_HOOKS && ! grep -qE "^MODULES=.*(\bthunderbolt\b)" $OMARCHY_HOOKS; then
|
|
||||||
# Add thunderbolt inside the existing MODULES=(...) list (before the closing paren)
|
|
||||||
sudo sed -i -E "s/^(MODULES=\([^)]*)\)/\1 thunderbolt)/" $OMARCHY_HOOKS
|
|
||||||
RUN_MKINITCPIO=true
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$RUN_MKINITCPIO" = true ]; then
|
sudo limine-update
|
||||||
echo "Regenerating initramfs with thunderbolt module included"
|
|
||||||
# From omarchy-refresh-plymouth
|
|
||||||
if command -v limine-mkinitcpio &>/dev/null; then
|
|
||||||
sudo limine-mkinitcpio
|
|
||||||
else
|
|
||||||
sudo mkinitcpio -P
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|||||||
Reference in New Issue
Block a user