From f3e860136aac50bcfb7b9b67188402491b9bff38 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 27 Apr 2017 09:48:39 -0300 Subject: Support for default version at bootfde and bootimg --- templates/grub.cfg | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'templates') diff --git a/templates/grub.cfg b/templates/grub.cfg index 85f509d..6ff5b62 100644 --- a/templates/grub.cfg +++ b/templates/grub.cfg @@ -52,6 +52,14 @@ function bootfde { set target=root fi + if [ "${version}" == 'default' ]; then + set kernel="/vmlinuz" + set initrd="/initrd.img" + else + set kernel="/boot/vmlinuz-${version}" + set initrd="/boot/initrd.img-${version}"" + fi + cryptomount lvm/${volume} set root=(crypto0) @@ -61,9 +69,9 @@ function bootfde { insmod lvm echo "Loading ${volume}..." - linux /boot/vmlinuz-${version} root=/dev/mapper/${target} cryptopts=target=${target},source=${source} ro quiet apparmor=1 security=apparmor + linux ${kernel} root=/dev/mapper/${target} cryptopts=target=${target},source=${source} ro quiet apparmor=1 security=apparmor echo 'Loading initial ramdisk ...' - initrd /boot/initrd.img-${version} + initrd ${initrd} } # @@ -97,10 +105,18 @@ function bootimg { set distro=debian fi + if [ "${version}" == 'default' ]; then + set kernel="/vmlinuz" + set initrd="/initrd.img" + else + set kernel="/boot/custom/${distro}/vmlinuz-${version}" + set initrd="/boot/custom/${distro}initrd.img-${version}"" + fi + echo "Loading ${1}..." - linux /boot/custom/${distro}/vmlinuz-${version} root=/dev/mapper/${rootfs} cryptopts=target=${target},source=${volume} ro quiet apparmor=1 security=apparmor + linux ${kernel} root=/dev/mapper/${rootfs} cryptopts=target=${target},source=${volume} ro quiet apparmor=1 security=apparmor echo 'Loading initial ramdisk ...' - initrd /boot/custom/${distro}/initrd.img-${version} + initrd ${initrd} } # -- cgit v1.2.3