aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-04-27 09:48:39 -0300
committerSilvio Rhatto <rhatto@riseup.net>2017-04-27 09:48:39 -0300
commitf3e860136aac50bcfb7b9b67188402491b9bff38 (patch)
treee1eb48d9415c4dc65daa5384a7bd999ffd6b21fe /templates
parentf8f3a1df47586e80cbbcd76263a18e3b52ccbcf8 (diff)
downloadbootless-f3e860136aac50bcfb7b9b67188402491b9bff38.tar.gz
bootless-f3e860136aac50bcfb7b9b67188402491b9bff38.tar.bz2
Support for default version at bootfde and bootimg
Diffstat (limited to 'templates')
-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}
}
#