PDA

Bekijk de volledige versie : Trying to replace Busybox



MoD
26-11-2006, 19:40
The original WL700gE Busybox is v1.0.0-pre2. I replaced it with v1.0.0.

HDD is mountig as expected in shares/MYVOLUME1/MYSHARE1, but USB flash-drive causes an error:

# Disk (8, 64) added.
Failed trying to read the Disk Header for /dev/scsi/host1/bus0/target0/lun0/disc: No such device or address
Failed trying to read the Disk Header for /dev/scsi/host1/bus0/target0/lun0/disc: No such device or address
The newly added disk is a foreign disk.
Currently, only 2 FATs are supported, not 191.

Failed to mount /dev/scsi/host2/bus0/target0/lun0/disc as type vfat: Invalid argument.
Failed to mount /dev/scsi/host2/bus0/target0/lun0/disc as type ntfs: Invalid argument.
Failed to mount /dev/scsi/host2/bus0/target0/lun0/disc as type iso9660: Invalid argument.
Error on disk (8, 64).
Notifying user: Error: Disk `Foreign Disk 1' is Broken.

when replaced with v1.1.3, the HDD also does not mounts. Mount command responds with error Invalid argument

could it be that Broadcom has modified busybox? could it be old glibc? any other ideas?

MMCM
27-11-2006, 09:16
Are you sure you want to mount the whole usb flash drive not a partition on it?
Does it have partitions on it?
Then you should use (e.g.) mount /dev/scsi/host1/bus0/target0/lun0/part1 ..... instead.

MoD
27-11-2006, 09:38
Are you sure you want to mount the whole usb flash drive not a partition on it?
Does it have partitions on it?
Then you should use (e.g.) mount /dev/scsi/host1/bus0/target0/lun0/part1 ..... instead.

Thanks for pointing out this, but then there is a bug somewhere because often when I plug my USB flash-drive, it is not mounted. On the serial console there is an error message:

~ # Disk (8, 0) added.
The newly added disk is a foreign disk.
Currently, only 2 FATs are supported, not 191.

Failed to mount /dev/scsi/host1/bus0/target0/lun0/disc as type vfat: Invalid argument.
Failed to mount /dev/scsi/host1/bus0/target0/lun0/disc as type ntfs: Invalid argument.
Failed to mount /dev/scsi/host1/bus0/target0/lun0/disc as type iso9660: Invalid argument.
Error on disk (8, 0).
Duplicate user notification ignored: Error: Disk `Foreign Disk 1' is Broken.
it is often for busybox v.1.00, but not for v.1.00-pre2 (original for asus)

What does this mean?:

Failed trying to read the Disk Header for /dev/scsi/host1/bus0/target0/lun0/disc: No such device or address
What does the mount command is trying to read from Disk Header ?

MMCM
27-11-2006, 09:56
When you try to mount the whole device ....../disc and the drive contains partitions, it will not read the partition header but the master boot record of the disk.
What does "fdisk -l /dev/scsi/host1/bus0/target0/lun0/disc" say?
If you don't have fdisk on the router, you can connect it to a desktop pc...

I think, the problems are because some USB sticks are formatted without the use of a partition, and others do use partitions.

If you don't have data on the stick, you could format it (without partitions) with "mkfs.vfat /dev/scsi/host1/bus0/target0/lun0/disc" on a linux pc.

MoD
27-11-2006, 10:01
When you try to mount the whole device ....../disc and the drive contains partitions, it will not read the partition header but the master boot record of the disk.
What does "fdisk -l /dev/scsi/host1/bus0/target0/lun0/disc" say?
If you don't have fdisk on the router, you can connect it to a desktop pc...

I think, the problems are because some USB sticks are formatted without the use of a partition, and others do use partitions.

If you don't have data on the stick, you could format it (without partitions) with "mkfs.vfat /dev/scsi/host1/bus0/target0/lun0/disc" on a linux pc.

fdisk output is the following

~ # fdisk -l /dev/scsi/host1/bus0/target0/lun0/disc

Disk /dev/scsi/host1/bus0/target0/lun0/disc: 524 MB, 524288000 bytes
32 heads, 32 sectors/track, 1000 cylinders
Units = cylinders of 1024 * 512 = 524288 bytes

Device Boot Start End Blocks Id
System
/dev/scsi/host1/bus0/target0/lun0/part1 * 1 999 511472 6 FAT16
from what you are saying I assume that it is actually a not correctly cretaed feature from asus and it could be fixed? there is a function hotplug_usb_mass(char *product) in file rc.asus/services_ex.c

MMCM
27-11-2006, 10:34
Busybox has a lot of options to configure :-)
Are you sure, you did everything right?

I'm not familiar with the WL-700gE, I use OpenWrt Kamikaze on my WL-500gx :-)

Are you able to mount the usb stick manually, with part1 instead of disc?

MoD
27-11-2006, 10:45
Busybox has a lot of options to configure :-)
Are you sure, you did everything right?

I'm not familiar with the WL-700gE, I use OpenWrt Kamikaze on my WL-500gx :-)

Are you able to mount the usb stick manually, with part1 instead of disc?

Yes, I can mount USB disk manually. I can say that with busybox form asus source tree everuthing works greate, but there are problems with Busybox v1.00 - USB not always mounts. And with newer Busybox releases HDD also does not mounts.

I'm pretty sure I configured Busybox the same as Asus did. The only thing is that Asus build options has "bogus-config-error-" as cross compiler prefix whereas I have "mipsel-linux-". otherwise it wont compile

MoD
27-11-2006, 14:03
there is another copy of busybox in /apps/bin if you try to launch it, there is an error:

# /apps/bin/busybox
/apps/bin/busybox: error while loading shared libraries: /apps/bin/busybox: symbol vprintf, version GLIBC_2.0 not defined in file libc.so.6 with link time reference

MoD
27-11-2006, 15:32
HDD is mounted inside rc binary by calling /sbin/init (witch is symlink to rc) and there is no source code for it.

when you attach or remove USB disk, hotdiskadd or hotdiskremove code is launched. They are symlinks to the same rc binary:

# ls /sbin/hotdisk* -l
lrwxrwxrwx 1 root root 2 Nov 27 16:38 /sbin/hotdiskadd -> rc
lrwxrwxrwx 1 root root 2 Jan 1 1970 /sbin/hotdiskremove -> rc
It seems that Broadcom, not ASUS has not released rc source :(. Why it is even worse, is that the original ASUS code has bugs and my USB disk is not always recognized:(:

# new USB device 01:03.2-3, assigned address 2new device strings: Mfr=1, Product=2, SerialNumber=3<4>scsi_error_handler: Error handler sleeping (134)
scsi1 : SCSI emulation for USB Mass Storage devices
Vendor: 512MB Model: USB2.0FlashDrive Rev: 2.00
Type: Direct-Access ANSI SCSI revision: 02
Attached scsi removable disk sda at scsi1, channel 0, id 0, lun 0
sda : READ CAPACITY failed.
sda : status = 1, message = 00, host = 0, driver = 08
Current sd00:00: sns = 70 6
ASC=28 ASCQ= 0
Raw sense data:0x70 0x00 0x06 0x00 0x00 0x00 0x00 0x0a 0x00 0x00 0x00 0x00 0x28
0x00 0x00 0x00 0x00 0x00
sda : block size assumed to be 512 bytes, disk size 1GB.
/dev/scsi/host1/bus0/target0/lun0: I/O error: dev 08:00, sector 0
SCSI error handling: /sbin/diskerror 8 0
I/O error: dev 08:00, sector 0
unable to read partition table
SCSI disk handling: /sbin/hotdiskadd 8 0
Disk (8, 0) addeAfter SCSI disk handling: d.
/sbin/hotdiskadd 8 0
SCSI device sda: 1024000 512-byte hdwr sectors (524 MB)
sda: Write Protect is off
/dev/scsi/host1/bus0/target0/lun0: p1
The newly added disk is a foreign disk.
Currently, only 2 FATs are supported, not 191.

MSDOS FS: Using codepage 950
FAT: bogus logical sector size 20487
VFS: Can't find a valid FAT filesystem on dev 08:00.
Failed to mount /dev/scsi/host1/bus0/target0/lun0/disc as type vfat: Invalid argument.
Failed to mount /dev/scsi/host1/bus0/target0/lun0/disc as type ntfs: Invalid argument.
Unable to identify CD-ROM format.
Failed to mount /dev/scsi/host1/bus0/target0/lun0/disc as type iso9660: Invalid argument.
Error on disk (8, 0).
Notifying user: Error: Disk `Foreign Disk 1' is Broken.
There are actually two versions of rc in the source tree. The first one, witch is used by default, is in apps/mipsel/install/rc/sbin, another - newer is in apps/mipsel/install.rc3/rc/sbin and is never used. Why is it here?:(

If Busyboxis replaced, something strange happens, and HDD is not mounted by issuing command:

mount /dev/se/2 /shares/MYVOLUME1

Could it be that glibc or any other librariy is old and therefore mount command does not work properly?

MMCM
28-11-2006, 08:31
More reasons to switch to OpenWrt ;-)

People should not try to enhance/bugfix the original Asus firmware, but try to get OpenWrt running on this device...
Then you could really do what YOU want.

MoD
28-11-2006, 10:45
More reasons to switch to OpenWrt ;-)

People should not try to enhance/bugfix the original Asus firmware, but try to get OpenWrt running on this device...
Then you could really do what YOU want.

I completely agree with you but it will take some time. OpenWRT is working on it: http://forum.openwrt.org/viewtopic.php?id=4883&p=2

I' more programmer than reverse engineer.