grml-live (0.0.7) unstable; urgency=low
+ * Added FAI patches to /usr/share/grml-live/patches/ - it's
+ recommended to apply the patches to FAI until they are accepted
+ upstream. See Debian's BTS for more details: #444210, #447080
+ and #448426.
+ * Support option '-u' for updating system.
* Reworked buildd concept.
- Now we have a seperate
/usr/share/grml-live/buildd/functions.sh for generic stuff
cp -a examples debian/grml-live/usr/share/doc/grml-live/
cp -a templates debian/grml-live/usr/share/grml-live/
cp -a scripts debian/grml-live/usr/share/grml-live/
+ cp -a patches debian/grml-live/usr/share/grml-live/
cp -a buildd/*.sh debian/grml-live/usr/share/grml-live/buildd/
install -o root -m 640 buildd/grml-buildd.conf debian/grml-live/etc/grml/grml-buildd.conf
install -o root -m 755 grml-live debian/grml-live/usr/sbin/grml-live
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
# make sure we prefer grml repository:
if [ -r /etc/grml/fai/files/etc/apt/preferences ] ; then
- cp /etc/grml/fai/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
$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
# default if undefined here: nfs://`hostname`/$FAI_CONFIGDIR
# supported URL-types: nfs, file, cvs, cvs+ssh, svn+file, svn+http,...
#FAI_CONFIG_SRC=nfs://yourservername$FAI_CONFIGDIR
+FAI_CONFIG_SRC=file:///etc/grml/fai
# the following variables are read only for most users
MNTPOINT=/media/mirror
# the local configuration directory on the install client
-FAI=/var/lib/fai/config
+#FAI=/var/lib/fai/config
+FAI=/etc/grml/fai/config
# 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: Sun Oct 28 15:26:10 CET 2007 [mika]
+# Latest change: Sun Oct 28 23:52:20 CET 2007 [mika]
################################################################################
# read configuration files, set some misc variables {{{
exit 1
fi
+if [ -r /var/run/fai/fai_softupdate_is_running ] ; then
+ echo "/usr/sbin/fai softupdate already running or was aborted before.">&2
+ echo "You may remove /var/run/fai/fai_softupdate_is_running and try again.">&2
+ exit 1
+fi
+
# make sure they are not set by default
VERBOSE=''
FORCE=''
+UPDATE=''
if [ -r /etc/grml/lsb-functions ] ; then
. /etc/grml/lsb-functions
# command line parsing {{{
-while getopts "a:c:g:i:o:r:s:t:v:FhV" opt; do
+while getopts "a:c:g:i:o:r:s:t:v:FhuV" opt; do
case "$opt" in
a) ARCH="$OPTARG" ;;
c) CLASSES="$OPTARG" ;;
v) VERSION="$OPTARG" ;;
F) FORCE=1 ;;
h) usage ; bailout 0 ;;
+ u) UPDATE=1 ;;
V) VERBOSE="-v" ;;
?) echo "invalid option -$OPTARG" >&2; bailout 1 ;;
esac
[ -n "$FAI_ARGS" ] && echo " additional arguments for FAI: $FAI_ARGS"
[ -n "$LOGFILE" ] && echo " Logging to file: $LOGFILE"
[ -n "$VERBOSE" ] && echo " Using VERBOSE mode."
+ [ -n "$UPDATE" ] && echo " Executing UPDATE instead of fresh installation."
echo
echo -n "Is this ok for you? [y/N] "
read a
# CHROOT_OUTPUT - execute FAI {{{
[ -n "$CHROOT_OUTPUT" ] || CHROOT_OUTPUT="$OUTPUT/grml_chroot"
-if [ -d "$CHROOT_OUTPUT/bin" ] ; then
+if [ -n "$UPDATE" ] ; then
+ FAI_ACTION=softupdate
+else
+ FAI_ACTION=dirinstall
+fi
+
+if [ -d "$CHROOT_OUTPUT/bin" -a -z "$UPDATE" ] ; then
log "$CHROOT_OUTPUT exists already, skipping stage 'fai dirinstall'"
ewarn "$CHROOT_OUTPUT exists already, skipping stage 'fai dirinstall'" ; eend 0
else
mkdir -p "${CHROOT_OUTPUT}/${MIRROR_DIRECTORY}"
mount --bind "${MIRROR_DIRECTORY}" "${CHROOT_OUTPUT}/${MIRROR_DIRECTORY}"
fi
- fai $VERBOSE -C "$GRML_FAI_CONFIG" -c"$CLASSES" -u "$HOSTNAME" dirinstall "$CHROOT_OUTPUT" $FAI_ARGS | tee -a $LOGFILE
+ fai $VERBOSE -C "$GRML_FAI_CONFIG" -c"$CLASSES" -u "$HOSTNAME" $FAI_ACTION "$CHROOT_OUTPUT" $FAI_ARGS | tee -a $LOGFILE
log "Setting /etc/grml_version to $GRML_NAME $VERSION Release Codename $RELEASENAME [$ISO_DATE]"
echo "$GRML_NAME $VERSION Release Codename $RELEASENAME [$ISO_DATE]" > $CHROOT_OUTPUT/etc/grml_version
chmod 644 $CHROOT_OUTPUT/etc/grml_version
if [ -r "/var/log/fai/dirinstall/$HOSTNAME/software.log" ] ; then
# 1 errors during executing of commands
# Unable to write mmap - msync (28 No space left on device)
+ # 'No candidate version found for' [/var/log/fai/current/software.log]
grep 'dpkg: error processing' /var/log/fai/dirinstall/$HOSTNAME/software.log >> $LOGFILE && ERROR=1
grep 'E: Method http has died unexpectedly!' /var/log/fai/dirinstall/$HOSTNAME/software.log >> $LOGFILE && ERROR=2
grep 'ERROR: chroot' /var/log/fai/dirinstall/$HOSTNAME/software.log >> $LOGFILE && ERROR=3
+++ /dev/null
-fai_dirupdate_[1234].diff:
-
-Try to provide an "update chroot" action, like:
-
- # TARGET=/dev/shm/grml_chroot fai -C/etc/grml/fai -cGRMLBASE,I386 dirupdate
-
-Needs work though...
-
-fai_dirinstall_check.diff:
-
-Make sure to exit in fai dirinstall if task instsoft wasn't successfull.
+++ /dev/null
---- /usr/lib/fai/subroutines.orig 2007-09-21 10:46:23.000000000 +0200
-+++ /usr/lib/fai/subroutines 2007-09-21 19:36:34.000000000 +0200
-@@ -476,6 +476,9 @@
- task prepareapt
- task updatebase
- task instsoft
-+ if grep -q 'E: Sub-process /usr/bin/dpkg returned an error code' $LOGDIR/software.log ; then
-+ die "Error in software installation task."
-+ fi
- task configure
- task finish
-
+++ /dev/null
---- /usr/lib/fai/subroutines.orig 2007-09-21 10:04:05.000000000 +0200
-+++ /usr/lib/fai/subroutines 2007-09-21 10:34:40.000000000 +0200
-@@ -266,6 +266,9 @@
- dirinstall)
- task dirinstall
- ;;
-+ dirupdate)
-+ task dirupdate
-+ ;;
- softupdate)
- echo Performing FAI system update. All data may be overwritten!
- task softupdate
-@@ -491,6 +494,29 @@
- fi
- }
- # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-+task_dirupdate() {
-+
-+ > $stamp
-+
-+ mkdir -p $FAI_ROOT
-+ FAI_ROOT=$(cd $FAI_ROOT;pwd)
-+ echo "Updating directory $FAI_ROOT"
-+ task configure
-+ task updatechroot
-+ task finish
-+
-+ rm -f $stamp
-+ unset LOGUSER # so logfile are not saved to remote
-+ task savelog
-+
-+ if [ -f $stamp ]; then
-+ echo "Error while executing commands in subshell."
-+ echo "$stamp was not removed."
-+ sendmon "TASKERROR install 21"
-+ die "Please look at the log files in $LOGDIR for errors."
-+ fi
-+}
-+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- task_softupdate() {
-
- local stamp=/var/run/fai/fai_softupdate_is_running
+++ /dev/null
---- /usr/lib/fai/get-config-dir.orig 2007-09-21 10:13:24.000000000 +0200
-+++ /usr/lib/fai/get-config-dir 2007-09-21 10:14:11.000000000 +0200
-@@ -9,6 +9,11 @@
- # Short-Description: get $FAI directory from $FAI_CONFIG_SRC
- ### END SUBROUTINE INFO
-
-+if [ -n "FAI_NO_CONFIG_SRC" ] ; then
-+ echo "Notice: skipping get-dir-config as requested"
-+ exit 0
-+fi
-+
- if [ -z "$FAI_CONFIG_SRC" ]; then
- sendmon "TASKERROR get_fai_dir 21"
- echo "Error: Provide the URL to obtain the fai config storage in \$FAI_CONFIG_SRC"
+++ /dev/null
---- /usr/sbin/fai.orig 2007-09-21 10:45:21.000000000 +0200
-+++ /usr/sbin/fai 2007-09-21 10:45:22.000000000 +0200
-@@ -280,7 +280,7 @@
- trap 'clean_exit' EXIT
- fi
-
--mkfifo $LOGDIR/logfifo
-+[ -w $LOGDIR/logfifo ] || mkfifo $LOGDIR/logfifo
- tee -a $LOGDIR/fai.log < $LOGDIR/logfifo &
- # in bash &> redirect stdout and stderr to file
- fstart &> $LOGDIR/logfifo
+++ /dev/null
---- /usr/lib/fai/subroutines-linux.orig 2007-09-21 10:47:35.000000000 +0200
-+++ /usr/lib/fai/subroutines-linux 2007-09-21 10:49:09.000000000 +0200
-@@ -229,6 +229,18 @@
- updatebase
- }
- # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-+task_updatechroot() {
-+
-+ # update the chroot
-+ echo "Updating chroot"
-+ if [ -z "$TARGET" ] ; then
-+ echo "Error: \$TARGET not set, exiting.">&2
-+ return 1
-+ else
-+ chroot $TARGET apt-get update
-+ fi
-+}
-+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- task_instsoft() {
-
- echo "Installing software may take a while"
--- /dev/null
+--- /usr/sbin/fai 2007-10-17 21:20:47.000000000 +0000
++++ /usr/sbin/fai 2007-10-17 21:20:50.000000000 +0000
+@@ -223,7 +223,7 @@
+
+ export NFSROOT=$(source $FAI_ETC_DIR/make-fai-nfsroot.conf; echo $NFSROOT)
+ export FAI_DEBOOTSTRAP=$(source $FAI_ETC_DIR/make-fai-nfsroot.conf; echo $FAI_DEBOOTSTRAP)
+- export FAI_DEBOOTSTRAP_OPT=$(source $FAI_ETC_DIR/make-fai-nfsroot.conf; echo $FAI_DEBOOTSTRAP_OPT)
++ export FAI_DEBOOTSTRAP_OPTS=$(source $FAI_ETC_DIR/make-fai-nfsroot.conf; echo $FAI_DEBOOTSTRAP_OPTS)
+
+ fi
+
--- /dev/null
+--- /usr/lib/fai/subroutines-linux 2007-10-17 21:21:11.000000000 +0000
++++ /usr/lib/fai/subroutines-linux 2007-10-17 21:21:03.000000000 +0000
+@@ -124,7 +124,7 @@
+
+ local dversion=$(dpkg -l debootstrap | grep debootstrap | cut -f7 -d' ')
+ echo "Creating base system using debootstrap version $dversion"
+- echo "Calling debootstrap $1 $FAI_ROOT $2"
++ echo "Calling debootstrap $1 $FAI_DEBOOTSTRAP_OPTS $FAI_ROOT $2"
+ yes '' | LC_ALL=C debootstrap $FAI_DEBOOTSTRAP_OPTS $1 $FAI_ROOT $2
+ }
+ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
--- /dev/null
+--- /usr/lib/fai/updatebase.orig 2007-10-29 00:12:49.000000000 +0100
++++ /usr/lib/fai/updatebase 2007-10-29 00:13:27.000000000 +0100
+@@ -31,7 +31,11 @@
+ [ $? -ne 0 ] && yes '' | $ROOTCMD dpkg --configure -a
+ # using the above value, causes an error: "dpkg need action"
+ export aptopt=
++if [ -x /usr/bin/aptitude ] ; then
++$ROOTCMD aptitude $aptopt -f -y dist-upgrade </dev/null
++else
+ $ROOTCMD apt-get $aptopt -f -y dist-upgrade </dev/null
++fi
+ # update dpkg info which packages are available
+ tmp=$($ROOTCMD mktemp)
+ $ROOTCMD apt-cache dumpavail > $FAI_ROOT/$tmp