+if [ -L "$target"/etc/apt/sources.list ] ; then
+ echo "Note: $target/etc/apt/sources.list seems to be the old sources.list setup."
+ echo "|-> Not modifying anything. If you want to switch to the new setup just"
+ echo "\`-> remove symlink $target/etc/apt/sources.list"
+ exit 0
+fi
+
+# remove leftover from /etc/grml/fai/config/hooks/instsoft.GRMLBASE:
+rm -f $target/etc/apt/sources.list.d/grml-live.list
+
+# restore original grml sources.list file:
+if [ -r $target/etc/apt/sources.list.d/grml.unused ] ; then
+ mv $target/etc/apt/sources.list.d/grml.unused $target/etc/apt/sources.list.d/grml.list
+fi
+
+GRML_SOURCES_LIST="$target/etc/apt/sources.list.d/grml.list"
+DEBIAN_SOURCES_LIST="$target/etc/apt/sources.list.d/debian.list"
+
+[ -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