2018-05-05 00:20:09 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
2018-08-21 22:10:02 +02:00
|
|
|
|
2018-08-21 23:43:37 +02:00
|
|
|
kernel1="$(echo $(find /boot/ -name "initramfs*$(uname -m).img") | cut -d" " -f2)"
|
|
|
|
linuz1="$(echo $(find /boot/ -name "vmlinuz*$(uname -m)") | cut -d" " -f2)"
|
2018-05-05 00:20:09 +02:00
|
|
|
kernel="${kernel1#/*/}"
|
|
|
|
linuz="${linuz1#/*/}"
|
2018-08-21 22:10:02 +02:00
|
|
|
|
2018-08-22 00:53:22 +02:00
|
|
|
kernelback1="$(find /boot/ -name "initramfs*$(uname -m)-fallback.img")"
|
2018-05-05 00:20:09 +02:00
|
|
|
kernelback="${kernelback1#/*/}"
|
|
|
|
|
2018-08-21 22:10:02 +02:00
|
|
|
|
2018-05-10 03:25:49 +02:00
|
|
|
echo "Kernel: ${kernel}"
|
|
|
|
echo "Linuz: ${linuz}"
|
|
|
|
echo "Kernel-fallback: ${kernelback}"
|
|
|
|
|
2018-05-05 00:20:09 +02:00
|
|
|
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
|