Re: [Setup-tool-hackers] FreeBSD patches



> I've done some preliminary work on back-end support for FreeBSD. The attached 
> patch lets two backends (shares and users) detect the platform, and get the 
> configuration. It's a pretty small patch, so it shouldn't cause too much 
> headaches. Would someone review and perhaps commit this patch?

Thanks! I'll try to comment on as much of this as I can.


>  --- configure.in:
> 
>  - Under FreeBSD, libcrypt's functions arent in <crypt.h> but in <unistd.h>,
>    so configure shouldn't fail on not finding it.
>  - The warning messages when cracklib isn't found cause configure to bail
>    out with '1: invalid FD'. Haven't been able to figure out why.

As long as the users tool builds without cracklib and doesn't depend on it,
i.e. builds and works as expected with crack features disabled, I don't see a
problem with this. We need to keep the warning messages, though, to alert
packagers so they ship packages with cracklib enabled where possible.

The best fix would be to allow configure.in to find the crack features on
FreeBSD too. I guess the normal way to do this can be gleaned from existing
FreeBSD projects using cracklib and autoconf.


>  --- SUPPORTED:
> 
>  - Add FreeBSD status, set everything to 'not worked on' except shares and 
> users, which may or may not work.

Yes, good. FreeBSD should be on the list.


>  --- backends/platform.pl.in (check_freebsd, xst_platform_guess):
> 
>  - xst_platform_guess now looks for /freebsdelf4/ in the output from
>    guess_system.sh. It then checks the value reported by the script by
>    executing 'sysctl -n kern.version', and then sets $xst_distro to
>    'freebsd-X'. As FreeBSD doesn't change architecturally during minor
>    releases, I thought the major number would be enough.

Looks good.


>  --- backends/shares-conf.in
> 
>  - Add FreeBSD to the $platforms, $platmap, and $filemap. There is no mtab
>    on FreeBSD though, so likely this stuff won't work until I find a way to
>    fix this.

The functions that do this are in the library file filesys.pl.in. Of
particular interest in this case is the xst_filesys_mtab_parse() function,
which needs to be replaced for FreeBSD.

Unfortunately I don't have a FreeBSD installation to test it on yet, but I
think we can make a function, say, xst_filesys_mount_parse() that parses the
output from running "mount", or even better make an xst_filesys_get_mntinfo()
using direct calls to the kernel's getmntinfo() from Perl (I don't know if
this is possible, but Perl does support similar calls).

This function should return a table that is interchangeable with the one from
xst_filesys_mtab_parse(), and under FreeBSD, the frontend should call this
new function.

So the first thing to do is write a xst_filesys_mtab_parse() replacement for
FreeBSD. Take a look at that function and tell me what you think.

We're getting FreeBSD installed on our test box sometime in the coming week,
so we can be more helpful towards this end :)


>  --- backends/users-conf.in
> 
>  - Add FreeBSD to $platforms. The information for /etc/login.defs is in
>    /etc/adduser.conf, but the layout is totally different. Add it anyway, so I
>    can modify the parser later. The skel dir for FreeBSD is in /usr/share/skel
>    I added it first so the empty /etc/skel is not found first. The shadow
>    password file is called /etc/master.passwd.

Tambet tells me that the skels location needs a little bit of work to be
functional - adduser (elsewhere in the backend) should be given a -k
<skeldir> argument.

I think the patch is good, but we need to invest more work in FreeBSD porting
(at least resolve the known issues) before it can be added to the lists of
supported platforms in the backends. What happens when you try to set the
configuration on FreeBSD now?

The platform detection for FreeBSD looks good and should be applied as soon
as possible.


--
Hans Petter

_______________________________________________
setup-tool-hackers maillist  -  setup-tool-hackers@helixcode.com
http://lists.helixcode.com/mailman/listinfo/setup-tool-hackers



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]