aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--templates/grub.cfg24
1 files changed, 20 insertions, 4 deletions
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}
}
#