Commit 6fdae8a6 authored by Dexter Morgan's avatar Dexter Morgan Committed by Lennart Poettering
Browse files

Add Mageia support

This patch adds support for the Mageia Linux distribution:
 http://www.mageia.org/

Mageia is a fork of Mandriva although some divergence has already occured
and thus inclusion of these changes upstream allow us to (hopefully)
migrate more rapidly to the new standard approaches systemd offers.
Indeed, we already use the preferred mechanism of OS identification via
the /etc/os-release file rather than a distro specific variation.

This patch mostly mirrors the patch added previously for Mandriva
support. In addition to those original authors, this patch was mostly
written by Dexter Morgan with help from Colin Guthrie and Eugeni Dodonov.
parent 25d6283a
......@@ -119,6 +119,13 @@ AM_CPPFLAGS += \
-DKBD_LOADKEYS=\"/bin/loadkeys\" \
-DKBD_SETFONT=\"/bin/setfont\" \
-DDEFAULT_FONT=\"latarcyrheb-sun16\"
else
if TARGET_MAGEIA
AM_CPPFLAGS += \
-DKBD_LOADKEYS=\"/bin/loadkeys\" \
-DKBD_SETFONT=\"/bin/setfont\" \
-DDEFAULT_FONT=\"LatArCyrHeb-16\"
endif
endif
endif
endif
......@@ -542,6 +549,13 @@ dist_systemunit_DATA += \
units/suse/halt-local.service
endif
if TARGET_MAGEIA
dist_systemunit_DATA += \
units/mageia/prefdm.service \
units/fedora/rc-local.service \
units/fedora/halt-local.service
endif
if HAVE_PLYMOUTH
dist_systemunit_DATA += \
units/plymouth-start.service \
......@@ -1999,6 +2013,23 @@ if TARGET_SUSE
$(LN_S) $(systemunitdir)/halt-local.service halt-local.service )
endif
if TARGET_MAGEIA
$(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 && \
$(LN_S) prefdm.service dm.service )
( cd $(DESTDIR)$(systemunitdir)/graphical.target.wants && \
rm -f display-manager.service && \
$(LN_S) $(systemunitdir)/display-manager.service display-manager.service )
endif
if HAVE_SYSV_COMPAT
( cd $(DESTDIR)$(systemunitdir)/local-fs.target.wants && \
rm -f var-lock.mount && \
......
......@@ -371,6 +371,7 @@ if test "z$with_distro" = "z"; then
test -f "/etc/mandriva-release" && with_distro="mandriva"
test -f "/etc/meego-release" && with_distro="meego"
test -f "/etc/angstrom-version" && with_distro="angstrom"
test -f "/etc/mageia-release" && with_distro="mageia"
if test "x`lsb_release -is 2>/dev/null`" = "xUbuntu"; then
with_distro="ubuntu"
fi
......@@ -458,6 +459,12 @@ case $with_distro in
AC_DEFINE(TARGET_ANGSTROM, [], [Target is Ångström])
M4_DEFINES=-DTARGET_ANGSTROM=1
;;
mageia)
SYSTEM_SYSVINIT_PATH=/etc/rc.d/init.d
AC_DEFINE(TARGET_MAGEIA, [], [Target is Mageia])
M4_DISTRO_FLAG=-DTARGET_MAGEIA=1
have_plymouth=yes
;;
other)
;;
*)
......@@ -515,6 +522,7 @@ 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(TARGET_MAGEIA, test x"$with_distro" = xmageia)
AM_CONDITIONAL(HAVE_PLYMOUTH, test "$have_plymouth" = "yes")
AM_CONDITIONAL(HAVE_SYSV_COMPAT, test "$SYSTEM_SYSV_COMPAT" = "yes")
......
......@@ -127,7 +127,7 @@ static int parse_proc_cmdline(void) {
arg_skip = true;
else if (startswith(w, "fsck.mode"))
log_warning("Invalid fsck.mode= parameter. Ignoring.");
#if defined(TARGET_FEDORA) || defined(TARGET_MANDRIVA)
#if defined(TARGET_FEDORA) || defined(TARGET_MANDRIVA) || defined(TARGET_MAGEIA)
else if (strneq(w, "fastboot", l))
arg_skip = true;
else if (strneq(w, "forcefsck", l))
......
......@@ -30,7 +30,7 @@
#include "util.h"
#include "log.h"
#if defined(TARGET_FEDORA) || defined(TARGET_ALTLINUX) || defined(TARGET_MANDRIVA) || defined(TARGET_MEEGO)
#if defined(TARGET_FEDORA) || defined(TARGET_ALTLINUX) || defined(TARGET_MANDRIVA) || defined(TARGET_MEEGO) || defined(TARGET_MAGEIA)
#define FILENAME "/etc/sysconfig/network"
#elif defined(TARGET_SUSE) || defined(TARGET_SLACKWARE)
#define FILENAME "/etc/HOSTNAME"
......@@ -64,7 +64,7 @@ static int read_and_strip_hostname(const char *path, char **hn) {
static int read_distro_hostname(char **hn) {
#if defined(TARGET_FEDORA) || defined(TARGET_ARCH) || defined(TARGET_GENTOO) || defined(TARGET_ALTLINUX) || defined(TARGET_MANDRIVA) || defined(TARGET_MEEGO)
#if defined(TARGET_FEDORA) || defined(TARGET_ARCH) || defined(TARGET_GENTOO) || defined(TARGET_ALTLINUX) || defined(TARGET_MANDRIVA) || defined(TARGET_MEEGO) || defined(TARGET_MAGEIA)
int r;
FILE *f;
......
......@@ -199,7 +199,7 @@ int locale_setup(void) {
if (r != -ENOENT)
log_warning("Failed to read /etc/profile.env: %s", strerror(-r));
}
#elif defined(TARGET_MANDRIVA)
#elif defined(TARGET_MANDRIVA) || defined(TARGET_MAGEIA )
if (r <= 0 &&
(r = parse_env_file("/etc/sysconfig/i18n", NEWLINE,
"LANG", &variables[VARIABLE_LANG],
......
......@@ -54,7 +54,7 @@ static int parse_proc_cmdline(void) {
arg_skip = true;
else if (startswith(w, "quotacheck.mode"))
log_warning("Invalid quotacheck.mode= parameter. Ignoring.");
#if defined(TARGET_FEDORA) || defined(TARGET_MANDRIVA)
#if defined(TARGET_FEDORA) || defined(TARGET_MANDRIVA) || defined(TARGET_MAGEIA)
else if (strneq(w, "forcequotacheck", l))
arg_force = true;
#endif
......@@ -65,8 +65,8 @@ static int parse_proc_cmdline(void) {
}
static void test_files(void) {
#if defined(TARGET_FEDORA) || defined(TARGET_MANDRIVA)
/* This exists only on Fedora or Mandriva */
#if defined(TARGET_FEDORA) || defined(TARGET_MANDRIVA) || defined(TARGET_MAGEIA)
/* This exists only on Fedora, Mandriva or Mageia */
if (access("/forcequotacheck", F_OK) >= 0)
arg_force = true;
#endif
......
......@@ -277,7 +277,8 @@ static int sysv_translate_facility(const char *name, const char *filename, char
static const char * const table[] = {
/* LSB defined facilities */
"local_fs", SPECIAL_LOCAL_FS_TARGET,
#ifndef TARGET_MANDRIVA
#if defined(TARGET_MANDRIVA) || defined(TARGET_MAGEIA)
#else
/* Due to unfortunate name selection in Mandriva,
* $network is provided by network-up which is ordered
* after network which actually starts interfaces.
......
......@@ -3462,7 +3462,7 @@ finish:
static int enable_sysv_units(char **args) {
int r = 0;
#if defined (HAVE_SYSV_COMPAT) && (defined(TARGET_FEDORA) || defined(TARGET_MANDRIVA) || defined(TARGET_SUSE) || defined(TARGET_MEEGO) || defined(TARGET_ALTLINUX))
#if defined (HAVE_SYSV_COMPAT) && (defined(TARGET_FEDORA) || defined(TARGET_MANDRIVA) || defined(TARGET_SUSE) || defined(TARGET_MEEGO) || defined(TARGET_ALTLINUX) || defined(TARGET_MAGEIA))
const char *verb = args[0];
unsigned f = 1, t = 1;
LookupPaths paths;
......
......@@ -160,7 +160,7 @@ int main(int argc, char **argv) {
#ifdef TARGET_GENTOO
char *vc_unicode = NULL;
#endif
#ifdef TARGET_MANDRIVA
#if defined(TARGET_MANDRIVA) || defined(TARGET_MAGEIA)
char *vc_keytable = NULL;
#endif
int fd = -1;
......@@ -371,7 +371,7 @@ int main(int argc, char **argv) {
log_warning("Failed to read /etc/conf.d/keymaps: %s", strerror(-r));
}
#elif defined(TARGET_MANDRIVA)
#elif defined(TARGET_MANDRIVA) || defined (TARGET_MAGEIA)
if ((r = parse_env_file("/etc/sysconfig/i18n", NEWLINE,
"SYSFONT", &vc_font,
......
......@@ -23,6 +23,9 @@ After=rc-local.service
m4_ifdef(`TARGET_MANDRIVA',
After=rc-local.service
)m4_dnl
m4_ifdef(`TARGET_MAGEIA',
After=rc-local.service
)m4_dnl
Before=getty.target
[Service]
......
......@@ -24,6 +24,9 @@ After=rc-local.service
m4_ifdef(`TARGET_MANDRIVA',
After=rc-local.service
)m4_dnl
m4_ifdef(`TARGET_MAGEIA',
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
......
# 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=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
[Service]
ExecStart=/etc/X11/prefdm
Type=forking
Restart=always
RestartSec=0
......@@ -25,10 +25,13 @@ ExecStart=-/bin/bash -c "exec ${SINGLE}"',
m4_ifdef(`TARGET_MANDRIVA',
`EnvironmentFile=/etc/sysconfig/init
ExecStart=-/bin/bash -c "exec ${SINGLE}"',
m4_ifdef(`TARGET_MAGEIA',
`EnvironmentFile=/etc/sysconfig/init
ExecStart=-/bin/bash -c "exec ${SINGLE}"',
m4_ifdef(`TARGET_MEEGO',
`EnvironmentFile=/etc/sysconfig/init
ExecStart=-/bin/bash -c "exec ${SINGLE}"',
`ExecStart=-/sbin/sulogin')))
`ExecStart=-/sbin/sulogin'))))
ExecStopPost=-/bin/systemctl --fail --no-block default
StandardInput=tty-force
StandardOutput=inherit
......
......@@ -24,6 +24,9 @@ After=rc-local.service
m4_ifdef(`TARGET_MANDRIVA',
After=rc-local.service
)m4_dnl
m4_ifdef(`TARGET_MAGEIA',
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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment