Re: [systemd-devel] [Patch V2] Angstrom support

2011-05-09 Thread Lennart Poettering
On Fri, 06.05.11 09:19, Koen Kooi (k...@dominion.thruhere.net) wrote:

> This commit consists of the initial work to include Angstrom as a ported
> distribution for systemd.
> 
> Angstrom tries to follow the debian way as much as possible, but deviates
> where it doesn't make sense for 'embedded'.

Thanks, applied!

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [Patch V2] Angstrom support

2011-05-06 Thread Koen Kooi
This commit consists of the initial work to include Angstrom as a ported
distribution for systemd.

Angstrom tries to follow the debian way as much as possible, but deviates
where it doesn't make sense for 'embedded'.

Signed-off-by: Koen Kooi 
---
 Makefile.am|7 +++
 configure.ac   |7 +++
 src/locale-setup.c |2 +-
 src/service.c  |   10 +-
 4 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 49d2ee8..f3f7818 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -96,6 +96,12 @@ AM_CPPFLAGS += \
-DKBD_SETFONT=\"/bin/setfont\" \
-DDEFAULT_FONT=\"LatArCyrHeb-16\"
 else
+if TARGET_ANGSTROM
+AM_CPPFLAGS += \
+   -DKBD_LOADKEYS=\"/usr/bin/loadkeys\" \
+   -DKBD_SETFONT=\"/usr/bin/setfont\" \
+   -DDEFAULT_FONT=\"LatArCyrHeb-16\"
+else
 AM_CPPFLAGS += \
-DKBD_LOADKEYS=\"/bin/loadkeys\" \
-DKBD_SETFONT=\"/bin/setfont\" \
@@ -105,6 +111,7 @@ endif
 endif
 endif
 endif
+endif
 
 rootbin_PROGRAMS = \
systemd \
diff --git a/configure.ac b/configure.ac
index dcd4b9d..b5b7ac3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -295,6 +295,7 @@ if test "z$with_distro" = "z"; then
 test -f "/etc/altlinux-release" && with_distro="altlinux"
 test -f "/etc/mandriva-release" && with_distro="mandriva"
 test -f "/etc/meego-release" && with_distro="meego"
+test -f "/etc/angstrom-version" && with_distro="angstrom"
 if test "x`lsb_release -is 2>/dev/null`" = "xUbuntu"; then
 with_distro="ubuntu"
 fi
@@ -375,6 +376,11 @@ case $with_distro in
 AC_DEFINE(TARGET_MEEGO, [], [Target is MeeGo])
 M4_DISTRO_FLAG=-DTARGET_MEEGO=1
;;
+angstrom)
+SYSTEM_SYSVRCND_PATH=/etc
+AC_DEFINE(TARGET_ANGSTROM, [], [Target is Ångström])
+M4_DISTRO_FLAG=-DTARGET_ANGSTROM=1
+;;
 other)
 ;;
 *)
@@ -425,6 +431,7 @@ AM_CONDITIONAL(TARGET_FRUGALWARE, test x"$with_distro" = 
xfrugalware)
 AM_CONDITIONAL(TARGET_ALTLINUX, test x"$with_distro" = xaltlinux)
 AM_CONDITIONAL(TARGET_MANDRIVA, test x"$with_distro" = xmandriva)
 AM_CONDITIONAL(TARGET_MEEGO, test x"$with_distro" = xmeego)
+AM_CONDITIONAL(TARGET_ANGSTROM, test x"$with_distro" = xangstrom)
 
 AM_CONDITIONAL(HAVE_PLYMOUTH, test -n "$have_plymouth")
 AM_CONDITIONAL(HAVE_SYSV_COMPAT, test "$SYSTEM_SYSV_COMPAT" = "yes")
diff --git a/src/locale-setup.c b/src/locale-setup.c
index d9adfa3..33111da 100644
--- a/src/locale-setup.c
+++ b/src/locale-setup.c
@@ -136,7 +136,7 @@ int locale_setup(void) {
 log_warning("Failed to read /etc/sysconfig/language: 
%s", strerror(-r));
 }
 
-#elif defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU)
+#elif defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU) || 
defined(TARGET_ANGSTROM)
 if (r <= 0 &&
 (r = parse_env_file("/etc/default/locale", NEWLINE,
 "LANG",  &variables[VARIABLE_LANG],
diff --git a/src/service.c b/src/service.c
index e7a5622..f826754 100644
--- a/src/service.c
+++ b/src/service.c
@@ -65,7 +65,7 @@ static const struct {
 { "boot.d", SPECIAL_SYSINIT_TARGET,   RUNLEVEL_SYSINIT },
 #endif
 
-#if defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU) || 
defined(TARGET_FRUGALWARE)
+#if defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU) || 
defined(TARGET_FRUGALWARE) || defined(TARGET_ANGSTROM)
 /* Debian style rcS.d */
 { "rcS.d",  SPECIAL_SYSINIT_TARGET,   RUNLEVEL_SYSINIT },
 #endif
@@ -246,7 +246,7 @@ static char *sysv_translate_name(const char *name) {
 if (!(r = new(char, strlen(name) + sizeof(".service"
 return NULL;
 
-#if defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU)
+#if defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU) || 
defined(TARGET_ANGSTROM)
 if (endswith(name, ".sh"))
 /* Drop Debian-style .sh suffix */
 strcpy(stpcpy(r, name) - 3, ".service");
@@ -297,7 +297,7 @@ static int sysv_translate_facility(const char *name, const 
char *filename, char
 "x-display-manager",SPECIAL_DISPLAY_MANAGER_SERVICE,
 "null", NULL,
 
-#if defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU)
+#if defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU) || 
defined(TARGET_ANGSTROM)
 "mail-transport-agent", SPECIAL_MAIL_TRANSFER_AGENT_TARGET,
 #endif
 
@@ -887,7 +887,7 @@ static int service_load_sysv_name(Service *s, const char 
*name) {
 
 /* For SysV services we strip the boot.*, rc.* and *.sh
  * prefixes/suffixes. */
-#if defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU)
+#if defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU) || 
defined(TARGET_ANGSTROM)
 if (endswith(name, ".sh.service"))
 return -ENOENT;
 #