From a9dba663c6e23f94bd5df9d65ece96072c2ff931 Mon Sep 17 00:00:00 2001
From: Lucas Manika Koeb <lmk08@c3sl.ufpr.br>
Date: Tue, 18 Jun 2013 11:08:59 -0300
Subject: [PATCH] Disable update-grub on the kernel postinst to avoid
 grub-probe problems

Signed-off-by: Lucas Manika Koeb <lmk08@c3sl.ufpr.br>
---
 scripts/00-update            | 5 +++++
 scripts/40-configure_le5     | 4 ++++
 scripts/40-configure_minicom | 5 +++++
 3 files changed, 14 insertions(+)

diff --git a/scripts/00-update b/scripts/00-update
index 2e27d99..9804adf 100755
--- a/scripts/00-update
+++ b/scripts/00-update
@@ -91,6 +91,11 @@ chroot "$CHROOTDIR" apt-key add - < "$TEMPLATES"/disk.key
 # Changes distro
 chroot "$CHROOTDIR" apt-get -y --force-yes update
 
+# Avoid the grub-probe error when updating the kernel image
+sed -i s/'exec update-grub'/'# exec update-grub'/g \
+    "$CHROOTDIR"/etc/kernel/postinst.d/zz-update-grub
+
+
 # Installs le-autoupgrade so the apt_preferences file is in place for the
 # rest of the process
 chroot "$CHROOTDIR" apt-get -y --force-yes install le-autoupgrade
diff --git a/scripts/40-configure_le5 b/scripts/40-configure_le5
index 898f62a..3ec3f08 100755
--- a/scripts/40-configure_le5
+++ b/scripts/40-configure_le5
@@ -96,6 +96,10 @@ chroot $CHROOTDIR dpkg-reconfigure le-greeter
 cp -f "$TEMPLATES"/casper/10adduser \
     "$CHROOTDIR"/usr/share/initramfs-tools/scripts/casper-bottom/10adduser
 
+# Re-enable update-grub on the kernel postinst
+sed -i s/'# exec update-grub'/'exec update-grub'/g \
+    "$CHROOTDIR"/etc/kernel/postinst.d/zz-update-grub
+
 # Sets deb-conf install command
 sed -i 's@Ubuntu@LE@g' "$CDDIR"/preseed/ubuntu.seed
 sed -i 's@ubuntu@le@g' "$CDDIR"/preseed/ubuntu.seed
diff --git a/scripts/40-configure_minicom b/scripts/40-configure_minicom
index 708a148..7092d8b 100755
--- a/scripts/40-configure_minicom
+++ b/scripts/40-configure_minicom
@@ -73,6 +73,11 @@ INFO_ISO=$(echo "$1" | cut -d "/" -f 2)
 INFO_ISO="$INFO_ISO:"$(date +"%d-%m-%y")
 echo "$INFO_ISO" > "$CHROOTDIR"/etc/le/data_iso.txt
 
+
+# Re-enable update-grub on the kernel postinst
+sed -i s/'# exec update-grub'/'exec update-grub'/g \
+    "$CHROOTDIR"/etc/kernel/postinst.d/zz-update-grub
+
 # Change the live user name
 case "$1" in
     "minicom/client")
-- 
GitLab