X-Git-Url: https://git.grml.org/?p=grml-live.git;a=blobdiff_plain;f=patches%2Ffai_chroot_update.patch;fp=patches%2Ffai_chroot_update.patch;h=350f613dbf86391dcabf16d3a25bcfc22a8f0816;hp=0000000000000000000000000000000000000000;hb=c6f2a325e4cd41d6b21f6b7b0f60e34b9bbab82d;hpb=cddb53de4280f7d5b8dcfb5963929b5967ac706b diff --git a/patches/fai_chroot_update.patch b/patches/fai_chroot_update.patch new file mode 100644 index 0000000..350f613 --- /dev/null +++ b/patches/fai_chroot_update.patch @@ -0,0 +1,63 @@ +--- subroutines.orig 2007-12-16 11:20:12.000000000 +0000 ++++ subroutines 2007-12-16 11:23:01.000000000 +0000 +@@ -294,6 +294,10 @@ + echo Performing FAI system update. All data may be overwritten! + task softupdate + ;; ++ chrootupdate) ++ echo Performing FAI chroot update. All data may be overwritten! ++ task chrootupdate ++ ;; + sysinfo) + echo Showing system information. + task sysinfo +@@ -568,6 +572,49 @@ + } + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + ++task_chrootupdate() { ++ ++ local stamp=/var/run/fai/fai_chrootupdate_is_running ++ ++ [ -f "$stamp" ] && die "Another fai chrootupdate is already running. Aborting." ++ echo $$ > $stamp ++ # if the system had been installed using fai < 3.0 disk_var.sh is found in /etc/fai ++ if [ ! -f /var/lib/fai/disk_var.sh -a -f /etc/fai/disk_var.sh ] ; then ++ mv /etc/fai/disk_var.sh /var/lib/fai/ ++ fi ++ # the following copy operation is required to make $LOGDIR a reliable source ++ # for disk_var.sh ++ # use the last disk_var during update if available ++ [ -f /var/lib/fai/disk_var.sh ] && cp -p /var/lib/fai/disk_var.sh $LOGDIR ++ ++ defnop wait_for_jobs ++ save_dmesg ++ ++ task mirror ++ task debconf ++ task configure ++ date ++ echo "The $FAI_ACTION took $[$(cut -d . -f 1 /proc/uptime)-$start_seconds] seconds." ++ ++ rm -f $stamp ++ # save again, because new messages could be created ++ save_dmesg ++ task savelog ++ ++ if [ -f $stamp ]; then ++ echo "Error while executing commands in subshell." ++ echo -n "$stamp was not removed. PID of running process: " ++ cat $stamp ++ sendmon "TASKERROR chrootupdate 21" ++ die "Please look at the log files in $LOGDIR for errors." ++ fi ++ echo $FAI_CONFIG_SRC | grep -q ^nfs:// ++ if [ $? -eq 0 ]; then ++ grep -q ^$FAI /etc/mtab && umount $FAI ++ fi ++} ++# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ++ + catnc() { + # cat but no comment lines + egrep -v "^#" $@