Mike Brady wrote:
> Kernel config attached.  This is from an openSUSE 10.2
> 2.6.18.8-0.1-default x86_64 kernel.
> 
> Looks like the only built in file system is minix?
> 
> Thanks
> 
> Mike
> 

Mike,

could you try if the following patch works? it adds the minix
fs to the filesystems that can be used to create a valid initrd.img...

Regards,
-Andrea

Index: lib/SystemImager/UseYourOwnKernel.pm
===================================================================
--- lib/SystemImager/UseYourOwnKernel.pm        (revision 3963)
+++ lib/SystemImager/UseYourOwnKernel.pm        (working copy)
@@ -451,7 +451,7 @@
         open(FILESYSTEMS,"<$file") or die("Couldn't open $file for reading.");
         while (<FILESYSTEMS>) {
                 chomp;
-                push (@filesystems, $_) if 
(m/(cramfs|ext2|ext3|reiserfs|xfs|jfs)/);
+                push (@filesystems, $_) if 
(m/(cramfs|ext2|ext3|reiserfs|xfs|jfs|minix)/);
         }
         close(FILESYSTEMS);
 
@@ -511,6 +511,15 @@
                 print "XXX just need to verify where the xfs module lives.\n";
         }
 
+        # minix
+        elsif ((grep { /minix/ } @filesystems) 
+                and (! -e "$modules_dir/kernel/fs/ext2/minix.o")
+                and (! -e "$modules_dir/kernel/fs/ext2/minix.ko")
+                and (! -e "$modules_dir/kernel/fs/ext2/minix.ko.gz")
+                ) { 
+                $fs = "minix";
+        }
+
         unless(defined $fs) {
 
                 die("Can't determine the appropriate filesystem to use for an 
initrd.");
@@ -668,6 +677,8 @@
             _create_initrd_jfs($staging_dir, $boot_dir);
         } elsif ($fs eq 'xfs') {
             _create_initrd_xfs($staging_dir, $boot_dir);
+        } elsif ($fs eq 'minix') {
+            _create_initrd_minix($staging_dir, $boot_dir);
         } else {
             die("FATAL: Unable to create initrd using $fs\n");
         }
@@ -915,6 +926,63 @@
         return 1;
 }
 
+sub _create_initrd_minix($$) {
+
+        my $staging_dir = shift;
+        my $boot_dir    = shift;
+
+        my $new_initrd  = $boot_dir . "/initrd";
+
+        my $new_initrd_mount_dir = _mk_tmp_dir();
+
+        # cleanup routine.
+        $SIG{__DIE__} = sub {
+            my $msg = shift;
+            run_cmd("umount $new_initrd_mount_dir", $verbose, 0) if 
($is_mounted);
+            unlink($new_initrd) if (-f $new_initrd);
+            run_cmd("rm -fr $staging_dir $new_initrd_mount_dir", $verbose, 1);
+            die $msg;
+        };
+
+        print ">>> New initrd mount point:     $new_initrd_mount_dir\n" 
if($verbose);
+        eval { mkpath($new_initrd_mount_dir, 0, 0755) }; 
+        if ($@) { 
+                die "Couldn't mkpath $new_initrd_mount_dir $@";
+        }
+
+        my $cmd;
+
+        # loopback file
+        chomp(my $size = `du -ks $staging_dir`);
+        $size =~ s/\s+.*$//;
+        my $breathing_room = 2000;
+        $size = $size + $breathing_room;
+        run_cmd("dd if=/dev/zero of=$new_initrd bs=1024 count=$size", 
$verbose, 1);
+
+        # fs creation
+        chomp(my $inodes = `find $staging_dir -printf "%i\n" | sort -u | wc 
-l`);
+        $inodes = $inodes + 10;
+        run_cmd("mkfs.minix $new_initrd", $verbose, 1);
+
+        # mount
+        run_cmd("mount $new_initrd $new_initrd_mount_dir -o loop -t minix", 
$verbose);
+        $is_mounted = 1;
+
+        # copy from staging dir to new initrd
+        run_cmd("tar -C $staging_dir -cf - . | tar -C $new_initrd_mount_dir 
-xf -", $verbose, 0);
+
+        # umount and gzip up
+        run_cmd("umount $new_initrd_mount_dir", $verbose);
+        $is_mounted = 0;
+        run_cmd("gzip -f -9 -S .img $new_initrd", $verbose);
+        run_cmd("ls -l $new_initrd.img", $verbose, 1) if($verbose);
+
+        # cleanup the temporary mount dir
+        run_cmd("rm -fr $new_initrd_mount_dir", $verbose, 1);
+
+        return 1;
+}
+
 #
 # Usage:  
 #       run_cmd("my shell command", 1, 1);

-------------------------------------------------------------------------
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