Skip to content

Instantly share code, notes, and snippets.

@mekb-turtle
Created June 15, 2024 05:45
Show Gist options
  • Save mekb-turtle/6a20907542f3729d671a0111da636a12 to your computer and use it in GitHub Desktop.
Save mekb-turtle/6a20907542f3729d671a0111da636a12 to your computer and use it in GitHub Desktop.
Script to regenerate dracut initramfs
#!/bin/sh
set -o errexit
KERNEL="$(pacman -Q linux | awk '{print $2}' | sed 's/\.\([a-z]\+\)/-\1/')"
echo "Generating initramfs for kernel $KERNEL"
echo "This may take a while..."
echo "Generaing /boot/initramfs-linux.img..."
dracut --hostonly --no-hostonly-cmdline /boot/initramfs-linux.img -f "$KERNEL"
echo "Generaing /boot/initramfs-linux-fallback.img..."
dracut /boot/initramfs-linux-fallback.img -f "$KERNEL"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment