update-bootloader

This commit is contained in:
simono41 2018-05-05 00:20:09 +02:00
parent 7021eadcd3
commit 7de5f82d5d
4 changed files with 35 additions and 1 deletions

View file

@ -581,6 +581,15 @@ if ! grep '#!' $RCLOCAL; then
echo "#!/bin/bash" > $RCLOCAL
fi
# Install rc.shutdown
echo "#!/bin/bash" > /etc/rc.local.shutdown
if [ "${version}" == "manjaro" ]; then
cp /opt/${repo}/update-bootloader /usr/bin/update-bootloader
chmod +x /usr/bin/update-bootloader
echo "/usr/bin/update-bootloader" >> /etc/rc.local.shutdown
fi
if [ "$version" != "lite" ]; then
### custom-installer

View file

@ -691,6 +691,13 @@ function systemdboot() {
echo "default arch-uefi" > ${mountpoint}/boot/loader/loader.conf
echo "timeout 1" >> ${mountpoint}/boot/loader/loader.conf
# update-bootloader
echo "title "${repo}"" > ${mountpoint}/boot/arch-uefi.conf.example
echo "linux /%LINUZ%" >> ${mountpoint}/boot/arch-uefi.conf.example
echo "initrd /intel-ucode.img" >> ${mountpoint}/boot/arch-uefi.conf.example
echo "initrd /%KERNEL%" >> ${mountpoint}/boot/arch-uefi.conf.example
echo "options root=${tobootdevice} rw ${parameter}quiet splash" >> ${mountpoint}/boot/arch-uefi.conf.example
if [ "${booteintraege}" != "n" ]; then
echo "Additional boot entries are created !!!"

View file

@ -2,7 +2,7 @@
echo "Start!!!"
date >> /startup.txt
date >> /startup.log
if [ -f /usr/bin/run ]
then

18
update-bootloader Executable file
View file

@ -0,0 +1,18 @@
#!/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