update-grub 532 B

1234567891011121314151617181920
  1. #!/usr/bin/env bash
  2. # milisarge-milislinux 2021
  3. #grub_cfg="/boot/grub/grub.cfg"
  4. grub_cfg="/boot/grub/grub.cfg"
  5. initramfs_file="/boot/initramfs-$(uname -r | cut -d'-' -f1).img"
  6. if [ "$1" = "test" ];then
  7. grub_cfg="/tmp/grub.cfg"
  8. initramfs_file="/tmp/initramfs-$(uname -r | cut -d'-' -f1).img"
  9. fi
  10. dracut --force -H -f ${initramfs_file}
  11. LC_ALL=C grub-mkconfig -o ${grub_cfg}
  12. echo "--------------------------------"
  13. echo "iniramfs file: ${initramfs_file}"
  14. echo "grub.cfg file: ${grub_cfg}"
  15. echo "--------------------------------"