Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Jul 2007 16:39:05 -0400
From:      John Nielsen <lists@jnielsen.net>
To:        freebsd-emulation@freebsd.org
Subject:   Re: linux ioctls not implemented - advice?
Message-ID:  <200707241639.05232.lists@jnielsen.net>
In-Reply-To: <200707241545.59049.lists@jnielsen.net>
References:  <200707241545.59049.lists@jnielsen.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 24 July 2007 03:45:58 pm John Nielsen wrote:
> I'm trying to get the latest Linux remote agent for Backup Exec to run on a
> FreeBSD-amd64 machine. The exact version is RALUS-11d.7170.2, although I
> suspect any 10d or 11d version would be the same.
>
> After trying a few things (including installing on a real Linux host) I was
> able to identify and extract the files containing the two rpm's that are
> actually installed. I ran those through rpm2cpio and got a simple directory
> layout. I duplicated the directory structure and config file from the Linux
> host and ran the main executable. (The init script tries (and fails, even
> after I fixed all the hardcoded paths) to do some housekeeping, but none of
> it is necessary for the thing to actually run.)
>
> The executable seems to run okay and the host even shows up as a Unix
> target on the (Windows) Backup Exec server, but I'm unable to authenticate
> or do any backups. Looking through the system messages I saw these:
>
> linux: pid 4080 (beremote): ioctl fd=6, cmd=0x8938 ('\M^I',56) is not
> implemented
> linux: pid 4080 (beremote): ioctl fd=6, cmd=0x8938 ('\M^I',56) is not
> implemented
> linux: pid 4080 (beremote): ioctl fd=6, cmd=0x8933 ('\M^I',51) is not
> implemented
> linux: pid 4080 (beremote): ioctl fd=6, cmd=0x8933 ('\M^I',51) is not
> implemented
> linux: pid 4080 (beremote): ioctl fd=6, cmd=0x8933 ('\M^I',51) is not
> implemented
> linux: pid 4080 (beremote): ioctl fd=6, cmd=0x8933 ('\M^I',51) is not
> implemented
>
> Two attempts to use ioctl 0x8938 and four attempts to use ioctl 0x8933
> every time I start the executable (regardless of login attempts).
>
> The message is fairly explanatory; my question is what can I do about it?
> Is there a canonical list of Linux ioctls anywhere that would tell me what
> this binary is trying to do? From the behavior I'm seeing and from looking
> at linux_ioctl.h I suspect that they belong in the "socket" category, but
> that's as far as I've gotten.
>
> Thanks for any tips, etc.

Digging a little deeper, it looks like 0x8933 translates to SIOCGIFINDEX. 
There is a ready-made (at least it looks that way to me) patch in kern/99068, 
which apparently has only not been committed because the debug output uses 
the wrong function. I'll play around with that and perhaps comment on the PR 
if I make any headway.

The 0x8938 ioctl appears to translate to SIOCGIFCOUNT. Can anyone point me in 
the right direction for creating a linux_ifcount function for linux_ioctl.c? 
I have some C experience but little to no kernel experience. However the PR 
above and the existing code provide a pretty good template for me to follow. 
Would getting the value of net.link.generic.system.ifcount be an appropriate 
action? If so, what would that reference look like in C appropriate for 
linux_ioctl.c?

Thanks!

JN



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200707241639.05232.lists>