Browse Source

Add a patched version of connman

master
PapaTutuWawa 11 months ago
parent
commit
2e08ea82c7
  1. 1
      .gitignore
  2. 74
      connman/0000-add-writeresolvconf-setting.patch
  3. 64
      connman/PKGBUILD
  4. 12
      connman/allow_group_network.diff

1
.gitignore

@ -8,6 +8,7 @@
*/**/*.pkg.tar.zst
*/**/*.asc
*/**/.SRCINFO
*/**/*.sign
# Only allow PKGBUILDS and patch files
#!*/PKGBUILD

74
connman/0000-add-writeresolvconf-setting.patch

@ -0,0 +1,74 @@
diff --git a/src/main.c b/src/main.c
index 94afc1d9..a18e02b2 100644
--- a/src/main.c
+++ b/src/main.c
@@ -91,6 +91,7 @@ static struct {
bool auto_connect_roaming_services;
bool acd;
bool use_gateways_as_timeservers;
+ bool write_resolv_conf;
} connman_settings = {
.bg_scan = true,
.pref_timeservers = NULL,
@@ -113,6 +114,7 @@ static struct {
.auto_connect_roaming_services = false,
.acd = false,
.use_gateways_as_timeservers = false,
+ .write_resolv_conf = true,
};
#define CONF_BG_SCAN "BackgroundScanning"
@@ -136,6 +138,7 @@ static struct {
#define CONF_AUTO_CONNECT_ROAMING_SERVICES "AutoConnectRoamingServices"
#define CONF_ACD "AddressConflictDetection"
#define CONF_USE_GATEWAYS_AS_TIMESERVERS "UseGatewaysAsTimeservers"
+#define CONF_WRITE_RESOLV_CONF "WriteResolvConf"
static const char *supported_options[] = {
CONF_BG_SCAN,
@@ -159,6 +162,7 @@ static const char *supported_options[] = {
CONF_AUTO_CONNECT_ROAMING_SERVICES,
CONF_ACD,
CONF_USE_GATEWAYS_AS_TIMESERVERS,
+ CONF_WRITE_RESOLV_CONF,
NULL
};
@@ -477,6 +481,13 @@ static void parse_config(GKeyFile *config)
connman_settings.use_gateways_as_timeservers = boolean;
g_clear_error(&error);
+
+ boolean = __connman_config_get_bool(config, "General",
+ CONF_WRITE_RESOLV_CONF, &error);
+ if (!error)
+ connman_settings.write_resolv_conf = boolean;
+
+ g_clear_error(&error);
}
static int config_init(const char *file)
@@ -696,6 +707,9 @@ bool connman_setting_get_bool(const char *key)
if (g_str_equal(key, CONF_USE_GATEWAYS_AS_TIMESERVERS))
return connman_settings.use_gateways_as_timeservers;
+ if (g_str_equal(key, CONF_WRITE_RESOLV_CONF))
+ return connman_settings.write_resolv_conf;
+
return false;
}
diff --git a/src/resolver.c b/src/resolver.c
index 618353fd..48f8c6b1 100644
--- a/src/resolver.c
+++ b/src/resolver.c
@@ -104,6 +104,9 @@ static int resolvfile_export(void)
unsigned int count;
mode_t old_umask;
+ if (!connman_setting_get_bool("WriteResolvConf"))
+ return 0;
+
content = g_string_new("# Generated by Connection Manager\n");
/*

64
connman/PKGBUILD

@ -0,0 +1,64 @@
# Maintainer : Christian Rebischke <Chris.Rebischke[at]archlinux[dot]org>
# Contributor: Daniel Wallace <danielwallace at gtmanfred dot com>
# Contributor: Lucas De Marchi <lucas.de.marchi@gmail.com>
pkgname=connman
pkgver=1.38
pkgrel=1
pkgdesc="Intel's modular network connection manager"
url="https://01.org/connman"
arch=('x86_64')
license=('GPL2')
makedepends=('bluez' 'wpa_supplicant' 'openconnect' 'openvpn' 'ppp' 'iwd')
depends=('dbus' 'iptables' 'gnutls' 'glib2')
backup=('etc/connman/main.conf')
optdepends=('bluez: Support for Bluetooth devices'
'wpa_supplicant: for WiFi devices'
'pptpclient: for ppp support'
'openvpn: for VPN Support'
'iwd: for WiFi devices')
source=("${pkgname}-${pkgver}.tar.xz::https://www.kernel.org/pub/linux/network/${pkgname}/${pkgname}-${pkgver}.tar.xz"
"${pkgname}-${pkgver}.tar.sign::https://www.kernel.org/pub/linux/network/${pkgname}/${pkgname}-${pkgver}.tar.sign"
'allow_group_network.diff'
'0000-add-writeresolvconf-setting.patch')
sha512sums=('9c8f77c4dd62763ccb9ea5cc5d285a8a1c51bb09a82eafc73246231557a4f627ae1e5e4a9df5e104457390ebba643349d7d67800a4ee4c17c6dceff192afe8d4'
'SKIP'
'06dd5867d460f1c3cf6c359e650ca2ef24495493a99cd03dbd17f23e587e9066d9bc98758d85d5c690d1ae21fa77ad8da5e2fa83d0b52c95d7a535784c5c4964'
'45cb9c56ca89fab58f64a07b13c36d6a1a246417058047ec64406be9607562dffb8984e6a131760654505b51f48a4e5c4f878dc37297c5679f75e7ccd36e6457')
validpgpkeys=('E932D120BC2AEC444E558F0106CA9F5D1DCF2659')
prepare(){
cd "${pkgname}-${pkgver}"
patch -Np1 -i "${srcdir}/allow_group_network.diff"
patch -Np1 -i "${srcdir}/0000-add-writeresolvconf-setting.patch"
}
build() {
cd "${pkgname}-${pkgver}"
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
--bindir=/usr/bin \
--sbindir=/usr/bin \
--with-systemdunitdir=/usr/lib/systemd/system \
--enable-pptp \
--enable-openconnect \
--enable-vpnc \
--enable-openvpn \
--enable-polkit \
--enable-client \
--enable-nmcompat \
--enable-test \
--enable-pie \
--enable-iwd
make
}
package() {
make -C "${pkgname}-${pkgver}" DESTDIR="${pkgdir}" install
install -Dm755 "${srcdir}/${pkgname}-${pkgver}/client/${pkgname}ctl" "${pkgdir}/usr/bin/${pkgname}ctl"
install -Dm644 "${srcdir}/${pkgname}-${pkgver}/src/main.conf" "${pkgdir}/etc/connman/main.conf"
find "${pkgdir}/usr" -name \*.service -exec sed -i 's/s\(bin\)/\1/' {} +
# See FS#48044
sed -i 's/ProtectSystem=full/ProtectSystem=true/' "${pkgdir}"/usr/lib/systemd/system/connman.service
rm -r "${pkgdir}"/usr/lib/tmpfiles.d
}

12
connman/allow_group_network.diff

@ -0,0 +1,12 @@
--- a/src/connman-polkit.conf 2010-11-05 12:09:04.285423955 -0200
+++ b/src/connman-polkit.conf 2010-11-05 12:10:53.041423934 -0200
@@ -5,6 +5,9 @@
<allow own="net.connman"/>
<allow send_interface="net.connman.Agent"/>
</policy>
+ <policy group="network">
+ <allow send_interface="net.connman.Agent"/>
+ </policy>
<policy context="default">
<allow send_destination="net.connman"/>
</policy>
Loading…
Cancel
Save