Support option -u for updating; added FAI patches; several other small updates
[grml-live.git] / etc / grml / fai / config / hooks / instsoft.GRMLBASE
index cdca8a8..441b009 100755 (executable)
@@ -4,12 +4,30 @@
 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
 # Bug-Reports:   see http://grml.org/bugs/
 # License:       This file is licensed under the GPL v2 or any later version.
-# Latest change: Mit Okt 24 14:30:53 CEST 2007 [mika]
+# Latest change: Sat Oct 27 02:15:35 CEST 2007 [mika]
 ################################################################################
 
 set -u
 set -e
 
+if [ "$FAI_ACTION" = "softupdate" ] ; then
+   echo "Softupdate"
+   # make sure we prefer grml repository:
+   if [ -r /etc/grml/fai/apt/preferences ] ; then
+      cp /etc/grml/fai/apt/preferences $target/etc/apt/preferences
+   fi
+
+   if [ -r /etc/grml/fai/apt/sources.list ] ; then
+      if [ -L $target/etc/apt/sources.list ] ; then
+         rm $target/etc/apt/sources.list
+      fi
+      cp /etc/grml/fai/apt/sources.list $target/etc/apt/sources.list
+   fi
+
+   $ROOTCMD apt-get update
+
+else # no softupdate but fresh installation
+
 # work around http://trac.lighttpd.net/trac/ticket/657
 # should be removed later on:
 echo "Acquire::http::Pipeline-Depth "0"; // added by grml-live" >> $target/etc/apt/apt.conf
@@ -22,7 +40,7 @@ $ROOTCMD apt-key add /etc/apt/grml.key
 
 # make sure we prefer grml repository:
 if [ -r /etc/grml/fai/files/etc/apt/preferences ] ; then
-   cp /etc/grml/fai/files/etc/apt/preferences $target/etc/apt/preferences
+   cp /etc/grml/fai/apt/preferences $target/etc/apt/preferences
 fi
 
 # make sure we have file-rc available before
@@ -56,5 +74,7 @@ if [ -L "$target"/usr/sbin/invoke-rc.d ] ; then
    $ROOTCMD dpkg-divert --package fai --rename --remove /usr/sbin/invoke-rc.d
 fi
 
+fi # end of FAI_ACTION = softupdate
+
 ## END OF FILE #################################################################
 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3