+# restore original grml sources.list file (temporarly moved via
+# /etc/grml/fai/config/hooks/instsoft.GRMLBASE):
+if [ -r "${GRML_SOURCES_LIST}.unused" ] ; then
+ mv "${GRML_SOURCES_LIST}.unused" "${GRML_SOURCES_LIST}"
+fi
+if [ -r "${DEBIAN_SOURCES_LIST}.unused" ] ; then
+ mv "${DEBIAN_SOURCES_LIST}.unused" "${DEBIAN_SOURCES_LIST}"
+fi
+
+[ -d $target/etc/apt/sources.list.d ] || mkdir $target/etc/apt/sources.list.d
+
+# remove any existing sources.list and inform user about the new
+# /etc/apt/sources.list.d/ setup:
+cat > $target/etc/apt/sources.list << EOF
+##### IMPORTANT NOTE ##############################################
+# The configuration file /etc/apt/sources.list has been split
+# into structured files in /etc/apt/sources.list.d/ - check out:
+#
+# /etc/apt/sources.list.d/grml.list for the grml related repositories
+# /etc/apt/sources.list.d/debian.list for official Debian repositories
+#
+# If you're looking for the "old" /etc/apt/sources.list file or
+# need some further repositories please take a look at the file
+# /etc/apt/sources.list.grml
+##### IMPORTANT NOTE ##############################################
+EOF
+
+# retrieve build information ($SUITE):
+if [ -r $target/etc/grml_live_version ] ; then
+ . $target/etc/grml_live_version
+fi
+
+# if we stil do not know which Debian suite we are building assume "stable"
+[ -n "$SUITE" ] || SUITE="stable"