SpectreOS-old/update-bootloader
simono41 214dff8fa4 fix
2018-08-21 23:28:05 +02:00

25 lines
690 B
Bash
Executable file

#!/bin/bash
set -ex
kernel1="$(echo $(find /boot/ -name "initramfs*.img") | cut -d" " -f2)"
linuz1="$(echo $(find /boot/ -name "vmlinuz*") | cut -d" " -f2)"
kernel="${kernel1#/*/}"
linuz="${linuz1#/*/}"
kernelback1="$(find /boot/ -name "initramfs*-fallback.img")"
kernelback="${kernelback1#/*/}"
echo "Kernel: ${kernel}"
echo "Linuz: ${linuz}"
echo "Kernel-fallback: ${kernelback}"
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