Add UEFI support for kernel update

This commit is contained in:
Stefan Reimer 2016-03-28 12:15:21 -07:00
parent 9ef4b5c8c8
commit 18b95ce96b

View File

@ -20,11 +20,20 @@ dracut --xz -H --force --strip ${TARGET}/initrd-${NEW} ${NEW}
export INSTALL_PATH=${TARGET} export INSTALL_PATH=${TARGET}
make install make install
if [ ! -d /sys/firmware/efi ]; then # UEFI
grub2-mkconfig -o ${TARGET}/grub/grub.cfg if [ -d /sys/firmware/efi ]; then
pushd ${TARGET} >/dev/null LUKS_UUID=$(blkid | grep crypto_LUKS | awk '{print $2}' | uniq | sed -e 's/UUID=//' | sed -e 's/"//g')
ln -sf System.map-${NEW} System.map
popd > /dev/null # Remove potential existing entries for this kernel
BOOT_IDS=$(efibootmgr | grep Gentoo-${NEW} | awk '{print $1}' | sed 's/Boot\(.*\)\*/\1/')
for b in $BOOT_IDS; do efibootmgr -b $b -B > /dev/null; done
efibootmgr -c -L Gentoo-${NEW} -l /EFI/Gentoo/vmlinuz-${NEW} -u "initrd=/EFI/Gentoo/initrd-${NEW} root=/dev/mapper/disks-root ro quiet rd.luks.uuid=${LUKS_UUID} rd.lvm.vg=disks rd.luks.allow-discards libata.force=noncq"
else
grub2-mkconfig -o ${TARGET}/grub/grub.cfg
pushd ${TARGET} >/dev/null
ln -sf System.map-${NEW} System.map
popd > /dev/null
fi fi
echo "Building tools from within kernel sources..." echo "Building tools from within kernel sources..."