Only set a default GRUB_PRELOAD_MODULES if not already defined; otherwise used the existing values.

core-include-dmsetup
Mathieu Trudel-Lapierre 7 years ago
parent f48670cec5
commit a75544e0c3

@ -82,8 +82,9 @@ install_grub() {
cat << EOF >> mountpoint/etc/default/grub.d/50-cloudimg-settings.cfg cat << EOF >> mountpoint/etc/default/grub.d/50-cloudimg-settings.cfg
${CLOUD_IMG_STR} ${CLOUD_IMG_STR}
# For Cloud Image compatability # For Cloud Image compatability
GRUB_PRELOAD_MODULES="${grub_modules}" GRUB_PRELOAD_MODULES="${GRUB_PRELOAD_MODULES:-$grub_modules}"
EOF EOF
chroot mountpoint grub-install "${loop_device}" \ chroot mountpoint grub-install "${loop_device}" \
--boot-directory=/boot \ --boot-directory=/boot \
--efi-directory=/boot/efi \ --efi-directory=/boot/efi \

Loading…
Cancel
Save