Remove ewarn+eend from chroot-script
[grml-debootstrap.git] / chroot-script
index 7753bdb..40fa486 100644 (file)
@@ -36,7 +36,7 @@ stage() {
      echo "$2" > "$STAGES/$1"
      return 0
   elif grep -q done "$STAGES/$1" 2>/dev/null ; then
-     ewarn "Notice: stage $1 has been executed already, skipping execution therefore." ; eend 0
+     echo "Notice: stage $1 has been executed already, skipping execution therefore.">&2
      return 1
   fi
 }
@@ -130,7 +130,9 @@ kernel() {
 reconfigure() {
   if [ -n "$RECONFIGURE" ] ; then
      for package in $RECONFIGURE ; do
-         dpkg --list $package 1>/dev/null 2>/dev/null && dpkg-reconfigure $package || echo "Warning: $package does not exist, can not reconfigure it."
+         dpkg --list $package 1>/dev/null 2>/dev/null && \
+         DEBIAN_FRONTEND=$DEBIAN_FRONTEND dpkg-reconfigure $package || \
+         echo "Warning: $package does not exist, can not reconfigure it."
      done
   fi
 }
@@ -260,13 +262,18 @@ grub() {
      [ "$RELEASE" = 'sarge' ]       && cp /lib/grub/i386-pc/* /boot/grub/
 
      # finally install grub
-     update-grub -y
+     if [ -x /usr/sbin/update-grub ] ; then
+        UPDATEGRUB='/usr/sbin/update-grub'
+     else
+        UPDATEGRUB='/sbin/update-grub'
+     fi
+     $UPDATEGRUB -y
      if [ -f /boot/grub/menu.lst ] ; then
         sed -i "s/^# groot=.*/# groot=(${GROOT})/g" /boot/grub/menu.lst
         sed -i "s|^# kopt=root=.*|# kopt=root=${TARGET} ro|g" /boot/grub/menu.lst
         # not sure why savedefault does not work for me; any ideas?
         sed -i "s/^savedefault.*/# &/g" /boot/grub/menu.lst
-        update-grub -y
+        $UPDATEGRUB -y
      fi
   fi
 }