[Setup-tool-hackers] FreeBSD patches




Hi,

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?

Here's a more thorough description:

 --- 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.

 --- SUPPORTED:

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

 --- 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.

 --- 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.

 --- 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.


My perl is not very good, so please be gentle :)

-- 
Theo van Klaveren <t.vanklaveren@student.utwente.nl>
http://home.student.utwente.nl/t.vanklaveren
? xml-i18n-extract
? xml-i18n-merge
? xml-i18n-update
? backends/platform.pl.in.backup
? backends/simple-test.pl
? backends/.platform.pl.in.swp
Index: SUPPORTED
===================================================================
RCS file: /cvs/gnome/ximian-setup-tools/SUPPORTED,v
retrieving revision 1.2
diff -u -3 -p -r1.2 SUPPORTED
--- SUPPORTED	2001/05/17 19:12:25	1.2
+++ SUPPORTED	2001/05/19 01:30:01
@@ -146,3 +146,17 @@ Network         -       -
 Shares          -       -
 Time            -       -
 Users           -       -
+
+
+FreeBSD:
+
+Version        4.x     5.x
+
+Boot            -       -
+Disks           -       -
+Memory          -       -
+Network         -       -
+Shares          ?       ?
+Time            -       -
+Users           ?       ?
+
Index: configure.in
===================================================================
RCS file: /cvs/gnome/ximian-setup-tools/configure.in,v
retrieving revision 1.62
diff -u -3 -p -r1.62 configure.in
--- configure.in	2001/05/17 23:46:08	1.62
+++ configure.in	2001/05/19 01:30:01
@@ -38,15 +38,7 @@ GNOME_XML_CHECK
 AM_PATH_GDK_PIXBUF
 AM_PATH_LIBGLADE(,,"gnome")
 
-AC_CHECK_LIB(crack, FascistCheck, ,[
-  AC_MSG_WARN(),
-  AC_MSG_WARN(---------- Building without cracklib is not recommended. ----------),
-  AC_MSG_WARN(),
-  AC_MSG_WARN(-- If you are looking for cracklib you can try  :),
-  AC_MSG_WARN(--    http://www.users.dircon.co.uk/~crypto/),
-  AC_MSG_WARN(--    or :),
-  AC_MSG_WARN(--    http://www.rpmfind.net/linux/rpm2html/search.php?query=cracklib),
-  AC_MSG_WARN()])
+AC_CHECK_LIB(crack, FascistCheck, ,)
 if test x"$HAVE_LIBCRACK" = xyes ; then
   AC_CHECK_HEADER(crack.h, ,[
   AC_MSG_ERROR(cracklib crack.h header file not found.)])
@@ -54,8 +46,7 @@ fi
 
 AC_CHECK_LIB(crypt, crypt, ,[
   AC_MSG_ERROR(crypt library is required.)])
-AC_CHECK_HEADER(crypt.h, ,[
-  AC_MSG_ERROR(crypt.h header file not found.)])
+AC_CHECK_HEADER(crypt.h, ,)
 
 dnl ==================
 dnl GdkPixbuf checking
Index: backends/platform.pl.in
===================================================================
RCS file: /cvs/gnome/ximian-setup-tools/backends/platform.pl.in,v
retrieving revision 1.11
diff -u -3 -p -r1.11 platform.pl.in
--- backends/platform.pl.in	2001/05/16 23:59:05	1.11
+++ backends/platform.pl.in	2001/05/19 01:30:02
@@ -138,6 +138,26 @@ sub check_linuxppc
   return -1;
 }
 
+sub check_freebsd
+{
+  my $dir = "___scriptsdir___";
+
+  system ("sysctl -n kern.version > $dir/system.freebsdversion");
+  open RELEASE, "$dir/system.freebsdversion" or return -1;
+  while (<RELEASE>)
+  {
+    chomp;
+    if (/^FreeBSD\s(\S+)\.\S+.*/)
+    {
+      close RELEASE;
+      unlink "$dir/system.freebsdversion";
+      return "freebsd-$1";
+    }
+  }
+  unlink "$dir/system.freebsdversion";
+  close RELEASE;
+  return -1;
+}
 
 sub xst_platform_guess
 {
@@ -185,6 +205,19 @@ sub xst_platform_guess
         $xst_dist = $dist;
         return;
       }
+    }
+
+    $xst_dist = "unknown";
+  }
+
+  if ($xst_system =~ /freebsdelf/)
+  {
+    my $dist;
+
+    $dist = &check_freebsd ();
+    if ($dist != -1) {
+      $xst_dist = $dist;
+      return;
     }
 
     $xst_dist = "unknown";
Index: backends/shares-conf.in
===================================================================
RCS file: /cvs/gnome/ximian-setup-tools/backends/shares-conf.in,v
retrieving revision 1.58
diff -u -3 -p -r1.58 shares-conf.in
--- backends/shares-conf.in	2001/05/17 19:20:44	1.58
+++ backends/shares-conf.in	2001/05/19 01:30:02
@@ -53,7 +53,8 @@ require "___scriptsdir___/share.pl";
 $name = "shares";
 $version = "0.1.0";
 @platforms = ("redhat-5.2", "redhat-6.0", "redhat-6.1", "redhat-6.2", "redhat-7.0",
-              "mandrake-7.2", "debian-2.2", "debian-woody", "suse-7.0");
+              "mandrake-7.2", "debian-2.2", "debian-woody", "suse-7.0", "freebsd-4",
+	      "freebsd-5");
 
 $description =<<"end_of_description;";
        Configures network shares for import or export.
@@ -72,7 +73,9 @@ $platmap =
   "debian-2.2"   => "redhat-7.0",
   "debian-woody" => "redhat-7.0",
   "mandrake-7.2" => "redhat-7.0",
-  "suse-7.0"     => "redhat-6.2"
+  "suse-7.0"     => "redhat-6.2",
+  "freebsd-4"    => "freebsd-4",
+  "freebsd-5"    => "freebsd-4"
 };
 
 $filemap =
@@ -91,6 +94,13 @@ $filemap =
     "mtab"     => "/etc/mtab",
     "exports"  => "/etc/exports",
     "smb.conf" => "/etc/samba/smb.conf"
+  },
+
+  "freebsd-4" =>
+  {
+    "fstab"    => "/etc/fstab",
+    "exports"  => "/etc/exports",
+    "smb.conf" => "/usr/local/etc/smb.conf"
   }
 };
 
Index: backends/users-conf.in
===================================================================
RCS file: /cvs/gnome/ximian-setup-tools/backends/users-conf.in,v
retrieving revision 1.55
diff -u -3 -p -r1.55 users-conf.in
--- backends/users-conf.in	2001/05/17 16:40:32	1.55
+++ backends/users-conf.in	2001/05/19 01:30:02
@@ -59,7 +59,7 @@ $TEST_NIS = 0;
 $name = "users";
 $version = "0.1.0";
 @platforms = ("redhat-5.2", "redhat-6.0", "redhat-6.1", "redhat-6.2", "redhat-7.0",
-              "mandrake-7.2", "debian-2.2", "debian-woody");
+              "mandrake-7.2", "debian-2.2", "debian-woody", "freebsd-4", "freebsd-5");
 
 $description =<<"end_of_description;";
        Manages system users.
@@ -71,11 +71,11 @@ end_of_description;
 # They are tried in array order. First found = used.
 
 @passwd_names =     ( "/etc/passwd" );
-@shadow_names =     ( "/etc/shadow" );
+@shadow_names =     ( "/etc/shadow", "/etc/master.passwd" );
 @group_names =      ( "/etc/group" );
-@login_defs_names = ( "/etc/login.defs" );
+@login_defs_names = ( "/etc/login.defs", "/etc/adduser.conf" );
 @shell_names =      ( "/etc/shells" );
-@skel_dir =         ( "/etc/skel" );
+@skel_dir =         ( "/usr/share/skel", "/etc/skel" );
 
 # Where are the tools?
 


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