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.
This commit is contained in:
Dexter Morgan 2011-10-28 19:16:33 +02:00 committed by Lennart Poettering
parent 25d6283acf
commit 6fdae8a6a4
14 changed files with 85 additions and 12 deletions

View file

@ -119,6 +119,13 @@ AM_CPPFLAGS += \
-DKBD_LOADKEYS=\"/bin/loadkeys\" \ -DKBD_LOADKEYS=\"/bin/loadkeys\" \
-DKBD_SETFONT=\"/bin/setfont\" \ -DKBD_SETFONT=\"/bin/setfont\" \
-DDEFAULT_FONT=\"latarcyrheb-sun16\" -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 endif
endif endif
@ -542,6 +549,13 @@ dist_systemunit_DATA += \
units/suse/halt-local.service units/suse/halt-local.service
endif 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 if HAVE_PLYMOUTH
dist_systemunit_DATA += \ dist_systemunit_DATA += \
units/plymouth-start.service \ units/plymouth-start.service \
@ -1999,6 +2013,23 @@ if TARGET_SUSE
$(LN_S) $(systemunitdir)/halt-local.service halt-local.service ) $(LN_S) $(systemunitdir)/halt-local.service halt-local.service )
endif 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 if HAVE_SYSV_COMPAT
( cd $(DESTDIR)$(systemunitdir)/local-fs.target.wants && \ ( cd $(DESTDIR)$(systemunitdir)/local-fs.target.wants && \
rm -f var-lock.mount && \ rm -f var-lock.mount && \

View file

@ -371,6 +371,7 @@ if test "z$with_distro" = "z"; then
test -f "/etc/mandriva-release" && with_distro="mandriva" test -f "/etc/mandriva-release" && with_distro="mandriva"
test -f "/etc/meego-release" && with_distro="meego" test -f "/etc/meego-release" && with_distro="meego"
test -f "/etc/angstrom-version" && with_distro="angstrom" 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 if test "x`lsb_release -is 2>/dev/null`" = "xUbuntu"; then
with_distro="ubuntu" with_distro="ubuntu"
fi fi
@ -458,6 +459,12 @@ case $with_distro in
AC_DEFINE(TARGET_ANGSTROM, [], [Target is Ångström]) AC_DEFINE(TARGET_ANGSTROM, [], [Target is Ångström])
M4_DEFINES=-DTARGET_ANGSTROM=1 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) 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_MANDRIVA, test x"$with_distro" = xmandriva)
AM_CONDITIONAL(TARGET_MEEGO, test x"$with_distro" = xmeego) AM_CONDITIONAL(TARGET_MEEGO, test x"$with_distro" = xmeego)
AM_CONDITIONAL(TARGET_ANGSTROM, test x"$with_distro" = xangstrom) 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_PLYMOUTH, test "$have_plymouth" = "yes")
AM_CONDITIONAL(HAVE_SYSV_COMPAT, test "$SYSTEM_SYSV_COMPAT" = "yes") AM_CONDITIONAL(HAVE_SYSV_COMPAT, test "$SYSTEM_SYSV_COMPAT" = "yes")

View file

@ -127,7 +127,7 @@ static int parse_proc_cmdline(void) {
arg_skip = true; arg_skip = true;
else if (startswith(w, "fsck.mode")) else if (startswith(w, "fsck.mode"))
log_warning("Invalid fsck.mode= parameter. Ignoring."); 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)) else if (strneq(w, "fastboot", l))
arg_skip = true; arg_skip = true;
else if (strneq(w, "forcefsck", l)) else if (strneq(w, "forcefsck", l))

View file

@ -30,7 +30,7 @@
#include "util.h" #include "util.h"
#include "log.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" #define FILENAME "/etc/sysconfig/network"
#elif defined(TARGET_SUSE) || defined(TARGET_SLACKWARE) #elif defined(TARGET_SUSE) || defined(TARGET_SLACKWARE)
#define FILENAME "/etc/HOSTNAME" #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) { 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; int r;
FILE *f; FILE *f;

View file

@ -199,7 +199,7 @@ int locale_setup(void) {
if (r != -ENOENT) if (r != -ENOENT)
log_warning("Failed to read /etc/profile.env: %s", strerror(-r)); 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 && if (r <= 0 &&
(r = parse_env_file("/etc/sysconfig/i18n", NEWLINE, (r = parse_env_file("/etc/sysconfig/i18n", NEWLINE,
"LANG", &variables[VARIABLE_LANG], "LANG", &variables[VARIABLE_LANG],

View file

@ -54,7 +54,7 @@ static int parse_proc_cmdline(void) {
arg_skip = true; arg_skip = true;
else if (startswith(w, "quotacheck.mode")) else if (startswith(w, "quotacheck.mode"))
log_warning("Invalid quotacheck.mode= parameter. Ignoring."); 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)) else if (strneq(w, "forcequotacheck", l))
arg_force = true; arg_force = true;
#endif #endif
@ -65,8 +65,8 @@ static int parse_proc_cmdline(void) {
} }
static void test_files(void) { static void test_files(void) {
#if defined(TARGET_FEDORA) || defined(TARGET_MANDRIVA) #if defined(TARGET_FEDORA) || defined(TARGET_MANDRIVA) || defined(TARGET_MAGEIA)
/* This exists only on Fedora or Mandriva */ /* This exists only on Fedora, Mandriva or Mageia */
if (access("/forcequotacheck", F_OK) >= 0) if (access("/forcequotacheck", F_OK) >= 0)
arg_force = true; arg_force = true;
#endif #endif

View file

@ -277,7 +277,8 @@ static int sysv_translate_facility(const char *name, const char *filename, char
static const char * const table[] = { static const char * const table[] = {
/* LSB defined facilities */ /* LSB defined facilities */
"local_fs", SPECIAL_LOCAL_FS_TARGET, "local_fs", SPECIAL_LOCAL_FS_TARGET,
#ifndef TARGET_MANDRIVA #if defined(TARGET_MANDRIVA) || defined(TARGET_MAGEIA)
#else
/* Due to unfortunate name selection in Mandriva, /* Due to unfortunate name selection in Mandriva,
* $network is provided by network-up which is ordered * $network is provided by network-up which is ordered
* after network which actually starts interfaces. * after network which actually starts interfaces.

View file

@ -3462,7 +3462,7 @@ finish:
static int enable_sysv_units(char **args) { static int enable_sysv_units(char **args) {
int r = 0; 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]; const char *verb = args[0];
unsigned f = 1, t = 1; unsigned f = 1, t = 1;
LookupPaths paths; LookupPaths paths;

View file

@ -160,7 +160,7 @@ int main(int argc, char **argv) {
#ifdef TARGET_GENTOO #ifdef TARGET_GENTOO
char *vc_unicode = NULL; char *vc_unicode = NULL;
#endif #endif
#ifdef TARGET_MANDRIVA #if defined(TARGET_MANDRIVA) || defined(TARGET_MAGEIA)
char *vc_keytable = NULL; char *vc_keytable = NULL;
#endif #endif
int fd = -1; 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)); 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, if ((r = parse_env_file("/etc/sysconfig/i18n", NEWLINE,
"SYSFONT", &vc_font, "SYSFONT", &vc_font,

View file

@ -23,6 +23,9 @@ After=rc-local.service
m4_ifdef(`TARGET_MANDRIVA', m4_ifdef(`TARGET_MANDRIVA',
After=rc-local.service After=rc-local.service
)m4_dnl )m4_dnl
m4_ifdef(`TARGET_MAGEIA',
After=rc-local.service
)m4_dnl
Before=getty.target Before=getty.target
[Service] [Service]

View file

@ -24,6 +24,9 @@ After=rc-local.service
m4_ifdef(`TARGET_MANDRIVA', m4_ifdef(`TARGET_MANDRIVA',
After=rc-local.service After=rc-local.service
)m4_dnl )m4_dnl
m4_ifdef(`TARGET_MAGEIA',
After=rc-local.service
)m4_dnl
# If additional gettys are spawned during boot then we should make # If additional gettys are spawned during boot then we should make
# sure that this is synchronized before getty.target, even though # sure that this is synchronized before getty.target, even though

View file

@ -0,0 +1,21 @@
# 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

View file

@ -25,10 +25,13 @@ ExecStart=-/bin/bash -c "exec ${SINGLE}"',
m4_ifdef(`TARGET_MANDRIVA', m4_ifdef(`TARGET_MANDRIVA',
`EnvironmentFile=/etc/sysconfig/init `EnvironmentFile=/etc/sysconfig/init
ExecStart=-/bin/bash -c "exec ${SINGLE}"', ExecStart=-/bin/bash -c "exec ${SINGLE}"',
m4_ifdef(`TARGET_MAGEIA',
`EnvironmentFile=/etc/sysconfig/init
ExecStart=-/bin/bash -c "exec ${SINGLE}"',
m4_ifdef(`TARGET_MEEGO', m4_ifdef(`TARGET_MEEGO',
`EnvironmentFile=/etc/sysconfig/init `EnvironmentFile=/etc/sysconfig/init
ExecStart=-/bin/bash -c "exec ${SINGLE}"', ExecStart=-/bin/bash -c "exec ${SINGLE}"',
`ExecStart=-/sbin/sulogin'))) `ExecStart=-/sbin/sulogin'))))
ExecStopPost=-/bin/systemctl --fail --no-block default ExecStopPost=-/bin/systemctl --fail --no-block default
StandardInput=tty-force StandardInput=tty-force
StandardOutput=inherit StandardOutput=inherit

View file

@ -24,6 +24,9 @@ After=rc-local.service
m4_ifdef(`TARGET_MANDRIVA', m4_ifdef(`TARGET_MANDRIVA',
After=rc-local.service After=rc-local.service
)m4_dnl )m4_dnl
m4_ifdef(`TARGET_MAGEIA',
After=rc-local.service
)m4_dnl
# If additional gettys are spawned during boot then we should make # If additional gettys are spawned during boot then we should make
# sure that this is synchronized before getty.target, even though # sure that this is synchronized before getty.target, even though