SpectreOS-old/update-bootloader
2018-05-05 00:24:32 +02:00

18 lines
585 B
Bash
Executable file

#!/bin/bash
set -ex
kernel1="$(find /boot/ -name "initramfs*$(uname -m).img")"
linuz1="$(find /boot/ -name "vmlinuz*$(uname -m)")"
kernel="${kernel1#/*/}"
linuz="${linuz1#/*/}"
kernelback1="$(find /boot/ -name "initramfs*$(uname -m)-fallback.img")"
kernelback="${kernelback1#/*/}"
sed "s|%LINUZ%|${linuz}|g;
s|%KERNEL%|${kernel}|g" /boot/arch-uefi.conf.example > /boot/loader/entries/arch-uefi.conf
sed "s|%LINUZ%|${linuz}|g;
s|%KERNEL%|${kernelback}|g" /boot/arch-uefi.conf.example > /boot/loader/entries/arch-uefi-fallback.conf
echo "Bootloader update $(date)" >> /shutdown.log