[BusyBox 0001066]: New tool: raidautorun

bugs at busybox.net bugs at busybox.net
Thu Oct 19 08:00:01 UTC 2006


A NOTE has been added to this issue. 
====================================================================== 
http://busybox.net/bugs/view.php?id=1066 
====================================================================== 
Reported By:                Thomas Jarosch
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   1066
Category:                   New Features
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             10-05-2006 05:13 PDT
Last Modified:              10-19-2006 01:00 PDT
====================================================================== 
Summary:                    New tool: raidautorun
Description: 
Hello,

we use busybox as part of a initramfs based boot system.
After loading SATA/SCSI/IDE drivers, we have to tell the kernel
to autodetect md based RAID devices. This is done by calling an ioctl.

Here's a patch for busybox to add a "raidautorun" tool.

Best regards,
Thomas Jarosch

====================================================================== 

---------------------------------------------------------------------- 
 vda - 10-15-06 11:25  
---------------------------------------------------------------------- 
+int raidautorun_main(int argc, char *argv[])
+{
+    int fd;
+
+    if (argc != 2)
+       bb_show_usage();
+
+    if ((fd = open(argv[1], O_RDONLY)) == -1) {
+       bb_error_msg("Can't open md device %s\n", argv[1]);
+       return EXIT_FAILURE;
+    }
+
+    if (ioctl(fd, RAID_AUTORUN, NULL) != 0) {
+       bb_error_msg("RAID_AUTORUN ioctl failed\n");
+        close (fd);
+        return EXIT_FAILURE;
+    }
+
+    close (fd);
+
+    return EXIT_SUCCESS;
+}

Please indent using tabs.
Please use xopen(), XXXXerror_msg_and_die()
Please do not place assignment in if(). 

---------------------------------------------------------------------- 
 Thomas Jarosch - 10-19-06 01:00  
---------------------------------------------------------------------- 
Ok, will do. Might take some time. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
10-05-06 05:13  Thomas Jarosch New Issue                                    
10-05-06 05:13  Thomas Jarosch Status                   new => assigned     
10-05-06 05:13  Thomas Jarosch Assigned To               => BusyBox         
10-05-06 05:13  Thomas Jarosch File Added: busybox-raidautorun.patch            
       
10-15-06 11:25  vda            Note Added: 0001704                          
10-19-06 01:00  Thomas Jarosch Note Added: 0001708                          
======================================================================




More information about the busybox-cvs mailing list