diff options
author | Parabola <dev@list.parabolagnulinux.org> | 2011-04-05 14:26:38 +0000 |
---|---|---|
committer | Parabola <dev@list.parabolagnulinux.org> | 2011-04-05 14:26:38 +0000 |
commit | 415856bdd4f48ab4f2732996f0bae58595092bbe (patch) | |
tree | ede2018b591f6dfb477fe9341ba17b9bc000fab9 /core/rfkill |
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'core/rfkill')
-rw-r--r-- | core/rfkill/60-rfkill.rules | 1 | ||||
-rw-r--r-- | core/rfkill/PKGBUILD | 38 | ||||
-rw-r--r-- | core/rfkill/rfkill.conf.d | 20 | ||||
-rwxr-xr-x | core/rfkill/rfkill.rc.d | 38 |
4 files changed, 97 insertions, 0 deletions
diff --git a/core/rfkill/60-rfkill.rules b/core/rfkill/60-rfkill.rules new file mode 100644 index 000000000..bc98a3bef --- /dev/null +++ b/core/rfkill/60-rfkill.rules @@ -0,0 +1 @@ +KERNEL=="rfkill", GROUP="rfkill", MODE="0664" diff --git a/core/rfkill/PKGBUILD b/core/rfkill/PKGBUILD new file mode 100644 index 000000000..bf8259e65 --- /dev/null +++ b/core/rfkill/PKGBUILD @@ -0,0 +1,38 @@ +# $Id: PKGBUILD 109452 2011-02-09 18:22:15Z stephane $ +# Maintainer: Thomas Bächler <thomas@archlinux.org> +# Contributor: Giovanni Scafora <giovanni@archlinux.org> + +pkgname=rfkill +pkgver=0.4 +pkgrel=2 +pkgdesc="A tool for enabling and disabling wireless devices" +arch=('i686' 'x86_64') +url="http://linuxwireless.org/en/users/Documentation/rfkill" +license=('custom') +depends=('glibc' 'filesystem>=2010.01') +source=(http://wireless.kernel.org/download/${pkgname}/${pkgname}-${pkgver}.tar.bz2 + 60-rfkill.rules + rfkill.conf.d + rfkill.rc.d) +backup=(etc/conf.d/rfkill) +md5sums=('727892c0fb35c80ee3849fbe89b45350' + '63f9bf9264911242e430867a41e8918c' + '398e7cadf023e05e3e0c323aa33575b9' + '793f0510e26547eb2632efce7d16e50e') + +build() { + cd "${srcdir}/${pkgname}-${pkgver}" + make +} + +package() { + cd "${srcdir}/${pkgname}-${pkgver}" + make DESTDIR="${pkgdir}" install + # License + install -Dm644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + # Udev rule + install -Dm644 "${srcdir}/60-rfkill.rules" "${pkgdir}/lib/udev/rules.d/60-rfkill.rules" + # Init script + install -Dm644 "${srcdir}/rfkill.conf.d" "${pkgdir}/etc/conf.d/rfkill" + install -Dm755 "${srcdir}/rfkill.rc.d" "${pkgdir}/etc/rc.d/rfkill" +} diff --git a/core/rfkill/rfkill.conf.d b/core/rfkill/rfkill.conf.d new file mode 100644 index 000000000..4483da26c --- /dev/null +++ b/core/rfkill/rfkill.conf.d @@ -0,0 +1,20 @@ +# +# /etc/conf.d/rfkill +# Configuration for the rfkill startup script +# + +# List of devices to block on startup (space-separated) +RFKILL_BLOCK="" + +# List of devices to unblock on startup (space-separated) +RFKILL_UNBLOCK="all" + +# Supported device names are: all, wifi, bluetooth, umb, wimax, wwan, gps and specific device names like phy0, hci0, ... +# See "rfkill list" for available devices +# Examples: +# +# Block all bluetooth devices: +# RFKILL_BLOCK="bluetooth" +# +# Unblock the phy0 wifi device and all wwan devices: +# RFKILL_UNBLOCK="phy0 wwan" diff --git a/core/rfkill/rfkill.rc.d b/core/rfkill/rfkill.rc.d new file mode 100755 index 000000000..ce90ee150 --- /dev/null +++ b/core/rfkill/rfkill.rc.d @@ -0,0 +1,38 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions +. /etc/conf.d/rfkill + +case "$1" in + start) + for device in ${RFKILL_BLOCK}; do + stat_busy "Blocking rfkill device: ${device}" + /usr/sbin/rfkill block ${device} + if [ $? -eq 0 ]; then + stat_done + else + stat_fail + fi + done + for device in ${RFKILL_UNBLOCK}; do + stat_busy "Unblocking rfkill device: ${device}" + /usr/sbin/rfkill unblock ${device} + if [ $? -eq 0 ]; then + stat_done + else + stat_fail + fi + done + ;; + stop) + ;; + restart) + $0 start + ;; + *) + echo "usage: $0 {start}" + exit 1 + ;; +esac +exit 0 |