Author: viric
Date: 2010-06-12 08:44:51 +0000 (Sat, 12 Jun 2010)
New Revision: 22228

You can view the changes in this commit at:
   https://svn.nixos.org/viewvc/nix?rev=22228&view=rev

Modified:
   nixos/trunk/modules/system/boot/stage-2-init.sh

Log:
Noting the booted-system as a gcroot



Changes:

Modified: nixos/trunk/modules/system/boot/stage-2-init.sh
===================================================================
--- nixos/trunk/modules/system/boot/stage-2-init.sh     2010-06-11 22:37:47 UTC 
(rev 22227)
+++ nixos/trunk/modules/system/boot/stage-2-init.sh     2010-06-12 08:44:51 UTC 
(rev 22228)
@@ -121,9 +121,15 @@
 @activateConfiguration@ "$systemConfig"
 
 
-# Record the boot configuration.  !!! Should this be a GC root?
+# Record the boot configuration.
 if test -n "$systemConfig"; then
     ln -sfn "$systemConfig" /var/run/booted-system
+
+    # Prevent the booted system form being garbage-collected
+    # If it weren't a gcroot, if we were running a different kernel,
+    # switched system, and garbage collected all, we could not load
+    # kernel modules anymore.
+    ln -sfn /var/run/booted-system /nix/var/nix/gcroots/booted-system
 fi
 
 

_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to