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

Re: FW: dpkg support for Solaris



Hi!

On Mon, 2011-11-14 at 15:45:54 +0000, Andrew Stormont wrote:
> From:  Andrew Stormont <andrew.stormont@nexenta.com>
> Date:  Thu, 10 Nov 2011 23:47:14 +0000
> To:  <debian-dpkg@lists.debian.org>
> Subject:  Re: dpkg support for Solaris
> 
> I've also attached a patch which adds support for Solaris zones.  I imagine
> this won't be the sort of thing you can apply is-is like the other patch.

So, AFAIUI Solaris zones are a bit like BSD jails, and the intent I
gather from the patch is that it's not unpacking when inside a zone,
because the data has been unpacked elsewhere (in the global zone)?

If this is the case then I think it's a bad idea, similar to user
installable packages, because the databases and the unpacked data
will get out of sync with each other.


> From:  Andrew Stormont <andrew.stormont@nexenta.com>
> Date:  Thu, 10 Nov 2011 14:03:18 +0000
> To:  <debian-dpkg@lists.debian.org>
> Subject:  dpkg support for Solaris

> Please could you apply the attached patch which fixes dpkg Support for
> Solaris.

I've pushed fixes for several of these issues.

> diff --git a/dselect/main.cc b/dselect/main.cc
> index 6508b1f..5b1c08b 100644
> --- a/dselect/main.cc
> +++ b/dselect/main.cc
> @@ -53,6 +55,10 @@
>  #include <dpkg/dpkg-db.h>
>  #include <dpkg/options.h>
>  
> +#ifndef ERR
> +#define ERR (-1)
> +#endif
> +
>  #include "dselect.h"
>  #include "bindings.h"
>  #include "pkglist.h"

This should not be needed, given that Solaris should be conforming to
either the SVr4 or XPG4 curses, which define that the return value for
error for several functions is ERR.

> diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c
> index 03a7b57..6f62a42 100644
> --- a/utils/start-stop-daemon.c
> +++ b/utils/start-stop-daemon.c
> @@ -31,6 +33,7 @@
>  #  define OSHurd
>  #elif defined(__sun)
>  #  define OSsunos
> +#  undef HAVE_KVM_H
>  #elif defined(OPENBSD) || defined(__OpenBSD__)
>  #  define OSOpenBSD
>  #elif defined(hpux)
> @@ -1039,7 +1042,7 @@ pid_is_exec(pid_t pid, const char *name)
>  }
>  #endif
>  
> -#if defined(OSLinux)
> +#if defined(OSLinux) || defined(OSsunos)
>  static bool
>  pid_is_user(pid_t pid, uid_t uid)
>  {
> @@ -1095,7 +1098,7 @@ pid_is_user(pid_t pid, uid_t uid)
>  }
>  #endif
>  
> -#if defined(OSLinux)
> +#if defined(OSLinux) || defined(OSsunos)
>  static bool
>  pid_is_cmd(pid_t pid, const char *name)
>  {
> @@ -1103,7 +1106,11 @@ pid_is_cmd(pid_t pid, const char *name)
>  	FILE *f;
>  	int c;
>  
> +#if defined(OSsunos)
> +	sprintf(buf, "/proc/%d/status", pid);
> +#else
>  	sprintf(buf, "/proc/%d/stat", pid);
> +#endif
>  	f = fopen(buf, "r");
>  	if (!f)
>  		return false;

These are not right, the Solaris proc(4) layout is not documented to be
compatible with the one on Linux.

I've some local changes fixing the kvm support for at least FreeBSD
and Mac OS X, which should help for Solaris too, but will polish and
push only after having dealt with the multiarch merge.

thanks,
guillem


Reply to: