jef,

you're using a very old release of perl... and an old distribution...
anyway it seems that your version of perl doesn't support "switch ..
case" statements. A solution could be to rewrite the piece of code in
UseYourOwnKernel.pm.

Try the following patch.

-Andrea

Index: lib/SystemImager/UseYourOwnKernel.pm
===================================================================
--- lib/SystemImager/UseYourOwnKernel.pm        (revision 3813)
+++ lib/SystemImager/UseYourOwnKernel.pm        (working copy)
@@ -612,8 +612,6 @@
         my $boot_dir = shift;
         my $filesystem = shift;

-        use Switch;
-
         my $fs;
         if ($filesystem) {
             $fs = $filesystem;
@@ -629,14 +627,18 @@
         print ">>> Choosing filesystem for new initrd:  $fs\n" if( $verbose );
         print ">>> Creating new initrd from staging dir:  $staging_dir\n" if( 
$verbose );

-        switch ($fs) {
-                case 'cramfs'   { _create_initrd_cramfs(   $staging_dir, 
$boot_dir) }
-                case 'ext2'     { _create_initrd_ext2(     $staging_dir, 
$boot_dir) }
-                case 'reiserfs' { _create_initrd_reiserfs( $staging_dir, 
$boot_dir) }
-                case 'jfs'      { _create_initrd_jfs(      $staging_dir, 
$boot_dir) }
-                case 'xfs'      { _create_initrd_xfs(      $staging_dir, 
$boot_dir) }
-
-                else { die("FATAL: Unable to create initrd using $fs") }
+        if ($fs eq 'cramfs') {
+            _create_initrd_cramfs($staging_dir, $boot_dir);
+        } elsif ($fs eq 'ext2') {
+            _create_initrd_ext2($staging_dir, $boot_dir);
+        } elsif ($fs eq 'reiserfs') {
+            _create_initrd_reiserfs($staging_dir, $boot_dir);
+        } elsif ($fs eq 'jfs') {
+            _create_initrd_jfs($staging_dir, $boot_dir);
+        } elsif ($fs eq 'xfs') {
+            _create_initrd_xfs($staging_dir, $boot_dir);
+        } else {
+            die("FATAL: Unable to create initrd using $fs");
         }

         # Print initrd size information.

jef e wrote:
> It looks like the latest 3.7.4r3 RPMs found here
> http://www.bcgsc.ca/downloads/oscar/systemimager/3.7.4/
> are not liked by Redhat AS 2.1.
> 
> Initially, I get this error:
> 
> Can't locate Switch.pm in @INC (@INC contains: /usr/lib/systemconfig
> /usr/lib/systemimager/perl /usr/lib/perl5/5.6.1/i386-linux
> /usr/lib/perl5/5.6.1 /usr/lib/perl5/site_perl/5.6.1/i386-linux
> /usr/lib/perl5/site_perl/5.6.1 /usr/lib/perl5/site_perl/5.6.0/i386-linux
> /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl
> /usr/lib/perl5/vendor_perl/5.6.1/i386-linux
> /usr/lib/perl5/vendor_perl/5.6.1 /usr/lib/perl5/vendor_perl .) at
> /usr/lib/systemimager/perl/SystemImager/UseYourOwnKernel.pm line 602.
> BEGIN failed--compilation aborted at
> /usr/lib/systemimager/perl/SystemImager/UseYourOwnKernel.pm line 602.
> Compilation failed in require at /usr/sbin/si_prepareclient line 85.
> BEGIN failed--compilation aborted at /usr/sbin/si_prepareclient line 85.
> 
> Switch.pm *does8 exist in /usr/lib/perl5/5.6.1/CGI, but making a symlink
> to it in /usr/lib/perl5/5.6.1/ results in this error:
> 
> # si_prepareclient --help
> /etc/systemimager/systemimager.conf: No such file or directory
> String found where operator expected at
> /usr/lib/systemimager/perl/SystemImager/UseYourOwnKernel.pm line 615,
> near "case 'cramfs'"
>         (Do you need to predeclare case?)
> String found where operator expected at
> /usr/lib/systemimager/perl/SystemImager/UseYourOwnKernel.pm line 616,
> near "case 'ext2'"
>         (Do you need to predeclare case?)
> syntax error at
> /usr/lib/systemimager/perl/SystemImager/UseYourOwnKernel.pm line 614,
> near ") {"
> syntax error at
> /usr/lib/systemimager/perl/SystemImager/UseYourOwnKernel.pm line 616,
> near "case 'ext2'"
> Global symbol "$staging_dir" requires explicit package name at
> /usr/lib/systemimager/perl/SystemImager/UseYourOwnKernel.pm line 616.
> Global symbol "$boot_dir" requires explicit package name at
> /usr/lib/systemimager/perl/SystemImager/UseYourOwnKernel.pm line 616.
> Compilation failed in require at /usr/sbin/si_prepareclient line 85.
> BEGIN failed--compilation aborted at /usr/sbin/si_prepareclient line 85.
> 
> I know there is no config file, but that doesn't seem to stop it from
> working on other systems. It works fine on AS 4, but sadly one of my
> systems is stuck at 2.1 for a while yet.
> 
> Any ideas what might be missing from 2.1? Anyone else have this working
> under 2.1?
> 
> Thanks,
> 
> jef
> 

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sisuite-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sisuite-users

Reply via email to