From 574c42b5cbb9d1264b84bade255aed42547db8ec Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Sun, 31 Jan 2010 14:51:23 +0100 Subject: [PATCH] Rename /etc/grml/fai/files to /etc/grml/fai/config/files and move /etc/grml/fai/live-initramfs to /etc/grml/fai/config. Moving files to FAI's config space allows us to use a much cleaner interface and configuration through FAI's fcopy command. --- docs/grml-live.txt | 8 +----- etc/grml/fai/apt/important_note.txt | 2 +- etc/grml/fai/apt/sources.list | 2 +- .../files/etc/apt/grml.key/GRMLBASE} | Bin .../files/etc/apt/preferences/GRMLBASE} | 0 .../etc/fstab => config/files/etc/fstab/GRMLBASE} | 0 .../etc/hosts => config/files/etc/hosts/GRMLBASE} | 0 .../files/etc/live.conf/GRMLBASE} | 0 .../files/etc/network/interfaces/GRMLBASE} | 0 .../sudoers => config/files/etc/sudoers/GRMLBASE} | 0 .../scripts/init-top/grml/GRMLBASE} | 0 etc/grml/fai/config/hooks/instsoft.GRMLBASE | 32 ++++++++------------- etc/grml/fai/config/hooks/updatebase.GRMLBASE | 30 ++++++------------- .../fai/config/scripts/GRMLBASE/10-build-initramfs | 19 ++---------- etc/grml/fai/config/scripts/GRMLBASE/20-sudo | 8 ++---- etc/grml/fai/config/scripts/GRMLBASE/30-fstab | 6 ++-- etc/grml/fai/config/scripts/GRMLBASE/34-hosts | 4 +-- etc/grml/fai/config/scripts/GRMLBASE/35-network | 4 +-- grml-live | 4 +-- 19 files changed, 35 insertions(+), 84 deletions(-) rename etc/grml/fai/{files/etc/apt/grml.key => config/files/etc/apt/grml.key/GRMLBASE} (100%) rename etc/grml/fai/{files/etc/apt/preferences => config/files/etc/apt/preferences/GRMLBASE} (100%) rename etc/grml/fai/{files/etc/fstab => config/files/etc/fstab/GRMLBASE} (100%) rename etc/grml/fai/{files/etc/hosts => config/files/etc/hosts/GRMLBASE} (100%) rename etc/grml/fai/{live-initramfs/live.conf => config/files/etc/live.conf/GRMLBASE} (100%) rename etc/grml/fai/{files/etc/network/interfaces => config/files/etc/network/interfaces/GRMLBASE} (100%) rename etc/grml/fai/{files/etc/sudoers => config/files/etc/sudoers/GRMLBASE} (100%) rename etc/grml/fai/{live-initramfs/grml-script.init-top => config/files/usr/share/initramfs-tools/scripts/init-top/grml/GRMLBASE} (100%) diff --git a/docs/grml-live.txt b/docs/grml-live.txt index 6d58660..0874fdd 100644 --- a/docs/grml-live.txt +++ b/docs/grml-live.txt @@ -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 diff --git a/etc/grml/fai/apt/important_note.txt b/etc/grml/fai/apt/important_note.txt index 0f94ca3..7d4e0c0 100644 --- a/etc/grml/fai/apt/important_note.txt +++ b/etc/grml/fai/apt/important_note.txt @@ -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! diff --git a/etc/grml/fai/apt/sources.list b/etc/grml/fai/apt/sources.list index 69b6293..1b052e7 100644 --- a/etc/grml/fai/apt/sources.list +++ b/etc/grml/fai/apt/sources.list @@ -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 diff --git a/etc/grml/fai/files/etc/apt/grml.key b/etc/grml/fai/config/files/etc/apt/grml.key/GRMLBASE similarity index 100% rename from etc/grml/fai/files/etc/apt/grml.key rename to etc/grml/fai/config/files/etc/apt/grml.key/GRMLBASE diff --git a/etc/grml/fai/files/etc/apt/preferences b/etc/grml/fai/config/files/etc/apt/preferences/GRMLBASE similarity index 100% rename from etc/grml/fai/files/etc/apt/preferences rename to etc/grml/fai/config/files/etc/apt/preferences/GRMLBASE diff --git a/etc/grml/fai/files/etc/fstab b/etc/grml/fai/config/files/etc/fstab/GRMLBASE similarity index 100% rename from etc/grml/fai/files/etc/fstab rename to etc/grml/fai/config/files/etc/fstab/GRMLBASE diff --git a/etc/grml/fai/files/etc/hosts b/etc/grml/fai/config/files/etc/hosts/GRMLBASE similarity index 100% rename from etc/grml/fai/files/etc/hosts rename to etc/grml/fai/config/files/etc/hosts/GRMLBASE diff --git a/etc/grml/fai/live-initramfs/live.conf b/etc/grml/fai/config/files/etc/live.conf/GRMLBASE similarity index 100% rename from etc/grml/fai/live-initramfs/live.conf rename to etc/grml/fai/config/files/etc/live.conf/GRMLBASE diff --git a/etc/grml/fai/files/etc/network/interfaces b/etc/grml/fai/config/files/etc/network/interfaces/GRMLBASE similarity index 100% rename from etc/grml/fai/files/etc/network/interfaces rename to etc/grml/fai/config/files/etc/network/interfaces/GRMLBASE diff --git a/etc/grml/fai/files/etc/sudoers b/etc/grml/fai/config/files/etc/sudoers/GRMLBASE similarity index 100% rename from etc/grml/fai/files/etc/sudoers rename to etc/grml/fai/config/files/etc/sudoers/GRMLBASE diff --git a/etc/grml/fai/live-initramfs/grml-script.init-top b/etc/grml/fai/config/files/usr/share/initramfs-tools/scripts/init-top/grml/GRMLBASE similarity index 100% rename from etc/grml/fai/live-initramfs/grml-script.init-top rename to etc/grml/fai/config/files/usr/share/initramfs-tools/scripts/init-top/grml/GRMLBASE diff --git a/etc/grml/fai/config/hooks/instsoft.GRMLBASE b/etc/grml/fai/config/hooks/instsoft.GRMLBASE index b192b8a..55886f9 100755 --- a/etc/grml/fai/config/hooks/instsoft.GRMLBASE +++ b/etc/grml/fai/config/hooks/instsoft.GRMLBASE @@ -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 diff --git a/etc/grml/fai/config/hooks/updatebase.GRMLBASE b/etc/grml/fai/config/hooks/updatebase.GRMLBASE index a501682..c229448 100755 --- a/etc/grml/fai/config/hooks/updatebase.GRMLBASE +++ b/etc/grml/fai/config/hooks/updatebase.GRMLBASE @@ -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 diff --git a/etc/grml/fai/config/scripts/GRMLBASE/10-build-initramfs b/etc/grml/fai/config/scripts/GRMLBASE/10-build-initramfs index 9777a52..d6930fe 100755 --- a/etc/grml/fai/config/scripts/GRMLBASE/10-build-initramfs +++ b/etc/grml/fai/config/scripts/GRMLBASE/10-build-initramfs @@ -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 diff --git a/etc/grml/fai/config/scripts/GRMLBASE/20-sudo b/etc/grml/fai/config/scripts/GRMLBASE/20-sudo index 4199f70..d940103 100755 --- a/etc/grml/fai/config/scripts/GRMLBASE/20-sudo +++ b/etc/grml/fai/config/scripts/GRMLBASE/20-sudo @@ -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 diff --git a/etc/grml/fai/config/scripts/GRMLBASE/30-fstab b/etc/grml/fai/config/scripts/GRMLBASE/30-fstab index 6638878..bd47b64 100755 --- a/etc/grml/fai/config/scripts/GRMLBASE/30-fstab +++ b/etc/grml/fai/config/scripts/GRMLBASE/30-fstab @@ -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 diff --git a/etc/grml/fai/config/scripts/GRMLBASE/34-hosts b/etc/grml/fai/config/scripts/GRMLBASE/34-hosts index 8038cc0..961fc5c 100755 --- a/etc/grml/fai/config/scripts/GRMLBASE/34-hosts +++ b/etc/grml/fai/config/scripts/GRMLBASE/34-hosts @@ -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 diff --git a/etc/grml/fai/config/scripts/GRMLBASE/35-network b/etc/grml/fai/config/scripts/GRMLBASE/35-network index 0d39adc..be04b3e 100755 --- a/etc/grml/fai/config/scripts/GRMLBASE/35-network +++ b/etc/grml/fai/config/scripts/GRMLBASE/35-network @@ -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 diff --git a/grml-live b/grml-live index d66c995..e67a5ab 100755 --- 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 -- 2.1.4