backends: add Linux From Scratch (LFS) support (bgo #679202)

This commit is contained in:
Armin K
2012-07-02 12:31:32 +02:00
committed by Jiří Klimeš
parent a26ea1acc4
commit b37ed68e18
3 changed files with 62 additions and 2 deletions

View File

@@ -107,7 +107,7 @@ dnl Make sha1.c happy on big endian systems
dnl
AC_C_BIGENDIAN
AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO], [Specify the Linux distribution to target: One of redhat, suse, gentoo, debian, arch, slackware, paldo, mandriva, pardus, linexa or exherbo]))
AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO], [Specify the Linux distribution to target: One of redhat, suse, gentoo, debian, arch, slackware, paldo, mandriva, pardus, linexa, exherbo or lfs]))
if test "z$with_distro" = "z"; then
AC_CHECK_FILE(/etc/redhat-release,with_distro="redhat")
AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse")
@@ -121,6 +121,7 @@ if test "z$with_distro" = "z"; then
AC_CHECK_FILE(/etc/pardus-release,with_distro="pardus")
AC_CHECK_FILE(/etc/linexa-release,with_distro="linexa")
AC_CHECK_FILE(/etc/exherbo-release,with_distro="exherbo")
AC_CHECK_FILE(/etc/lfs-release,with_distro="lfs")
if test "z$with_distro" = "z"; then
with_distro=`lsb_release -is`
fi
@@ -132,7 +133,7 @@ if test "z$with_distro" = "z"; then
exit 1
else
case $with_distro in
redhat|suse|gentoo|debian|slackware|arch|paldo|frugalware|mandriva|pardus|linexa|exherbo|generic) ;;
redhat|suse|gentoo|debian|slackware|arch|paldo|frugalware|mandriva|pardus|linexa|exherbo|lfs|generic) ;;
*)
echo "Your distribution (${with_distro}) is not yet supported! (patches welcome)"
exit 1
@@ -205,6 +206,11 @@ if test x"$with_distro" = xexherbo; then
AC_DEFINE(TARGET_EXHERBO, 1, [Define if you have Exherbo])
fi
AM_CONDITIONAL(TARGET_LFS, test x"$with_distro" = xlfs)
if test x"$with_distro" = xlfs; then
AC_DEFINE(TARGET_LFS, 1, [Define if you have Linux From Scratch])
fi
dnl
dnl Distribution version string
dnl

View File

@@ -64,6 +64,10 @@ if TARGET_EXHERBO
libnmbackend_la_SOURCES += NetworkManagerExherbo.c
endif
if TARGET_LFS
libnmbackend_la_SOURCES += NetworkManagerLFS.c
endif
libnmbackend_la_LIBADD += \
$(top_builddir)/src/logging/libnm-logging.la \
$(LIBNL_LIBS) \

View File

@@ -0,0 +1,50 @@
/* NetworkManager -- Network link manager
*
* Backend implementation for the Linux From Scratch http://www.linuxfromscratch.org/
*
* Wayne Blaszczyk <wblaszcz@bigpond.net.au>
* Armin K. <krejzi@email.com>
*
* Heavily based on NetworkManagerRedhat.c by Dan Williams <dcbw@redhat.com>
*
* This program 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* (C) Copyright 2004 Tom Parker
* (C) Copyright 2004 Matthew Garrett
* (C) Copyright 2004 - 2012 Red Hat, Inc.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "NetworkManagerGeneric.h"
#include "NetworkManagerUtils.h"
void nm_backend_enable_loopback (void)
{
nm_generic_enable_loopback ();
}
void nm_backend_update_dns (void)
{
if (g_file_test("/var/run/nscd/nscd.pid", G_FILE_TEST_EXISTS))
nm_spawn_process ("/usr/sbin/nscd -i hosts");
}
int nm_backend_ipv6_use_tempaddr (void)
{
return nm_generic_ipv6_use_tempaddr ();
}