Author: locilka Date: Thu Dec 8 16:47:38 2011 New Revision: 67014 URL: http://svn.opensuse.org/viewcvs/yast?rev=67014&view=rev Log: Fixed saving state of the current randomness (bnc#692799). Modified: trunk/installation/package/yast2-installation.changes trunk/installation/src/inst_finish/umount_finish.ycp Modified: trunk/installation/package/yast2-installation.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/installation/package/yast2-installation.changes?rev=67014&r1=67013&r2=67014&view=diff ============================================================================== --- trunk/installation/package/yast2-installation.changes (original) +++ trunk/installation/package/yast2-installation.changes Thu Dec 8 16:47:38 2011 @@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Thu Dec 8 16:45:15 CET 2011 - locilka@suse.cz + +- Fixed saving state of the current randomness (bnc#692799). + +------------------------------------------------------------------- Fri Nov 25 11:35:04 CET 2011 - jsuchome@suse.cz - ask for Abort confirmation in Update URLs step (bnc#728907) Modified: trunk/installation/src/inst_finish/umount_finish.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/installation/src/inst_finish/umount_finish.ycp?rev=67014&r1=67013&r2=67014&view=diff ============================================================================== --- trunk/installation/src/inst_finish/umount_finish.ycp (original) +++ trunk/installation/src/inst_finish/umount_finish.ycp Thu Dec 8 16:47:38 2011 @@ -55,26 +55,36 @@ } } +/** + * Preserves the current randomness state + */ void preserve_randomness_state () { + if (Mode::update()) { + y2milestone ("Not saving current random seed - in update mode"); + return; + } + + y2milestone ("Saving the current randomness state..."); + string service_bin = "/sbin/haveged"; - string dev_path = "/dev"; - string random_path = sformat ("%1/urandom", dev_path); + string random_path = "/dev/urandom"; + string store_to = sformat ("%1/var/lib/misc/random-seed", Installation::destdir); ret = true; - // Preserve the current randomness state - if (!Mode::update() && Installation::destdir != "/") { - // stop the random number generator service - LocalCommand (sformat ("killproc -TERM %1", service_bin)); - - // copy the current state of random number generator to the installed system - if (LocalCommand (sformat ("cp -av '%1' '%2/%1'", String::Quote (random_path), String::Quote (Installation::destdir)))) { - y2milestone ("State of %1 has been successfully copied to %2", random_path, Installation::destdir); - } else { - y2milestone ("Cannot copy %1 to %2/%1", random_path, Installation::destdir); - ret = false; - } + // Copy the current state of random number generator to the installed system + if (LocalCommand (sformat ("dd if='%1' bs=1024 count=1 of='%2'", + String::Quote (random_path), String::Quote (store_to) + ))) { + y2milestone ("State of %1 has been successfully copied to %2", random_path, store_to); + } else { + y2milestone ("Cannot store %1 state to %2", random_path, store_to); + ret = false; } + + // stop the random number generator service + y2milestone ("Stopping %1 service", service_bin); + LocalCommand (sformat ("killproc -TERM %1", service_bin)); } if (func == "Info") @@ -185,7 +195,7 @@ preserve_randomness_state(); } - y2milestone ("umount target: %1", tmp); + y2milestone ("umount target: %1, %2 more to go..", tmp, umountLength); boolean umount_status = (boolean) WFM::Execute (.local.umount, tmp); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org