BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001066 [BusyBox] New Features minor always 10-05-06 05:13 10-24-06 13:07
Reporter Thomas Jarosch View Status public  
Assigned To BusyBox
Priority normal Resolution fixed  
Status closed   Product Version 1.2.x
Summary 0001066: 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
Additional Information
Attached Files  busybox-raidautorun.patch [^] (3,552 bytes) 10-05-06 05:13
 busybox-raidautorun.01c.patch [^] (3,021 bytes) 10-19-06 04:40
 busybox-raidautorun.01d.patch [^] (3,449 bytes) 10-19-06 07:00

- Relationships

- Notes
(0001704)
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().
 
(0001708)
Thomas Jarosch
10-19-06 01:00

Ok, will do. Might take some time.
 
(0001709)
bernhardf
10-19-06 04:41

raidautorun.01c.patch

added a version that takes vda's comment into account. Still way too big ;)

   text data bss dec hex filename
     79 0 0 79 4f miscutils/raidautorun.o
 
(0001710)
bernhardf
10-19-06 07:01

busybox-raidautorun.01d.patch

Is what i'd check in;

   text data bss dec hex filename
     60 0 0 60 3c miscutils/raidautorun.o

thanks,
Bernhard
 
(0001713)
bernhardf
10-21-06 05:11

Thomas,

vda did check the applet in, please test if it's ok for you and report back so
i can close this issue.

After 2006-11-01, this issue will be closed if i don't hear anything back.

Thanks,
 
(0001714)
Thomas Jarosch
10-23-06 06:27

Hello Bernhard,

Thanks for doing the modifications. I'll test the new code tomorrow.
There are two concerns about the 01d revision:

1. You can't distinguish if it's a permission problem (/dev/md0 open failed)
or if the ioctl() failed.

2. Does is still show the usage if you call it without parameters?
I'll test this tomorrow.

Cheers,
Thomas
 
(0001716)
Thomas Jarosch
10-24-06 09:28

Hello Bernhard,

the new code runs fine. My only suggestion is to add the

if (argc != 2)
    bb_show_usage();

part back in. Otherwise argv[1] could point to invalid memory.
Or does busybox somehow handle this magically?

Cheers,
Thomas
 
(0001717)
bernhardf
10-24-06 13:07

We don't handle this magically, no.

Added the check, fwiw.

   text data bss dec hex filename
     53 0 0 53 35 miscutils/raidautorun.o.r16429
     65 0 0 65 41 miscutils/raidautorun.o

Fixed in r16430
 

- 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
10-19-06 04:40 bernhardf File Added: busybox-raidautorun.01c.patch
10-19-06 04:41 bernhardf Note Added: 0001709
10-19-06 07:00 bernhardf File Added: busybox-raidautorun.01d.patch
10-19-06 07:01 bernhardf Note Added: 0001710
10-21-06 05:11 bernhardf Note Added: 0001713
10-23-06 06:27 Thomas Jarosch Note Added: 0001714
10-24-06 09:28 Thomas Jarosch Note Added: 0001716
10-24-06 13:07 bernhardf Status assigned => closed
10-24-06 13:07 bernhardf Note Added: 0001717
10-24-06 13:07 bernhardf Resolution open => fixed
10-24-06 13:07 bernhardf Fixed in Version  => svn


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker