-DKBD_SETFONT=\"/usr/bin/setfont\" \
-DDEFAULT_FONT=\"LatArCyrHeb-16\"
else
+if TARGET_MANDRIVA
+AM_CPPFLAGS += \
+ -DKBD_LOADKEYS=\"/bin/loadkeys\" \
+ -DKBD_SETFONT=\"/bin/setfont\" \
+ -DDEFAULT_FONT=\"LatArCyrHeb-16\"
+else
AM_CPPFLAGS += \
-DKBD_LOADKEYS=\"/bin/loadkeys\" \
-DKBD_SETFONT=\"/bin/setfont\" \
endif
endif
endif
+endif
rootbin_PROGRAMS = \
systemd \
units/fedora/halt-local.service
endif
+if TARGET_MANDRIVA
+dist_systemunit_DATA += \
+ units/mandriva/prefdm.service \
+ units/fedora/rc-local.service \
+ units/fedora/halt-local.service
+endif
+
if HAVE_PLYMOUTH
dist_systemunit_DATA += \
units/plymouth-start.service \
rm -f display-manager.service && \
$(LN_S) $(systemunitdir)/display-manager.service display-manager.service )
endif
+
+if TARGET_MANDRIVA
+ $(MKDIR_P) -m 0755 $(DESTDIR)$(systemunitdir)/final.target.wants
+ ( cd $(DESTDIR)$(systemunitdir)/multi-user.target.wants && \
+ rm -f rc-local.service && \
+ $(LN_S) $(systemunitdir)/rc-local.service rc-local.service )
+ ( cd $(DESTDIR)$(systemunitdir)/final.target.wants && \
+ rm -f halt-local.service && \
+ $(LN_S) $(systemunitdir)/halt-local.service halt-local.service )
+ ( cd $(DESTDIR)$(systemunitdir) && \
+ rm -f display-manager.service && \
+ $(LN_S) prefdm.service display-manager.service )
+ ( cd $(DESTDIR)$(systemunitdir)/graphical.target.wants && \
+ rm -f display-manager.service && \
+ $(LN_S) $(systemunitdir)/display-manager.service display-manager.service )
+endif
+
if TARGET_DEBIAN_OR_UBUNTU
( cd $(DESTDIR)$(systemunitdir) && \
rm -f runlevel5.target && \
test -f "/etc/slackware-version" && with_distro="slackware"
test -f "/etc/frugalware-release" && with_distro="frugalware"
test -f "/etc/altlinux-release" && with_distro="altlinux"
+ test -f "/etc/mandriva-release" && with_distro="mandriva"
if test "x`lsb_release -is 2>/dev/null`" = "xUbuntu"; then
with_distro="ubuntu"
fi
M4_DISTRO_FLAG=-DTARGET_ALTLINUX=1
have_plymouth=true
;;
+ mandriva)
+ SYSTEM_SYSVINIT_PATH=/etc/rc.d/init.d
+ SYSTEM_SYSVRCND_PATH=/etc/rc.d
+ SPECIAL_SYSLOG_SERVICE=rsyslog.service
+ AC_DEFINE(TARGET_MANDRIVA, [], [Target is Mandriva])
+ M4_DISTRO_FLAG=-DTARGET_MANDRIVA=1
+ have_plymouth=true
+ ;;
other)
AS_IF([test "x$with_syslog_service" = "x"],
[AC_MSG_ERROR([With --distro=other, you must pass --with-syslog-service= to configure])])
AM_CONDITIONAL(TARGET_SLACKWARE, test x"$with_distro" = xslackware)
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(HAVE_PLYMOUTH, test -n "$have_plymouth")
arg_skip = true;
else if (startswith(w, "fsck.mode"))
log_warning("Invalid fsck.mode= parameter. Ignoring.");
-#ifdef TARGET_FEDORA
+#if defined(TARGET_FEDORA) || defined(TARGET_MANDRIVA)
else if (strneq(w, "fastboot", l))
arg_skip = true;
else if (strneq(w, "forcefsck", l))
#include "util.h"
#include "log.h"
-#if defined(TARGET_FEDORA) || defined(TARGET_ALTLINUX)
+#if defined(TARGET_FEDORA) || defined(TARGET_ALTLINUX) || defined(TARGET_MANDRIVA)
#define FILENAME "/etc/sysconfig/network"
#elif defined(TARGET_SUSE) || defined(TARGET_SLACKWARE) || defined(TARGET_FRUGALWARE)
#define FILENAME "/etc/HOSTNAME"
static int read_distro_hostname(char **hn) {
-#if defined(TARGET_FEDORA) || defined(TARGET_ARCH) || defined(TARGET_GENTOO) || defined(TARGET_ALTLINUX)
+#if defined(TARGET_FEDORA) || defined(TARGET_ARCH) || defined(TARGET_GENTOO) || defined(TARGET_ALTLINUX) || defined(TARGET_MANDRIVA)
int r;
FILE *f;
if (r != -ENOENT)
log_warning("Failed to read /etc/profile.env: %s", strerror(-r));
}
+#elif defined(TARGET_MANDRIVA)
+ if (r <= 0 &&
+ (r = parse_env_file("/etc/sysconfig/i18n", NEWLINE,
+ "LANG", &variables[VARIABLE_LANG],
+ "LC_CTYPE", &variables[VARIABLE_LC_CTYPE],
+ "LC_NUMERIC", &variables[VARIABLE_LC_NUMERIC],
+ "LC_TIME", &variables[VARIABLE_LC_TIME],
+ "LC_COLLATE", &variables[VARIABLE_LC_COLLATE],
+ "LC_MONETARY", &variables[VARIABLE_LC_MONETARY],
+ "LC_MESSAGES", &variables[VARIABLE_LC_MESSAGES],
+ "LC_PAPER", &variables[VARIABLE_LC_PAPER],
+ "LC_NAME", &variables[VARIABLE_LC_NAME],
+ "LC_ADDRESS", &variables[VARIABLE_LC_ADDRESS],
+ "LC_TELEPHONE", &variables[VARIABLE_LC_TELEPHONE],
+ "LC_MEASUREMENT", &variables[VARIABLE_LC_MEASUREMENT],
+ "LC_IDENTIFICATION", &variables[VARIABLE_LC_IDENTIFICATION],
+ NULL)) < 0) {
+
+ if (r != -ENOENT)
+ log_warning("Failed to read /etc/sysconfig/i18n: %s", strerror(-r));
+ }
+
#endif
if (!variables[VARIABLE_LANG]) {
arg_skip = true;
else if (startswith(w, "quotacheck.mode"))
log_warning("Invalid quotacheck.mode= parameter. Ignoring.");
-#ifdef TARGET_FEDORA
+#if defined(TARGET_FEDORA) || defined(TARGET_MANDRIVA)
else if (strneq(w, "forcequotacheck", l))
arg_force = true;
#endif
}
static void test_files(void) {
-#ifdef TARGET_FEDORA
- /* This exists only on Fedora */
+#if defined(TARGET_FEDORA) || defined(TARGET_MANDRIVA)
+ /* This exists only on Fedora or Mandriva */
if (access("/forcequotacheck", F_OK) >= 0)
arg_force = true;
#endif
static const char * const table[] = {
/* LSB defined facilities */
"local_fs", SPECIAL_LOCAL_FS_TARGET,
+#ifndef TARGET_MANDRIVA
+ /* Due to unfortunate name selection in Mandriva,
+ * $network is provided by network-up which is ordered
+ * after network which actually starts interfaces.
+ * To break the loop, just ignore it */
"network", SPECIAL_NETWORK_TARGET,
+#endif
"named", SPECIAL_NSS_LOOKUP_TARGET,
"portmap", SPECIAL_RPCBIND_TARGET,
"remote_fs", SPECIAL_REMOTE_FS_TARGET,
}
if (!f) {
-#if defined(TARGET_FEDORA) && defined (HAVE_SYSV_COMPAT)
+#if (defined(TARGET_FEDORA) || defined(TARGET_MANDRIVA)) && defined (HAVE_SYSV_COMPAT)
if (endswith(i->name, ".service")) {
char *sysv;
if (!ansi_color)
const_color = "0;33"; /* Orange/Brown for Ubuntu */
+#elif defined(TARGET_MANDRIVA)
+
+ if (!pretty_name) {
+ char *s, *p;
+
+ if ((r = read_one_line_file("/etc/mandriva-release", &s) < 0)) {
+ if (r != -ENOENT)
+ log_warning("Failed to read /etc/mandriva-release: %s", strerror(-r));
+ } else {
+ p = strstr(s, " release ");
+ if (p) {
+ *p = '\0';
+ p += 9;
+ p[strcspn(p, " ")] = '\0';
+
+ /* This corresponds to standard rc.sysinit */
+ if (asprintf(&pretty_name, "%s\x1B[0;39m %s", s, p) > 0)
+ const_color = "1;36";
+ else
+ log_warning("Failed to allocate Mandriva version string.");
+ } else
+ log_warning("Failed to parse /etc/mandriva-release");
+ free(s);
+ }
+ }
+
#endif
if (!pretty_name && !const_pretty)
char *vc_font_unimap = NULL;
#ifdef TARGET_GENTOO
char *vc_unicode = NULL;
+#endif
+#ifdef TARGET_MANDRIVA
+ char *vc_keytable = NULL;
#endif
int fd = -1;
bool utf8;
if (r != -ENOENT)
log_warning("Failed to read /etc/conf.d/keymaps: %s", strerror(-r));
}
+
+#elif defined(TARGET_MANDRIVA)
+
+ if ((r = parse_env_file("/etc/sysconfig/i18n", NEWLINE,
+ "SYSFONT", &vc_font,
+ "SYSFONTACM", &vc_font_map,
+ "UNIMAP", &vc_font_unimap,
+ NULL)) < 0) {
+
+ if (r != -ENOENT)
+ log_warning("Failed to read /etc/sysconfig/i18n: %s", strerror(-r));
+ }
+
+ if ((r = parse_env_file("/etc/sysconfig/keyboard", NEWLINE,
+ "KEYTABLE", &vc_keytable,
+ "KEYMAP", &vc_keymap,
+ "UNIKEYTABLE", &vc_keymap,
+ "GRP_TOGGLE", &vc_keymap_toggle,
+ NULL)) < 0) {
+
+ if (r != -ENOENT)
+ log_warning("Failed to read /etc/sysconfig/i18n: %s", strerror(-r));
+ }
+
+ if (vc_keytable) {
+ if (vc_keymap)
+ free(vc_keymap);
+ if (utf8) {
+ if (endswith(vc_keytable, ".uni") || strstr(vc_keytable, ".uni."))
+ vc_keymap = strdup(vc_keytable);
+ else {
+ char *s;
+ if ((s = strstr(vc_keytable, ".map")))
+ vc_keytable[s-vc_keytable+1] = '\0';
+ vc_keymap = strappend(vc_keytable, ".uni");
+ }
+ } else
+ vc_keymap = strdup(vc_keytable);
+
+ free(vc_keytable);
+
+ if (!vc_keymap) {
+ log_error("Out of memory.");
+ goto finish;
+ }
+ }
+
+ if (access("/etc/sysconfig/console/default.kmap", F_OK) >= 0) {
+ char *t;
+
+ if (!(t = strdup("/etc/sysconfig/console/default.kmap"))) {
+ log_error("Out of memory.");
+ goto finish;
+ }
+
+ free(vc_keymap);
+ vc_keymap = t;
+ }
#endif
}
m4_ifdef(`TARGET_ALTLINUX',
After=rc-local.service
)m4_dnl
+m4_ifdef(`TARGET_MANDRIVA',
+After=rc-local.service
+)m4_dnl
# If additional gettys are spawned during boot then we should make
# sure that this is synchronized before getty.target, even though
m4_ifdef(`TARGET_ALTLINUX',
Names=runlevel5.target
)m4_dnl
+m4_ifdef(`TARGET_MANDRIVA',
+Names=runlevel5.target
+)m4_dnl
AllowIsolate=yes
[Install]
--- /dev/null
+# This file is part of systemd.
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+
+[Unit]
+Description=Display Manager
+After=syslog.target livesys-late.service rc-local.service systemd-user-sessions.service
+After=network.target acpid.service fs.service haldaemon.service
+
+# Do not stop plymouth, it is done in prefdm if required
+Conflicts=plymouth-quit.service
+After=plymouth-quit.service
+
+# Hide SysV script
+Names=dm.service
+
+[Service]
+ExecStart=/etc/X11/prefdm
+Type=forking
+Restart=always
+RestartSec=0
Names=runlevel2.target runlevel3.target runlevel4.target runlevel5.target
)m4_dnl
)m4_dnl
+m4_ifdef(`TARGET_MANDRIVA',
+Names=runlevel3.target
+)m4_dnl
AllowIsolate=yes
[Install]
Conflicts=shutdown.target
After=basic.target
Before=shutdown.target
+m4_ifdef(`TARGET_MANDRIVA',
+`# Hide SysV script
+Names=single.service')
[Service]
Environment=HOME=/root
m4_ifdef(`TARGET_FEDORA',
`EnvironmentFile=/etc/sysconfig/init
ExecStart=-/bin/bash -c "exec ${SINGLE}"',
-`ExecStart=-/sbin/sulogin')
+m4_ifdef(`TARGET_MANDRIVA',
+`EnvironmentFile=/etc/sysconfig/init
+ExecStart=-/bin/bash -c "exec ${SINGLE}"',
+`ExecStart=-/sbin/sulogin'))
ExecStopPost=-/bin/systemctl --fail default
StandardInput=tty-force
KillMode=process-group
m4_ifdef(`TARGET_ALTLINUX',
After=rc-local.service
)m4_dnl
+m4_ifdef(`TARGET_MANDRIVA',
+After=rc-local.service
+)m4_dnl
# If additional gettys are spawned during boot then we should make
# sure that this is synchronized before getty.target, even though