https://wiki.archlinux.org/api.php?action=feedcontributions&user=Agru&feedformat=atomArchWiki - User contributions [en]2024-03-28T09:13:25ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Iwd&diff=530898Iwd2018-07-24T19:22:20Z<p>Agru: Add info on how to enable iwd backend in NetworkManager</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Wireless networking]]<br />
[[Category:Network configuration]]<br />
[[ja:Iwd]]<br />
{{Related articles start}}<br />
{{Related|Network configuration}}<br />
{{Related|Wireless network configuration}}<br />
{{Related|WPA supplicant}}<br />
{{Related articles end}}<br />
[https://iwd.wiki.kernel.org/ IWD] (iNet wireless daemon) is a wireless daemon for Linux, written by Intel aiming to replace [[WPA supplicant]].[https://www.youtube.com/watch?v=F2Q86cphKDo] IWD works standalone or in combination with [[ConnMan]] or [[NetworkManager]].<br />
It comes with different enhancements like an own crypto-library, called ELL, which docks directly into the Linux Kernel cryptography.<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|iwd}} package.<br />
<br />
=== NetworkManager ===<br />
<br />
To enable the (experimental) {{Pkg|iwd}} backend in [[NetworkManager]] modify {{ic|/etc/NetworkManager/NetworkManager.conf}}<br />
<br />
{{hc|/etc/NetworkManager/NetworkManager.conf|2=<br />
[device]<br />
wifi.backend=iwd<br />
}}<br />
<br />
== Usage ==<br />
<br />
The {{Pkg|iwd}} package provides the client program {{ic|iwctl}}, the daemon {{ic|iwd}} and the Wi-Fi monitoring tool {{ic|iwmon}}.<br />
<br />
Once the iwd daemon is running ([[start/enable]] {{ic|iwd.service}}) you can control it using the {{ic|iwctl}} command.<br />
<br />
=== iwctl ===<br />
<br />
Running {{ic|iwctl}} gets you an interactive prompt. From now on commands that need to be run in the {{ic|iwctl}} prompt will be prefixed by {{ic|[iwd]#}}.<br />
<br />
{{Tip|In the {{ic|iwctl}} prompt you can auto-complete commands and device names by hitting {{ic|Tab}}.}}<br />
<br />
List available commands:<br />
<br />
[iwd]# help<br />
<br />
List all wifi devices:<br />
<br />
[iwd]# device list<br />
<br />
Scan for networks:<br />
<br />
[iwd]# device ''interface'' scan<br />
<br />
List networks:<br />
<br />
[iwd]# device ''interface'' get-networks<br />
<br />
Connect to a WPA2 protected network (will prompt you for the passphrase):<br />
<br />
[iwd]# device ''interface'' connect ''network_name''<br />
<br />
{{Note|<br />
* {{ic|iwd}} automatically stores network passphrases (as encrypted {{ic|PreSharedKey}}) in the {{ic|/var/lib/iwd}} directory and uses them to auto-connect in the future.<br />
* To connect to a network with spaces in the SSID, the network name should be double quoted when connecting.<br />
}}<br />
<br />
Displaying details of a WiFi device (like MAC address, state and connected network):<br />
<br />
[iwd]# device ''interface'' show<br />
<br />
List known networks:<br />
<br />
[iwd]# known-networks list<br />
<br />
Forget a known network:<br />
<br />
[iwd]# known-networks forget ''network_name''<br />
<br />
== WPA Enterprise ==<br />
<br />
=== EAP-PWD ===<br />
<br />
For connecting to a EAP-PWD protected enterprice access point you need to create a file called: {{ic|''essid''.8021x}} in the folder {{ic|/var/lib/iwd}} with the following content:<br />
<br />
{{hc|/var/lib/iwd/''essid''.8021x|2=<br />
[Security]<br />
EAP-Method=PWD<br />
EAP-Identity=''your_enterprise_email''<br />
EAP-PWD-Password=''your_password''<br />
<br />
[Settings]<br />
Autoconnect=True<br />
}}<br />
<br />
If you do not want autoconnect to the AP you can set the option to False and connect manually to the access point via {{ic|iwctl}}. The same applies to the password, if you do not want to store it plaintext leave the option out of the file and just connect to the enterprise AP.<br />
<br />
== Optional configuration ==<br />
<br />
{{Expansion|Mention what can be configured and how?}}<br />
<br />
File {{ic|/etc/iwd/main.conf}} can be used for main configuration.<br />
<br />
Directory {{ic|/var/lib/iwd}} can be used for network (SSID) configuration.<br />
<br />
=== Disable auto-connect for a particular network ===<br />
<br />
Create / edit file {{ic|/var/lib/iwd/''network''.''type''}}, where ''network'' is network SSID and ''type'' is network type i.e. one of "open", "wep", "psk", "8021x". Add the following section to it:<br />
<br />
{{hc|/var/lib/iwd/spaceship.psk (for example)|2=<nowiki><br />
[Settings]<br />
Autoconnect=false<br />
</nowiki>}}<br />
<br />
=== Deny console (local) user from modifying the settings ===<br />
<br />
By default {{ic|iwd}} D-Bus interface allows ''any'' console user to connect to {{ic|iwd}} daemon and modify the settings, even if that user is not a ''root'' user.<br />
<br />
If you do not want to allow console user to modify the settings but allow reading the status information, then create a D-Bus configuration file as follows.<br />
<br />
{{hc|/etc/dbus-1/system.d/iwd-strict.conf|2=<nowiki><br />
<!-- prevent local users from changing iwd settings, but allow<br />
reading status information. overrides some part of<br />
/usr/share/dbus-1/system.d/iwd-dbus.conf. --><br />
<br />
<!-- This configuration file specifies the required security policies<br />
for iNet Wireless Daemon to work. --><br />
<br />
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"<br />
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"><br />
<busconfig><br />
<br />
<policy at_console="true"><br />
<deny send_destination="net.connman.iwd"/><br />
<allow send_destination="net.connman.iwd" send_interface="org.freedesktop.DBus.Properties" send_member="GetAll" /><br />
<allow send_destination="net.connman.iwd" send_interface="org.freedesktop.DBus.Properties" send_member="Get" /><br />
<allow send_destination="net.connman.iwd" send_interface="org.freedesktop.DBus.ObjectManager" send_member="GetManagedObjects" /><br />
<allow send_destination="net.connman.iwd" send_interface="net.connman.iwd.Device" send_member="RegisterSignalLevelAgent" /><br />
<allow send_destination="net.connman.iwd" send_interface="net.connman.iwd.Device" send_member="UnregisterSignalLevelAgent" /><br />
</policy><br />
<br />
</busconfig><br />
</nowiki>}}<br />
<br />
{{Tip|Remove ''<allow>'' lines above to deny reading the status information as well.}}<br />
<br />
== See also ==<br />
<br />
* [https://iwd.wiki.kernel.org/gettingstarted Getting Started with iwd]<br />
* [https://git.kernel.org/pub/scm/network/wireless/iwd.git/tree/autotests More examples for Enterprise WPA]</div>Agruhttps://wiki.archlinux.org/index.php?title=VCS_package_guidelines&diff=308036VCS package guidelines2014-04-02T19:44:25Z<p>Agru: /* A sample Git PKGBUILD */</p>
<hr />
<div>[[Category:Package development]]<br />
[[it:VCS PKGBUILD Guidelines]]<br />
[[ja:VCS PKGBUILD Guidelines]]<br />
[[zh-CN:VCS PKGBUILD Guidelines]]<br />
[[zh-TW:VCS PKGBUILD Guidelines]]<br />
{{Package Guidelines}}<br />
<br />
[[Wikipedia:Revision_control|Version control systems]] can be used for retrieval of source code for both usual statically versioned packages and latest (trunk) version of a development branch. This article covers both cases.<br />
<br />
== Prototypes ==<br />
{{Warning|The prototype files provided in the {{Pkg|abs}} package and in [https://projects.archlinux.org/abs.git/tree/prototypes the ABS Git repository] are ''significantly'' out-of-date. Do ''not'' consider the prototypes to be authoritative in any way. See {{Bug|34485}}.}}<br />
<br />
The {{Pkg|abs}} package for the [[Arch Build System]] provides prototypes for [[CVS]], [[SVN]], [[Git]], [[Mercurial]], and [[Wikipedia:Darcs|Darcs]] [[PKGBUILD]]s. When {{Pkg|abs}} is installed, you can find them in {{ic|/usr/share/pacman}}. Latest versions can be found in the [https://projects.archlinux.org/abs.git/tree/prototypes prototypes directory in the ABS Git repository].<br />
<br />
== Guidelines ==<br />
<br />
* Suffix {{Ic|pkgname}} with {{Ic|-cvs}}, {{Ic|-svn}}, {{Ic|-hg}}, {{Ic|-darcs}}, {{Ic|-bzr}}, {{Ic|-git}} etc. unless the package fetches a specific release.<br />
<br />
* If the resulting package is different after changing the dependencies, URL, sources, etc. increasing the {{Ic|pkgrel}} is mandatory. Touching the {{ic|pkgver}} is not.<br />
<br />
* {{Ic|--holdver}} can be used to prevent [[makepkg]] from updating the {{ic|pkgver}} (see: [https://www.archlinux.org/pacman/makepkg.8.html makepkg(8)])<br />
<br />
* Include what the package conflicts with and provides (e.g. for {{AUR|fluxbox-git}}: {{Ic|1=conflicts=('fluxbox')}} and {{Ic|1=provides=('fluxbox')}}).<br />
<br />
* {{Ic|1=replaces=()}} generally causes unnecessary problems and should be avoided.<br />
<br />
* When using the cvsroot, use {{Ic|anonymous:@}} rather than {{Ic|anonymous@}} to avoid having to enter a blank password or {{Ic|anonymous:password@}}, if one is required.<br />
<br />
* Include the appropriate VCS tool in {{Ic|1=makedepends=()}} ({{pkg|cvs}}, {{pkg|subversion}}, {{pkg|git}}, ...).<br />
<br />
=== VCS sources ===<br />
{{Note|Pacman 4.1 supports the following VCS sources: {{ic|bzr}}, {{ic|git}}, {{ic|hg}} and {{ic|svn}}. See the {{ic|fragment}} section of {{ic|man PKGBUILD}} or [https://www.archlinux.org/pacman/PKGBUILD.5.html PKGBUILD(5)] for a list of supported VCS.}}<br />
<br />
Starting with {{Pkg|pacman}} 4.1, the VCS sources should be specified in the {{ic|1=source=()}} array and will be treated like any other source. {{ic|makepkg}} will clone/checkout/branch the repo into {{ic|$SRCDEST}} (same as {{ic|$startdir}} if not set in [https://www.archlinux.org/pacman/makepkg.conf.5.html makepkg.conf(5)]) and copy it to {{ic|$srcdir}} (in a specific way to each VCS). The local repo is left untouched, thus invalidating the need for a {{ic|-build}} directory.<br />
<br />
The general format of a VCS {{ic|1=source=()}} array is:<br />
source=('[folder::][vcs+]url[#fragment]')<br />
<br />
* {{ic|folder}} (optional) is used to change the default repo name to something more relevant (e.g. than {{ic|trunk}}) or to preserve the previous sources<br />
* {{ic|vcs+}} is needed for URLs that do not reflect the VCS type, e.g. {{ic|git+http://some_repo}}.<br />
* {{ic|url}} is the URL to the distant or local repo<br />
* {{ic|#fragment}} (optional) is needed to pull a specific branch or commit. See {{ic|man PKGBUILD}} for more information on the fragments available for each VCS.<br />
<br />
An example Git source array:<br />
source=('project_name::git+http://project_url#branch=project_branch')<br />
<br />
=== The pkgver() function ===<br />
The {{ic|pkgver}} autobump is now achieved via a dedicated {{ic|pkgver()}} function. This allows for better control over the {{ic|pkgver}}, and maintainers should favor a {{ic|pkgver}} that makes sense.<br />
<br />
It is recommended to have following version format: ''RELEASE.rREVISION'' where ''REVISION'' is a monotonically increasing number that uniquely identifies the source tree (VCS revisions do this). The last VCS tag can be used for ''RELEASE''. If there are no public releases and no repository tags then zero could be used as a release number or you can drop ''RELEASE'' completely and use version number that looks like ''rREVISION''. If there are public releases but repo has no tags then developer should get the release version somehow e.g. by parsing the project files.<br />
<br />
Following are some examples showing the ''intended'' output:<br />
<br />
==== Git ====<br />
<br />
Using the most recent annotated tag reachable from the last commit:<br />
<br />
{{hc|<nowiki>pkgver() {<br />
cd "$srcdir/repo"<br />
git describe --long | sed -r 's/([^-]*-g)/r\1/;s/-/./g'<br />
}</nowiki>|<br />
2.0.r6.ga17a017<br />
}}<br />
<br />
Using the most recent unannotated tag reachable from the last commit:<br />
<br />
{{hc|<nowiki>pkgver() {<br />
cd "$srcdir/repo"<br />
git describe --long --tags | sed -r 's/([^-]*-g)/r\1/;s/-/./g'<br />
}</nowiki>|<br />
0.71.r115.gd95ee07<br />
}}<br />
<br />
In case if the git tag does not contain dashes then one can use simpler sed expression {{ic|sed 's/-/.r/; s/-/./'}}.<br />
<br />
If tag contains a prefix, like {{ic|v}} or project name then it should be cut off:<br />
<br />
{{hc|<nowiki>pkgver() {<br />
cd "$srcdir/repo"<br />
# cutting off 'foo-' prefix that presents in the git tag<br />
git describe --long | sed -r 's/^foo-//;s/([^-]*-g)/r\1/;s/-/./g'<br />
}</nowiki>|<br />
6.1.r3.gd77e105<br />
}}<br />
<br />
If there are no tags then use number of revisions since beginning of the history:<br />
<br />
{{hc|<nowiki>pkgver() {<br />
cd "$srcdir/repo"<br />
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"<br />
}</nowiki>|<br />
r1142.a17a017<br />
}}<br />
<br />
{{Note|SHA1 (in this case {{ic|a17a017}}) is not used in the version comparison and can be omitted, although it allows quick identification of the exact revision used and might be useful during debugging.}}<br />
<br />
==== Subversion ====<br />
{{hc|<nowiki>pkgver() {<br />
cd "$srcdir/repo"<br />
local ver="$(svnversion)"<br />
printf "r%s" "${ver//[[:alpha:]]}"<br />
}</nowiki>|<br />
r8546<br />
}}<br />
<br />
{{Note|If the project has releases you should use them instead of the {{ic|0.}}.}}<br />
<br />
==== Mercurial ====<br />
{{hc|<nowiki>pkgver() {<br />
cd "$srcdir/repo"<br />
printf "r%s.%s" "$(hg identify -n)" "$(hg identify -i)"<br />
}</nowiki>|<br />
r2813.75881cc5391e<br />
}}<br />
<br />
==== Bazaar ====<br />
{{hc|<nowiki>pkgver() {<br />
cd "$srcdir/repo"<br />
printf "r%s" "$(bzr revno)"<br />
}</nowiki>|<br />
r830<br />
}}<br />
<br />
==== Fallback ====<br />
The current date can be used, in case no satisfactory {{ic|pkgver}} can be extracted from the repository:<br />
<br />
{{hc|<nowiki>pkgver() {<br />
date +%Y%m%d<br />
}</nowiki>|<br />
20130408<br />
}}<br />
<br />
Although it does not identify source tree state uniquely, so avoid it if possible.<br />
<br />
== Tips ==<br />
<br />
=== A sample Git PKGBUILD ===<br />
# Maintainer: Dave Reisner <d@falconindy.com> <br />
# Contributor: William Giokas (KaiSforza) <1007380@gmail.com><br />
<br />
pkgname=expac-git<br />
pkgver=0.0.0<br />
pkgrel=1<br />
pkgdesc="Pacman database extraction utility"<br />
arch=('i686' 'x86_64')<br />
url="https://github.com/falconindy/expac"<br />
license=('MIT')<br />
depends=('pacman')<br />
makedepends=('git')<br />
conflicts=('expac')<br />
provides=('expac')<br />
# The git repo is detected by the 'git:' or 'git+' beginning.<br />
#source=('git+https://github.com/falconindy/expac.git'<br />
# The repo is cloned into '$pkgname' (optional).<br />
source=("$pkgname"::'git://github.com/falconindy/expac.git'<br />
'expac_icon.png')<br />
# To check out a specific branch use #branch=<branch>:<br />
#source=('git+https://github.com/falconindy/expac.git#branch=master'<br />
# Because the sources are not static, skip Git checksum:<br />
md5sums=('SKIP'<br />
'020c36e38466b68cbc7b3f93e2044b49')<br />
<br />
pkgver() {<br />
cd "$srcdir/$pkgname"<br />
# Use the tag of the last commit<br />
git describe --long | sed -E 's/([^-]*-g)/r\1/;s/-/./g'<br />
}<br />
<br />
build() {<br />
cd "$srcdir/$pkgname"<br />
make<br />
}<br />
<br />
package() {<br />
cd "$srcdir/$pkgname"<br />
make PREFIX=/usr DESTDIR="$pkgdir" install<br />
install -Dm644 "$srcdir/expac_icon.png" "$pkgdir/usr/share/pixmaps/expac.png"<br />
}<br />
<br />
=== Git Submodules ===<br />
Git submodules are a little tricky to do. The idea is to add the URLs of the submodules themselves directly to the sources array and then reference them during prepare(). This could look like this:<br />
<br />
source=("git://somewhere.org/something/something.git"<br />
"git://somewhere.org/mysubmodule/mysubmodule.git")<br />
<br />
prepare() {<br />
cd something<br />
git submodule init<br />
git config submodule.mysubmodule.url $srcdir/mysubmodule<br />
git submodule update<br />
}</div>Agru