Rename /etc/grml/fai/files to /etc/grml/fai/config/files and move /etc/grml/fai/live...
authorMichael Prokop <mika@grml.org>
Sun, 31 Jan 2010 13:51:23 +0000 (14:51 +0100)
committerMichael Prokop <mika@grml.org>
Sun, 31 Jan 2010 16:37:00 +0000 (17:37 +0100)
Moving files to FAI's config space allows us to use a much cleaner
interface and configuration through FAI's fcopy command.

19 files changed:
docs/grml-live.txt
etc/grml/fai/apt/important_note.txt
etc/grml/fai/apt/sources.list
etc/grml/fai/config/files/etc/apt/grml.key/GRMLBASE [moved from etc/grml/fai/files/etc/apt/grml.key with 100% similarity]
etc/grml/fai/config/files/etc/apt/preferences/GRMLBASE [moved from etc/grml/fai/files/etc/apt/preferences with 100% similarity]
etc/grml/fai/config/files/etc/fstab/GRMLBASE [moved from etc/grml/fai/files/etc/fstab with 100% similarity]
etc/grml/fai/config/files/etc/hosts/GRMLBASE [moved from etc/grml/fai/files/etc/hosts with 100% similarity]
etc/grml/fai/config/files/etc/live.conf/GRMLBASE [moved from etc/grml/fai/live-initramfs/live.conf with 100% similarity]
etc/grml/fai/config/files/etc/network/interfaces/GRMLBASE [moved from etc/grml/fai/files/etc/network/interfaces with 100% similarity]
etc/grml/fai/config/files/etc/sudoers/GRMLBASE [moved from etc/grml/fai/files/etc/sudoers with 100% similarity]
etc/grml/fai/config/files/usr/share/initramfs-tools/scripts/init-top/grml/GRMLBASE [moved from etc/grml/fai/live-initramfs/grml-script.init-top with 100% similarity]
etc/grml/fai/config/hooks/instsoft.GRMLBASE
etc/grml/fai/config/hooks/updatebase.GRMLBASE
etc/grml/fai/config/scripts/GRMLBASE/10-build-initramfs
etc/grml/fai/config/scripts/GRMLBASE/20-sudo
etc/grml/fai/config/scripts/GRMLBASE/30-fstab
etc/grml/fai/config/scripts/GRMLBASE/34-hosts
etc/grml/fai/config/scripts/GRMLBASE/35-network
grml-live

index 6d58660..0874fdd 100644 (file)
@@ -379,7 +379,7 @@ like to see included). Important: this file should *not* be adjusted manually!
 Instead use the GRML_LIVE_SOURCES variable inside /etc/grml/grml-live.conf or
 /etc/grml/grml-live.local which modifies /etc/grml/fai/apt/sources.list
 on-the-fly via grml-live then. If you want to generally adjust apt configuration
-check out /etc/grml/fai/files/etc/apt instead.
+use FAI's fcopy command with /etc/grml/fai/config/files instead.
 
   /etc/grml/fai/config/
 
@@ -417,12 +417,6 @@ reasonable package configuration.
 
 Scripts for customising the ISO within the build process.
 
-  /etc/grml/fai/files/
-
-This directory provides files used inside the scripts of
-/etc/grml/fai/config/scripts/*. For a full documentation what happens with the
-files please refer to the source of the scripts.
-
   /etc/grml/fai/live-initramfs/
 
 This directory provides the files used for building the initramfs/initrd via
index 0f94ca3..7d4e0c0 100644 (file)
@@ -1,4 +1,4 @@
 # NOTE: This directory is *NOT* meant for manual customisation! Files in this
 # directory are written by grml-live only and any changes might be overriden.
 # You might consider using GRML_LIVE_SOURCES in /etc/grml/grml-live.conf*
-# and /etc/grml/fai/files/etc/apt instead!
+# or FAI's fcopy command with /etc/grml/fai/config/files instead!
index 69b6293..1b052e7 100644 (file)
@@ -1,7 +1,7 @@
 # NOTE: This file is *NOT* meant for manual customisation! This file is
 # modified by grml-live and any changes might be overriden.
 # You might consider using GRML_LIVE_SOURCES in /etc/grml/grml-live.conf*
-# and using /etc/grml/fai/files/etc/apt instead!'
+# or FAI's fcopy command with /etc/grml/fai/config/files instead!
 deb http://deb.grml.org/            grml-stable  main
 deb http://deb.grml.org/            grml-testing main
 deb http://cdn.debian.net/debian lenny        main contrib non-free
index b192b8a..55886f9 100755 (executable)
@@ -83,29 +83,21 @@ EOF
 else # no softupdate but fresh installation
 
 # install all apt related files
-if [ -r /etc/grml/fai/files/etc/apt ] ; then
-   cp -a /etc/grml/fai/files/etc/apt/* $target/etc/apt/
-   # remove grml-live's sources.list file from chroot:
-   if [ -r $target/etc/apt/important_note.txt ] ; then
-      grep -q GRML_LIVE_SOURCES $target/etc/apt/important_note.txt && rm $target/etc/apt/important_note.txt
-   fi
-fi
+fcopy -r /etc/apt
 
-# install all present (but at least the grml) gpg keys:
-if [ -r /etc/grml/fai/files/etc/apt/grml.key ] ; then
-   for file in /etc/grml/fai/files/etc/apt/*.key ; do
-      FILE="$(basename $file)"
-      # installed via 'cp -a /etc/grml/fai/files/etc/apt/* $target/etc/apt/' above already
-      # cp $file $target/etc/apt/"$FILE"
-      $ROOTCMD apt-key add /etc/apt/"$FILE"
-   done
-else
-   gpg --keyserver subkeys.pgp.net      --recv-keys F61E2E7CECDEA787 || \
-   gpg --keyserver blackhole.pca.dfn.de --recv-keys F61E2E7CECDEA787
-   gpg --export F61E2E7CECDEA787 > $target/etc/apt/grml.key
-   $ROOTCMD apt-key add /etc/apt/grml.key
+# remove grml-live's sources.list file from chroot:
+if [ -r $target/etc/apt/important_note.txt ] ; then
+   grep -q GRML_LIVE_SOURCES $target/etc/apt/important_note.txt && rm $target/etc/apt/important_note.txt
 fi
 
+# install grml gpg key:
+fcopy /etc/apt/grml.key
+$ROOTCMD apt-key add /etc/apt/grml.key
+#   gpg --keyserver subkeys.pgp.net      --recv-keys F61E2E7CECDEA787 || \
+#   gpg --keyserver blackhole.pca.dfn.de --recv-keys F61E2E7CECDEA787
+#   gpg --export F61E2E7CECDEA787 > $target/etc/apt/grml.key
+#   $ROOTCMD apt-key add /etc/apt/grml.key
+
 # make sure the file exists
 [ -e $target/etc/apt/apt.conf ] || touch $target/etc/apt/apt.conf
 
index a501682..c229448 100755 (executable)
@@ -28,30 +28,18 @@ EOF
 else # no softupdate but updating chroot based on /etc/grml/fai/config/basefiles/*
 
 # install all apt related files
-if [ -r /etc/grml/fai/files/etc/apt ] ; then
-   cp -a /etc/grml/fai/files/etc/apt/* $target/etc/apt/
-   # remove grml-live's sources.list file from chroot:
-   if [ -r $target/etc/apt/important_note.txt ] ; then
-      grep -q GRML_LIVE_SOURCES $target/etc/apt/important_note.txt && rm $target/etc/apt/important_note.txt
-   fi
-fi
+fcopy -r /etc/apt
 
-# install all present (but at least the grml) gpg keys:
-if [ -r /etc/grml/fai/files/etc/apt/grml.key ] ; then
-   for file in /etc/grml/fai/files/etc/apt/*.key ; do
-      FILE="$(basename $file)"
-      # installed via 'cp -a /etc/grml/fai/files/etc/apt/* $target/etc/apt/' above already
-      # cp $file $target/etc/apt/"$FILE"
-      $ROOTCMD apt-key add /etc/apt/"$FILE"
-   done
-else
-   gpg --keyserver subkeys.pgp.net      --recv-keys F61E2E7CECDEA787 || \
-   gpg --keyserver blackhole.pca.dfn.de --recv-keys F61E2E7CECDEA787
-   gpg --export F61E2E7CECDEA787 > $target/etc/apt/grml.key
-   $ROOTCMD apt-key add /etc/apt/grml.key
+# remove grml-live's notice file from chroot:
+if [ -r $target/etc/apt/important_note.txt ] ; then
+   grep -q GRML_LIVE_SOURCES $target/etc/apt/important_note.txt && rm $target/etc/apt/important_note.txt
 fi
 
-fi
+# install grml gpg key:
+fcopy /etc/apt/grml.key
+$ROOTCMD apt-key add /etc/apt/grml.key
+
+fi # softupdate check
 
 ## END OF FILE #################################################################
 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3
index 9777a52..d6930fe 100755 (executable)
@@ -8,27 +8,12 @@
 
 set -e
 
-if ! [ -f "$target/etc/live.conf" ] ; then
-  echo "Warning: $target/etc/live.conf does not exist yet,"
-  echo "         ... installing /etc/grml/fai/live-initramfs/live.conf"
-  cp /etc/grml/fai/live-initramfs/live.conf "$target/etc/live.conf"
-fi
-
-if [ -f /etc/grml/fai/live-initramfs/grml-script.init-top ] ; then
-  cp /etc/grml/fai/live-initramfs/grml-script.init-top "$target/usr/share/initramfs-tools/scripts/init-top/grml"
-else
-  echo "Warning: /etc/grml/fai/live-initramfs/grml-script.init-top could not be read"
-fi
+fcopy /etc/live.conf
+fcopy /usr/share/initramfs-tools/scripts/init-top/grml
 
 FILE=$(ls -1 $target/boot/vmlinuz-* 2>/dev/null| sort -r | head -1)
 KERNELVERSION=$(echo "${FILE##$target/boot/vmlinuz-}")
 
-# make sure mdadm isn't executed in initrd:
-#if [ -f "$target"/etc/default/mdadm ] ; then
-#   sed -i "s/START_DAEMON=.*/START_DAEMON=false/" "$target"/etc/default/mdadm
-#   sed -i "s/INITRDSTART=.*/INITRDSTART=none/"    "$target"/etc/default/mdadm
-#fi
-
 if [ -z "$KERNELVERSION" ] ; then
    echo "Error: No kernel found, can not create initramfs. Exiting.">&2
    exit 1
index 4199f70..d940103 100755 (executable)
@@ -14,11 +14,9 @@ USERNAME=''
 [ -r /etc/grml/grml-live.local ] && . /etc/grml/grml-live.local
 [ -n "$USERNAME" ] || USERNAME=grml
 
-if [ -r /etc/grml/fai/files/etc/sudoers ] ; then
-   cp /etc/grml/fai/files/etc/sudoers $target/etc/sudoers
-   sed -i "s/\$USERNAME/$USERNAME/" $target/etc/sudoers
-   chmod 440 $target/etc/sudoers
-fi
+fcopy /etc/sudoers
+sed -i "s/\$USERNAME/$USERNAME/" $target/etc/sudoers
+chmod 440 $target/etc/sudoers
 
 ## END OF FILE #################################################################
 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3
index 6638878..bd47b64 100755 (executable)
@@ -14,10 +14,8 @@ USERNAME=''
 [ -r /etc/grml/grml-live.local ] && . /etc/grml/grml-live.local
 [ -n "$USERNAME" ] || USERNAME=grml
 
-if [ -r /etc/grml/fai/files/etc/fstab ] ; then
-   cp /etc/grml/fai/files/etc/fstab $target/etc/fstab
-   sed -i "s/uid=USERNAME,gid=USERNAME/uid=$USERNAME,gid=$USERNAME/" $target/etc/fstab
-fi
+fcopy /etc/fstab
+sed -i "s/uid=USERNAME,gid=USERNAME/uid=$USERNAME,gid=$USERNAME/" $target/etc/fstab
 
 ## END OF FILE #################################################################
 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3
index 8038cc0..961fc5c 100755 (executable)
@@ -14,9 +14,7 @@ HOSTNAME=''
 [ -r /etc/grml/grml-live.local ] && . /etc/grml/grml-live.local
 [ -n "$HOSTNAME" ] || HOSTNAME=grml
 
-if [ -r /etc/grml/fai/files/etc/hosts ] ; then
-   cp /etc/grml/fai/files/etc/hosts $target/etc/hosts
-fi
+fcopy /etc/hosts
 
 # replace $HOSTNAME with the real hostname:
 sed -i "s/\$HOSTNAME/$HOSTNAME/" $target/etc/hosts
index 0d39adc..be04b3e 100755 (executable)
@@ -9,9 +9,7 @@
 set -u
 set -e
 
-if [ -r /etc/grml/fai/files/etc/network/interfaces ] ; then
-   cp /etc/grml/fai/files/etc/network/interfaces $target/etc/network/interfaces
-fi
+fcopy /etc/network/interfaces
 
 ## END OF FILE #################################################################
 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3
index d66c995..e67a5ab 100755 (executable)
--- a/grml-live
+++ b/grml-live
@@ -392,7 +392,7 @@ if [ -n "$MIRROR_DIRECTORY" ] ; then
 # NOTE: This file is *NOT* meant for manual customisation! This file is
 # modified by grml-live and any changes might be overriden.
 # You might consider using GRML_LIVE_SOURCES in /etc/grml/grml-live.conf*
-# and using /etc/grml/fai/files/etc/apt instead!'
+# or FAI's fcopy command with /etc/grml/fai/config/files instead!
 EOF
    echo "$MIRROR_SOURCES" >> "$SOURCES_LIST_FILE"
    if [ -n "$GRML_LIVE_SOURCES" ] ; then
@@ -403,7 +403,7 @@ elif [ -n "$GRML_LIVE_SOURCES" ] ; then
 # NOTE: This file is *NOT* meant for manual customisation! This file is
 # modified by grml-live and any changes might be overriden.
 # You might consider using GRML_LIVE_SOURCES in /etc/grml/grml-live.conf*
-# and using /etc/grml/fai/files/etc/apt instead!'
+# or FAI's fcopy command with /etc/grml/fai/config/files instead!
 EOF
    echo "$GRML_LIVE_SOURCES" >> "$SOURCES_LIST_FILE"
 fi