Coscup 2012-urfkill

16
urfkill daemon introduction August 18, 2012, Taipei Joey Lee SUSE Lab

Transcript of Coscup 2012-urfkill

Page 1: Coscup 2012-urfkill

urfkill daemon introductionAugust 18, 2012, Taipei

Joey LeeSUSE Lab

Page 2: Coscup 2012-urfkill

2

Agenda

• Introduce rfkill

• Trap of rfkill control

• Introduce urfkill daemon

Functions

Architecture

• Q&A

Page 3: Coscup 2012-urfkill

Introduce rfkill

Page 4: Coscup 2012-urfkill

4

rfkill

• rfkill is a RF switch subsystem in Network subsystem in Linux Kernel

code path: net/rfkill

• Kernel Doc: Documentation/rfkill.txt Documentation/ABI/stable/sysfs-class-rfkill Documentation/ABI/obsolete/sysfs-class-rfkill

• In Documentation/rfkill.txt The rfkill subsystem provides a generic interface to disabling any

radio transmitter in the system. When a transmitter is blocked, it shall not radiate any power.

Page 5: Coscup 2012-urfkill

5

states of rfkill

• unblock

Transmitter is (potentially) active

• hard block:

Transmitter is forced off by something outside of the drivers control.

Read-only radio block that can not be overriden by software.

• soft block:

Transmitter is turned off by software

Writable radio block (need not be readable) that is set by the system software.

• Interface to user space

/dev/rfkill

/sys/class/rfkill/rfkill[0-9]+/state

Page 6: Coscup 2012-urfkill

Trap of rfkill control

Page 7: Coscup 2012-urfkill

7

Not only one layer touch rfkill state

• Hardware

Hardware switch, button

• BIOS/EC

BIOS option, Fn+F? function key

• Linux Kernel

rfkill-input

platform driver

• User space

HAL

NetworkManager, Gnome-bluetooth

urfkill

Page 8: Coscup 2012-urfkill

8

Whole picture

• rfkill is a RF switch subsystem in Second-level bullet (20 pt) Third-level bullet (16pt)

Fourth-level bullet (14pt)

Page 9: Coscup 2012-urfkill

Introduce urfkill daemon

Page 10: Coscup 2012-urfkill

10

urfkill

• Main page

http://www.freedesktop.org/wiki/Software/urfkill/

For the laptop and mobile devices users, the management of the radio killswitches is important for the connectivity and power consumption. HAL used to take care of this job, but it is now deprecated. The urfkill project is created to fill the gap and to provide more flexible configuration for the rfkill-related function keys.

• The latest release is 0.4.0

https://github.com/lcp/urfkill

• Founder/Maintainer: [email protected]

• Installation: zypper in urfkill

• [RFC] propose to develop a rfkill daemon on freedesktop:

http://www.mail-archive.com/[email protected]/msg00832.html

Page 11: Coscup 2012-urfkill

11

Functions

• Broadcast rfkill state changed event to DBus for registered userland applications.

• Provide DBus interface for userland applications to block/unblock rfkill.

liburfkill-glib: provide Gobjects binding

• Use PolicyKit for system-wide privileges.

• Send RFKILL_IOCTL_NOINPUT by ioctl to disable rfkill-input function.

c64fb01627e24725d1f9d535e4426475a4415753 http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=c64fb01627e24725d1f9d535e4426475a4415753

Page 12: Coscup 2012-urfkill

12

Configuration

• /etc/urfkill/urfkill.conf

key_control=true

# This variable is to enable/disable the key control function

master_key=false

# A master key is a key that controls all killswitches

force_sync=false

# This variable is to enable/disable the key control function

• /etc/urfkill/profile/*.xml (10-asus-settings.xml, 10-lenovo-settings.xml)

<match key="sys_vendor" contains_ncase="asus">

<match key="product_name" string="1005HA">

<option key="key_control" type="bool">true</option>

<option key="master_key" type="bool">true</option>

<option key="force_sync" type="bool">false</option>

</match>

</match>

Page 13: Coscup 2012-urfkill

13

Software Architecture

Page 14: Coscup 2012-urfkill

Thank you.

14

Welcome to join us!

www.opensuse.org

Page 15: Coscup 2012-urfkill

Corporate HeadquartersMaxfeldstrasse 590409 NurembergGermany

+49 911 740 53 0 (Worldwide)www.suse.com

Join us on:www.opensuse.org

15

Page 16: Coscup 2012-urfkill

Unpublished Work of SUSE. All Rights Reserved.This work is an unpublished work and contains confidential, proprietary and trade secret information of SUSE. Access to this work is restricted to SUSE employees who have a need to know to perform tasks within the scope of their assignments. No part of this work may be practiced, performed, copied, distributed, revised, modified, translated, abridged, condensed, expanded, collected, or adapted without the prior written consent of SUSE. Any use or exploitation of this work without authorization could subject the perpetrator to criminal and civil liability.

General DisclaimerThis document is not to be construed as a promise by any participating company to develop, deliver, or market a product. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. SUSE makes no representations or warranties with respect to the contents of this document, and specifically disclaims any express or implied warranties of merchantability or fitness for any particular purpose. The development, release, and timing of features or functionality described for SUSE products remains at the sole discretion of SUSE. Further, SUSE reserves the right to revise this document and to make changes to its content, at any time, without obligation to notify any person or entity of such revisions or changes. All SUSE marks referenced in this presentation are trademarks or registered trademarks of Novell, Inc. in the United States and other countries. All third-party trademarks are the property of their respective owners.