On Wednesday 04 February 2009 10:54, Christian Dumhart wrote:
> Hi,
> 
> I make the first tests with mdev and have problems with it.
> 
> ####################
> follow mdev.conf:
> sd[a-z].[1-9]* root:disk 660 */usr/sbin/mnt $MDEV
> ####################
> 
> ####################
> follow mnt script:
> #!/bin/sh
> 
> echo "HIER in mnt.sh"
> usb_name="usb_storage_$1"
> 
> 
> MNT_DIR="/mnt/$usb_name"
> 
> #debug
> #echo "action: $ACTION / mdev: $MDEV / devpath: $DEVPATH / subsystem: 
> $SUBSYSTEM / mntdir: $MNT_DIR" >> /tmp/hotplug.log
> 
> # check mount / unmount
> if [ "$ACTION" = "remove" ]; then
>    # unmount
>    /bin/umount -lf /dev/$1
>    /bin/rmdir "/mnt/$usb_name"
> else
>    # mount
>         if [ ! -d "/mnt/$usb_name" ]; then
>       /bin/mkdir "/mnt/$usb_name"
>         fi
>         /bin/mount /dev/$1 "/mnt/$usb_name"
> fi
> ####################
> 
> now the system (hotplug?) or mdev is call the script twice!?
> ####################
> / # mdev -s
> HIER in mnt.sh
> mount: mounting /dev/sdb1 on /mnt/usb_storage_sdb1 failed: Device or resource 
> busy
> HIER in mnt.sh
> mount: mounting /dev/sdb1 on /mnt/usb_storage_sdb1 failed: Device or resource 
> busy
> / #
> ####################
> 
> The error that the device is bussy is ok because mdev is called before I've 
> type manuale the mdev -s command.
> 
> Have anybode a tipp what it can be?

No. Need more data.
Can you rebuild the busybox with this change in mdev.c:

fileAction(const char *fileName,
                struct stat *statbuf UNUSED_PARAM,
                void *userData,
                int depth UNUSED_PARAM)
{
        size_t len = strlen(fileName) - 4; /* can't underflow */
        char *scratch = userData;

        /* len check is for paranoid reasons */
        if (strcmp(fileName + len, "/dev") != 0 || len >= PATH_MAX)
                return FALSE;

bb_error_msg("fileName '%s'", fileName); <========== THIS LINE
        strcpy(scratch, fileName);
        scratch[len] = '\0';
        make_device(scratch, 0);

        return TRUE;
}

then re-do experiment of running "mdev -s",
and let me know what do you see.

--
vda
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to