From Rude Dove, 2 Months ago, written in Bash.
This paste will check out in 8 Months.
Embed
  1. #!/bin/bash
  2.  
  3. name="$1"
  4. ver="$2"
  5.  
  6. initrd="/boot/initramfs-${name}-dracut"
  7. ext="img"
  8.  
  9. for preset in 'default' 'fallback'; do
  10.     case $preset in
  11.         'fallback') dargs="-fMq"; initrd+="-fallback" ;;
  12.         *) dargs="-fMqH" ;;
  13.     esac
  14.     echo "==> Generating '$preset'"
  15.     dracut $dargs $initrd.$ext ${ver}
  16. done
  17.