fb6ca3bdf6790325413ab8dff09db693afd1f5b6
[grml-live.git] / patches / fai_dirupdate_1.diff
1 --- /usr/lib/fai/subroutines.orig       2007-09-21 10:04:05.000000000 +0200
2 +++ /usr/lib/fai/subroutines    2007-09-21 10:34:40.000000000 +0200
3 @@ -266,6 +266,9 @@
4         dirinstall)
5             task dirinstall
6             ;;
7 +       dirupdate)
8 +           task dirupdate
9 +           ;;
10         softupdate)
11             echo Performing FAI system update. All data may be overwritten!
12             task softupdate
13 @@ -491,6 +494,29 @@
14      fi
15  }
16  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
17 +task_dirupdate() {
18 +
19 +    > $stamp
20 +
21 +    mkdir -p $FAI_ROOT
22 +    FAI_ROOT=$(cd $FAI_ROOT;pwd)
23 +    echo "Updating directory $FAI_ROOT"
24 +    task configure
25 +    task updatechroot
26 +    task finish
27 +
28 +    rm -f $stamp
29 +    unset LOGUSER # so logfile are not saved to remote
30 +    task savelog
31 +
32 +    if [ -f $stamp ]; then
33 +       echo "Error while executing commands in subshell."
34 +       echo "$stamp was not removed."
35 +       sendmon "TASKERROR install 21"
36 +       die "Please look at the log files in $LOGDIR for errors."
37 +    fi
38 +}
39 +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
40  task_softupdate() {
41  
42      local stamp=/var/run/fai/fai_softupdate_is_running