Author: jsrain Date: Mon Aug 8 13:09:51 2011 New Revision: 65266 URL: http://svn.opensuse.org/viewcvs/yast?rev=65266&view=rev Log: enhance error reporting when running out of disk space during live installation (bnc#533601) Modified: trunk/live-installer/VERSION trunk/live-installer/package/yast2-live-installer.changes trunk/live-installer/src/inst_live_doit.ycp Modified: trunk/live-installer/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/VERSION?rev=65266&r1=65265&r2=65266&view=diff ============================================================================== --- trunk/live-installer/VERSION (original) +++ trunk/live-installer/VERSION Mon Aug 8 13:09:51 2011 @@ -1 +1 @@ -2.20.0 +2.21.0 Modified: trunk/live-installer/package/yast2-live-installer.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/package/yast2-live-installer.changes?rev=65266&r1=65265&r2=65266&view=diff ============================================================================== --- trunk/live-installer/package/yast2-live-installer.changes (original) +++ trunk/live-installer/package/yast2-live-installer.changes Mon Aug 8 13:09:51 2011 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Mon Aug 8 10:58:52 CEST 2011 - jsrain@suse.cz + +- enhance error reporting when running out of disk space during + live installation (bnc#533601) +- 2.21.0 + +------------------------------------------------------------------- Fri Aug 5 12:33:11 CEST 2011 - tgoettlicher@suse.de - fixed .desktop file (bnc #681249) Modified: trunk/live-installer/src/inst_live_doit.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/src/inst_live_doit.ycp?rev=65266&r1=65265&r2=65266&view=diff ============================================================================== --- trunk/live-installer/src/inst_live_doit.ycp (original) +++ trunk/live-installer/src/inst_live_doit.ycp Mon Aug 8 13:09:51 2011 @@ -112,6 +112,46 @@ SCR::Execute (.target.bash, sformat ("/bin/cp -a %1/etc %2", tmpdir, Installation::destdir)); return ret; } + +void ReportImageCopyError() { + // check for out of disk space + string cmd = "df -P"; + y2milestone ("Executing %1", cmd); + map out = (map)SCR::Execute (.target.bash_output, cmd); + y2milestone ("Output: %1", out); + string total_str = out["stdout"]:""; + string error = nil; + foreach (string line, splitstring(total_str, "\n"), { + list<string> parsed = filter (string s, splitstring (line, " "), {return s != "";}); + string dev = parsed[0]:""; + string mp = parsed[5]:""; + string free = parsed[3]:""; + if (substring (dev, 0, 4) == "/dev" && substring (mp, 0, 4) == "/mnt") + { + if (tointeger (free) < 100*1024) // need to set some lower limit - roughly estimated maximum size of the last file which could have failed + { + error = _("Copying the live image to hard disk failed. + +You have run out of disk space. Choose +a bigger disk partition for the installation +of the live system."); + } + } + }); + if (error != nil) + { + Report::Error (error); + return; + } + + total_str = splitstring(total_str, "\n")[1]:""; + integer total_mb = tointeger (filter (string s, splitstring (total_str, " "), {return s != "";})[2]:"0") / 1024; + + + + // generic error report + Report::Error (_("Copying the live image to hard disk failed.")); +} /* Progress::New( // Headline for last dialog of base installation: Install LILO etc. @@ -145,15 +185,13 @@ if (! CopyRootImage (5, 5 + step_size)) { - // error report - Report::Error (_("Copying the live image to hard disk failed.")); + ReportImageCopyError(); return `abort; } //Progress::NextStageStep (10); if (! CopySymlinkedImage (copy_map, 5 + step_size)) { - // error report - Report::Error (_("Copying the live image to hard disk failed.")); + ReportImageCopyError(); return `abort; } //Progress::Finish(); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org