#!/bin/sh set -eux rootsource=$(findmnt -fno source -T /) firmwaresource=$(findmnt -fno source -T /boot/firmware/) if ! test x"$rootsource" = x"$firmwaresource"; then cp --dereference /vmlinuz /boot/firmware/vmlinuz \ || cp --dereference /vmlinuz.old /boot/firmware/vmlinuz cp --dereference /initrd.img /boot/firmware/initrd.img \ || cp --dereference /initrd.img.old /boot/firmware/initrd.img ls -lah /vmlinuz /initrd.img > /boot/firmware/versions.txt \ || ls -lah /vmlinuz.old /initrd.img.old > /boot/firmware/versions.txt fi exit 0