Author: pebender
Date: Thu Jan  8 05:11:34 2009
New Revision: 4189

Modified:
    trunk/gar-minimyth/html/minimyth/conf/minimyth.pm
    trunk/gar-minimyth/script/utils/busybox/checksums
    trunk/gar-minimyth/script/utils/busybox/files/busybox-1.11.3.config

Log:
- Enabled 'dd' in busybox so that it could be used to create a network swap  
file.
- Updated network swap file example in minimyth.pm.



Modified: trunk/gar-minimyth/html/minimyth/conf/minimyth.pm
==============================================================================
--- trunk/gar-minimyth/html/minimyth/conf/minimyth.pm   (original)
+++ trunk/gar-minimyth/html/minimyth/conf/minimyth.pm   Thu Jan  8 05:11:34  
2009
@@ -30,22 +30,53 @@
      my $self     = shift;
      my $minimyth = shift;

-    # NFS mount a swap partition.
-    # This can be useful for MiniMyth frontends that have too little  
memory to
-    # run without swap (i.e. MiniMyth frontends that have less than 512MB  
of
-    # memory).
-    # For this to work, you need to prepare the swap file on the server.  
This is
-    # done using the command:
-    #   'cd {swap-dir} ; dd if=/dev/zero of={swap-file} bs=1k  
count={swap-size}'
-    # where {swap-dir} is the directory that will be exported and mounted  
on
-    # the frontend as the directory containing the swap file, {swap-file}  
is the
-    # name of the swap file, and {swap-size} is the size of the swap file  
in
-    # kilobytes. Remember to use different swap files for each MiniMyth  
frontend.
+#     
#---------------------------------------------------------------------------
+#    # Function:
+#    #   swap_init
+#    #
+#    # Description:
+#    #   Initialize a network (often NFS) swap partition. This can be  
useful for
+#    #   MiniMyth frontends that have too little memory to run without  
swap (i.e.
+#    #   MiniMyth frontends that have less than 512MB of memory).
+#    #
+#    # Parameters:
+#    #   minimyth:
+#    #     Required.
+#    #     The pointer to an instance of a MiniMyth object.
+#    #   swap_url:
+#    #     Required.
+#    #     The URL that points to the remote directory that contains (or  
will
+#    #     contain) the swap file. The MiniMyth frontend must have write  
access
+#    #     as user 'root' to this remote directory.
+#    #   swap_file:
+#    #     Optional.
+#    #     The name of the swap file in (or to be created in) the remote
+#    #     directory pointed ot by URL $swap_url. If this file is not  
present
+#    #     then MiniMyth will create it.  If this value is not present,  
then
+#    #     it will be assumed to be '{hostname}.swap', where '{hostname}'  
is
+#    #     the hostnme of the MiniMyth frontend.
+#    #   swap_size:
+#    #     Optional.
+#    #     The size of the swap file in kilobytes. This value is used only  
when
+#    #     creating the swap file. Therefore, if the swap file already  
exists
+#    #     then this value is ignored. If this value is not present, then  
it will
+#    #     be assumed to be 1024*1024.
+#     
#---------------------------------------------------------------------------
+#    sub swap_init
  #    {
-#        my $swap_url    = '{swap-url}';
-#        my $swap_file   = '{swap-file}';
+#        my $minimyth  = shift;
+#        my $swap_url  = shift;
+#        my $swap_file = shift;
+#        my $swap_size = shift;
+#
+#        ($minimyth ) || die qq(swap_init is missing required  
argument 'minimyth');
+#        ($swap_url ) || die qq(swap_init is missing required  
argument 'swap_url');
+#        ($swap_file) || ($swap_file = $minimyth->hostname() . '.swap');
+#        ($swap_size) || ($swap_size = 1024 * 1024);
+#
  #        my $swap_device = '';
-#        open(FILE, '-|', '/sbin/losetup -f') || die;
+#        open(FILE, '-|', '/sbin/losetup -f') ||
+#            die qq(swap_init failed to run command '/sbin/losetup -f');
  #        while(<FILE>)
  #        {
  #            chomp;
@@ -53,15 +84,25 @@
  #            last;
  #        }
  #        close(FILE);
-#        if ((! $swap_url) || (! $swap_file) || (! $swap_device))
+#        ($swap_device) ||
+#            die qq(swap_init failed to locate an available loopback  
device);
+#        $minimyth->url_mount($swap_url, '/mnt/swap') ||
+#            die qq(swap_init failed to mount '$swap_url' at '/mnt/swap');
+#        (-w '/mnt/swap') ||
+#            die qq(swap_init cannot write '$swap_url');
+#        if (! -e "/mnt/swap/$swap_file")
  #        {
-#            die;
+#            system(qq(/bin/dd if='/dev/zero' of='/mnt/swap/$swap_file'  
bs=1024 count=$swap_size > /dev/null 2>&1)) &&
+#                die qq(swap_init failed to create swap  
file '/mnt/swap/$swap_file');
  #        }
-#        $minimyth->url_mount($swap_url, '/mnt/swap') || die;
-#        system(qq(/sbin/losetup $swap_device "/mnt/swap/$swap_file")) &&  
die;
-#        system(qq(/sbin/mkswap $swap_device)) && die;
-#        system(qq(/sbin/swapon $swap_device)) && die;
+#        system(qq(/sbin/losetup '$swap_device' '/mnt/swap/$swap_file' >  
/dev/null 2>&1)) &&
+#            die qq(swap_init could not set up swap loopback  
device '$swap_device');
+#        system(qq(/sbin/mkswap '$swap_device' > /dev/null 2>&1)) &&
+#            die qq(swap_init could not make swap device '$swap_device');
+#        system(qq(/sbin/swapon '$swap_device' > /dev/null 2>&1)) &&
+#            die qq(swap_init could not enable swap device '$swap_device');
  #    }
+#    &swap_init($minimyth, 'nfs://myth.home/home/public/minimyth/swap');

      return 1;
  }

Modified: trunk/gar-minimyth/script/utils/busybox/checksums
==============================================================================
--- trunk/gar-minimyth/script/utils/busybox/checksums   (original)
+++ trunk/gar-minimyth/script/utils/busybox/checksums   Thu Jan  8 05:11:34  
2009
@@ -2,4 +2,4 @@
  ce61a66858e59c2dcf1e670b1a80c6c4   
download/busybox-1.11.3-dhcp_options.patch
  7443fc5f3978eb5720ea870693805779   
download/busybox-1.11.3-dhcp_timezone.patch
  94a7f9b074f8379262ab2be6d018fc83   
download/busybox-1.11.3-tftp_timeout.patch
-da9f2e7e529427334f36b2356a7d41bb  download/busybox-1.11.3.config
+2660a9fd41d9d5391decb69b043da66f  download/busybox-1.11.3.config

Modified:  
trunk/gar-minimyth/script/utils/busybox/files/busybox-1.11.3.config
==============================================================================
--- trunk/gar-minimyth/script/utils/busybox/files/busybox-1.11.3.config  
(original)
+++ trunk/gar-minimyth/script/utils/busybox/files/busybox-1.11.3.config Thu  
Jan  8 05:11:34 2009
@@ -1,7 +1,7 @@
  #
  # Automatically generated make config: don't edit
  # Busybox version: 1.11.3
-# Fri Nov 14 06:39:17 2008
+# Thu Jan  8 03:18:54 2009
  #
  CONFIG_HAVE_DOT_CONFIG=y

@@ -156,9 +156,9 @@
  CONFIG_CUT=y
  CONFIG_DATE=y
  CONFIG_FEATURE_DATE_ISOFMT=y
-# CONFIG_DD is not set
-# CONFIG_FEATURE_DD_SIGNAL_HANDLING is not set
-# CONFIG_FEATURE_DD_IBS_OBS is not set
+CONFIG_DD=y
+CONFIG_FEATURE_DD_SIGNAL_HANDLING=y
+CONFIG_FEATURE_DD_IBS_OBS=y
  CONFIG_DF=y
  CONFIG_FEATURE_DF_INODE=y
  CONFIG_DIRNAME=y

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"minimyth-commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/minimyth-commits?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to