https://wiki.archlinux.org/api.php?action=feedcontributions&user=Markg85&feedformat=atomArchWiki - User contributions [en]2024-03-29T05:41:49ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Avahi&diff=690870Avahi2021-08-05T11:11:54Z<p>Markg85: Add ping troubleshooting.</p>
<hr />
<div>[[Category:Multicast DNS]]<br />
[[fr:Avahi]]<br />
[[ja:Avahi]]<br />
From [[Wikipedia:Avahi (software)]]:<br />
:[https://avahi.org/ Avahi] is a free [[Wikipedia:Zero-configuration networking|Zero-configuration networking]] (zeroconf) implementation, including a system for multicast DNS/DNS-SD service discovery. It allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example you can plug into a network and instantly find printers to print to, files to look at and people to talk to. It is licensed under the GNU Lesser General Public License (LGPL).<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|avahi}} package.<br />
<br />
You can manage the Avahi daemon with {{ic|avahi-daemon.service}} [[systemd#Using units|using systemd]].<br />
<br />
{{Note|[[systemd-resolved]] has a built-in multicast DNS service, make sure to disable systemd-resolved's mDNS resolver/responder (refer to {{man|5|resolved.conf}}) or [[disable]] {{ic|systemd-resolved.service}} entirely before using Avahi.}}<br />
<br />
== Using Avahi ==<br />
<br />
=== Hostname resolution ===<br />
<br />
Avahi provides local hostname resolution using a "''hostname''.local" naming scheme. To enable it, install the {{Pkg|nss-mdns}} package and [[start]] {{ic|avahi-daemon.service}}.<br />
<br />
Then, edit the file {{ic|/etc/nsswitch.conf}} and change the {{ic|hosts}} line to include {{ic|1=mdns_minimal [NOTFOUND=return]}} before {{ic|resolve}} and {{ic|dns}}:<br />
<br />
hosts: ... '''mdns_minimal [NOTFOUND=return]''' resolve [!UNAVAIL=return] dns ...<br />
<br />
{{Note|<br />
* If you experience slowdowns in resolving {{ic|.local}} hosts try to use {{ic|mdns4_minimal}} instead of {{ic|mdns_minimal}}.<br />
* The line above makes {{ic|nss-mdns}} authoritative for the {{ic|.local}} domain, unless your unicast DNS server responds to {{ic|SOA}} queries for the top level {{ic|local}} name, or if the request has more than two labels. See {{ic|nss-mdns}} [https://github.com/lathiat/nss-mdns/blob/master/README.md#activation activation notes].<br />
}}<br />
<br />
==== Configuring mDNS for custom TLD ====<br />
<br />
The {{ic|mdns_minimal}} module handles queries for the {{ic|.local}} TLD only. Note the {{ic|<nowiki>[NOTFOUND=return]</nowiki>}}, which specifies that if {{ic|mdns_minimal}} cannot find {{ic|*.local}}, it will not continue to search for it in {{ic|dns}}, {{ic|myhostname}}, etc.<br />
<br />
In case you want Avahi to support other TLDs, you should:<br />
<br />
* replace {{ic|1=mdns_minimal [NOTFOUND=return]}} with the full {{ic|mdns}} module. There also are IPv4-only and IPv6-only modules {{ic|mdns[46](_minimal)}}<br />
* customize {{ic|/etc/avahi/avahi-daemon.conf}} with the {{ic|domain-name}} of your choice<br />
* whitelist Avahi custom TLDs in {{ic|/etc/mdns.allow}}<br />
<br />
==== Tools ====<br />
<br />
Avahi includes several utilities which help you discover the services running on a network. For example, run<br />
<br />
$ avahi-browse --all --ignore-local --resolve --terminate<br />
<br />
to discover services in your network.<br />
<br />
The Avahi Zeroconf Browser ({{ic|avahi-discover}} – note that it needs Avahi's optional dependencies {{Pkg|gtk3}}, {{Pkg|dbus-python}} and {{Pkg|python-gobject}}) shows the various services on your network. You can also browse SSH and VNC Servers using {{ic|bssh}} and {{ic|bvnc}} respectively.<br />
<br />
=== Firewall ===<br />
<br />
Be sure to open UDP port {{ic|5353}} if you are using a [[firewall]].<br />
<br />
=== Link-Local (Bonjour/Zeroconf) chat ===<br />
<br />
Avahi can be used for Bonjour protocol support under Linux. Check [[Wikipedia:Comparison of instant messaging clients]] or [[List of applications#Instant messaging clients]] for a list of clients supporting the Bonjour protocol.<br />
<br />
=== Obtaining IPv4LL IP address ===<br />
<br />
{{Merge|dhcpcd|should be merged into the main page}}<br />
<br />
By default, if you are getting IP using DHCP, you are using the {{Pkg|dhcpcd}} package. It can attempt to obtain an IPv4LL address if it failed to get one via DHCP. By default this option is disabled. To enable it, comment noipv4ll string:<br />
<br />
{{hc|/etc/dhcpcd.conf|<br />
...<br />
#noipv4ll<br />
...}}<br />
<br />
Alternatively, run {{ic|avahi-autoipd}}:<br />
<br />
# avahi-autoipd -D<br />
<br />
== Adding services ==<br />
<br />
Avahi advertises the services whose {{ic|*.service}} files are found in {{ic|/etc/avahi/services}}. Files in this directory must be readable by the {{ic|avahi}} user/group.<br />
<br />
If you want to advertise a service for which there is no {{ic|*.service}} file, it is very easy to create your own.<br />
As an example, let us say you wanted to advertise a quote of the day (QOTD) service operating per RFC 865 on TCP port {{ic|17}} which you are running on your machine<br />
<br />
The first thing to do is to determine the {{ic|<type>}}. {{man|5|avahi.service}} indicates that the type should be "the DNS-SD service type for this service. e.g. '_http._tcp'". Since the [http://www.dns-sd.org/ServiceTypes.html DNS-SD register was merged into the IANA register in 2010], we look for the service name on the [https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml IANA register] or in {{ic|/etc/services}} file. The service name shown there is {{ic|qotd}}. Since we are running QOTD on tcp, we now know the service is {{ic|_qotd._tcp}} and the port (per IANA and RFC 865) is {{ic|17}}.<br />
<br />
Our service file is thus:<br />
<br />
{{hc|qotd.service|<nowiki><br />
<?xml version="1.0" standalone='no'?><!--*-nxml-*--><br />
<!DOCTYPE service-group SYSTEM "avahi-service.dtd"><br />
<br />
<service-group><br />
<br />
<name replace-wildcards="yes">%h</name><br />
<br />
<service><br />
<type>_qotd._tcp</type><br />
<port>17</port><br />
</service><br />
<br />
</service-group><br />
</nowiki>}}<br />
<br />
For more complicated scenarios, such as advertising services running on a different server, DNS sub-types and so on, consult {{man|5|avahi.service}}.<br />
<br />
=== SSH ===<br />
<br />
Avahi comes with an example service file to advertise an SSH server. To enable it:<br />
<br />
# cp /usr/share/doc/avahi/ssh.service /etc/avahi/services/<br />
<br />
=== File sharing ===<br />
<br />
==== NFS ====<br />
<br />
If you have an [[NFS]] share set up, you can use Avahi to be able to automount them in Zeroconf-enabled browsers (such as Konqueror on KDE and Finder on macOS) or file managers such as [[GNOME/Files]].<br />
<br />
Create a {{ic|.service}} file in {{ic|/etc/avahi/services}} with the following contents:<br />
<br />
{{hc|/etc/avahi/services/nfs_Zephyrus_Music.service|<nowiki><br />
<?xml version="1.0" standalone='no'?><br />
<!DOCTYPE service-group SYSTEM "avahi-service.dtd"><br />
<service-group><br />
<name replace-wildcards="yes">NFS Music Share on %h</name><br />
<service><br />
<type>_nfs._tcp</type><br />
<port>2049</port><br />
<txt-record>path=/data/shared/Music</txt-record><br />
</service><br />
</service-group><br />
</nowiki>}}<br />
<br />
The port is correct if you have ''insecure'' as an option in your {{ic|/etc/exports}}; otherwise, it needs to be changed (note that ''insecure'' is needed for macOS clients). The path is the path to your export, or a subdirectory of it. For some reason the automount functionality has been removed from Leopard, however [http://www.macosxhints.com/article.php?story=20071116042238744 a script is available]. This was based upon [https://ubuntuforums.org/showthread.php?p=4387032#post4387032 this post].<br />
<br />
==== Samba ====<br />
<br />
With the Avahi daemon running on both the server and client, the file manager on the client should automatically find the server.<br />
<br />
==== Vsftpd ====<br />
<br />
You can also auto-discover regular FTP servers, such as [[vsftpd]]. Install the {{Pkg|vsftpd}} package and change the settings of vsftpd according to your own personal preferences (see [https://ubuntuforums.org/showthread.php?t=218630 this thread on ubuntuforums.org] or {{man|5|vsftpd.conf}}).<br />
<br />
Create a {{ic|.service}} file in {{ic|/etc/avahi/services}} with the following contents:<br />
<br />
{{hc|/etc/avahi/services/ftp.service|<nowiki><br />
<?xml version="1.0" standalone='no'?><br />
<!DOCTYPE service-group SYSTEM "avahi-service.dtd"><br />
<service-group><br />
<name>FTP file sharing</name><br />
<service><br />
<type>_ftp._tcp</type><br />
<port>21</port><br />
</service><br />
</service-group><br />
</nowiki>}}<br />
<br />
The FTP server should now be advertised by Avahi. You should now be able to find the FTP server from a file manager on another computer in your network. You might need to enable [[#Hostname resolution]] on the client.<br />
<br />
=== AirPrint from Mobile Devices ===<br />
<br />
{{Merge | AirPort#Printing | AirPrint is a feature provided by the Apple AirPort Express and by some printers. The manual configuration technique (using JetDirect) can also apply here and may be easier.}}<br />
<br />
Avahi along with [[CUPS]] also provides the capability to print to just about any printer from airprint compatible mobile devices. In order to enable print capability from your device, simply create an Avahi service file for your printer in {{ic|/etc/avahi/services/}}. An example of a generic services file for an HP-Laserjet printer would be similar to the following with the {{ic|name}}, {{ic|rp}}, {{ic|ty}}, {{ic|adminurl}} and {{ic|note}} fields changed.<br />
<br />
{{hc|/etc/avahi/services/airprint.service|<nowiki><br />
<?xml version="1.0" standalone='no'?><!--*-nxml-*--><br />
<!DOCTYPE service-group SYSTEM "avahi-service.dtd"><br />
<service-group><br />
<name>yourPrnterName</name><br />
<service><br />
<type>_ipp._tcp</type><br />
<subtype>_universal._sub._ipp._tcp</subtype><br />
<port>631</port><br />
<txt-record>txtver=1</txt-record><br />
<txt-record>qtotal=1</txt-record><br />
<txt-record>rp=printers/yourPrnterName</txt-record><br />
<txt-record>ty=yourPrnterName</txt-record><br />
<txt-record>adminurl=http://198.168.7.15:631/printers/yourPrnterName</txt-record><br />
<txt-record>note=Office Laserjet 4100n</txt-record><br />
<txt-record>priority=0</txt-record><br />
<txt-record>product=(GPL Ghostscript)</txt-record><br />
<txt-record>printer-state=3</txt-record><br />
<txt-record>printer-type=0x801046</txt-record><br />
<txt-record>Transparent=T</txt-record><br />
<txt-record>Binary=T</txt-record><br />
<txt-record>Fax=F</txt-record><br />
<txt-record>Color=T</txt-record><br />
<txt-record>Duplex=T</txt-record><br />
<txt-record>Staple=F</txt-record><br />
<txt-record>Copies=T</txt-record><br />
<txt-record>Collate=F</txt-record><br />
<txt-record>Punch=F</txt-record><br />
<txt-record>Bind=F</txt-record><br />
<txt-record>Sort=F</txt-record><br />
<txt-record>Scan=F</txt-record><br />
<txt-record>pdl=application/octet-stream,application/pdf,application/postscript,image/jpeg,image/png,image/urf</txt-record><br />
<txt-record>URF=W8,SRGB24,CP1,RS600</txt-record><br />
</service><br />
</service-group><br />
</nowiki>}}<br />
<br />
Alternatively, https://raw.github.com/tjfontaine/airprint-generate/master/airprint-generate.py can be used to generate Avahi service files. It depends on {{Pkg|python}} and {{Pkg|python-pycups}}. The script can be run using:<br />
<br />
# python3 airprint-generate.py -d /etc/avahi/services<br />
<br />
{{Note|If your printer under http://localhost:631/printers is "Not Shared", this python script will not output any file to /etc/avahi/services; in that case, you will need to "Modify Printer" under one of the CUPS drop-down menus to turn sharing on. If that does not work, check out the ArchWiki on [[CUPS printer sharing]].}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Hostname changes with appending incrementing numbers ===<br />
<br />
This is a [https://github.com/lathiat/avahi/issues/117 known bug] that is caused by a hostname race condition. One possible workaround is [https://github.com/lathiat/avahi/issues/117#issuecomment-302849130 disabling IPv6] to attempt to prevent the race condition. If multiple interfaces are present [https://github.com/lathiat/avahi/issues/117#issuecomment-401225716 use allow-interfaces] to limit Avahi to a single interface. Another possible workaround is to [https://github.com/lathiat/avahi/issues/117#issuecomment-442201162 disable the cache] to prevent Avahi from checking for host name conflicts altogether, but this prevents Avahi from performing lookups.<br />
<br />
=== Ping doesn't work, avahi-resolve does ===<br />
I've had it all too often that a command like {{ic|avahi-resolve -n -4 <hostname>.local}} resolves just fine, but {{ic|ping <hostname>.local}} doesn't.<br />
A common issue in that case is that ping simply doesn't know about avahi yet.<br />
[https://serverfault.com/a/579996 This] answer from stackoverflow explains it perfectly:<br />
{{bc|<nowiki>ping use glibc's name resolution system, called Name Service Switch. This uses the /etc/nsswitch.conf file to know where to look for in order to resolve a name to an IP. The hosts: line in this file represents an order of preference for each service. For exemple, files represent the local /etc/hosts file, dns uses the /etc/resolv.conf file to contact a DNS server, and mdns uses mdns.</nowiki>}}<br />
<br />
In this situation your avahi on it's own works perfectly but you quite likely miss the plugin that adds avahi in ''glibc's name resolution''.<br />
To fix that:<br />
# pacman -S nss-mdns<br />
<br />
Now try pinging again (a reboot isn't needed), it's likely fixed!<br />
<br />
== See also ==<br />
<br />
* [https://avahi.org/ Avahi] - Official project website<br />
* [[Wikipedia:Avahi (software)]]<br />
* [https://www.apple.com/itunes/download/ iTunes (includes Bonjour)] - Enable Zeroconf on Windows<br />
* http://www.zeroconf.org/</div>Markg85https://wiki.archlinux.org/index.php?title=Talk:Gitweb&diff=591599Talk:Gitweb2019-12-11T16:36:05Z<p>Markg85: /* Relationship with CGit and Gitosis */</p>
<hr />
<div>== VirtualHost ==<br />
<br />
Might be nice to add some vhost config examples here as well<br />
::--[[User:Wsduvall|Wsduvall]] October 24 2010 10:53<br />
<br />
=== Nginx ===<br />
To answer Wsduvall, here is my configuration in a virtualhost on nginx :<br />
<br />
server {<br />
server_name my_server_name;<br />
<br />
root /srv/http/gitweb;<br />
index gitweb.cgi;<br />
<br />
gzip off;<br />
<br />
location ~ \.cgi$ {<br />
fastcgi_param GITWEB_CONFIG /etc/conf.d/gitweb.conf;<br />
include fastcgi_params;<br />
fastcgi_pass unix:/run/fcgiwrap.sock;<br />
include fastcgi.conf;<br />
}<br />
}<br />
<br />
<br />
== SSH ==<br />
<br />
I added a section that explains how to checkout over SSH. Please do check it for errors if you want.<br />
<br />
== Merge with Git ==<br />
<br />
Hi,<br />
<br />
I marked a few section that i think would better fit the [[Git]] page rather then the [[Gitweb]] page. Those are the sections for cloning over the git protocol, over ssh and over http. It's neat but really not part of [[Gitweb]]. I made those sections even this article but now i think it's best to merge a part of it with [[Git]]. What do you think of it?<br />
: +1 for merging them to [[Git]]. -- [[User:Fengchao|Fengchao]] ([[User talk:Fengchao|talk]]) 08:09, 6 February 2013 (UTC)<br />
<br />
== mod_perl ==<br />
<br />
As mod_perl now require a downgraded version of perl, why using it for apache 2.4 ?<br />
<br />
This configuration seems to be working fine :<br />
<br />
<Directory "/usr/share/gitweb"><br />
DirectoryIndex gitweb.cgi<br />
Require all granted<br />
Options ExecCGI<br />
AddHandler cgi-script .cgi<br />
SetEnv GITWEB_CONFIG /etc/conf.d/gitweb.conf<br />
</Directory><br />
<br />
== Relationship with CGit and Gitosis ==<br />
<br />
The flag was raised in [https://wiki.archlinux.org//index.php?title=Gitweb&diff=prev&oldid=559751 version 559751]. It has been there since [https://wiki.archlinux.org/index.php?title=Gitweb&oldid=115994 the first version]. --[[User:Franklin Yu|Franklin Yu]] ([[User talk:Franklin Yu|talk]]) 09:10, 11 December 2019 (UTC)<br />
<br />
Hi, i have NO CLUE how this editing works with providing feedback or even finding what the question is.<br />
He that messaged me apparently knows much more about wiki stuff then i do.<br />
<br />
So what's the question?<br />
Ah right, apparently the proclaimed basis of gitweb for cgit and gitosis.<br />
I don't know why i said that. Back then i was looking for some git self hosted solution and apparently was under the impression that CGit and gitosis were dependent on gitweb.<br />
It's easy to say they are not NOW... But i definitely vaguely remember gitweb being the core "git from web" implementation and that cgit + gitosis were using gitweb internally + some more fancy scripts on top. It might not be the case anymore (10 years later...). That doesn't make it "factual inaccurate", only that times have changed and with "today's" version of all those git for web projects.<br />
It's a wiki, feel free to amend it with the changes you deem right :)</div>Markg85https://wiki.archlinux.org/index.php?title=Talk:Gitweb&diff=591598Talk:Gitweb2019-12-11T16:20:13Z<p>Markg85: /* Relationship with CGit and Gitosis */</p>
<hr />
<div>== VirtualHost ==<br />
<br />
Might be nice to add some vhost config examples here as well<br />
::--[[User:Wsduvall|Wsduvall]] October 24 2010 10:53<br />
<br />
=== Nginx ===<br />
To answer Wsduvall, here is my configuration in a virtualhost on nginx :<br />
<br />
server {<br />
server_name my_server_name;<br />
<br />
root /srv/http/gitweb;<br />
index gitweb.cgi;<br />
<br />
gzip off;<br />
<br />
location ~ \.cgi$ {<br />
fastcgi_param GITWEB_CONFIG /etc/conf.d/gitweb.conf;<br />
include fastcgi_params;<br />
fastcgi_pass unix:/run/fcgiwrap.sock;<br />
include fastcgi.conf;<br />
}<br />
}<br />
<br />
<br />
== SSH ==<br />
<br />
I added a section that explains how to checkout over SSH. Please do check it for errors if you want.<br />
<br />
== Merge with Git ==<br />
<br />
Hi,<br />
<br />
I marked a few section that i think would better fit the [[Git]] page rather then the [[Gitweb]] page. Those are the sections for cloning over the git protocol, over ssh and over http. It's neat but really not part of [[Gitweb]]. I made those sections even this article but now i think it's best to merge a part of it with [[Git]]. What do you think of it?<br />
: +1 for merging them to [[Git]]. -- [[User:Fengchao|Fengchao]] ([[User talk:Fengchao|talk]]) 08:09, 6 February 2013 (UTC)<br />
<br />
== mod_perl ==<br />
<br />
As mod_perl now require a downgraded version of perl, why using it for apache 2.4 ?<br />
<br />
This configuration seems to be working fine :<br />
<br />
<Directory "/usr/share/gitweb"><br />
DirectoryIndex gitweb.cgi<br />
Require all granted<br />
Options ExecCGI<br />
AddHandler cgi-script .cgi<br />
SetEnv GITWEB_CONFIG /etc/conf.d/gitweb.conf<br />
</Directory><br />
<br />
== Relationship with CGit and Gitosis ==<br />
<br />
The flag was raised in [https://wiki.archlinux.org//index.php?title=Gitweb&diff=prev&oldid=559751 version 559751]. It has been there since [https://wiki.archlinux.org/index.php?title=Gitweb&oldid=115994 the first version]. --[[User:Franklin Yu|Franklin Yu]] ([[User talk:Franklin Yu|talk]]) 09:10, 11 December 2019 (UTC)<br />
<br />
Hi, i have NO CLUE how this editing works with providing feedback or even finding what the question is.<br />
He that messaged me apparently knows much more about wiki stuff then i do.<br />
<br />
So what's the question?<br />
It's a wiki, feel free to amend it with the changes you deem right :)</div>Markg85https://wiki.archlinux.org/index.php?title=Mpv&diff=446687Mpv2016-08-14T21:31:22Z<p>Markg85: Updated description for better key bindings.</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Multimedia players]]<br />
[[ja:Mpv]]<br />
[[ru:Mpv]]<br />
[[zh-cn:Mpv]]<br />
{{Related articles start}}<br />
{{Related|MPlayer}}<br />
{{Related articles end}}<br />
<br />
[http://mpv.io/ mpv] is a media player based on [[MPlayer]] and MPlayer2. It supports a wide variety of video file formats, audio and video codecs, and subtitle types. A comprehensive (although admittedly incomplete) list of differences between ''mpv'' and the aforementioned players can be found [https://github.com/mpv-player/mpv/blob/master/DOCS/mplayer-changes.rst here].<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|mpv}} package from the [[official repositories]] or {{AUR|mpv-git}} from the [[Arch User Repository]].<br />
<br />
=== Front ends ===<br />
<br />
''mpv'' provides an elegant User Interface called OSC which appears when moving the mouse. To ease casual users, other graphical interfaces exist:<br />
<br />
* {{App|Baka MPlayer|Free and open source, cross-platform, ''libmpv'' based multimedia player (Qt 5).|https://github.com/u8sand/Baka-MPlayer/|{{Pkg|baka-mplayer}}, {{AUR|baka-mplayer-git}}}}<br />
* {{App|bomi|Powerful and easy to use multimedia player (Qt 5).|https://bomi-player.github.io/|{{AUR|bomi}}, {{AUR|bomi-git}}}}<br />
* {{App|GNOME MPV|A simple frontend for ''mpv'' (GTK+ 3).|https://github.com/gnome-mpv/gnome-mpv/|{{AUR|gnome-mpv-git}}, {{AUR|gnome-mpv}}}}<br />
* {{App|[[Wikipedia:SMPlayer|SMPlayer]]|Qt multimedia player with extra features (CSS themes, YouTube integration, etc.) (Qt 5).|http://smplayer.sourceforge.net/|{{Pkg|smplayer}}}}<br />
* {{App|xt7-player-mpv|Qt/Gambas GUI to mpv with a rich set of configurable options including filters and drivers, ladspa plugins support as well as library/playlist managment, YouTube, online radios, podcasts, DVB-T and more.|https://github.com/kokoko3k/xt7-player-mpv|{{AUR|xt7-player-mpv-git}}}}<br />
<br />
{{Note|CMPlayer/''bomi'' packages provide ''mpv'' internally.}}<br />
<br />
== Configuration ==<br />
<br />
''mpv'''s configuration is read from the files {{ic|mpv.conf}} ([https://raw.githubusercontent.com/mpv-player/mpv/master/etc/mpv.conf example]) (settings), {{ic|input.conf}} (key bindings), and {{ic|lua-settings/osc.conf}} ([https://raw.githubusercontent.com/mpv-player/mpv/master/etc/input.conf example]) (on screen display). For a full list of options, see the man page or the github docs [https://github.com/mpv-player/mpv/blob/master/DOCS/man/options.rst options.rst], [https://github.com/mpv-player/mpv/blob/master/DOCS/man/input.rst input.rst], and [https://github.com/mpv-player/mpv/blob/master/DOCS/man/osc.rst osc.rst].<br />
<br />
If the [[environment variable]] {{ic|XDG_CONFIG_HOME}} is not set, user configuration files will be read from the {{ic|~/.config/mpv}} directory. System-wide configuration files are read from the {{ic|/etc/mpv}} directory.<br />
<br />
=== An example {{ic|input.conf}} file ===<br />
<br />
Copying the following into {{ic|~/.config/mpv/input.conf}} will add a number of useful keybindings to mpv such as rotating video 90 degrees, zooming and panning.<br />
<br />
Alt+RIGHT add video-rotate 90<br />
Alt+LEFT add video-rotate -90<br />
Alt+- add video-zoom -0.25<br />
Alt+= add video-zoom 0.25<br />
Alt+j add video-pan-x -0.05<br />
Alt+l add video-pan-x 0.05<br />
Alt+i add video-pan-y 0.05<br />
Alt+k add video-pan-y -0.05<br />
<br />
=== mpv and PulseAudio since 0.18.1 ===<br />
<br />
This entry only applies if you are using pulseaudio for mpv ({{ic|1=-ao=pulse}} or {{ic|1=ao=pulse}} in {{ic|mpv.conf}}).<br />
<br />
Add the following to your {{ic|~/.config/mpv/input.conf}} to make volume changes work again from PulseAudio to mpv and vice versa:<br />
<br />
/ add ao-volume -2<br />
SHIFT+* add ao-volume 2<br />
<br />
Change the above to whatever volume keys you use. The above is the default of MPV only handles by "softvol" and with those lines handled by PulseAudio.<br />
<br />
== Tips and Tricks ==<br />
<br />
=== Hardware Decoding ===<br />
<br />
See [[Hardware video acceleration]].<br />
<br />
Unlike ''mplayer'' and ''mplayer2'', ''mpv'' has both VA-API and VDPAU support built-in. To enable it, run ''mpv'' with the {{ic|1=--hwdec='method'}} option. You can find list of all available methods looking for {{ic|1=--hwdec=<api>}} in [[man page]] {{ic|mpv (1)}}. To make this persistent, add the line {{ic|1=hwdec=''method''}} to your configuration file. <br />
<br />
When hardware decoding is used, the video output should generally be set to {{ic|opengl}} or {{ic|opengl-hq}} (or possibly {{ic|vdpau}} if using {{ic|1=hwdec=vdpau}}). In particular, {{ic|1=hwdec=vaapi}} should be used with {{ic|1=vo=opengl}} [https://github.com/mpv-player/mpv/blob/master/DOCS/man/vo.rst] if possible. <br />
<br />
If hardware decoding cannot be used, ''mpv'' will automatically fall back to software decoding.<br />
<br />
=== High quality video output ===<br />
<br />
The {{ic|opengl-hq}} video output is an OpenGL output preconfigured with various options by the mpv developers. To make use of it, specify it in your configuration file.<br />
<br />
{{hc|1=~/.config/mpv/mpv.conf|2=vo=opengl-hq}}<br />
<br />
This comes with a GLSL debanding filter by default, which may lead to bad performance for some users, and can reduce the visual quality of grainy content. You can disable it easily though.<br />
<br />
{{hc|1=~/.config/mpv/mpv.conf|2=vo=opengl-hq:deband=no}}<br />
<br />
=== Automatically resuming from where you left off ===<br />
<br />
The default key to quit ''mpv'', saving the video's current position and state, is {{ic|Shift+q}}. This key can be changed by adding the {{ic|quit_watch_later}} string in the key bindings configuration file.<br />
<br />
To always automatically save the current playback position on quit, start ''mpv'' with a flag {{ic|--save-position-on-quit}}. To make option permanent, add line {{ic|save-position-on-quit}} to configuration file.<br />
<br />
=== Volume is too low ===<br />
<br />
Set {{ic|1=volume-max=''value''}} in your configuration file to a reasonable amount, such as {{ic|1=volume-max=600}}. Additionally (or alternatively), you can utilize [[Wikipedia:Dynamic range compression|dynamic range compression]] with {{ic|1=af=drc}}.<br />
<br />
=== Quickly cycle between multiple aspect ratio ===<br />
<br />
You can cycle between aspect ratios using {{ic|Shift+a}} from version 0.8.0 onwards.<br />
<br />
=== Drawing to a root window ===<br />
<br />
Run ''mpv'' with {{ic|1=--wid=0}}. This tells ''mpv'' to draw onto a window with a window ID of 0.<br />
<br />
=== Always show GUI ===<br />
<br />
It may be useful to always show the GUI window, even for audio files, especially when ''mpv'' is not started from terminal. This can be done by using {{ic|--force-window}} option.<br />
<br />
=== Use as a browser plugin ===<br />
<br />
With the help of {{AUR|mozplugger}}, ''mpv'' can be used in a supported browser to play video. See [[Browser plugins#MozPlugger]] for configuration details. This coupled with a user script such as [http://isebaro.com/viewtube/?ln=en ViewTube], allows you to use ''mpv'' in place of a site's integrated video player.<br />
<br />
[[Browser plugins#Video players workarounds]] page shows other easy ways to watch videos.<br />
<br />
=== Improving mpv as a music player with Lua scripts ===<br />
<br />
The development of mpv's Lua scripts are documented in [https://github.com/mpv-player/mpv/blob/master/DOCS/man/lua.rst DOCS/man/lua.rst]<br />
and examples are shown in [https://github.com/mpv-player/mpv/tree/master/TOOLS/lua TOOLS/lua]<br />
of the [https://github.com/mpv-player/mpv mpv repository].<br />
[http://bamos.github.io/2014/07/05/mpv-lua-scripting/ This blog post] introduces the<br />
[https://github.com/bamos/dotfiles/blob/master/.mpv/scripts/music.lua music.lua] script,<br />
which shows how Lua scripts can be used to improve mpv as a music player.<br />
<br />
=== Twitch.tv streaming over mpv ===<br />
<br />
If {{Pkg|youtube-dl}} is installed, mpv can directly open a Twitch livestream.<br />
<br />
Alternatively, {{Pkg|livestreamer}} can be used to stream Twitch. See [[Livestreamer#Twitch]].<br />
<br />
Another alternative based on Livestreamer is this Lua script: https://gist.github.com/ChrisK2/8701184fe3ea7701c9cc<br />
<br />
=== youtube-dl and choosing formats ===<br />
<br />
The default {{ic|--ytdl-format}} is {{ic|bestvideo+bestaudio/best}}. For youtube videos that have 4K resolutions available, this may mean that your device will struggle to decode 4K VP9 encoded video in software even if the attached monitor is much lower resolution.<br />
<br />
Setting the right youtube-dl format selectors can fix this easily though. In the following configuration example, only videos with a vertical resolution of 1080 pixels or less will be considered.<br />
<br />
ytdl-format=bestvideo[height<=?1080]+bestaudio/best<br />
<br />
If you wish to avoid a certain codec altogether because you cannot hardware-decode it, you can add this to the format selector. For example, we can additionally choose to ignore VP9 as follows:<br />
<br />
ytdl-format=bestvideo[height<=?1080][vcodec!=vp9]+bestaudio/best<br />
<br />
=== youtube-dl audio with search ===<br />
<br />
To find and play audio straight from your terminal with {{ic|mm "''search terms''"}} put the following function in your {{ic|.bashrc}}:<br />
<br />
function mm() {<br />
mpv --no-video --ytdl-format=bestaudio ytdl://ytsearch10:"$@"<br />
}<br />
<br />
=== Use mpv with a compositor ===<br />
<br />
If you're using a compositor (e.g. in KDE Plasma 5) and find that composition is disabled (e.g. in Plasma this would make you unable to present windows or see window thumbnails in the default app switcher) when mpv is playing a video, try {{ic|1=x11-bypass-compositor=no}}<br />
<br />
== Vapoursynth ==<br />
<br />
Vapoursynth is an alternative to AviSynth that can be used on Linux and allows for Video manipulation via python scripts. Vapoursynths python scripts can be used as video filters for ''mpv''.<br />
<br />
To use vapoursynth filters you have to install the {{Pkg|vapoursynth}} package and compile ''mpv'' with the {{ic|--enable-vapoursynth}} build flag. <br />
<br />
=== Debanding (flash3kyuu) ===<br />
<br />
To use the {{ic|f3k_db}} debanding filter install {{AUR|vapoursynth-plugin-flash3kyuu_deband-git}}{{Broken package link|{{aur-mirror|vapoursynth-plugin-flash3kyuu_deband-git}}}} and write a python script that uses the ''vapoursynth'' extension.<br />
<br />
The following sample script can be used to enable debanding in ''mpv''.<br />
<br />
import vapoursynth as vs<br />
core = vs.get_core()<br />
<br />
clip = video_in<br />
clip = core.std.Trim(clip, first=0, length=500000)<br />
clip = core.f3kdb.Deband(clip, grainy=0, grainc=0, output_depth=16)<br />
clip.set_output()<br />
<br />
Finally specify the python script in the config file or use a command line argument when executing mpv.<br />
$ mpv --vf=vapoursynth=f3k_db.py <video_file></div>Markg85https://wiki.archlinux.org/index.php?title=Mpv&diff=445910Mpv2016-08-08T19:00:21Z<p>Markg85: Added a section that hels fixing mpv sound issues with pulseaudio because it's not working anymore by default.</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Multimedia players]]<br />
[[ja:Mpv]]<br />
[[ru:Mpv]]<br />
[[zh-cn:Mpv]]<br />
{{Related articles start}}<br />
{{Related|MPlayer}}<br />
{{Related articles end}}<br />
<br />
[http://mpv.io/ mpv] is a media player based on [[MPlayer]] and MPlayer2. It supports a wide variety of video file formats, audio and video codecs, and subtitle types. A comprehensive (although admittedly incomplete) list of differences between ''mpv'' and the aforementioned players can be found [https://github.com/mpv-player/mpv/blob/master/DOCS/mplayer-changes.rst here].<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|mpv}} package from the [[official repositories]] or {{AUR|mpv-git}} from the [[Arch User Repository]].<br />
<br />
=== Front ends ===<br />
<br />
''mpv'' provides an elegant User Interface called OSC which appears when moving the mouse. To ease casual users, other graphical interfaces exist:<br />
<br />
* {{App|Baka MPlayer|Free and open source, cross-platform, ''libmpv'' based multimedia player (Qt 5).|https://github.com/u8sand/Baka-MPlayer/|{{Pkg|baka-mplayer}}, {{AUR|baka-mplayer-git}}}}<br />
* {{App|bomi|Powerful and easy to use multimedia player (Qt 5).|https://bomi-player.github.io/|{{AUR|bomi}}, {{AUR|bomi-git}}}}<br />
* {{App|GNOME MPV|A simple frontend for ''mpv'' (GTK+ 3).|https://github.com/gnome-mpv/gnome-mpv/|{{AUR|gnome-mpv-git}}, {{AUR|gnome-mpv}}}}<br />
* {{App|[[Wikipedia:SMPlayer|SMPlayer]]|Qt multimedia player with extra features (CSS themes, YouTube integration, etc.) (Qt 5).|http://smplayer.sourceforge.net/|{{Pkg|smplayer}}}}<br />
* {{App|xt7-player-mpv|Qt/Gambas GUI to mpv with a rich set of configurable options including filters and drivers, ladspa plugins support as well as library/playlist managment, YouTube, online radios, podcasts, DVB-T and more.|https://github.com/kokoko3k/xt7-player-mpv|{{AUR|xt7-player-mpv-git}}}}<br />
<br />
{{Note|CMPlayer/''bomi'' packages provide ''mpv'' internally.}}<br />
<br />
== Configuration ==<br />
<br />
''mpv'''s configuration is read from the files {{ic|mpv.conf}} ([https://raw.githubusercontent.com/mpv-player/mpv/master/etc/mpv.conf example]) (settings), {{ic|input.conf}} (key bindings), and {{ic|lua-settings/osc.conf}} ([https://raw.githubusercontent.com/mpv-player/mpv/master/etc/input.conf example]) (on screen display). For a full list of options, see the man page or the github docs [https://github.com/mpv-player/mpv/blob/master/DOCS/man/options.rst options.rst], [https://github.com/mpv-player/mpv/blob/master/DOCS/man/input.rst input.rst], and [https://github.com/mpv-player/mpv/blob/master/DOCS/man/osc.rst osc.rst].<br />
<br />
If the [[environment variable]] {{ic|XDG_CONFIG_HOME}} is not set, user configuration files will be read from the {{ic|~/.config/mpv}} directory. System-wide configuration files are read from the {{ic|/etc/mpv}} directory.<br />
<br />
=== An example {{ic|input.conf}} file ===<br />
<br />
Copying the following into {{ic|~/.config/mpv/input.conf}} will add a number of useful keybindings to mpv such as rotating video 90 degrees, zooming and panning.<br />
<br />
Alt+RIGHT add video-rotate 90<br />
Alt+LEFT add video-rotate -90<br />
Alt+- add video-zoom -0.25<br />
Alt+= add video-zoom 0.25<br />
Alt+j add video-pan-x -0.05<br />
Alt+l add video-pan-x 0.05<br />
Alt+i add video-pan-y 0.05<br />
Alt+k add video-pan-y -0.05<br />
<br />
== mpv and PulseAudio since 0.18.1 ==<br />
Since mpv 0.18.1 the developers have decided to clean some audio handling code up. That's always good, but the pulse audio handling suffered a bit. Also,the way to get it working as it used to be isn't clearly described in the mpv man page so keep this entry here as long as mpv i a bit hard on PulseAudio. You obviously have to be using pulseaudio for mpv (-ao=pulse or ao=pulse in mpv.conf).<br />
<br />
Add the following to your {{ic|~/.config/mpv/input.conf}}. That will make volume changes work again from PulseAudio to mpv and vice versa.<br />
+ add ao-volume -1<br />
<br />
The volume can now be raised to 130%. Some like it, some don't. If you want 100% to be your max then add the following to {{ic|~/.config/mpv/mpv.conf}}:<br />
volume-max=100.0<br />
<br />
That should do it.<br />
<br />
== Tips and Tricks ==<br />
<br />
=== Hardware Decoding ===<br />
<br />
See [[Hardware video acceleration]].<br />
<br />
Unlike ''mplayer'' and ''mplayer2'', ''mpv'' has both VA-API and VDPAU support built-in. To enable it, run ''mpv'' with the {{ic|1=--hwdec='method'}} option. You can find list of all available methods looking for {{ic|1=--hwdec=<api>}} in [[man page]] {{ic|mpv (1)}}. To make this persistent, add the line {{ic|1=hwdec=''method''}} to your configuration file. <br />
<br />
When hardware decoding is used, the video output should generally be set to {{ic|opengl}} or {{ic|opengl-hq}} (or possibly {{ic|vdpau}} if using {{ic|1=hwdec=vdpau}}). In particular, {{ic|1=hwdec=vaapi}} should be used with {{ic|1=vo=opengl}} [https://github.com/mpv-player/mpv/blob/master/DOCS/man/vo.rst] if possible. <br />
<br />
If hardware decoding cannot be used, ''mpv'' will automatically fall back to software decoding.<br />
<br />
=== High quality video output ===<br />
<br />
The {{ic|opengl-hq}} video output is an OpenGL output preconfigured with various options by the mpv developers. To make use of it, specify it in your configuration file.<br />
<br />
{{hc|1=~/.config/mpv/mpv.conf|2=vo=opengl-hq}}<br />
<br />
This comes with a GLSL debanding filter by default, which may lead to bad performance for some users, and can reduce the visual quality of grainy content. You can disable it easily though.<br />
<br />
{{hc|1=~/.config/mpv/mpv.conf|2=vo=opengl-hq:deband=no}}<br />
<br />
=== Automatically resuming from where you left off ===<br />
<br />
The default key to quit ''mpv'', saving the video's current position and state, is {{ic|Shift+q}}. This key can be changed by adding the {{ic|quit_watch_later}} string in the key bindings configuration file.<br />
<br />
To always automatically save the current playback position on quit, start ''mpv'' with a flag {{ic|--save-position-on-quit}}. To make option permanent, add line {{ic|save-position-on-quit}} to configuration file.<br />
<br />
=== Volume is too low ===<br />
<br />
Set {{ic|1=volume-max=''value''}} in your configuration file to a reasonable amount, such as {{ic|1=volume-max=600}}. Additionally (or alternatively), you can utilize [[Wikipedia:Dynamic range compression|dynamic range compression]] with {{ic|1=af=drc}}.<br />
<br />
=== Quickly cycle between multiple aspect ratio ===<br />
<br />
You can cycle between aspect ratios using {{ic|Shift+a}} from version 0.8.0 onwards.<br />
<br />
=== Drawing to a root window ===<br />
<br />
Run ''mpv'' with {{ic|1=--wid=0}}. This tells ''mpv'' to draw onto a window with a window ID of 0.<br />
<br />
=== Always show GUI ===<br />
<br />
It may be useful to always show the GUI window, even for audio files, especially when ''mpv'' is not started from terminal. This can be done by using {{ic|--force-window}} option.<br />
<br />
=== Use as a browser plugin ===<br />
<br />
With the help of {{AUR|mozplugger}}, ''mpv'' can be used in a supported browser to play video. See [[Browser plugins#MozPlugger]] for configuration details. This coupled with a user script such as [http://isebaro.com/viewtube/?ln=en ViewTube], allows you to use ''mpv'' in place of a site's integrated video player.<br />
<br />
[[Browser plugins#Video players workarounds]] page shows other easy ways to watch videos.<br />
<br />
=== Improving mpv as a music player with Lua scripts ===<br />
<br />
The development of mpv's Lua scripts are documented in [https://github.com/mpv-player/mpv/blob/master/DOCS/man/lua.rst DOCS/man/lua.rst]<br />
and examples are shown in [https://github.com/mpv-player/mpv/tree/master/TOOLS/lua TOOLS/lua]<br />
of the [https://github.com/mpv-player/mpv mpv repository].<br />
[http://bamos.github.io/2014/07/05/mpv-lua-scripting/ This blog post] introduces the<br />
[https://github.com/bamos/dotfiles/blob/master/.mpv/scripts/music.lua music.lua] script,<br />
which shows how Lua scripts can be used to improve mpv as a music player.<br />
<br />
=== Twitch.tv streaming over mpv ===<br />
<br />
If {{Pkg|youtube-dl}} is installed, mpv can directly open a Twitch livestream.<br />
<br />
Alternatively, {{Pkg|livestreamer}} can be used to stream Twitch. See [[Livestreamer#Twitch]].<br />
<br />
Another alternative based on Livestreamer is this Lua script: https://gist.github.com/ChrisK2/8701184fe3ea7701c9cc<br />
<br />
=== youtube-dl and choosing formats ===<br />
<br />
The default {{ic|--ytdl-format}} is {{ic|bestvideo+bestaudio/best}}. For youtube videos that have 4K resolutions available, this may mean that your device will struggle to decode 4K VP9 encoded video in software even if the attached monitor is much lower resolution.<br />
<br />
Setting the right youtube-dl format selectors can fix this easily though. In the following configuration example, only videos with a vertical resolution of 1080 pixels or less will be considered.<br />
<br />
ytdl-format=bestvideo[height<=?1080]+bestaudio/best<br />
<br />
If you wish to avoid a certain codec altogether because you cannot hardware-decode it, you can add this to the format selector. For example, we can additionally choose to ignore VP9 as follows:<br />
<br />
ytdl-format=bestvideo[height<=?1080][vcodec!=vp9]+bestaudio/best<br />
<br />
=== youtube-dl audio with search ===<br />
<br />
To find and play audio straight from your terminal with {{ic|mm "''search terms''"}} put the following function in your {{ic|.bashrc}}:<br />
<br />
function mm() {<br />
mpv --no-video --ytdl-format=bestaudio ytdl://ytsearch10:"$@"<br />
}<br />
<br />
=== Use mpv with a compositor ===<br />
<br />
If you're using a compositor (e.g. in KDE Plasma 5) and find that composition is disabled (e.g. in Plasma this would make you unable to present windows or see window thumbnails in the default app switcher) when mpv is playing a video, try {{ic|1=x11-bypass-compositor=no}}<br />
<br />
== Vapoursynth ==<br />
<br />
Vapoursynth is an alternative to AviSynth that can be used on Linux and allows for Video manipulation via python scripts. Vapoursynths python scripts can be used as video filters for ''mpv''.<br />
<br />
To use vapoursynth filters you have to install the {{Pkg|vapoursynth}} package and compile ''mpv'' with the {{ic|--enable-vapoursynth}} build flag. <br />
<br />
=== Debanding (flash3kyuu) ===<br />
<br />
To use the {{ic|f3k_db}} debanding filter install {{AUR|vapoursynth-plugin-flash3kyuu_deband-git}}{{Broken package link|{{aur-mirror|vapoursynth-plugin-flash3kyuu_deband-git}}}} and write a python script that uses the ''vapoursynth'' extension.<br />
<br />
The following sample script can be used to enable debanding in ''mpv''.<br />
<br />
import vapoursynth as vs<br />
core = vs.get_core()<br />
<br />
clip = video_in<br />
clip = core.std.Trim(clip, first=0, length=500000)<br />
clip = core.f3kdb.Deband(clip, grainy=0, grainc=0, output_depth=16)<br />
clip.set_output()<br />
<br />
Finally specify the python script in the config file or use a command line argument when executing mpv.<br />
$ mpv --vf=vapoursynth=f3k_db.py <video_file></div>Markg85https://wiki.archlinux.org/index.php?title=Talk:Installation_guide&diff=438891Talk:Installation guide2016-06-24T15:58:50Z<p>Markg85: /* EFI System Partition link must be changed */ new section</p>
<hr />
<div>== Read this first before adding new suggestions ==<br />
<br />
* The point of this page is to ''not'' become another Beginners' guide. It is meant to be a ''concise'' checklist of things to be done. So, detailed installation instructions should go to [[Beginners' guide]]. <br />
* If there is something to discuss which should also affect the Beginners' guide, then do it on [[Talk:Beginners' guide]]. An advanced user will find this page less bloated and easier to read, so let's KISS.<br />
* systemd tools such as ''hostnamectl'', ''timedatectl'' and ''localectl'' [https://github.com/systemd/systemd/issues/798#issuecomment-126568596 do not work] in the installation chroot environment, so please do not propose to use them in the guide unless you can prove that they have been made to work also in that case. See [https://wiki.archlinux.org/index.php?title=Talk:Beginners%27_guide&oldid=388727#General_problems], [https://wiki.archlinux.org/index.php?title=Talk:Beginners%27_guide&oldid=404695#Replace_commands_with_their_systemd_equivalents], [https://wiki.archlinux.org/index.php?title=Talk:Beginners%27_guide&oldid=418662#Utilizing_systemd_tools] and [https://wiki.archlinux.org/index.php?title=Talk:Installation_guide&oldid=434985#change_configuration_system_from_old_way_to_new_way.28using_systemd_commands.29] for some past discussions about this issue.<br />
<br />
__TOC__<br />
<br />
== Let's mention filesystem tools in pacstrap step ==<br />
<br />
I propose changing the sentence to ''Other packages or groups can be installed by appending their names to the above command (space separated), possibly including the boot loader '''or filesystem tools'''.'' As the purpose of the site is that it is a checklist, it should mention the most common pacstrap packages such as filesystem tools (for example btrfs-progs are needed separately).<br />
<br />
{{unsigned|18:43, 8 April 2016|Drws}}<br />
<br />
:The {{grp|base}} group already includes {{pkg|e2fsprogs}}, {{pkg|jfsutils}}, {{pkg|reiserfsprogs}}, {{pkg|sysfsutils}} and {{pkg|xfsprogs}}, but no boot loader (except [[systemd-boot]]). Adding a hint for filesystem tools is of much less value than boot loaders, because the system will boot even without the file system tools, which would otherwise have to be loaded from the file system they should make accessible. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 20:58, 8 April 2016 (UTC)<br />
<br />
::I agree. If you install to (e.g.) btrfs, generating the initramfs later on is bound to fail without required tools installed. Yet, "'''possibly''' ''the boot loader''" is a little fuzzy itself: If you (a) want to install a boot loader before the chroot (e.g. its install target {{ic|/mnt/boot}}), you would need to install it to the booted ramdisk first. If you (b) install it regularly, inside the chroot, the boot loader instructions will tell what you need and the general hint should be better moved to [[Installation guide#Install a boot loader]] itself. <br />
::I suggest we change the sentence like so: <br />
:::"Other packages or groups (e.g. any your system may require on top for the first boot) can be installed directly, by appending the names to the above command (space separated), or individually during the next step." <br />
::And make the boot loader hint more explicit, by changing [[Installation guide#Install a boot loader]] to: <br />
:::"[[Install]] a boot loader package and the boot loader to the respective bootable partition. See [[Boot loaders]] for the available choices and configuration." <br />
::Both changes keeping in mind, the main target group for this guide should be being a checklist for advanced users ''without'' previous exposure to the distro/tools. --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 11:09, 4 June 2016 (UTC)<br />
<br />
== EFI System Partition link must be changed ==<br />
<br />
The "EFI System Partition" link is currently broken. It should be updated to link to https://wiki.archlinux.org/index.php/EFI_System_Partition.<br />
I don't appear to have the permissions to change it, so please someone with the right permissions...</div>Markg85https://wiki.archlinux.org/index.php?title=PulseAudio&diff=416638PulseAudio2016-01-22T19:34:38Z<p>Markg85: /* Tips and tricks */</p>
<hr />
<div>[[Category:Sound]]<br />
[[cs:PulseAudio]]<br />
[[es:PulseAudio]]<br />
[[fr:PulseAudio]]<br />
[[it:PulseAudio]]<br />
[[ja:PulseAudio]]<br />
[[pt:PulseAudio]]<br />
[[ru:PulseAudio]]<br />
[[tr:PulseAudio]]<br />
[[zh-CN:PulseAudio]]<br />
{{Related articles start}}<br />
{{Related|PulseAudio/Examples}}<br />
{{Related|PulseAudio/Troubleshooting}}<br />
{{Related articles end}}<br />
[[Wikipedia:PulseAudio|PulseAudio]] serves as a proxy to sound applications using existing kernel sound components like [[ALSA]] or [[OSS]]. Since ALSA is included in Arch Linux by default, the most common deployment scenarios include PulseAudio with ALSA.<br />
<br />
== Installation ==<br />
<br />
Install the {{Pkg|pulseaudio}} package.<br />
<br />
Some PulseAudio modules have been [https://www.archlinux.org/news/pulseaudio-split/ split] from the main package and must be installed separately if needed:<br />
<br />
* {{Pkg|pulseaudio-bluetooth}}: Bluetooth (Bluez) support<br />
* {{Pkg|pulseaudio-equalizer}}: Equalizer sink (qpaeq)<br />
* {{Pkg|pulseaudio-gconf}}: GConf support (paprefs)<br />
* {{Pkg|pulseaudio-jack}}: JACK sink, source and jackdbus detection<br />
* {{Pkg|pulseaudio-lirc}}: Infrared (LIRC) volume control<br />
* {{Pkg|pulseaudio-xen}}: Xen paravirtual sink<br />
* {{Pkg|pulseaudio-zeroconf}}: Zeroconf (Avahi/DNS-SD) support<br />
<br />
{{Note|Some confusion can be made between [[ALSA]] and PulseAudio. ALSA includes both Linux kernel component with sound card drivers, and a userspace component, {{ic|libalsa}}.[http://www.alsa-project.org/main/index.php/Download] PulseAudio builds only on the kernel component, but offers compatibility with {{ic|libalsa}} through {{Pkg|pulseaudio-alsa}}.[http://www.freedesktop.org/wiki/Software/PulseAudio/FAQ/#index14h3]}}<br />
<br />
=== Front-ends ===<br />
<br />
There is a number of front-ends available for controlling the PulseAudio daemon:<br />
<br />
* GTK GUIs: {{Pkg|paprefs}} and {{Pkg|pavucontrol}}<br />
* Volume control via mapped keyboard keys: {{AUR|pulseaudio-ctl}}<br />
* Console (CLI) mixers: {{Pkg|ponymix}} and {{Pkg|pamixer}}<br />
* Console (curses) mixer: {{AUR|pulsemixer-git}}<br />
* Web volume control: [https://github.com/Siot/PaWebControl PaWebControl]<br />
* System tray icon: {{AUR|pasystray-git}}<br />
* KF5 plasma applet: {{Pkg|kmix}} and {{Pkg|plasma-pa}}<br />
* If you want to use Bluetooth Headsets or other Bluetooth Audio Devices together with PulseAudio see the [[Bluetooth headset]] Article.<br />
<br />
== Configuration ==<br />
<br />
=== Configuration files ===<br />
<br />
{{Merge|PulseAudio/Configuration|Configuration should stay in the main article, so the linked page should be merged here. Split [[#Troubleshooting]] instead if this page is found too long.|section=Abandoned draft}}<br />
By default, PulseAudio is configured to automatically detect all sound cards and manage them. It takes control of all detected ALSA devices and redirect all audio streams to itself, making the PulseAudio daemon the central configuration point. The daemon should work mostly out of the box, only requiring a few minor tweaks. <br />
<br />
PulseAudio will first look for configuration files in home directory {{ic|~/.config/pulse}}, then in system wide {{ic|/etc/pulse}}.<br />
<br />
PulseAudio runs as a server daemon that can run either system-wide or on per-user basis using a client/server architecture. The daemon by itself does nothing without its modules except to provide an API and host dynamically loaded modules. The audio routing and processing tasks are all handled by various modules. You can find a detailed list of all available modules at [http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Modules/ Pulseaudio Loadable Modules]. To enable them you can just add a line {{ic|load-module <module-name-from-list>}} to {{ic|~/.config/pulse/default.pa}}.<br />
<br />
{{Tip|<br />
* It is strongly suggested not to edit system wide configuration files, but rather edit user ones. Create the {{ic|~/.config/pulse}} directory, then copy the system configuration files into it and edit according to your need.<br />
* Make sure you keep user configuration in sync with changes to the packaged files in {{ic|/etc/pulse/}}. Otherwise, PulseAudio may refuse to start due to configuration errors.<br />
* There is no need to add your user to audio group, as it uses [[udev]] and ''logind'' to dynamically give access to the currently "active" user}}<br />
<br />
==== daemon.conf ====<br />
<br />
Defines base settings like the default sample rates used by modules, resampling methods, realtime scheduling and various other settings related to the server process. These can not be changed at runtime without restarting the PulseAudio daemon. The defaults are sensible for most users.<br />
<br />
{| class="wikitable"<br />
|+ Notable configuration options<br />
! Option || Description<br />
|+<br />
| system-instance || Run the daemon as a system-wide instance. Highly discouraged as it can introduce security issues. Useful on (headless) systems that have no real local users. Defaults to {{ic|no}}.<br />
|+<br />
| resample-method || Which resampler to use when audio with incompatible sample rates needs to be passed between modules (e.g. playback of 96kHz audio on hardware which only supports 48kHz). The available resamplers can be listed with {{ic|$ pulseaudio --dump-resample-methods}}. Choose the best tradeoff between CPU usage and audio quality for the present use-case. {{Tip|In some cases PulseAudio will generate a high CPU load. This can happen when multiple streams are resampled (individually). If this is a common use-case in a workflow, it should be considered to create an additional sink at a matching sample rate which can then be fed into the main sink, resampling only once.}}<br />
|+<br />
| flat-volumes ||{{ic|flat-volumes}} scales the device-volume with the volume of the "loudest" application. For example, raising the VoIP call volume will raise the hardware volume and adjust the music-player volume so it stays where it was, without having to lower the volume of the music-player manually. Defaults to {{ic|yes}} upstream, but to {{ic|no}} within Arch. {{Note|The default behavior upstream can sometimes be confusing and some applications, unaware of this feature, can set their volume to 100% at startup, potentially blowing your speakers or your ears. This is why Arch defaults to the classic (ALSA) behavior by setting this to {{ic|no}}.}}<br />
|+<br />
| default-fragments || Audio samples are split into multiple fragments of {{ic|default-fragment-size-msec}} each. The larger the buffer is, the less likely audio will skip when the system is overloaded. On the downside this will increase the overall latency. Increase this value if you have issues.<br />
|}<br />
<br />
==== default.pa ====<br />
<br />
This file is a startup script and is used to configure modules. It is actually parsed and read after the daemon has finished initializing and additionnal commands can be sent at runtime using {{ic|$ pactl}} or {{ic|$ pacmd}}. The startup script can also be provided on the command line by starting PulseAudio in a terminal using {{ic|$ pulseaudio -nC}}. This will make the daemon load the CLI module and will accept the configuration directly from the command line, and output resulting information or error messages on the same terminal. This can be useful when debugging the daemon or just to test various modules before setting them permanently on disk. The manual page is quite self-explanatory, please consult {{ic|man pulse-cli-syntax}} for the details of the syntax.<br />
<br />
{{tip|<br />
* Run {{ic|<nowiki>$ pacmd list-sinks|egrep -i 'index:|name:'</nowiki>}} to list available sinks. The present default sink is marked with an asterisk.<br />
* Edit {{ic|~/.config/pulse/default.pa}} to insert/alter the set-default-sink command using the sink's name as the numbering cannot be guaranteed repeatable.<br />
}}<br />
<br />
==== {{ic|client.conf}} ====<br />
This is the configuration file read by every PulseAudio client application. It is used to configure runtime options for individual clients. It can be used to set and configure the default sink and source statically as well as allowing (or disallowing) clients to automatically start the server if not currently running.<br />
<br />
=== Configuration command ===<br />
<br />
The main command to configure a server during runtime is {{ic|$ pacmd}}. Run {{ic|$ pacmd --help}} for a list options, or just run {{ic|$ pacmd}} to enter the shell interactive mode and {{ic|Ctrl+d}} to exit. All modifications will immediately be applied.<br />
<br />
Once your new settings have been tested and meet your needs, edit the {{ic|default.pa}} accordingly to make the change persistent. See [[PulseAudio/Examples]] for some basic settings.<br />
<br />
{{Tip|leave the {{ic|load-module module-default-device-restore}} line in the {{ic|default.pa}} file untouched. It will allow you to restart the server in its default state, thus dismissing any wrong setting.}}<br />
<br />
It is important to understand that the "sources" (processes, capture devices) and "sinks" (sound cards, servers, other processes) accessible and selectable through PulseAudio depend upon the current hardware "Profile" selected. These "Profiles" are those ALSA "pcms" listed by the command {{ic|aplay -L}}, and more specifically by the command {{ic|pacmd list-cards}}, which will include a line "index:", a list beginning "profiles:", and a line "active profile: <...>" in the output, among other things.<br />
<br />
The "active profile" can be set with the command {{ic|pacmd set-card-profile INDEX PROFILE}}, with ''no'' comma separating INDEX and PROFILE, where INDEX is just the number on the line "index:" and a PROFILE name is everything shown from the beginning of any line under "profile:" to just ''before'' the colon and first space, as shown by the command {{ic|pacmd list-cards}}. For instance, {{ic|pacmd set-card-profile 0 output:analog-stereo+input:analog-stereo}}.<br />
<br />
It may be easier to select a "Profile" with a graphical tool like {{ic|pavucontrol}}, under the "Configuration" tab, or KDE System Settings, "Multimedia/Audio and Video Settings", under the "Audio Hardware Setup" tab. Each audio "Card", which are those devices listed by the command {{ic|aplay -l}}, or again by the command {{ic|pacmd list-cards}}, will have its own selectable "Profile". When a "Profile" has been selected, the then available "sources" and "sinks" can be seen by using the commands {{ic|pacmd list-sources}} and {{ic|pacmd list-sinks}}. Note that the "index" of the available sources and sinks will change each time a card profile is changed.<br />
<br />
The selected "Profile" can be an issue for some applications, especially the Adobe Flash players, typically {{ic|/usr/lib/mozilla/plugins/libflashplayer.so}} and {{ic|/usr/lib/PepperFlash/libpepflashplayer.so}}. Often, these Flash players will only work when one of the Stereo profiles is selected, and otherwise, will play video with no sound, or will simply "crash". When all else fails, you might try selecting a different profile.<br />
<br />
Of course, when configuring some variation of Surround Sound in PulseAudio, the appropriate Surround profile will have to be selected, before Surround Sound will work, or in order to do things like remap the speaker channels.<br />
<br />
== Running ==<br />
<br />
Since [http://www.freedesktop.org/wiki/Software/PulseAudio/Notes/7.0/ version 7.0], PulseAudio on Arch uses socket activation. [https://projects.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/pulseaudio&id=419bd740dc8 By default], {{ic|pulseaudio.socket}} is enabled for the [[systemd/User]] instance.<br />
<br />
{{Note|<br />
* To disable {{ic|pulseaudio.socket}}, make sure that {{ic|$XDG_CONFIG_HOME/systemd/user/}} exists and run {{ic|systemctl --user mask pulseaudio.socket}}.<br />
* Many [[desktop environments]] autostart programs based on [[Desktop entries#Autostart|desktop files]] in the {{ic|/etc/xdg/autostart/}} directory. In this case, PulseAudio will be launched automatically regardless of the socket activation status.<br />
}}<br />
<br />
For more information, see [http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Running/ PulseAudio: Running].<br />
<br />
=== Starting manually ===<br />
<br />
PulseAudio can be manually started with:<br />
$ pulseaudio --start<br />
<br />
And stopped with:<br />
$ pulseaudio --kill<br />
<br />
== Back-end configuration ==<br />
<br />
=== ALSA ===<br />
<br />
Install the {{Pkg|pulseaudio-alsa}} package. It contains the necessary {{ic|/etc/asound.conf}} for configuring ALSA to use PulseAudio.<br />
<br />
Also install {{Pkg|lib32-libpulse}} and {{Pkg|lib32-alsa-plugins}} if you run a x86_64 system and want to have sound for 32-bit [[multilib]] programs like Wine, Skype and Steam.<br />
<br />
To prevent applications from using ALSA's OSS emulation and bypassing PulseAudio (thereby preventing other applications from playing sound), make sure the module {{ic|snd_pcm_oss}} is not being loaded at boot. If it is currently loaded ({{ic|<nowiki>lsmod | grep oss</nowiki>}}), disable it by executing:<br />
# rmmod snd_pcm_oss<br />
<br />
==== ALSA/dmix without grabbing hardware device ====<br />
<br />
{{Note|This section describes alternative configuration, which is generally '''not''' recommended.}}<br />
<br />
You may want to use ALSA directly in most of your applications while still being able to use applications which require PulseAudio at the same time. The following steps allow you to make PulseAudio use dmix instead of grabbing ALSA hardware device.<br />
<br />
* Remove package {{Pkg|pulseaudio-alsa}}, which provides compatibility layer between ALSA applications and PulseAudio. After this your ALSA apps will use ALSA directly without being hooked by Pulse.<br />
<br />
* Edit {{ic|/etc/pulse/default.pa}}.<br />
:Find and uncomment lines which load back-end drivers. Add '''device''' parameters as follows. Then find and comment lines which load autodetect modules.<br />
load-module module-alsa-sink '''device=dmix'''<br />
load-module module-alsa-source '''device=dsnoop'''<br />
# load-module module-udev-detect<br />
# load-module module-detect<br />
<br />
* ''Optional:'' If you use {{Pkg|kdemultimedia-kmix}} you may want to control ALSA volume instead of PulseAudio volume:<br />
$ echo export KMIX_PULSEAUDIO_DISABLE=1 > ~/.kde4/env/kmix_disable_pulse.sh<br />
$ chmod +x ~/.kde4/env/kmix_disable_pulse.sh<br />
<br />
* Now, reboot your computer and try running ALSA and PulseAudio applications at the same time. They both should produce sound simultaneously.<br />
:Use {{Pkg|pavucontrol}} to control PulseAudio volume if needed.<br />
<br />
=== OSS ===<br />
<br />
There are multiple ways of making OSS-only programs output to PulseAudio:<br />
<br />
==== ossp ====<br />
<br />
Install {{Pkg|ossp}} package and start {{ic|osspd.service}}.<br />
<br />
==== padsp wrapper ====<br />
<br />
Programs using OSS can work with PulseAudio by starting it with padsp (included with PulseAudio):<br />
<br />
$ padsp OSSprogram<br />
<br />
A few examples:<br />
<br />
$ padsp aumix<br />
$ padsp sox foo.wav -t ossdsp /dev/dsp<br />
<br />
You can also add a custom wrapper script like this: <br />
<br />
{{hc|/usr/local/bin/OSSProgram|<nowiki><br />
#!/bin/sh<br />
exec padsp /usr/bin/OSSprogram "$@"<br />
</nowiki>}}<br />
<br />
Make sure {{ic|/usr/local/bin}} comes before {{ic|/usr/bin}} in your '''PATH'''.<br />
<br />
=== GStreamer ===<br />
<br />
Install {{Pkg|gst-plugins-good}}, or {{Pkg|gstreamer0.10-good-plugins}} if your intended program has a legacy [[GStreamer]] implementation.<br />
<br />
=== OpenAL ===<br />
<br />
OpenAL Soft should use PulseAudio by default, but can be explicitly configured to do so: {{hc|/etc/openal/alsoft.conf|2=drivers=pulse,alsa}}<br />
<br />
=== libao ===<br />
<br />
Edit the libao configuration file:<br />
{{hc|/etc/libao.conf|2=default_driver=pulse}}<br />
Be sure to remove the {{ic|1=dev=default}} option of the alsa driver or adjust it to specify a specific Pulse sink name or number. <br />
<br />
{{Note|You could possibly also keep the libao standard of outputting to the ''alsa'' driver and its default device if you install {{pkg|pulseaudio-alsa}} since the ALSA default device then '''is''' PulseAudio.}}<br />
<br />
== Equalizer ==<br />
<br />
{{Out of date|As of {{pkg|pulseaudio}}-7.0-2, the {{ic|module-equalizer-sink}} is unsupported, see [[Talk:PulseAudio#Equalizer module is unsupported]].}}<br />
<br />
PulseAudio has an integrated 10-band equalizer system. In order to use the equalizer do the following:<br />
<br />
Install {{Pkg|pulseaudio-equalizer}}:<br />
<br />
=== Load equalizer sink and dbus-protocol module ===<br />
<br />
$ pactl load-module module-equalizer-sink<br />
$ pactl load-module module-dbus-protocol<br />
<br />
=== GUI front-end ===<br />
<br />
run:<br />
<br />
$ qpaeq<br />
<br />
{{Note|If qpaeq has no effect, install {{pkg|pavucontrol}} and change "ALSA Playback on" to "FFT based equalizer on ..." while the media player is running.}}<br />
<br />
=== Load equalizer and dbus module on every boot ===<br />
<br />
Edit the {{ic|/etc/pulse/default.pa}} or {{ic|~/.config/pulse/default.pa}} file with your favorite editor and append the following lines:<br />
<br />
### Load the integrated PulseAudio equalizer and D-Bus module<br />
load-module module-equalizer-sink<br />
load-module module-dbus-protocol<br />
<br />
{{Note|The equalizer sink needs to be loaded after the master sink is already available.}}<br />
<br />
== Applications ==<br />
<br />
=== QEMU ===<br />
<br />
{{Merge|QEMU|QEMU is the most complex of the "applications" described in this section, merging to the main article would provide better context.}}<br />
<br />
The audio driver used by QEMU is set with the {{ic|QEMU_AUDIO_DRV}} environment variable:<br />
<br />
$ export QEMU_AUDIO_DRV=pa<br />
<br />
Run the following command to get QEMU's configuration options related to PulseAudio:<br />
<br />
$ qemu-system-x86_64 -audio-help | awk '/Name: pa/' RS=<br />
<br />
The listed options can be exported as environment variables, for example:<br />
<br />
{{bc|1=<br />
$ export QEMU_PA_SINK=alsa_output.pci-0000_04_01.0.analog-stereo.monitor<br />
$ export QEMU_PA_SOURCE=input<br />
}}<br />
<br />
{{Style|The following is not specific to PulseAudio.}}<br />
<br />
To get list of the supported emulation audio drivers<br />
$ qemu-system-x86_64 -soundhw help<br />
<br />
To use e.g. {{ic|ac97}} driver for the guest use the {{ic|-soundhw ac97}} commnad with QEMU.<br />
<br />
{{Note|Video graphic card emulated drivers for the guest machine may also cause a problem with the sound quality. Test one by one to make it work. You can list possible options with {{ic|<nowiki>qemu-system-x86_64 -h | grep vga</nowiki>}}.}}<br />
<br />
=== AlsaMixer.app ===<br />
<br />
Make {{AUR|alsamixer.app}} dockapp for the {{Pkg|windowmaker}} use pulseaudio, e.g.<br />
$ AlsaMixer.app --device pulse<br />
<br />
Here is a two examples where the first one is for ALSA and the other one is for pulseaudio. You can run multiple instances of it. Use the {{ic|-w}} option to choose which of the control buttons to bind to the mouse wheel.<br />
# AlsaMixer.app -3 Mic -1 Master -2 PCM --card 0 -w 1<br />
# AlsaMixer.app --device pulse -1 Capture -2 Master -w 2<br />
<br />
{{Note|It can use only those output sinks that set as default.}}<br />
<br />
=== XMMS2 ===<br />
<br />
Make it switch to pulseaudio output<br />
$ nyxmms2 server config output.plugin pulse<br />
and to alsa<br />
$ nyxmms2 server config output.plugin alsa<br />
To make xmms2 use a different output sink, e.g.<br />
$ nyxmms2 server config pulse.sink alsa_output.pci-0000_04_01.0.analog-stereo.monitor<br />
<br />
See also the official guide [https://xmms2.org/wiki/Using_the_application].<br />
<br />
=== KDE Plasma Workspaces and Qt4 ===<br />
<br />
PulseAudio will automatically be used by KDE/Qt4 applications. It is supported by default in the KDE sound mixer. For more information see the [http://www.pulseaudio.org/wiki/KDE KDE page in the PulseAudio wiki]. One useful tidbit from that page is to add {{ic|load-module module-device-manager}} to {{ic|/etc/pulse/default.pa}}.<br />
<br />
If the phonon-gstreamer backend is used for Phonon, GStreamer should also be configured as described in [[#GStreamer]].<br />
<br />
=== Audacious ===<br />
<br />
[[Audacious]] natively supports PulseAudio. In order to use it, set Audacious Preferences -> Audio -> Current output plugin to 'PulseAudio Output Plugin'.<br />
<br />
=== Java/OpenJDK 6 ===<br />
<br />
Create a wrapper for the Java executable using padsp as seen on the [[Java#Java_sound_with_PulseAudio|Java sound with PulseAudio]] page.<br />
<br />
=== Music Player Daemon (MPD) ===<br />
<br />
[http://mpd.wikia.com/wiki/PulseAudio configure] [[MPD]] to use PulseAudio. See also [[MPD/Tips and Tricks#MPD and PulseAudio]].<br />
<br />
=== MPlayer ===<br />
<br />
[[MPlayer]] natively supports PulseAudio output with the {{ic|-ao pulse}} option. It can also be configured to default to PulseAudio output, in {{ic|~/.mplayer/config}} for per-user, or {{ic|/etc/mplayer/mplayer.conf}} for system-wide:<br />
{{hc|/etc/mplayer/mplayer.conf|2=ao=pulse}}<br />
<br />
=== guvcview ===<br />
<br />
{{Pkg|guvcview}} when using the PulseAudio input from a [[Webcam]] may have the audio input suspended resulting in no audio being recorded. You can check this by executing:<br />
<br />
$ pactl list sources<br />
<br />
If the audio source is "suspended" then modifying the following line in {{ic|/etc/pulse/default.pa}} and changing:<br />
<br />
load-module module-suspend-on-idle<br />
to<br />
#load-module module-suspend-on-idle<br />
<br />
And then either restarting PulseAudio or your computer will only idle the input source instead of suspending it. guvcview will then correctly record audio from the device.<br />
<br />
== Tips and tricks ==<br />
<br />
=== Keyboard volume control ===<br />
<br />
Map the following commands to your volume keys: {{ic|XF86AudioRaiseVolume}}, {{ic|XF86AudioLowerVolume}}, {{ic|XF86AudioMute}}<br />
<br />
First find out which sink corresponds to the audio output you'd like to control.<br />
To list available sinks:<br />
pactl list sinks short<br />
<br />
Suppose sink 0 is to be used, to raise the volume:<br />
sh -c "pactl set-sink-mute 0 false ; pactl set-sink-volume 0 +5%"<br />
<br />
To lower the volume:<br />
sh -c "pactl set-sink-mute 0 false ; pactl -- set-sink-volume 0 -5%"<br />
<br />
To mute/unmute the volume:<br />
pactl set-sink-mute 0 toggle<br />
<br />
To mute/unmute the microphone:<br />
pactl set-source-mute 1 toggle<br />
<br />
=== Play sound from a non-interactive shell (systemd service, cron) === <br />
<br />
Set {{ic|XDG_RUNTIME_DIR}} before the command (replace {{ic|''user_id''}} with the ID of the user running PulseAudio):<br />
<br />
XDG_RUNTIME_DIR=/run/user/''user_id'' paplay /usr/share/sounds/freedesktop/stereo/complete.oga<br />
<br />
Or use {{ic|machinectl}}:<br />
<br />
# machinectl shell .host --uid=''user_id'' /usr/bin/paplay /usr/share/sounds/freedesktop/stereo/complete.oga<br />
<br />
=== X11 Bell Events ===<br />
<br />
To get pulseaudio to handle X11 bell events, run the following commands after the X11 session has been started:<br />
<br />
pactl upload-sample /usr/share/sounds/freedesktop/stereo/bell.oga x11-bell<br />
pactl load-module module-x11-bell sample=x11-bell display=$DISPLAY<br />
<br />
To adjust the volume of the X11 bell, run the following command:<br />
<br />
xset b 100<br />
<br />
100 is a percentage. This requires the {{Pkg|xorg-xset}} package. See [[Autostarting]] for a way to run these commands automatically when the X11 session is started.<br />
<br />
=== Switch on connect ===<br />
This is a module used to switch the output sound to the newly connected device. For example, if you plug in a USB headset, the output will be switched to that. If you unplug it, the output will be send back to the last device. This used to be quite buggy, but got a lot of attention for PulseAudio 8.0 and is working really well now.<br />
<br />
If you just want to test the module then you can load it at runtime by calling:<br />
pactl load-module module-switch-on-connect<br />
<br />
If you want to make the change persistent the nyou will have to add it to your local pulseaudio settings or to /etc/pulse/default.pa (for system wide). In either case, add this line:<br />
load-module module-switch-on-connect<br />
<br />
==== On KDE/Plasma5: disable module-device-manager! ====<br />
When KDE or Plasma5 is started it loads (via start-pulseaudio-x11) the module module-device-manager for pulseaudio to manage the devices. But that module apparently conflicts with module-switch-on-connect so you should disable that module by editing /bin/start-pulseaudio-x11 and commenting the lines for KDE. For me the file looks like this:<br />
#!/bin/sh<br />
<br />
# This file is part of PulseAudio.<br />
#<br />
# PulseAudio is free software; you can redistribute it and/or modify<br />
# it under the terms of the GNU Lesser General Public License as published by<br />
# the Free Software Foundation; either version 2 of the License, or<br />
# (at your option) any later version.<br />
#<br />
# PulseAudio is distributed in the hope that it will be useful, but<br />
# WITHOUT ANY WARRANTY; without even the implied warranty of<br />
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU<br />
# General Public License for more details.<br />
#<br />
# You should have received a copy of the GNU Lesser General Public License<br />
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.<br />
<br />
set -e<br />
<br />
if [ x"$DISPLAY" != x ] ; then<br />
<br />
/usr/bin/pactl load-module module-x11-publish "display=$DISPLAY" > /dev/null<br />
#/usr/bin/pactl load-module module-x11-cork-request "display=$DISPLAY" > /dev/null<br />
<br />
# if [ x"$KDE_FULL_SESSION" = x"true" ]; then<br />
# /usr/bin/pactl load-module module-device-manager "do_routing=1" > /dev/null<br />
# fi<br />
<br />
if [ x"$SESSION_MANAGER" != x ] ; then<br />
/usr/bin/pactl load-module module-x11-xsmp "display=$DISPLAY session_manager=$SESSION_MANAGER" > /dev/null<br />
fi<br />
fi<br />
<br />
Logout and in again and on connect switching works just fine.<br />
<br />
== Troubleshooting ==<br />
<br />
See [[PulseAudio/Troubleshooting]].<br />
<br />
== See also ==<br />
<br />
* [http://www.alsa-project.org/main/index.php/Asoundrc .asoundrc on ALSA wiki]<br />
* [http://www.pulseaudio.org/ PulseAudio official site]<br />
* [http://www.freedesktop.org/wiki/Software/PulseAudio/FAQ/ PulseAudio FAQ]</div>Markg85https://wiki.archlinux.org/index.php?title=Bridge_with_netctl&diff=303012Bridge with netctl2014-03-03T14:14:13Z<p>Markg85: /* Configuration */</p>
<hr />
<div>[[Category:Networking]]<br />
A bridge is a piece of software used to unite two or more network segments. A bridge behaves like a virtual network switch, working transparently (the other machines don't need to know or care about its existence). Any real devices (e.g. {{ic|eth0}}) and virtual devices (e.g. {{ic|tap0}}) can be connected to it.<br />
<br />
This article explains how to create a bridge that contains at least an ethernet device. This is useful for things like the bridge mode of [[QEMU]], setting a software based access point, etc.<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] the {{Pkg|netctl}} package from the [[official repositories]].<br />
<br />
[[pacman|Install]] the {{Pkg|bridge-utils}} package from the [[official repositories]].<br />
<br />
== Configuration ==<br />
<br />
* Copy {{ic|/etc/netctl/examples/bridge}} to {{ic|/etc/netctl/bridge}}.<br />
* In this example, we create a bridge called {{ic|br0}} which has real Ethernet adapter {{ic|eth0}} and optionally a tap device {{ic|tap0}} connected to it. Of course, edit {{ic|br0}}, {{ic|eth0}} and {{ic|tap0}} to your needs.<br />
<br />
{{hc|/etc/netctl/bridge|<nowiki><br />
Description="Example Bridge connection"<br />
Interface=br0<br />
Connection=bridge<br />
BindsToInterfaces=(eth0)<br />
IP=dhcp<br />
</nowiki>}}<br />
<br />
{{Tip|If you are using static IP, see man pages of [[netctl]], and also edit {{ic|/etc/resolv.conf}} if necessary.}}<br />
<br />
* You can bridge any combination of network devices editing {{ic|BindsToInterfaces}} option.<br />
* If any of the bridged devices (e.g. {{ic|eth0}}, {{ic|tap0}}) had [[dhcpcd]] enabled, [[systemd#Using units|stop and disable]] the {{ic|dhcpcd@eth0.service}} daemon. Or set {{ic|1=IP=no}} to the netctl profiles.<br />
* Finally, [[netctl#Just one profile|start and enable]] your {{ic|/etc/netctl/bridge}}.<br />
<br />
== Tips and tricks ==<br />
<br />
=== Manually adding/removing network devices ===<br />
<br />
The {{Pkg|bridge-utils}} package provides tool ''brctl'' to manipulate bridges. You can use it to manually add or remove a device from a bridge:<br />
<br />
# brctl addif br0 eth1<br />
# brctl delif br0 eth0<br />
<br />
See {{ic|brctl(8)}}<br />
<br />
=== Wireless interface on a bridge ===<br />
<br />
To add a wireless interface to a bridge, you first have to assign the wireless interface to an access point or start an access point with hostapd. Otherwise the wireless interface won't be added to the bridge.</div>Markg85https://wiki.archlinux.org/index.php?title=GitLab&diff=261245GitLab2013-06-05T12:40:16Z<p>Markg85: /* Required packages */</p>
<hr />
<div>[[Category:Version Control System]]<br />
{{Article summary start}}<br />
{{Article summary text|This page gives guidelines for the installation and configuration of Gitlab on Archlinux.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Gitolite}}<br />
{{Article summary wiki|Ruby on Rails}}<br />
{{Article summary end}}<br />
{{Merge|Gitlab2|Most of the article is duplicated.}}<br />
{{Out of date|As of version 5.0,Gitlab will no longer depend on gitolite. Also redis is replaced by sidekiq. A rewrite is scheduled when 5.0 comes out on March 22nd.}}<br />
<br />
[http://gitlab.org/ Gitlab] is a free git repository management application based on [[Ruby on Rails]]. It is distributed under the MIT License and its source code can be found on [https://github.com/gitlabhq/gitlabhq Github]. It is a very active project with a monthly release cycle and ideal for businesses that want to keep their code private. Consider it as a self hosted Github but open source. You can try a demo [http://demo.gitlabhq.com/ here].<br />
<br />
==Required packages==<br />
<br />
Install the packages below as they are needed to proceed further.<br />
<br />
# pacman -Syu --noconfirm --needed sudo base-devel zlib libyaml openssl gdbm readline ncurses libffi curl git openssh redis libxml2 libxslt icu python2 mysql postgresql<br />
<br />
{{Note| In order to receive mail notifications, make sure to install a mail server. By default, Archlinux does not ship with one. The recommended mail server is [[postfix]], but you can use others such as [[SSMTP]], [[msmtp]], [[sendmail]], [https://wiki.archlinux.org/index.php/Category:Mail_Server etc].}}<br />
<br />
== PKGBUILDs for Gitlab and Gitlab-shell ==<br />
There are some (not fully working) PKGBUILDs available to create installable packages:<br />
<br />
[https://github.com/mtorromeo/archlinux-packages/tree/master/gitlab Gitlab PKGBUILD on GitHub.com]<br />
<br />
[https://github.com/mtorromeo/archlinux-packages/tree/master/gitlab-shell Gitlab-shell PKGBUILD on GitHub.com]<br />
<br />
(Please extend/rename this section with further instructions)<br />
<br />
==Ruby==<br />
<br />
GitLab supports [[ruby]] >= {{ic|1.9.3}} and {{ic|2.0.0}}, but some dependencies gems work better with ruby {{ic|1.9.3}}. Install it from the official repositories and if you bump into any trouble use [[rvm]] with ruby {{ic|1.9.3-p392}}.<br />
<br />
{{Note|If you want to use rvm be sure to check out [[Gitlab#Running GitLab with rvm]] before starting with the installation}}<br />
<br />
==User accounts==<br />
<br />
Add {{ic|git}} user:<br />
<br />
# useradd -U -m -d /home/git git<br />
<br />
{{Note| {{ic|git}} user must have its initial group set to {{ic|git}} (not {{ic|users}}). If the initial group is not {{ic|git}}, then all files created by the {{ic|git}} user will be owned by {{ic|git:users}} which will prevent GitLab from showing you a newly created repository (it will get stucked at the page where it tells you how to push to the new repository).}}<br />
<br />
==gitlab-shell==<br />
<br />
GitLab Shell is an ssh access and repository management software developed specially for GitLab.<br />
<br />
Login as git:<br />
<br />
# su - git<br />
<br />
Clone gitlab shell:<br />
<br />
$ git clone https://github.com/gitlabhq/gitlab-shell.git<br />
$ cd gitlab-shell<br />
<br />
Switch to the right version:<br />
<br />
$ git checkout v1.4.0<br />
<br />
Edit {{ic|config.yml}} and replace gitlab_url with something like {{ic|http://domain.com/}}:<br />
<br />
$ cp config.yml.example config.yml<br />
<br />
Setup the environment:<br />
<br />
$ ./bin/install<br />
<br />
You should see this result:<br />
<br />
{{hc|Example output|<nowiki><br />
mkdir -p /home/git/repositories: true<br />
mkdir -p /home/git/.ssh: true<br />
chmod 700 /home/git/.ssh: true<br />
touch /home/git/.ssh/authorized_keys: true<br />
chmod 600 /home/git/.ssh/authorized_keys: true<br />
chmod -R ug+rwX,o-rwx /home/git/repositories: true<br />
find /home/git/repositories -type d -print0 | xargs -0 chmod g+s: true<br />
</nowiki>}}<br />
<br />
==Database selection==<br />
<br />
Currently GitLab supports [[MySQL]] and [[PostgreSQL]]. [[MariaDB]] has not been officially tested.<br />
<br />
===MariaDB===<br />
<br />
[[pacman|Install]] {{Pkg|mariadb}} and {{Pkg|libmariadbclient}} from the [[official repositories]] and start the [[daemon]]. Create the database and do not forget to replace {{ic|your_password_here}} with a real one.<br />
<br />
# su - git<br />
$ mysql -u root -p<br />
<br />
mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;<br />
mysql> CREATE USER 'gitlab'@'localhost' IDENTIFIED BY 'your_password_here';<br />
mysql> GRANT SELECT, LOCK TABLES, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'gitlab'@'localhost';<br />
mysql> \q<br />
<br />
Try connecting to the new database with the new user:<br />
<br />
$ mysql -u gitlab -p -D gitlabhq_production<br />
<br />
===PostgreSQL===<br />
<br />
[[pacman|Install]] {{Pkg|postgresql}} and {{Pkg|libpqxx}} from the [[official repositories]]. Follow [[PostgreSQL#Installing_PostgreSQL]] to set it up and start the [[daemon]].<br />
<br />
Login to PostgreSQL and remember to change {{ic|your_password_here}} to a real one:<br />
<br />
# sudo -u postgres psql -d template1<br />
<br />
template1=# CREATE USER git WITH PASSWORD 'your_password_here';<br />
template1=# CREATE DATABASE gitlabhq_production OWNER git;<br />
template1=# \q<br />
<br />
Try connecting to the new database with the new user:<br />
<br />
# sudo -u git -H psql -d gitlabhq_production<br />
<br />
===MySQL===<br />
<br />
If you are still in favor of {{AUR|mysql}}, follow the same commands as MariaDB.<br />
<br />
==Gitlab==<br />
<br />
===Installation===<br />
<br />
Clone GitLab's repository:<br />
# su - git<br />
$ git clone https://github.com/gitlabhq/gitlabhq.git gitlab<br />
$ cd gitlab<br />
$ git checkout 5-2-stable<br />
<br />
{{Note| You can change {{ic|5-2-stable}} to {{ic|master}} if you want the bleeding edge version, but do so with caution! Check github to see what is the latest stable version and replace above accordingly.}}<br />
<br />
===Basic configuration===<br />
<br />
First we need to rename the example file.<br />
<br />
$ cp config/gitlab.yml.example config/gitlab.yml<br />
<br />
The options are pretty straightforward. Open {{ic|config/gitlab.yml}} with your favorite editor and edit where needed.<br />
Make sure to change {{ic|localhost}} to the fully-qualified domain name of your host serving GitLab where necessary.<br />
<br />
Make sure GitLab can write to the {{ic|log/}} and {{ic|tmp/}} directories:<br />
<br />
$ chown -R git log/<br />
$ chown -R git tmp/<br />
$ chmod -R u+rwX log/<br />
$ chmod -R u+rwX tmp/<br />
<br />
Create directory for satellites:<br />
<br />
$ mkdir /home/git/gitlab-satellites<br />
<br />
Create directories for sockets/pids and make sure GitLab can write to them:<br />
<br />
$ mkdir tmp/{pids,sockets}<br />
$ chmod -R u+rwX tmp/{pids,sockets}<br />
<br />
Create the {{ic|public/uploads}} directory otherwise backup will fail:<br />
<br />
$ mkdir public/uploads<br />
$ chmod -R u+rwX public/uploads<br />
<br />
Copy the example Puma config and edit to your liking:<br />
<br />
$ cp config/puma.rb.example config/puma.rb<br />
<br />
Configure Git global settings for git user, useful when editing via web. Edit {{ic|user.email}} according to what is set in {{ic|gitlab.yml}}:<br />
<br />
$ git config --global user.name "GitLab"<br />
$ git config --global user.email "gitlab@localhost"<br />
<br />
Configure GitLab database settings:<br />
<br />
* MariaDB:<br />
$ cp config/database.yml.mysql config/database.yml<br />
<br />
* PostgreSQL:<br />
$ cp config/database.yml.postgresql config/database.yml<br />
<br />
Make sure to update {{ic|username}}/{{ic|password}} in {{ic|config/database.yml}}.<br />
<br />
<br />
===Install gems===<br />
<br />
{{Tip| If you do not want to download any gem documentation, add {{ic|gem: --no-rdoc --no-ri}} to {{ic|/home/git/.gemrc}}. Be sure to add it as the {{ic|git}} user in order to acquire the appropriate permissions.}}<br />
{{Note|See bug #[https://bugs.archlinux.org/task/33327 33327] for about system-wide gems. As a temporary solution the following packages will be installed as {{ic|git}} user, make sure nano {{ic|~/.gemrc}} contains {{ic|gem: ... --user-install}}. And then add the {{ic|bin}} path to the {{ic|PATH}} variable like so {{ic|1=export PATH="${PATH}:~/.gem/ruby/2.0.0/bin"}}.}}<br />
<br />
Install {{ic|bundler}} and {{ic|charlock_holmes}} under {{ic|$HOME/.gem/}} (normally system wide via sudo):<br />
<br />
# su - git<br />
$ gem install charlock_holmes --version '0.6.9.4'<br />
$ gem install bundler<br />
<br />
Install gems from Gemfile:<br />
<br />
$ cd gitlab/<br />
<br />
{{Note|When executing the below and you recieve `Could not verify the SSL certificate for https://rubygems.org/` see bug #[https://github.com/gitlabhq/gitlabhq/issues/4095 GitHub-4095] most likely because you're behind a proxy that tries to inject a local certificate for SSL domains in order to verify its content}}<br />
<br />
If you used MariaDB:<br />
<br />
$ bundle install --deployment --without development test postgres<br />
<br />
If you used PostgreSQL:<br />
<br />
$ bundle install --deployment --without development test mysql<br />
<br />
{{Note|1= Using {{ic|--without group_name}} in bundle command line will ignore required packages for the mentioned groups.}}<br />
<br />
===Initialize Database===<br />
<br />
{{Note| Make sure the redis [[daemon]] is enabled and started, otherwise the following command will fail. To check the status and see if it's running execute {{ic|systemctl status redis}}, if it's dead start it as per usual via {{ic|systemctl start redis}}}}<br />
<br />
Initialize database and activate advanced features: <br />
$ bundle exec rake gitlab:setup RAILS_ENV=production<br />
<br />
{{Note|If you recieve a error {{ic|No such file or directory - /home/git/repositories/root}} then most likely you've changed the default configuration for {{ic|GitLab}} and you'll need to modify all static paths in {{ic|config/gitlab.yml}} and run the above command again to initialize the database!}}<br />
<br />
===Check status===<br />
<br />
With the following commands we check if the steps we followed so far are configured properly. <br />
<br />
$ bundle exec rake gitlab:env:info RAILS_ENV=production<br />
$ bundle exec rake gitlab:check RAILS_ENV=production<br />
<br />
{{hc|Example output of gitlab:env:info|<br />
System information<br />
System: Arch Linux<br />
Current User: git<br />
Using RVM: yes<br />
RVM Version: 1.20.3<br />
Ruby Version: 2.0.0p0<br />
Gem Version: 2.0.0<br />
Bundler Version:1.3.5<br />
Rake Version: 10.0.4<br />
<br />
GitLab information<br />
Version: 5.2.0.pre<br />
Revision: 4353bab<br />
Directory: /home/git/gitlab<br />
DB Adapter: mysql2<br />
URL: http://gitlab.arch<br />
HTTP Clone URL: http://gitlab.arch/some-project.git<br />
SSH Clone URL: git@gitlab.arch:some-project.git<br />
Using LDAP: no<br />
Using Omniauth: no<br />
<br />
GitLab Shell<br />
Version: 1.4.0<br />
Repositories: /home/git/repositories/<br />
Hooks: /home/git/gitlab-shell/hooks/<br />
Git: /usr/bin/git<br />
}}<br />
<br />
{{Note| {{ic|gitlab:check}} will complain about missing initscripts. Don't worry, we will use ArchLinux' [[systemd]] to manage server start (which GitLab does not recognize).}}<br />
<br />
==Web server configuration==<br />
<br />
<br />
===Unicorn only===<br />
<br />
{{Note|As of GitLab 5.1 Unicorn is no longer the default server as it got replaced by Puma. You can therefore ignore this section.}}<br />
<br />
Edit {{ic|/home/gitlab/gitlab/config/unicorn.rb}} uncomment:<br />
<br />
listen 8080 # listen to port 8080 on all TCP interfaces<br />
<br />
Create {{ic|/etc/rc.d/unicorn-gitlab}}.<br />
<pre><br />
#!/bin/bash<br />
<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
<br />
<br />
PID=`pidof -o %PPID /usr/bin/ruby`<br />
case "$1" in<br />
start)<br />
stat_busy "Starting unicorn"<br />
[ -z "$PID" ] && sudo -u gitlab bash -c "source /home/gitlab/.bash_profile && cd /home/gitlab/gitlab/ && bundle exec unicorn_rails -c config/unicorn.rb -E production -D"<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
add_daemon unicorn<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Stopping unicorn"<br />
[ ! -z "$PID" ] && kill $PID &> /dev/null<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon unicorn<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 1<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
esac<br />
exit 0<br />
</pre><br />
<br />
Start '''unicorn''':<br />
<br />
# /etc/rc.d/unicorn-gitlab start<br />
<br />
Test it http://localhost:8080<br />
<br />
Add it to DAEMONS array in /etc/rc.conf<br />
<br />
Redirect http port to unicorn server<br />
<br />
# iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080<br />
<br />
And test again, now http://localhost<br />
<br />
===Nginx and unicorn===<br />
<br />
[[pacman|Install]] {{Pkg|nginx}} from the [[official repositories]].<br />
<br />
Run these commands to setup nginx:<br />
<br />
# wget https://raw.github.com/gitlabhq/gitlab-recipes/master/nginx/gitlab -P /etc/nginx/sites-available/<br />
# ln -s /etc/nginx/sites-available/gitlab /etc/nginx/sites-enabled/gitlab <br />
<br />
Edit {{ic|/etc/nginx/sites-enabled/gitlab}} and change YOUR_SERVER_IP and YOUR_SERVER_FQDN to the IP address and fully-qualified domain name of the host serving Gitlab. As you can see nginx needs to access {{ic|/home/gitlab/gitlab/tmp/sockets/gitlab.socket}} socket file. You have to be able to run {{ic|sudo -u http ls /home/gitlab/gitlab/tmp/sockets/gitlab.socket}} successfully. Otherwise setup access to the directory:<br />
<br />
# chgrp http /home/gitlab<br />
# chmod u=rwx,g=rx,o= /home/gitlab<br />
<br />
Restart gitlab.service, resque.service and nginx.<br />
<br />
[http://unicorn.bogomips.org/ Unicorn] is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels. First we rename the example file and then we start unicorn:<br />
<br />
# cd /home/gitlab/gitlab<br />
# sudo -u gitlab cp config/unicorn.rb.orig config/unicorn.rb<br />
# sudo -u gitlab bundle exec unicorn_rails -c config/unicorn.rb -E production -D<br />
<br />
===Apache and unicorn===<br />
<br />
[[pacman|Install]] {{Pkg|apache}} from the [[official repositories]]. <br />
<br />
====Configure Unicorn====<br />
<br />
{{Note|If the default path is not {{ic|/home/git}} for your installation, change the below path accordingly}}<br />
<br />
As the official installation guide instructs, copy the unicorn configuration file:<br />
# sudo -u git -H cp /home/git/gitlab/config/unicorn.rb.example /home/git/gitlab/config/unicorn.rb<br />
<br />
Now edit {{ic|config/unicorn.rb}} and add a listening port by uncommenting the following line:<br />
listen "127.0.0.1:8080"<br />
<br />
{{Tip| You can set a custom port if you want. Just remember to also include it in Apache's virtual host. See below.}}<br />
<br />
====Create a virtual host for Gitlab====<br />
<br />
Create a configuration file for Gitlab’s virtual host and insert the lines below adjusted accordingly. For the ssl section see [[LAMP#SSL]]. If you do not need it, remove it. Notice that the SSL virtual host needs a specific IP instead of generic. Also if you set a custom port for Unicorn, do not forget to set it at the BalanceMember line.<br />
<br />
# mkdir -pv /etc/httpd/conf/vhosts/<br />
<br />
{{hc|/etc/httpd/conf/vhosts/gitlab|<br />
<VirtualHost *:80><br />
ServerName gitlab.myserver.com<br />
ServerAlias www.gitlab.myserver.com<br />
DocumentRoot /home/gitlab/gitlab/public<br />
ErrorLog /var/log/httpd/gitlab_error_log<br />
CustomLog /var/log/httpd/gitlab_access_log combined<br />
<br />
<Proxy balancer://unicornservers><br />
BalancerMember http://127.0.0.1:8080<br />
</Proxy><br />
<br />
<Directory /home/gitlab/gitlab/public><br />
AllowOverride All<br />
Options -MultiViews<br />
</Directory><br />
<br />
RewriteEngine on<br />
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f<br />
RewriteRule ^/(.*)$ balancer://unicornservers%{REQUEST_URI} [P,QSA,L]<br />
<br />
ProxyPass /uploads !<br />
ProxyPass / balancer://unicornservers/<br />
ProxyPassReverse / balancer://unicornservers/<br />
ProxyPreserveHost on<br />
<br />
<Proxy *><br />
Order deny,allow<br />
Allow from all<br />
</Proxy><br />
</VirtualHost><br />
<br />
<VirtualHost MY_IP:443><br />
ServerName gitlab.myserver.com<br />
ServerAlias www.gitlab.myserver.com<br />
DocumentRoot /home/gitlab/gitlab/public<br />
ErrorLog /var/log/httpd/gitlab_error_log<br />
CustomLog /var/log/httpd/gitlab_access_log combined<br />
<br />
<Proxy balancer://unicornservers><br />
BalancerMember http://127.0.0.1:8080<br />
</Proxy><br />
<br />
<Directory /home/gitlab/gitlab/public><br />
AllowOverride All<br />
Options -MultiViews<br />
</Directory><br />
<br />
RewriteEngine on<br />
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f<br />
RewriteRule ^/(.*)$ balancer://unicornservers%{REQUEST_URI} [P,QSA,L]<br />
<br />
ProxyPass /uploads !<br />
ProxyPass / balancer://unicornservers/<br />
ProxyPassReverse / balancer://unicornservers/<br />
ProxyPreserveHost on<br />
<br />
<Proxy *><br />
Order deny,allow<br />
Allow from all<br />
</Proxy><br />
<br />
SSLEngine on<br />
SSLCertificateFile /home/gitlab/gitlab/ssl.cert<br />
SSLCertificateKeyFile /home/gitlab/gitlab/ssl.key<br />
</VirtualHost><br />
}}<br />
<br />
====Enable host and start unicorn====<br />
<br />
Enable your Gitlab virtual host and reload [[Apache]]:<br />
{{hc|/etc/httpd/conf/httpd.conf|Include conf/vhosts/gitlab}}<br />
<br />
Finally start unicorn:<br />
<br />
# cd /home/gitlab/gitlab<br />
# sudo -u gitlab bundle exec unicorn_rails -c config/unicorn.rb -E production -D<br />
<br />
==systemd support==<br />
<br />
Note that you don't need the systemd units to launch shell scripts as suggested by the gitlab authors. Just make sure the ExecStart line points to the full path of the **bundle** executable. <br />
<br />
Create:<br />
{{hc|gitlab.service|<nowiki><br />
<br />
[Unit]<br />
Description=GitLab Puma Server<br />
<br />
[Service]<br />
User=git<br />
WorkingDirectory=/home/git/gitlab<br />
Environment=RAILS_ENV=production<br />
SyslogIdentifier=gitlab-puma<br />
Type=forking<br />
TimeoutStartSec=600<br />
PIDFile=/home/git/gitlab/tmp/pids/puma.pid<br />
<br />
ExecStart=/usr/bin/bundle exec "puma -C /home/git/gitlab/config/puma.rb -e production"<br />
ExecReload=/bin/kill -HUP $MAINPID<br />
ExecStop=/bin/kill -QUIT $MAINPID<br />
<br />
<br />
[Install]<br />
WantedBy=gitlab.target<br />
</nowiki><br />
}}<br />
<br />
{{hc|gitlab-sidekiq.service|<nowiki><br />
[Unit]<br />
Description=GitLab Sidekiq Server<br />
<br />
[Service]<br />
User=git<br />
WorkingDirectory=/home/git/gitlab<br />
Environment=RAILS_ENV=production<br />
SyslogIdentifier=gitlab-sidekiq<br />
Type=forking<br />
PIDFile=/home/git/gitlab/tmp/pids/sidekiq.pid<br />
<br />
<br />
ExecStart=/usr/bin/bundle exec rake sidekiq:start<br />
ExecStop=/usr/bin/bundle exec rake sidekiq:stop<br />
<br />
[Install]<br />
WantedBy=gitlab.target</nowiki><br />
}}<br />
<br />
Also see: https://github.com/gitlabhq/gitlab-recipes/issues/14<br />
<br />
==Useful Tips==<br />
===Hook into /var===<br />
sudo mkdir -m700 /var/log/gitlab /var/tmp/gitlab<br />
sudo chown gitlab:gitlab /var/log/gitlab /var/tmp/gitlab<br />
sudo -u gitlab -i<br />
cd ~/gitlab<br />
d=log; mv $d/* /var/$d/gitlab; rm -f $d/.gitkeep; rm -r $d && ln -s /var/$d/gitlab $d<br />
d=tmp; mv $d/* /var/$d/gitlab; rm -f $d/.gitkeep; rm -r $d && ln -s /var/$d/gitlab $d<br />
<br />
===Hidden options===<br />
Go to Gitlab's home directory<br />
# cd /home/gitlab/gitlab<br />
<br />
and run<br />
# rake -T | grep gitlab<br />
<br />
These are the options so far:<br />
rake gitlab:app:backup_create # GITLAB | Create a backup of the gitlab system<br />
rake gitlab:app:backup_restore # GITLAB | Restore a previously created backup<br />
rake gitlab:app:enable_automerge # GITLAB | Enable auto merge<br />
rake gitlab:app:setup # GITLAB | Setup production application<br />
rake gitlab:app:status # GITLAB | Check gitlab installation status<br />
rake gitlab:gitolite:update_hooks # GITLAB | Rewrite hooks for repos<br />
rake gitlab:gitolite:update_keys # GITLAB | Rebuild each key at gitolite config<br />
rake gitlab:gitolite:update_repos # GITLAB | Rebuild each project at gitolite config<br />
rake gitlab:test # GITLAB | Run both cucumber & rspec<br />
<br />
===Backup and restore===<br />
<br />
Create a backup of the gitlab system:<br />
# sudo -u gitlab -H rake RAILS_ENV=production gitlab:backup:create<br />
<br />
Restore the previously created backup file {{ic|/home/gitlab/gitlab/tmp/backups/20130125_11h35_1359131740_gitlab_backup.tar}}:<br />
# sudo -u gitlab -H rake RAILS_ENV=production gitlab:backup:restore BACKUP=/home/gitlab/gitlab/tmp/backups/20130125_11h35_1359131740<br />
<br />
{{Note| Backup folder is set in {{ic|conig.yml}}. Check [[#Application_specific_settings]].}}<br />
<br />
===Update Gitlab===<br />
<br />
When a new version is out follow the instructions at [https://github.com/gitlabhq/gitlabhq/wiki Github wiki]. A new release is out every 22nd of a month.<br />
<br />
===Migrate from sqlite to mysql===<br />
<br />
Get latest code as described in [[#Update_Gitlab]].<br />
Save data.<br />
# cd /home/gitlab/gitlab<br />
# sudo -u gitlab bundle exec rake db:data:dump RAILS_ENV=production<br />
<br />
Follow [[#Mysql]] instructions and then setup the database.<br />
# sudo -u gitlab bundle exec rake db:setup RAILS_ENV=production<br />
<br />
Finally restore old data.<br />
# sudo -u gitlab bundle exec rake db:data:load RAILS_ENV=production<br />
<br />
===Running GitLab with rvm===<br />
<br />
To run gitlab with rvm first you have to set up an rvm:<br />
<br />
curl -L https://get.rvm.io | bash -s stable --ruby=1.9.3<br />
<br />
{{Note|Version 1.9.3 is currently recommended to avoid some compatibility issues.}}<br />
<br />
For the complete installation you will want to be the final user (e.g. {{ic|git}}) so make sure to switch to this user and activate your rvm:<br />
<br />
su - git<br />
source "$HOME/.rvm/scripts/rvm"<br />
<br />
Then continue with the installation instructions from above. However, the systemd scripts will not work this way, because the environment for the rvm is not activated. The recommendation here is to create to separate shell scripts for {{ic|puma}} and {{ic|sidekiq}} to activate the environment and then start the service:<br />
<br />
{{hc|gitlab.sh|<nowiki><br />
#!/bin/sh<br />
source `/home/git/.rvm/bin/rvm 1.9.3 do rvm env --path`<br />
RAILS_ENV=production bundle exec puma -C "/home/git/gitlab/config/puma.rb"</nowiki><br />
}}<br />
<br />
{{hc|sidekiq.sh|<nowiki><br />
#!/bin/sh<br />
source `/home/git/.rvm/bin/rvm 1.9.3 do rvm env --path`<br />
case $1 in<br />
start)<br />
bundle exec rake sidekiq:start RAILS_ENV=production<br />
;;<br />
stop)<br />
bundle exec rake sidekiq:stop RAILS_ENV=production<br />
;;<br />
*)<br />
echo "Usage $0 {start|stop}"<br />
esac<br />
</nowiki>}}<br />
<br />
Then modify the above systemd files so they use these scripts. Modify the given lines:<br />
<br />
{{hc|gitlab.service|<nowiki><br />
ExecStart=/home/git/bin/gitlab.sh<br />
</nowiki>}}<br />
{{hc|sidekiq.service|<nowiki><br />
ExecStart=/home/git/bin/sidekiq.sh start<br />
ExecStop=/home/git/bin/sidekiq.sh stop<br />
</nowiki>}}<br />
<br />
==Troubleshooting==<br />
<br />
Sometimes things may not work as expected. Be sure to visit the [https://github.com/gitlabhq/gitlab-public-wiki/wiki/Trouble-Shooting-Guide Trouble Shooting Guide].<br />
<br />
==See also==<br />
*[https://github.com/gitlabhq/gitlabhq/blob/stable/doc/install/installation.md Official Documentation]<br />
*[https://github.com/gitlabhq/gitlab-recipes Gitlab recipes for setup on different platforms, update etc.]<br />
*[http://www.andmarios.com/en/2012/06/gitlab-on-an-ubuntu-10-04-server-with-apache/ GitLab on an Ubuntu 10.04 server with Apache]<br />
*[http://blog.phusion.nl/2012/04/21/tutorial-setting-up-gitlab-on-debian-6/ Setting up gitlab on Debian 6]<br />
*[http://howto.basjes.nl/linux/installing-gitlab-on-centos-6 Installing Gitlab on CentOS 6]<br />
*[https://gist.github.com/2440768 Gist: Install Gitlab on Debian Squeeze]<br />
*[https://gist.github.com/3305554 Gist: Install Gitlab on Archlinux]</div>Markg85https://wiki.archlinux.org/index.php?title=GitLab&diff=261244GitLab2013-06-05T12:39:44Z<p>Markg85: /* User accounts */</p>
<hr />
<div>[[Category:Version Control System]]<br />
{{Article summary start}}<br />
{{Article summary text|This page gives guidelines for the installation and configuration of Gitlab on Archlinux.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Gitolite}}<br />
{{Article summary wiki|Ruby on Rails}}<br />
{{Article summary end}}<br />
{{Merge|Gitlab2|Most of the article is duplicated.}}<br />
{{Out of date|As of version 5.0,Gitlab will no longer depend on gitolite. Also redis is replaced by sidekiq. A rewrite is scheduled when 5.0 comes out on March 22nd.}}<br />
<br />
[http://gitlab.org/ Gitlab] is a free git repository management application based on [[Ruby on Rails]]. It is distributed under the MIT License and its source code can be found on [https://github.com/gitlabhq/gitlabhq Github]. It is a very active project with a monthly release cycle and ideal for businesses that want to keep their code private. Consider it as a self hosted Github but open source. You can try a demo [http://demo.gitlabhq.com/ here].<br />
<br />
==Required packages==<br />
<br />
Install the packages below as they are needed to proceed further.<br />
<br />
# pacman -Syu --noconfirm --needed sudo base-devel zlib libyaml openssl gdbm readline ncurses libffi curl git openssh redis libxml2 libxslt icu python2<br />
<br />
{{Note| In order to receive mail notifications, make sure to install a mail server. By default, Archlinux does not ship with one. The recommended mail server is [[postfix]], but you can use others such as [[SSMTP]], [[msmtp]], [[sendmail]], [https://wiki.archlinux.org/index.php/Category:Mail_Server etc].}}<br />
<br />
== PKGBUILDs for Gitlab and Gitlab-shell ==<br />
There are some (not fully working) PKGBUILDs available to create installable packages:<br />
<br />
[https://github.com/mtorromeo/archlinux-packages/tree/master/gitlab Gitlab PKGBUILD on GitHub.com]<br />
<br />
[https://github.com/mtorromeo/archlinux-packages/tree/master/gitlab-shell Gitlab-shell PKGBUILD on GitHub.com]<br />
<br />
(Please extend/rename this section with further instructions)<br />
<br />
==Ruby==<br />
<br />
GitLab supports [[ruby]] >= {{ic|1.9.3}} and {{ic|2.0.0}}, but some dependencies gems work better with ruby {{ic|1.9.3}}. Install it from the official repositories and if you bump into any trouble use [[rvm]] with ruby {{ic|1.9.3-p392}}.<br />
<br />
{{Note|If you want to use rvm be sure to check out [[Gitlab#Running GitLab with rvm]] before starting with the installation}}<br />
<br />
==User accounts==<br />
<br />
Add {{ic|git}} user:<br />
<br />
# useradd -U -m -d /home/git git<br />
<br />
{{Note| {{ic|git}} user must have its initial group set to {{ic|git}} (not {{ic|users}}). If the initial group is not {{ic|git}}, then all files created by the {{ic|git}} user will be owned by {{ic|git:users}} which will prevent GitLab from showing you a newly created repository (it will get stucked at the page where it tells you how to push to the new repository).}}<br />
<br />
==gitlab-shell==<br />
<br />
GitLab Shell is an ssh access and repository management software developed specially for GitLab.<br />
<br />
Login as git:<br />
<br />
# su - git<br />
<br />
Clone gitlab shell:<br />
<br />
$ git clone https://github.com/gitlabhq/gitlab-shell.git<br />
$ cd gitlab-shell<br />
<br />
Switch to the right version:<br />
<br />
$ git checkout v1.4.0<br />
<br />
Edit {{ic|config.yml}} and replace gitlab_url with something like {{ic|http://domain.com/}}:<br />
<br />
$ cp config.yml.example config.yml<br />
<br />
Setup the environment:<br />
<br />
$ ./bin/install<br />
<br />
You should see this result:<br />
<br />
{{hc|Example output|<nowiki><br />
mkdir -p /home/git/repositories: true<br />
mkdir -p /home/git/.ssh: true<br />
chmod 700 /home/git/.ssh: true<br />
touch /home/git/.ssh/authorized_keys: true<br />
chmod 600 /home/git/.ssh/authorized_keys: true<br />
chmod -R ug+rwX,o-rwx /home/git/repositories: true<br />
find /home/git/repositories -type d -print0 | xargs -0 chmod g+s: true<br />
</nowiki>}}<br />
<br />
==Database selection==<br />
<br />
Currently GitLab supports [[MySQL]] and [[PostgreSQL]]. [[MariaDB]] has not been officially tested.<br />
<br />
===MariaDB===<br />
<br />
[[pacman|Install]] {{Pkg|mariadb}} and {{Pkg|libmariadbclient}} from the [[official repositories]] and start the [[daemon]]. Create the database and do not forget to replace {{ic|your_password_here}} with a real one.<br />
<br />
# su - git<br />
$ mysql -u root -p<br />
<br />
mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;<br />
mysql> CREATE USER 'gitlab'@'localhost' IDENTIFIED BY 'your_password_here';<br />
mysql> GRANT SELECT, LOCK TABLES, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'gitlab'@'localhost';<br />
mysql> \q<br />
<br />
Try connecting to the new database with the new user:<br />
<br />
$ mysql -u gitlab -p -D gitlabhq_production<br />
<br />
===PostgreSQL===<br />
<br />
[[pacman|Install]] {{Pkg|postgresql}} and {{Pkg|libpqxx}} from the [[official repositories]]. Follow [[PostgreSQL#Installing_PostgreSQL]] to set it up and start the [[daemon]].<br />
<br />
Login to PostgreSQL and remember to change {{ic|your_password_here}} to a real one:<br />
<br />
# sudo -u postgres psql -d template1<br />
<br />
template1=# CREATE USER git WITH PASSWORD 'your_password_here';<br />
template1=# CREATE DATABASE gitlabhq_production OWNER git;<br />
template1=# \q<br />
<br />
Try connecting to the new database with the new user:<br />
<br />
# sudo -u git -H psql -d gitlabhq_production<br />
<br />
===MySQL===<br />
<br />
If you are still in favor of {{AUR|mysql}}, follow the same commands as MariaDB.<br />
<br />
==Gitlab==<br />
<br />
===Installation===<br />
<br />
Clone GitLab's repository:<br />
# su - git<br />
$ git clone https://github.com/gitlabhq/gitlabhq.git gitlab<br />
$ cd gitlab<br />
$ git checkout 5-2-stable<br />
<br />
{{Note| You can change {{ic|5-2-stable}} to {{ic|master}} if you want the bleeding edge version, but do so with caution! Check github to see what is the latest stable version and replace above accordingly.}}<br />
<br />
===Basic configuration===<br />
<br />
First we need to rename the example file.<br />
<br />
$ cp config/gitlab.yml.example config/gitlab.yml<br />
<br />
The options are pretty straightforward. Open {{ic|config/gitlab.yml}} with your favorite editor and edit where needed.<br />
Make sure to change {{ic|localhost}} to the fully-qualified domain name of your host serving GitLab where necessary.<br />
<br />
Make sure GitLab can write to the {{ic|log/}} and {{ic|tmp/}} directories:<br />
<br />
$ chown -R git log/<br />
$ chown -R git tmp/<br />
$ chmod -R u+rwX log/<br />
$ chmod -R u+rwX tmp/<br />
<br />
Create directory for satellites:<br />
<br />
$ mkdir /home/git/gitlab-satellites<br />
<br />
Create directories for sockets/pids and make sure GitLab can write to them:<br />
<br />
$ mkdir tmp/{pids,sockets}<br />
$ chmod -R u+rwX tmp/{pids,sockets}<br />
<br />
Create the {{ic|public/uploads}} directory otherwise backup will fail:<br />
<br />
$ mkdir public/uploads<br />
$ chmod -R u+rwX public/uploads<br />
<br />
Copy the example Puma config and edit to your liking:<br />
<br />
$ cp config/puma.rb.example config/puma.rb<br />
<br />
Configure Git global settings for git user, useful when editing via web. Edit {{ic|user.email}} according to what is set in {{ic|gitlab.yml}}:<br />
<br />
$ git config --global user.name "GitLab"<br />
$ git config --global user.email "gitlab@localhost"<br />
<br />
Configure GitLab database settings:<br />
<br />
* MariaDB:<br />
$ cp config/database.yml.mysql config/database.yml<br />
<br />
* PostgreSQL:<br />
$ cp config/database.yml.postgresql config/database.yml<br />
<br />
Make sure to update {{ic|username}}/{{ic|password}} in {{ic|config/database.yml}}.<br />
<br />
<br />
===Install gems===<br />
<br />
{{Tip| If you do not want to download any gem documentation, add {{ic|gem: --no-rdoc --no-ri}} to {{ic|/home/git/.gemrc}}. Be sure to add it as the {{ic|git}} user in order to acquire the appropriate permissions.}}<br />
{{Note|See bug #[https://bugs.archlinux.org/task/33327 33327] for about system-wide gems. As a temporary solution the following packages will be installed as {{ic|git}} user, make sure nano {{ic|~/.gemrc}} contains {{ic|gem: ... --user-install}}. And then add the {{ic|bin}} path to the {{ic|PATH}} variable like so {{ic|1=export PATH="${PATH}:~/.gem/ruby/2.0.0/bin"}}.}}<br />
<br />
Install {{ic|bundler}} and {{ic|charlock_holmes}} under {{ic|$HOME/.gem/}} (normally system wide via sudo):<br />
<br />
# su - git<br />
$ gem install charlock_holmes --version '0.6.9.4'<br />
$ gem install bundler<br />
<br />
Install gems from Gemfile:<br />
<br />
$ cd gitlab/<br />
<br />
{{Note|When executing the below and you recieve `Could not verify the SSL certificate for https://rubygems.org/` see bug #[https://github.com/gitlabhq/gitlabhq/issues/4095 GitHub-4095] most likely because you're behind a proxy that tries to inject a local certificate for SSL domains in order to verify its content}}<br />
<br />
If you used MariaDB:<br />
<br />
$ bundle install --deployment --without development test postgres<br />
<br />
If you used PostgreSQL:<br />
<br />
$ bundle install --deployment --without development test mysql<br />
<br />
{{Note|1= Using {{ic|--without group_name}} in bundle command line will ignore required packages for the mentioned groups.}}<br />
<br />
===Initialize Database===<br />
<br />
{{Note| Make sure the redis [[daemon]] is enabled and started, otherwise the following command will fail. To check the status and see if it's running execute {{ic|systemctl status redis}}, if it's dead start it as per usual via {{ic|systemctl start redis}}}}<br />
<br />
Initialize database and activate advanced features: <br />
$ bundle exec rake gitlab:setup RAILS_ENV=production<br />
<br />
{{Note|If you recieve a error {{ic|No such file or directory - /home/git/repositories/root}} then most likely you've changed the default configuration for {{ic|GitLab}} and you'll need to modify all static paths in {{ic|config/gitlab.yml}} and run the above command again to initialize the database!}}<br />
<br />
===Check status===<br />
<br />
With the following commands we check if the steps we followed so far are configured properly. <br />
<br />
$ bundle exec rake gitlab:env:info RAILS_ENV=production<br />
$ bundle exec rake gitlab:check RAILS_ENV=production<br />
<br />
{{hc|Example output of gitlab:env:info|<br />
System information<br />
System: Arch Linux<br />
Current User: git<br />
Using RVM: yes<br />
RVM Version: 1.20.3<br />
Ruby Version: 2.0.0p0<br />
Gem Version: 2.0.0<br />
Bundler Version:1.3.5<br />
Rake Version: 10.0.4<br />
<br />
GitLab information<br />
Version: 5.2.0.pre<br />
Revision: 4353bab<br />
Directory: /home/git/gitlab<br />
DB Adapter: mysql2<br />
URL: http://gitlab.arch<br />
HTTP Clone URL: http://gitlab.arch/some-project.git<br />
SSH Clone URL: git@gitlab.arch:some-project.git<br />
Using LDAP: no<br />
Using Omniauth: no<br />
<br />
GitLab Shell<br />
Version: 1.4.0<br />
Repositories: /home/git/repositories/<br />
Hooks: /home/git/gitlab-shell/hooks/<br />
Git: /usr/bin/git<br />
}}<br />
<br />
{{Note| {{ic|gitlab:check}} will complain about missing initscripts. Don't worry, we will use ArchLinux' [[systemd]] to manage server start (which GitLab does not recognize).}}<br />
<br />
==Web server configuration==<br />
<br />
<br />
===Unicorn only===<br />
<br />
{{Note|As of GitLab 5.1 Unicorn is no longer the default server as it got replaced by Puma. You can therefore ignore this section.}}<br />
<br />
Edit {{ic|/home/gitlab/gitlab/config/unicorn.rb}} uncomment:<br />
<br />
listen 8080 # listen to port 8080 on all TCP interfaces<br />
<br />
Create {{ic|/etc/rc.d/unicorn-gitlab}}.<br />
<pre><br />
#!/bin/bash<br />
<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
<br />
<br />
PID=`pidof -o %PPID /usr/bin/ruby`<br />
case "$1" in<br />
start)<br />
stat_busy "Starting unicorn"<br />
[ -z "$PID" ] && sudo -u gitlab bash -c "source /home/gitlab/.bash_profile && cd /home/gitlab/gitlab/ && bundle exec unicorn_rails -c config/unicorn.rb -E production -D"<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
add_daemon unicorn<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Stopping unicorn"<br />
[ ! -z "$PID" ] && kill $PID &> /dev/null<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon unicorn<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 1<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
esac<br />
exit 0<br />
</pre><br />
<br />
Start '''unicorn''':<br />
<br />
# /etc/rc.d/unicorn-gitlab start<br />
<br />
Test it http://localhost:8080<br />
<br />
Add it to DAEMONS array in /etc/rc.conf<br />
<br />
Redirect http port to unicorn server<br />
<br />
# iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080<br />
<br />
And test again, now http://localhost<br />
<br />
===Nginx and unicorn===<br />
<br />
[[pacman|Install]] {{Pkg|nginx}} from the [[official repositories]].<br />
<br />
Run these commands to setup nginx:<br />
<br />
# wget https://raw.github.com/gitlabhq/gitlab-recipes/master/nginx/gitlab -P /etc/nginx/sites-available/<br />
# ln -s /etc/nginx/sites-available/gitlab /etc/nginx/sites-enabled/gitlab <br />
<br />
Edit {{ic|/etc/nginx/sites-enabled/gitlab}} and change YOUR_SERVER_IP and YOUR_SERVER_FQDN to the IP address and fully-qualified domain name of the host serving Gitlab. As you can see nginx needs to access {{ic|/home/gitlab/gitlab/tmp/sockets/gitlab.socket}} socket file. You have to be able to run {{ic|sudo -u http ls /home/gitlab/gitlab/tmp/sockets/gitlab.socket}} successfully. Otherwise setup access to the directory:<br />
<br />
# chgrp http /home/gitlab<br />
# chmod u=rwx,g=rx,o= /home/gitlab<br />
<br />
Restart gitlab.service, resque.service and nginx.<br />
<br />
[http://unicorn.bogomips.org/ Unicorn] is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels. First we rename the example file and then we start unicorn:<br />
<br />
# cd /home/gitlab/gitlab<br />
# sudo -u gitlab cp config/unicorn.rb.orig config/unicorn.rb<br />
# sudo -u gitlab bundle exec unicorn_rails -c config/unicorn.rb -E production -D<br />
<br />
===Apache and unicorn===<br />
<br />
[[pacman|Install]] {{Pkg|apache}} from the [[official repositories]]. <br />
<br />
====Configure Unicorn====<br />
<br />
{{Note|If the default path is not {{ic|/home/git}} for your installation, change the below path accordingly}}<br />
<br />
As the official installation guide instructs, copy the unicorn configuration file:<br />
# sudo -u git -H cp /home/git/gitlab/config/unicorn.rb.example /home/git/gitlab/config/unicorn.rb<br />
<br />
Now edit {{ic|config/unicorn.rb}} and add a listening port by uncommenting the following line:<br />
listen "127.0.0.1:8080"<br />
<br />
{{Tip| You can set a custom port if you want. Just remember to also include it in Apache's virtual host. See below.}}<br />
<br />
====Create a virtual host for Gitlab====<br />
<br />
Create a configuration file for Gitlab’s virtual host and insert the lines below adjusted accordingly. For the ssl section see [[LAMP#SSL]]. If you do not need it, remove it. Notice that the SSL virtual host needs a specific IP instead of generic. Also if you set a custom port for Unicorn, do not forget to set it at the BalanceMember line.<br />
<br />
# mkdir -pv /etc/httpd/conf/vhosts/<br />
<br />
{{hc|/etc/httpd/conf/vhosts/gitlab|<br />
<VirtualHost *:80><br />
ServerName gitlab.myserver.com<br />
ServerAlias www.gitlab.myserver.com<br />
DocumentRoot /home/gitlab/gitlab/public<br />
ErrorLog /var/log/httpd/gitlab_error_log<br />
CustomLog /var/log/httpd/gitlab_access_log combined<br />
<br />
<Proxy balancer://unicornservers><br />
BalancerMember http://127.0.0.1:8080<br />
</Proxy><br />
<br />
<Directory /home/gitlab/gitlab/public><br />
AllowOverride All<br />
Options -MultiViews<br />
</Directory><br />
<br />
RewriteEngine on<br />
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f<br />
RewriteRule ^/(.*)$ balancer://unicornservers%{REQUEST_URI} [P,QSA,L]<br />
<br />
ProxyPass /uploads !<br />
ProxyPass / balancer://unicornservers/<br />
ProxyPassReverse / balancer://unicornservers/<br />
ProxyPreserveHost on<br />
<br />
<Proxy *><br />
Order deny,allow<br />
Allow from all<br />
</Proxy><br />
</VirtualHost><br />
<br />
<VirtualHost MY_IP:443><br />
ServerName gitlab.myserver.com<br />
ServerAlias www.gitlab.myserver.com<br />
DocumentRoot /home/gitlab/gitlab/public<br />
ErrorLog /var/log/httpd/gitlab_error_log<br />
CustomLog /var/log/httpd/gitlab_access_log combined<br />
<br />
<Proxy balancer://unicornservers><br />
BalancerMember http://127.0.0.1:8080<br />
</Proxy><br />
<br />
<Directory /home/gitlab/gitlab/public><br />
AllowOverride All<br />
Options -MultiViews<br />
</Directory><br />
<br />
RewriteEngine on<br />
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f<br />
RewriteRule ^/(.*)$ balancer://unicornservers%{REQUEST_URI} [P,QSA,L]<br />
<br />
ProxyPass /uploads !<br />
ProxyPass / balancer://unicornservers/<br />
ProxyPassReverse / balancer://unicornservers/<br />
ProxyPreserveHost on<br />
<br />
<Proxy *><br />
Order deny,allow<br />
Allow from all<br />
</Proxy><br />
<br />
SSLEngine on<br />
SSLCertificateFile /home/gitlab/gitlab/ssl.cert<br />
SSLCertificateKeyFile /home/gitlab/gitlab/ssl.key<br />
</VirtualHost><br />
}}<br />
<br />
====Enable host and start unicorn====<br />
<br />
Enable your Gitlab virtual host and reload [[Apache]]:<br />
{{hc|/etc/httpd/conf/httpd.conf|Include conf/vhosts/gitlab}}<br />
<br />
Finally start unicorn:<br />
<br />
# cd /home/gitlab/gitlab<br />
# sudo -u gitlab bundle exec unicorn_rails -c config/unicorn.rb -E production -D<br />
<br />
==systemd support==<br />
<br />
Note that you don't need the systemd units to launch shell scripts as suggested by the gitlab authors. Just make sure the ExecStart line points to the full path of the **bundle** executable. <br />
<br />
Create:<br />
{{hc|gitlab.service|<nowiki><br />
<br />
[Unit]<br />
Description=GitLab Puma Server<br />
<br />
[Service]<br />
User=git<br />
WorkingDirectory=/home/git/gitlab<br />
Environment=RAILS_ENV=production<br />
SyslogIdentifier=gitlab-puma<br />
Type=forking<br />
TimeoutStartSec=600<br />
PIDFile=/home/git/gitlab/tmp/pids/puma.pid<br />
<br />
ExecStart=/usr/bin/bundle exec "puma -C /home/git/gitlab/config/puma.rb -e production"<br />
ExecReload=/bin/kill -HUP $MAINPID<br />
ExecStop=/bin/kill -QUIT $MAINPID<br />
<br />
<br />
[Install]<br />
WantedBy=gitlab.target<br />
</nowiki><br />
}}<br />
<br />
{{hc|gitlab-sidekiq.service|<nowiki><br />
[Unit]<br />
Description=GitLab Sidekiq Server<br />
<br />
[Service]<br />
User=git<br />
WorkingDirectory=/home/git/gitlab<br />
Environment=RAILS_ENV=production<br />
SyslogIdentifier=gitlab-sidekiq<br />
Type=forking<br />
PIDFile=/home/git/gitlab/tmp/pids/sidekiq.pid<br />
<br />
<br />
ExecStart=/usr/bin/bundle exec rake sidekiq:start<br />
ExecStop=/usr/bin/bundle exec rake sidekiq:stop<br />
<br />
[Install]<br />
WantedBy=gitlab.target</nowiki><br />
}}<br />
<br />
Also see: https://github.com/gitlabhq/gitlab-recipes/issues/14<br />
<br />
==Useful Tips==<br />
===Hook into /var===<br />
sudo mkdir -m700 /var/log/gitlab /var/tmp/gitlab<br />
sudo chown gitlab:gitlab /var/log/gitlab /var/tmp/gitlab<br />
sudo -u gitlab -i<br />
cd ~/gitlab<br />
d=log; mv $d/* /var/$d/gitlab; rm -f $d/.gitkeep; rm -r $d && ln -s /var/$d/gitlab $d<br />
d=tmp; mv $d/* /var/$d/gitlab; rm -f $d/.gitkeep; rm -r $d && ln -s /var/$d/gitlab $d<br />
<br />
===Hidden options===<br />
Go to Gitlab's home directory<br />
# cd /home/gitlab/gitlab<br />
<br />
and run<br />
# rake -T | grep gitlab<br />
<br />
These are the options so far:<br />
rake gitlab:app:backup_create # GITLAB | Create a backup of the gitlab system<br />
rake gitlab:app:backup_restore # GITLAB | Restore a previously created backup<br />
rake gitlab:app:enable_automerge # GITLAB | Enable auto merge<br />
rake gitlab:app:setup # GITLAB | Setup production application<br />
rake gitlab:app:status # GITLAB | Check gitlab installation status<br />
rake gitlab:gitolite:update_hooks # GITLAB | Rewrite hooks for repos<br />
rake gitlab:gitolite:update_keys # GITLAB | Rebuild each key at gitolite config<br />
rake gitlab:gitolite:update_repos # GITLAB | Rebuild each project at gitolite config<br />
rake gitlab:test # GITLAB | Run both cucumber & rspec<br />
<br />
===Backup and restore===<br />
<br />
Create a backup of the gitlab system:<br />
# sudo -u gitlab -H rake RAILS_ENV=production gitlab:backup:create<br />
<br />
Restore the previously created backup file {{ic|/home/gitlab/gitlab/tmp/backups/20130125_11h35_1359131740_gitlab_backup.tar}}:<br />
# sudo -u gitlab -H rake RAILS_ENV=production gitlab:backup:restore BACKUP=/home/gitlab/gitlab/tmp/backups/20130125_11h35_1359131740<br />
<br />
{{Note| Backup folder is set in {{ic|conig.yml}}. Check [[#Application_specific_settings]].}}<br />
<br />
===Update Gitlab===<br />
<br />
When a new version is out follow the instructions at [https://github.com/gitlabhq/gitlabhq/wiki Github wiki]. A new release is out every 22nd of a month.<br />
<br />
===Migrate from sqlite to mysql===<br />
<br />
Get latest code as described in [[#Update_Gitlab]].<br />
Save data.<br />
# cd /home/gitlab/gitlab<br />
# sudo -u gitlab bundle exec rake db:data:dump RAILS_ENV=production<br />
<br />
Follow [[#Mysql]] instructions and then setup the database.<br />
# sudo -u gitlab bundle exec rake db:setup RAILS_ENV=production<br />
<br />
Finally restore old data.<br />
# sudo -u gitlab bundle exec rake db:data:load RAILS_ENV=production<br />
<br />
===Running GitLab with rvm===<br />
<br />
To run gitlab with rvm first you have to set up an rvm:<br />
<br />
curl -L https://get.rvm.io | bash -s stable --ruby=1.9.3<br />
<br />
{{Note|Version 1.9.3 is currently recommended to avoid some compatibility issues.}}<br />
<br />
For the complete installation you will want to be the final user (e.g. {{ic|git}}) so make sure to switch to this user and activate your rvm:<br />
<br />
su - git<br />
source "$HOME/.rvm/scripts/rvm"<br />
<br />
Then continue with the installation instructions from above. However, the systemd scripts will not work this way, because the environment for the rvm is not activated. The recommendation here is to create to separate shell scripts for {{ic|puma}} and {{ic|sidekiq}} to activate the environment and then start the service:<br />
<br />
{{hc|gitlab.sh|<nowiki><br />
#!/bin/sh<br />
source `/home/git/.rvm/bin/rvm 1.9.3 do rvm env --path`<br />
RAILS_ENV=production bundle exec puma -C "/home/git/gitlab/config/puma.rb"</nowiki><br />
}}<br />
<br />
{{hc|sidekiq.sh|<nowiki><br />
#!/bin/sh<br />
source `/home/git/.rvm/bin/rvm 1.9.3 do rvm env --path`<br />
case $1 in<br />
start)<br />
bundle exec rake sidekiq:start RAILS_ENV=production<br />
;;<br />
stop)<br />
bundle exec rake sidekiq:stop RAILS_ENV=production<br />
;;<br />
*)<br />
echo "Usage $0 {start|stop}"<br />
esac<br />
</nowiki>}}<br />
<br />
Then modify the above systemd files so they use these scripts. Modify the given lines:<br />
<br />
{{hc|gitlab.service|<nowiki><br />
ExecStart=/home/git/bin/gitlab.sh<br />
</nowiki>}}<br />
{{hc|sidekiq.service|<nowiki><br />
ExecStart=/home/git/bin/sidekiq.sh start<br />
ExecStop=/home/git/bin/sidekiq.sh stop<br />
</nowiki>}}<br />
<br />
==Troubleshooting==<br />
<br />
Sometimes things may not work as expected. Be sure to visit the [https://github.com/gitlabhq/gitlab-public-wiki/wiki/Trouble-Shooting-Guide Trouble Shooting Guide].<br />
<br />
==See also==<br />
*[https://github.com/gitlabhq/gitlabhq/blob/stable/doc/install/installation.md Official Documentation]<br />
*[https://github.com/gitlabhq/gitlab-recipes Gitlab recipes for setup on different platforms, update etc.]<br />
*[http://www.andmarios.com/en/2012/06/gitlab-on-an-ubuntu-10-04-server-with-apache/ GitLab on an Ubuntu 10.04 server with Apache]<br />
*[http://blog.phusion.nl/2012/04/21/tutorial-setting-up-gitlab-on-debian-6/ Setting up gitlab on Debian 6]<br />
*[http://howto.basjes.nl/linux/installing-gitlab-on-centos-6 Installing Gitlab on CentOS 6]<br />
*[https://gist.github.com/2440768 Gist: Install Gitlab on Debian Squeeze]<br />
*[https://gist.github.com/3305554 Gist: Install Gitlab on Archlinux]</div>Markg85https://wiki.archlinux.org/index.php?title=Samba&diff=257789Samba2013-05-19T13:43:58Z<p>Markg85: /* Starting the service */</p>
<hr />
<div>[[Category:Networking]]<br />
[[cs:Samba]]<br />
[[de:Samba]]<br />
[[da:Samba]]<br />
[[es:Samba]]<br />
[[fr:Samba]]<br />
[[it:Samba]]<br />
[[ru:Samba]]<br />
[[sr:Samba]]<br />
[[tr:Samba]]<br />
[[zh-CN:Samba]]<br />
[[zh-TW:Samba]]<br />
[[ja:Samba]]<br />
{{Article summary start|Summary}}<br />
{{Article summary text|Installing, configuring and troubleshooting Samba}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|NFS}}<br />
{{Article summary wiki|Samba Domain Controller}}<br />
{{Article summary end}}<br />
'''Samba''' is a re-implementation of the SMB/CIFS networking protocol, it facilitates file and printer sharing among Linux and Windows systems as an alternative to [[NFS]]. Some users say that Samba is easily configured and that operation is very straight-forward. However, many new users run into problems with its complexity and non-intuitive mechanism. It is strongly suggested that the user stick close to the following directions.<br />
<br />
==Required packages==<br />
===Server===<br />
To share files with Samba, install {{Pkg|samba}}, from the [[Official Repositories]].<br />
<br />
===Client===<br />
Only {{Pkg|smbclient}} is required to access files from a Samba/SMB/CIFS server. It is also available from the Official Repositories.<br />
<br />
==Server configuration==<br />
The {{ic|/etc/samba/smb.conf}} file must be created before starting the service. Once that is set up, users may opt for using an advanced configuration interface like SWAT.<br />
<br />
As root, copy the default Samba configuration file to {{ic|/etc/samba/smb.conf}}:<br />
{{bc|# cp /etc/samba/smb.conf.default /etc/samba/smb.conf}}<br />
<br />
===Creating a share===<br />
Edit {{ic|/etc/samba/smb.conf}}, scroll down to the '''Share Definitions''' section. The default configuration automatically creates a share for each user's home directory. It also creates a share for printers by default.<br />
<br />
There are a number of commented sample configurations included. More information about available options for shared resources can be found in {{ic|man smb.conf}}. [http://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html Here] is the on-line version.<br />
<br />
=== Creating user share path ===<br />
This marks the named objects for automatic export to the environment of subsequently executed commands:<br />
{{bc|<nowiki># export USERSHARES_DIR="/var/lib/samba/usershares"<br />
# export USERSHARES_GROUP="sambashare"</nowiki>}}<br />
This creates the usershares directory in var/lib/samba:<br />
{{bc|<nowiki># mkdir -p ${USERSHARES_DIR}</nowiki>}}<br />
This makes the group sambashare:<br />
{{bc|<nowiki># groupadd ${USERSHARES_GROUP}</nowiki>}}<br />
This changes the owner of the directory and group you just created to root:<br />
{{bc|<nowiki># chown root:${USERSHARES_GROUP} ${USERSHARES_DIR}</nowiki>}}<br />
This changes the permissions of the usershares directory so that users in the group sambashare can read, write and execute files:<br />
{{bc|<nowiki># chmod 01770 ${USERSHARES_DIR}</nowiki>}}<br />
Set the following variable in {{ic|smb.conf}} configuration file: <br />
{{hc|/etc/samba/smb.conf|2=...<br />
[global]<br />
usershare path = /var/lib/samba/usershares<br />
usershare max shares = 100<br />
usershare allow guests = yes<br />
usershare owner only = False<br />
...<br />
}}<br />
Save the file and then add your user to the group sambashares replacing "your_username" with the name of your user:<br />
{{bc|# usermod -a -G ${USERSHARES_GROUP} your_username}}<br />
<br />
Restart Samba<br />
<br />
Log out and log back in. You should now be able to configure your samba share using GUI. For example, in [[Thunar]] you can right click on any directory and share it on the network.<br />
When the error {{ic|You are not the owner of the folder}} appears, simply try to reboot the system.<br />
<br />
===Adding a user===<br />
To log into a Samba share, a samba user is needed. The user '''must''' already have a [[Users and Groups|Linux user account]] with the same name on the server, otherwise running the next command will fail:<br />
# pdbedit -a -u <user><br />
<br />
{{Note|As of version 3.4.0, smbpasswd is no longer used by default. Existing smbpasswd databases can be [[Samba/Troubleshooting#Changes_in_Samba_version_3.4.0|converted to the new format]]}}<br />
<br />
=== Web-based configuration (SWAT)===<br />
'''SWAT''' (Samba Web Administration Tool) is a facility that is part of the Samba suite. Whether or not to use this tool remains a matter of personal preference. It does allow for quick configuration and has context-sensitive help for each {{ic|smb.conf}} parameter. SWAT also provides an interface for monitoring of current state of connection(s), and allows network-wide MS Windows network password management.<br />
<br />
{{Warning|Before using SWAT, be warned that SWAT will completely replace {{ic|/etc/samba/smb.conf}} with a fully optimized file that has been stripped of all comments, and only non-default settings will be written to the file.}}<br />
<br />
To use SWAT, first install {{Pkg|xinetd}}, available in the [[Official Repositories]].<br />
<br />
Edit {{ic|/etc/xinetd.d/swat}}. To enable SWAT, change the {{ic|1=disable = yes}} line to {{ic|1=disable = no}}.<br />
<br />
{{hc|/etc/xinetd.d/swat|<nowiki><br />
service swat<br />
{<br />
type = UNLISTED<br />
protocol = tcp<br />
port = 901<br />
socket_type = stream<br />
wait = no<br />
user = root<br />
server = /usr/sbin/swat<br />
log_on_success += HOST DURATION<br />
log_on_failure += HOST<br />
disable = no<br />
}</nowiki>}}<br />
<br />
Alternatively, add an entry for swat to {{ic|/etc/services}} and omit the first 3 lines of the configuration.<br />
<br />
Then start the ''xinetd'' daemon using [[systemd]].<br />
<br />
The web interface can be accessed on port 901 by default:<br />
{{ic|http://localhost:901/}}<br />
<br />
{{Note|An all-encompasing [[Webmin]] tool is also available, and the SWAT module can be loaded there.}}<br />
<br />
=== Starting the service ===<br />
Start/enable Samba via the '''smbd''' and '''nmbd''' at boot:<br />
systemctl enable smbd.service<br />
systemctl enable nmbd.service<br />
<br />
Run them right now as well (otherwise you'd have to reboot):<br />
systemctl start smbd.service<br />
systemctl start nmbd.service<br />
<br />
==Client configuration==<br />
Shared resources from other computers on the LAN may be accessed and mounted locally by GUI or CLI methods. The graphical manner is limited since most lightweight Desktop Environments do not have a native way to facilitate accessing these shared resources.<br />
<br />
There are two parts to share access. First is the underlying file system mechanism, and second is the interface which allows the user to select to mount shared resources. Some environments have the first part built into them.<br />
<br />
===Manual mounting===<br />
Install {{pkg|smbclient}} from the [[Official Repositories]].<br />
<br />
To list public shares on a server:<br />
{{bc|$ smbclient -L <hostname> -U%}}<br />
<br />
Create a mount point for the share:<br />
{{bc|# mkdir /mnt/MOUNTPOINT}}<br />
<br />
Mount the share using the {{ic|mount.cifs}} type. Not all the options listed below are needed or desirable (ie. {{ic|password}}).<br />
{{bc|# <nowiki>mount -t cifs //SERVER/SHARENAME /mnt/MOUNTPOINT -o user=USERNAME,password=PASSWORD,workgroup=WORKGROUP,ip=SERVERIP</nowiki>}}<br />
{{ic|'''SERVER'''}}<br />
:The Windows system name.<br />
{{ic|'''SHARENAME'''}}<br />
:The shared directory.<br />
{{ic|'''MOUNTPOINT'''}}<br />
:The local directory where the share will be mounted.<br />
{{ic|'''-o <nowiki>[options]</nowiki>'''}}<br />
:See {{ic|man mount.cifs}} for more information:<br />
{{Note|Abstain from using a trailing '''/'''. {{ic|//SERVER/SHARENAME'''/'''}} will not work.}}<br />
====Add Share to /etc/fstab====<br />
The simplest way to add an fstab entry is something like this:<br />
{{hc|/etc/fstab|<nowiki><br />
//SERVER/SHARENAME /mnt/MOUNTPOINT cifs noauto,username=USER,password=PASSWORD,workgroup=WORKGROUP,ip=SERVERIP 0 0</nowiki>}}<br />
However, storing passwords in a world readable file is not recommended! A safer method would be to use a credentials file. As an example, create a file and {{ic|chmod 600 <filename>}} so only the owning user can read and write to it. It should contain the following information:<br />
{{hc|/path/to/credentials/sambacreds|<nowiki><br />
username=USERNAME<br />
password=PASSWORD</nowiki>}}<br />
and the line in your fstab should look something like this:<br />
{{hc|/etc/fstab|<nowiki><br />
//SERVER/SHARENAME /mnt/MOUNTPOINT cifs noauto,username=USER,credentials=/path/to/credentials/sambacreds,workgroup=WORKGROUP,ip=SERVERIP 0 0</nowiki>}}<br />
If using '''systemd''' (modern installations), one can utilize the '''comment=systemd.automount''' option, which speeds up service boot by a few seconds. Also, one can map current user and group to make life a bit easier, utilizing '''uid''' and '''gid''' options ('''warning:''' using the uid and gid options may cause input ouput errors in programs that try to fetch data from network drives):<br />
{{hc|/etc/fstab|<nowiki>//SERVER/SHARENAME /mnt/MOUNTPOINT cifs noauto,credentials=/path/to/smbcredentials,comment=systemd.automount,uid=USERNAME,gid=USERGROUP 0 0</nowiki>}}<br />
<br />
====User mounting====<br />
{{hc|/etc/fstab|<nowiki>//SERVER/SHARENAME /mnt/MOUNTPOINT cifs users,noauto,credentials=/path/to/smbcredentials,workgroup=WORKGROUP,ip=SERVERIP 0 0</nowiki>}}<br />
{{note|Note: The option is user'''s''' (plural). For other filesystem types handled by mount, this option is usually ''user''; sans the "'''s'''".}}<br />
<br />
This will allow users to mount it as long as the mount point resides in a directory controllable by the user; i.e. the user's home. For users to be allowed to mount and unmount the Samba shares with mount points that they do not own, use [[Samba#smbnetfs|smbnetfs]], or grant privileges using [[sudo]].<br />
<br />
===Automatic Mounting===<br />
There are several ways to easily browse shared resources:<br />
====smbnetfs====<br />
Install {{pkg|smbnetfs}}, from the [[Official Repositories]].<br />
<br />
Add the following line to {{ic|/etc/fuse.conf}}:<br />
{{bc|user_allow_other}}<br />
and load the {{ic|fuse}} [[kernel module]]:<br />
{{bc|# modprobe fuse}}<br />
<br />
If a username and a password are required to access some of the shared folders, edit /etc/smbnetfs/.smb/smbnetfs.conf and uncomment the line starting with "auth":<br />
<br />
{{hc|/etc/smbnetfs/.smb/smbnetfs.conf|<br />
auth "hostname" "username" "password"<br />
}}<br />
<br />
Make sure to {{ic|chmod 600 /etc/smbnetfs/.smb/smbnetfs.conf}}, and any include files for smbnetfs to work correctly.<br />
<br />
===== Daemon =====<br />
Start and enable the '''smbnetfs''' [[daemon]].<br />
<br />
====fusesmb====<br />
{{Note|1=Because {{ic|smbclient 3.2.X}} is malfunctioning with {{ic|fusesmb}}, revert to using older versions if necessary. See the [https://bbs.archlinux.org/viewtopic.php?id=58434 relevant forum topic] for details.}}<br />
<br />
# Install {{AUR|fusesmb}}, available in the [[Arch User Repository]].<br />
# Create a mount point: {{ic|# mkdir /mnt/fusesmb}}<br />
# Load {{ic|fuse}} [[kernel module]].<br />
# Mount the shares: {{bc|# fusesmb -o allow_other /mnt/fusesmb}}<br />
<br />
====autofs====<br />
See [[Autofs]] for information on the kernel-based automounter for Linux.<br />
<br />
===File Manager Configuration===<br />
====Nautilus====<br />
In order to access samba shares through Nautilus, install the {{pkg|gvfs-smb}} package, available in the [[Official Repositories]].<br />
<br />
Press {{keypress|Ctrl+L}} and enter {{ic|smb://servername/share}} in the location bar to access your share.<br />
<br />
The mounted share is likely to be present at {{ic|/run/user/<your UID>/gvfs}} in the filesystem.<br />
<br />
====Thunar and pcmanfm====<br />
For access using Thunar or pcmanfm, install {{pkg|gvfs-smb}}, available in the Official Repositories. <br />
<br />
Go to {{ic|smb://servername/share}}, to access your share.<br />
<br />
====KDE====<br />
KDE, has the ability to browse Samba shares built in. Therefore do not need any additional packages. However, for a GUI in the KDE System Settings, install the {{pkg|kdenetwork-filesharing}} package from the [[Official Repositories]]<br />
<br />
====Other Graphical Environments====<br />
There are a number of useful programs, but they may need to have packages created for them. This can be done with the Arch package build system. The good thing about these others is that they do not require a particular environment to be installed to support them, and so they bring along less baggage.<br />
<br />
* {{pkg|pyneighborhood}} is available in the [[Official Repositories]].<br />
* LinNeighborhood, RUmba, xffm-samba plugin for Xffm are not available in the official repositories or the [[AUR]]. As they are not officially (or even unofficially supported), they may be obsolete and may not work at all.<br />
<br />
==See also==<br />
* [[{{FULLPAGENAME}}/Tips and tricks|Tips and tricks]] - A dedicated page for alternate configurations and suggestions.<br />
* [[{{FULLPAGENAME}}/Troubleshooting|Troubleshooting]] - A dedicated page for solving common (or not so common) issues.<br />
* [http://www.samba.org/samba/docs/SambaIntro.html Samba: An Introduction]<br />
* [http://www.samba.org/ Official Samba site]</div>Markg85https://wiki.archlinux.org/index.php?title=Network_configuration&diff=257786Network configuration2013-05-19T13:41:26Z<p>Markg85: /* Troubleshooting */</p>
<hr />
<div>[[Category:Networking]]<br />
[[Category:Getting and installing Arch]]<br />
[[cs:Configuring Network]]<br />
[[es:Configuring Network]]<br />
[[fr:Connexions reseau]]<br />
[[it:Configuring Network]]<br />
[[ja:Network Configuration]]<br />
[[nl:Configuring Network]]<br />
[[pt:Configuring Network]]<br />
[[ro:Configurare retea]]<br />
[[ru:Configuring Network]]<br />
[[sk:Configuring Network]]<br />
[[tr:Ağ_Yapılandırması]]<br />
[[zh-CN:Configuring Network]]<br />
{{Article summary start}}<br />
{{Article summary text|A simple guide for setting up and troubleshooting network.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Networking overview}}}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Jumbo Frames}}<br />
{{Article summary wiki|Firewalls}}<br />
{{Article summary wiki|Samba}}<br />
{{Article summary wiki|Wireless Setup}}<br />
{{Article summary end}}<br />
<br />
== Check the connection ==<br />
{{Note|If you receive an error like {{ic|ping: icmp open socket: Operation not permitted}} when executing ping, try to re-install the {{ic|iputils}} package.}} <br />
<br />
Many times, the basic installation procedure has created a working network configuration. To check if this is so, use the following command:<br />
<br />
{{Note|The {{ic|-c 3}} option calls it three times. See {{ic|man ping}} for more information.}}<br />
<br />
{{hc|$ ping -c 3 www.google.com|2=<br />
PING www.l.google.com (74.125.224.146) 56(84) bytes of data.<br />
64 bytes from 74.125.224.146: icmp_req=1 ttl=50 time=437 ms<br />
64 bytes from 74.125.224.146: icmp_req=2 ttl=50 time=385 ms<br />
64 bytes from 74.125.224.146: icmp_req=3 ttl=50 time=298 ms<br />
<br />
--- www.l.google.com ping statistics ---<br />
3 packets transmitted, 3 received, 0% packet loss, time 1999ms<br />
rtt min/avg/max/mdev = 298.107/373.642/437.202/57.415 ms}}<br />
<br />
If it works, then you may only wish to personalize your settings from the options below.<br />
<br />
If the previous command complains about unknown hosts, it means that your machine was unable to resolve this domain name. It might be related to your service provider or your router/gateway. You can try pinging a static IP address to prove that your machine has access to the Internet.<br />
<br />
{{hc|$ ping -c 3 8.8.8.8|2=<br />
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.<br />
64 bytes from 8.8.8.8: icmp_req=1 ttl=53 time=52.9 ms<br />
64 bytes from 8.8.8.8: icmp_req=2 ttl=53 time=72.5 ms<br />
64 bytes from 8.8.8.8: icmp_req=3 ttl=53 time=70.6 ms<br />
<br />
--- 8.8.8.8 ping statistics ---<br />
3 packets transmitted, 3 received, 0% packet loss, time 2002ms<br />
rtt min/avg/max/mdev = 52.975/65.375/72.543/8.803 ms}}<br />
<br />
{{Note|{{ic|8.8.8.8}} is a static address that is easy to remember. It is the address of Google's primary DNS server, therefore it can be considered reliable, and is generally not blocked by content filtering systems and proxies.}}<br />
<br />
If you are able to ping this address, you may try adding this nameserver to your {{ic|/etc/resolv.conf}} file.<br />
<br />
== Set the hostname ==<br />
<br />
A [[Wikipedia:Hostname|hostname]] is a unique name created to identify a machine on a network: it is configured in {{ic|/etc/hostname}}. The file can contain the system's domain name, if any. To set the hostname, do:<br />
<br />
# hostnamectl set-hostname '''myhostname'''<br />
<br />
This will put '''myhostname''' in {{ic|/etc/hostname}}.<br />
<br />
See {{ic|man 5 hostname}} and {{ic|man 1 hostnamectl}} for details.<br />
<br />
{{Note|<br />
*{{ic|hostnamectl}} supports FQDNs<br />
*You no longer need to edit {{ic|/etc/hosts}}, {{pkg|systemd}} will provide host name resolution, and is installed on all systems by default.}}<br />
<br />
To set the hostname temporarily (until a reboot), use the {{ic|hostname}} command from {{Pkg|inetutils}}:<br />
<br />
# hostname ''myhostname''<br />
<br />
== Device Driver ==<br />
<br />
=== Check the driver status ===<br />
<br />
Udev should detect your network interface card ([[Wikipedia:Network_interface_controller|NIC]]) and automatically load the necessary module at start up. Check the "Ethernet controller" entry (or similar) from the {{ic|lspci -v}} output. It should tell you which kernel module contains the driver for your network device. For example:<br />
<br />
{{hc|$ lspci -v|<br />
02:00.0 Ethernet controller: Attansic Technology Corp. L1 Gigabit Ethernet Adapter (rev b0)<br />
...<br />
Kernel driver in use: atl1<br />
Kernel modules: atl1}}<br />
<br />
Next, check that the driver was loaded via {{ic|dmesg <nowiki>|</nowiki> grep ''module_name''}}. For example:<br />
<br />
$ dmesg | grep atl1<br />
...<br />
atl1 0000:02:00.0: eth0 link is up 100 Mbps full duplex<br />
<br />
Skip the next section if the driver was loaded successfully. Otherwise, you will need to know which module is needed for your particular model.<br />
<br />
=== Load the device module ===<br />
<br />
Google for the right module/driver for the chipset. Once you know which module to use, you can [[Kernel modules#Loading|load it]] with:<br />
<br />
# modprobe ''module_name''<br />
<br />
If udev is not detecting and loading the proper module automatically during bootup, you can add it to a {{ic|*.conf}} file from the {{ic|/etc/modules-load.d/}} folder so that you do not need to {{ic|modprobe}} it every time you boot. For example, if {{ic|tg3}} is the network module:<br />
<br />
# tee /etc/modules-load.d/tg3.conf <<< "tg3"<br />
<br />
Other common modules are {{ic|8139too}} for cards with a Realtek chipset, or {{ic|sis900}} for cards with a SiS chipset.<br />
<br />
== Network Interfaces ==<br />
<br />
=== Device names ===<br />
<br />
For motherboards that have integrated NICs, it is important to have fixed device name. Many configuration problems are caused by interface name changing.<br />
<br />
[[Udev]] is responsible for which device gets which name. Systemd v197 introduced [http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames Predictable Network Interface Names], which automatically assigns static names to network devices. Interfaces are now prefixed with en (ethernet), wl (WLAN), or ww (WWAN) followed by an automatically generated identifier, creating an entry such as {{ic|enp0s25}}. <br />
<br />
This behavior may be disabled by adding a symlink:<br />
<br />
# ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules<br />
<br />
Users upgrading from an earlier systemd version will have a blank rules file created automatically. So if you want to use persistent device names, just delete the file.<br />
<br />
==== Change device name ====<br />
You can change the device name by defining the name manually with an udev-rule. For example: <br />
{{hc|/etc/udev/rules.d/10-network.rules|2=<br />
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="aa:bb:cc:dd:ee:ff", NAME="net1"<br />
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="ff:ee:dd:cc:bb:aa", NAME="net0"}}<br />
A couple things to note:<br />
<br />
* To get the MAC address of each card, use this command: {{ic|cat /sys/class/net/'''device-name'''/address}}<!-- {{ic|<nowiki>udevadm info -a -p /sys/class/net/<yourdevice> | grep address | tr [A-Z] [a-z]</nowiki>}} --><br />
* Make sure to use the lower-case hex values in your udev rules. It doesn't like upper-case. <br />
{{Note|When choosing the static names '''it should be avoided to use names in the format of "eth''X''" and "wlan''X''"''', because this may lead to race conditions between the kernel and udev during boot. Instead, it is better to use interface names that are not used by the kernel as default, e.g.: {{ic|net0}}, {{ic|net1}}, {{ic|wifi0}}, {{ic|wifi1}}. For further details please see the [http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames systemd] documentation.}}<br />
<br />
=== Get current device names ===<br />
<br />
Current NIC names can be found via sysfs<br />
<br />
{{hc|$ ls /sys/class/net|<br />
lo eth0 eth1 firewire0}}<br />
<br />
=== Enabling and disabling network interfaces ===<br />
<br />
You can activate or deactivate network interfaces using:<br />
<br />
# ip link set eth0 up<br />
# ip link set eth0 down<br />
<br />
To check the result:<br />
<br />
{{hc|$ ip link show dev eth0|<br />
2: eth0: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP mode DEFAULT qlen 1000<br />
[...]}}<br />
<br />
== Configure the IP address ==<br />
<br />
You have two options: a dynamically assigned address using [[Wikipedia:Dynamic Host Configuration Protocol|DHCP]], or an unchanging "static" address.<br />
<br />
=== Dynamic IP address ===<br />
<br />
==== Manually run DHCP Client Daemon ====<br />
<br />
Please note that {{ic|dhcpcd}} is not {{ic|dhcpd}}.<br />
<br />
{{hc|# dhcpcd eth0|<br />
dhcpcd: version 5.1.1 starting<br />
dhcpcd: eth0: broadcasting for a lease<br />
...<br />
dhcpcd: eth0: leased 192.168.1.70 for 86400 seconds}}<br />
<br />
And now, {{ic|ip addr show dev eth0}} should show your inet address.<br />
<br />
For some people, {{ic|dhclient}} (from the {{Pkg|dhclient}} package) works where {{ic|dhcpcd}} fails.<br />
<br />
==== Run DHCP at boot ====<br />
<br />
If you simply want to use DHCP for your Ethernet connection, you can use {{ic|dhcpcd@.service}} (provided by the {{Pkg|dhcpcd}} package).<br />
<br />
To enable DHCP for {{ic|eth0}}, simply use:<br />
<br />
# systemctl start dhcpcd@eth0<br />
<br />
You can enable the service to automatically start at boot with:<br />
<br />
# systemctl enable dhcpcd@eth0<br />
<br />
If the dhcpd service starts before your network card module ({{bug|30235}}), manually add your network card to {{ic|/etc/modules-load.d/*.conf}}. For example, if your Realtek card needs {{ic|r8169}} to be loaded, create:<br />
<br />
{{hc|/etc/modules-load.d/realtek.conf|<br />
r8169}}<br />
<br />
{{Tip|To find out which modules are used by your network card, use {{ic|lspci -k}}.}}<br />
<br />
If you use DHCP and you do '''not''' want your DNS servers automatically assigned every time you start your network, be sure to add the following to the last section of {{ic|dhcpcd.conf}}:<br />
<br />
{{hc|/etc/dhcpcd.conf|<br />
nohook resolv.conf}}<br />
<br />
To prevent {{ic|dhcpcd}} from adding domain name servers to {{ic|/etc/resolv.conf}}, use the {{ic|nooption}} option:<br />
<br />
{{hc|/etc/dhcpcd.conf|<br />
nooption domain_name_servers}}<br />
<br />
Then add your own DNS name server to {{ic|/etc/resolv.conf}}.<br />
<br />
You may use the {{Pkg|openresolv}} package if several different processes want to control {{ic|/etc/resolv.conf}} (e.g. {{Pkg|dhcpcd}} and a VPN client). No additional configuration for {{Pkg|dhcpcd}} is needed to use {{Pkg|openresolv}}.<br />
<br />
{{Note|It is possible to have a static IP address using {{Pkg|dhcpcd}}. Simply edit your {{ic|/etc/conf.d/dhcpcd}} file to look something like this (where {{ic|x.x.x.x}} is your desired IP address):<br />
<br />
{{bc|1=DHCPCD_ARGS="-q -s x.x.x.x"}}}}<br />
<br />
=== Static IP address ===<br />
<br />
There are various reasons why you may wish to assign static IP addresses on your network. For instance, one may gain a certain degree of predictability with unchanging addresses, or you may not have a DHCP server available.<br />
<br />
{{Note|If you share your Internet connection from a Windows machine without a router, be sure to use static IP addresses on both computers to avoid LAN problems.}}<br />
<br />
You need:<br />
<br />
* Static IP address<br />
* [[Wikipedia:Subnetwork|Subnet mask]]<br />
* [[Wikipedia:Broadcast_address|Broadcast address]]<br />
* [[Wikipedia:Default_gateway|Gateway]]'s IP address<br />
<br />
If you are running a private network, it is safe to use IP addresses in 192.168.*.* for your IP addresses, with a subnet mask of 255.255.255.0 and a broadcast address of 192.168.*.255. The gateway is usually 192.168.*.1 or 192.168.*.254.<br />
<br />
==== Manual assignment ====<br />
<br />
You can assign a static IP address in the console:<br />
<br />
# ip addr add <IP address>/<subnet mask> dev <interface><br />
<br />
For example:<br />
<br />
# ip addr add 192.168.1.2/24 dev eth0<br />
<br />
{{Note|The subnet mask was specified using [[Wikipedia:CIDR_notation|CIDR notation]].}}<br />
<br />
For more options, see {{ic|man ip}}.<br />
<br />
Add your gateway like so:<br />
<br />
# ip route add default via <default gateway IP address><br />
<br />
For example:<br />
<br />
# ip route add default via 192.168.1.1<br />
<br />
If you the get the error "No such process", it means you have to run {{ic|ip link set dev eth0 up}} as root.<br />
<br />
====Manual connection at boot using systemd====<br />
This section details how to manually connect using [[systemd]].<br />
<br />
{{Note|We use {{ic|net0}} as the interface name in these examples, you have to replace all occurrences (including those in the {{ic|BindsTo}} and {{ic|After}} values) with the name of the interface you are configuring.}}<br />
<br />
=====Using [[dhcpcd]]=====<br />
Create the file {{ic|/etc/systemd/system/network.service}} using your editor of choice. This example uses [[wpa_supplicant]].<br />
{{hc|/etc/systemd/system/network.service|<nowiki><br />
[Unit]<br />
Description=Network Connectivity<br />
Wants=network.target<br />
Before=network.target<br />
BindsTo=sys-subsystem-net-devices-net0.device<br />
After=sys-subsystem-net-devices-net0.device<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
ExecStart=/sbin/ip link set dev net0 up<br />
ExecStart=/usr/sbin/wpa_supplicant -B -i net0 -c /etc/wpa_supplicant.conf # Remove this for wired connections<br />
ExecStart=/sbin/dhcpcd net0<br />
<br />
ExecStop=/sbin/dhcpcd -k net0<br />
ExecStop=/sbin/ip addr flush dev net0<br />
ExecStop=/sbin/ip link set dev net0 down<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
# systemctl enable network<br />
<br />
To test, reboot or stop all other network daemons and run as root:<br />
# systemctl start network<br />
<br />
=====Using a static IP address=====<br />
Create the file {{ic|/etc/systemd/system/network.service}} using your editor of choice. This example uses a static IP address and [[wpa_supplicant]].<br />
{{hc|/etc/systemd/system/network.service|<nowiki><br />
[Unit]<br />
Description=Wireless Static IP Connectivity<br />
Wants=network.target<br />
Before=network.target<br />
BindsTo=sys-subsystem-net-devices-net0.device<br />
After=sys-subsystem-net-devices-net0.device<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
ExecStart=/sbin/ip link set dev net0 up<br />
ExecStart=/usr/sbin/wpa_supplicant -B -i net0 -c /etc/wpa_supplicant.conf # Remove this for wired connections<br />
ExecStart=/sbin/ip addr add 192.168.0.10/24 dev net0<br />
ExecStart=/sbin/ip route add default via 192.168.0.1<br />
<br />
ExecStop=/sbin/ip addr flush dev net0<br />
ExecStop=/sbin/ip link set dev net0 down<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
Do not forget to enable it!<br />
# systemctl enable network<br />
<br />
To test, reboot or make sure all other network daemons are stopped and then run as root<br />
# systemctl start network<br />
<br />
==== Calculating addresses ====<br />
<br />
You can use {{ic|ipcalc}} provided by the {{Pkg|ipcalc}} package to calculate IP broadcast, network, netmask, and host ranges for more advanced configurations. For example, I use ethernet over firewire to connect a windows machine to arch. For security and network organization, I placed them on their own network and configured the netmask and broadcast so that they are the only 2 machines on it. To figure out the netmask and broadcast addresses for this, I used ipcalc, providing it with the IP of the arch firewire nic 10.66.66.1, and specifying ipcalc should create a network of only 2 hosts.<br />
<br />
{{hc|$ ipcalc -nb 10.66.66.1 -s 1|2=<br />
Address: 10.66.66.1<br />
<br />
Netmask: 255.255.255.252 = 30<br />
Network: 10.66.66.0/30<br />
HostMin: 10.66.66.1<br />
HostMax: 10.66.66.2<br />
Broadcast: 10.66.66.3<br />
Hosts/Net: 2 Class A, Private Internet}}<br />
<br />
== Load configuration ==<br />
<br />
To test your settings either reboot the computer or reload the relevant systemd services:<br />
<br />
# systemctl restart dhcpcd@eth0<br />
<br />
Try pinging your gateway, DNS server, ISP provider and other Internet sites, in that order, to detect any connection problems along the way, as in this example:<br />
<br />
$ ping -c 3 www.google.com<br />
<br />
== Additional settings ==<br />
<br />
=== ifplugd for laptops ===<br />
<br />
{{Pkg|ifplugd}} in [[Official Repositories]] is a daemon which will automatically configure your Ethernet device when a cable is plugged in and automatically unconfigure it if the cable is pulled. This is useful on laptops with onboard network adapters, since it will only configure the interface when a cable is really connected. Another use is when you just need to restart the network but do not want to restart the computer or do it from the shell.<br />
<br />
By default it is configured to work for the {{ic|eth0}} device. This and other settings like delays can be configured in {{ic|/etc/ifplugd/ifplugd.conf}}.<br />
<br />
Enabling {{ic|net-auto-wired.service}} should start ifplugd on bootup if you have {{Pkg|netcfg}} installed, otherwise you can use {{ic|ifplugd@eth0.service}}.<br />
<br />
=== Bonding or LAG ===<br />
<br />
You will need {{Pkg|netcfg}} from the [[Official Repositories]], as well as the {{AUR|netcfg-bonding}} package from the [[AUR]].<br />
<br />
Edit/create the following files:<br />
<br />
{{hc|/etc/network.d/bonded|2=<br />
CONNECTION="bonding"<br />
INTERFACE="bond0"<br />
SLAVES="eth0 eth1"<br />
IP="dhcp"<br />
DHCP_TIMEOUT=10}}<br />
<br />
{{hc|/etc/modules-load.d/bonding.conf|<br />
bonding}}<br />
<br />
Set up netcfg to use the bond0 interface.<br />
<br />
Start your network:<br />
$ systemctl enable netcfg@bonded<br />
<br />
{{Note|To change the bonding mode (default is round robin) to, e.g, dynamic link aggregation:<br />
<br />
Create {{ic|/etc/modprobe.d/bonding.conf}}:<br />
<br />
{{hc|/etc/modprobe.d/bonding.conf|2=<br />
options bonding mode=4<br />
options bonding miimon=100}}<br />
<br />
For more information about the different bonding policies (and other driver settings) see the [http://sourceforge.net/projects/bonding/files/Documentation/ Linux Ethernet Bonding Driver HOWTO].}}<br />
<br />
To activate the new bonded ports modprobe {{ic|bonding}}, stop {{ic|network}} and start the {{ic|net-profiles}} service:<br />
<br />
# modprobe bonding<br />
# systemctl stop network<br />
# systemctl start net-profiles<br />
<br />
To check the status and bonding mode:<br />
<br />
$ cat /proc/net/bonding/bond0<br />
<br />
==== Wired -> Wireless Failover ====<br />
<br />
Using {{ic|bonding}} to fallback to wireless when the wired ethernet goes down, this also detects the presence of either network connection and starts dhcpcd when either or both are connected.<br />
<br />
You'll need {{Pkg|netcfg}}, {{Pkg|ifplugd}}, and {{Pkg|wpa_supplicant}} from the official repositories.<br />
<br />
First configure the bonding driver to use active-backup:<br />
<br />
{{hc|/etc/modprobe.d/bonding.conf|2=<br />
options bonding mode=active-backup<br />
options bonding miimon=100<br />
options bonding primary=eth0<br />
options bonding max_bonds=0}}<br />
<br />
The `max-bonds` line avoids getting the "Interface bond0 already exists" error.<br />
<br />
Next, configure a {{Pkg|netcfg}} profile to enslave the two hardware interfaces:<br />
<br />
{{hc|/etc/network.d/failover|2=<br />
CONNECTION="bond"<br />
DESCRIPTION="A wired connection with failover to wireless"<br />
INTERFACE="bond0"<br />
SLAVE_INTERFACES=("eth0" "wlan0")<br />
IP="no"<br />
SKIPNOCARRIER="no"}}<br />
<br />
Enable the profile on startup.<br />
<br />
# systemctl enable netcfg@failover<br />
<br />
Configure wpa_supplicant to associate with known networks. This can be done with a netcfg profile (remember to use IP="no"), a wpa_supplicant service running constantly, or on-demand with [[wpa_cli]]. Ways to do this are covered on the [[wpa_supplicant]] page.<br />
<br />
Create an {{Pkg|ifplugd}} action for automatic DHCP assignment on the bonded interface:<br />
<br />
{{hc|/etc/ifplugd/bond_dhcp.action|2=<br />
#!/bin/sh<br />
<br />
case "$2" in<br />
up)<br />
systemctl start "dhcpcd@$1.service" && exit 0<br />
;;<br />
down)<br />
systemctl stop "dhcpcd@$1.service" && exit 0<br />
;;<br />
*)<br />
echo "Wrong arguments" > /dev/stderr<br />
;;<br />
esac<br />
exit 1}}<br />
<br />
and make it executable<br />
<br />
# chmod +x /etc/ifplugd/bond_dhcp.action<br />
<br />
Then create the [[systemd]] service which starts ifplugd for bond0:<br />
<br />
{{hc|/etc/systemd/system/net-auto-bonded@.service|2=<br />
[Unit]<br />
Description=Provides automatic dhcp resolution for bonded failover connection<br />
Requires=netcfg@failover.service<br />
After=netcfg@failover.service<br />
<br />
[Service]<br />
ExecStart=/usr/bin/ifplugd -i %i -r /etc/ifplugd/bond_dhcp.action -fIns<br />
<br />
[Install]<br />
WantedBy=multi-user.target}}<br />
<br />
Enable the net-auto-bonded service and reboot:<br />
<br />
# systemctl enable net-auto-bonded@bond0.service<br />
# reboot<br />
<br />
If you have a wired and wireless connection to the same network, you can probably now disconnect and reconnect the wired connection without losing connectivity. In most cases, even streaming music won't skip!<br />
<br />
=== IP address aliasing ===<br />
<br />
IP aliasing is the process of adding more than one IP address to a network interface. With this, one node on a network can have multiple connections to a network, each serving a different purpose.<br />
<br />
To use IP aliasing from [[netcfg]], change {{ic|POST_UP}} and {{ic|PRE_DOWN}} commands in your network profile to set up the additional IP addresses manually. See [https://bbs.archlinux.org/viewtopic.php?pid=1036395#p1036395 here] for details.<br />
<br />
==== Example ====<br />
<br />
You will need {{Pkg|netcfg}} from the [[Official Repositories]].<br />
<br />
Prepare the configuration:<br />
<br />
{{hc|/etc/network.d/mynetwork|2=<br />
<br />
CONNECTION='ethernet'<br />
DESCRIPTION='Five different addresses on the same NIC.'<br />
INTERFACE='eth0'<br />
IP='static'<br />
ADDR='192.168.1.10'<br />
GATEWAY='192.168.1.1'<br />
DNS=('192.168.1.1')<br />
DOMAIN=''<br />
POST_UP='x=0; for i in 11 12 13 14; do ip addr add 192.168.1.$i/24 brd 192.168.1.255 dev eth0 label eth0:$((x++)); done'<br />
PRE_DOWN='for i in 11 12 13 14; do ip addr del 192.168.1.$i/24 dev eth0; done'}}<br />
<br />
The simply execute: <br />
<br />
$ systemctl enable net-auto-wired.service<br />
<br />
=== Change MAC/hardware address ===<br />
<br />
See [[MAC Address Spoofing]].<br />
<br />
=== Internet Share ===<br />
<br />
See [[Internet Share]].<br />
<br />
=== Router Configuration ===<br />
<br />
See [[Router]].<br />
<br />
== Troubleshooting ==<br />
<br />
=== Swapping computers on the cable modem ===<br />
<br />
Most domestic cable ISPs (videotron for example) have the cable modem configured to recognize only one client PC, by the MAC address of its network interface. Once the cable modem has learned the MAC address of the first PC or equipment that talks to it, it will not respond to another MAC address in any way. Thus if you swap one PC for another (or for a router), the new PC (or router) will not work with the cable modem, because the new PC (or router) has a MAC address different from the old one. To reset the cable modem so that it will recognise the new PC, you must power the cable modem off and on again. Once the cable modem has rebooted and gone fully online again (indicator lights settled down), reboot the newly connected PC so that it makes a DHCP request, or manually make it request a new DHCP lease.<br />
<br />
If this method does not work, you will need to clone the MAC address of the original machine. See also [[Configuring Network#Change MAC/hardware address|Change MAC/hardware address]].<br />
<br />
=== The TCP window scaling problem ===<br />
<br />
TCP packets contain a "window" value in their headers indicating how much data the other host may send in return. This value is represented with only 16 bits, hence the window size is at most 64Kb. TCP packets are cached for a while (they have to be reordered), and as memory is (or used to be) limited, one host could easily run out of it.<br />
<br />
Back in 1992, as more and more memory became available, [http://www.faqs.org/rfcs/rfc1323.html RFC 1323] was written to improve the situation: Window Scaling. The "window" value, provided in all packets, will be modified by a Scale Factor defined once, at the very beginning of the connection.<br />
<br />
That 8-bit Scale Factor allows the Window to be up to 32 times higher than the initial 64Kb.<br />
<br />
It appears that some broken routers and firewalls on the Internet are rewriting the Scale Factor to 0 which causes misunderstandings between hosts.<br />
<br />
The Linux kernel 2.6.17 introduced a new calculation scheme generating higher Scale Factors, virtually making the aftermaths of the broken routers and firewalls more visible.<br />
<br />
The resulting connection is at best very slow or broken.<br />
<br />
==== How to diagnose the problem ====<br />
<br />
First of all, let's make it clear: this problem is odd. In some cases, you will not be able to use TCP connections (HTTP, FTP, ...) at all and in others, you will be able to communicate with some hosts (very few).<br />
<br />
When you have this problem, the {{ic|dmesg}}'s output is OK, logs are clean and {{ic|ip addr}} will report normal status... and actually everything appears normal.<br />
<br />
If you cannot browse any website, but you can ping some random hosts, chances are great that you're experiencing this problem: ping uses ICMP and is not affected by TCP problems.<br />
<br />
You can try to use Wireshark. You might see successful UDP and ICMP communications but unsuccessful TCP communications (only to foreign hosts).<br />
<br />
==== How to fix it (The bad way) ====<br />
<br />
To fix it the bad way, you can change the tcp_rmem value, on which Scale Factor calculation is based. Although it should work for most hosts, it is not guaranteed, especially for very distant ones.<br />
<br />
# echo "4096 87380 174760" > /proc/sys/net/ipv4/tcp_rmem<br />
<br />
==== How to fix it (The good way) ====<br />
<br />
Simply disable Window Scaling. Since Window Scaling is a nice TCP feature, it may be uncomfortable to disable it, especially if you cannot fix the broken router. There are several ways to disable Window Scaling, and it seems that the most bulletproof way (which will work with most kernels) is to add the following line to {{ic|/etc/sysctl.conf}} (see also [[sysctl]])<br />
<br />
net.ipv4.tcp_window_scaling = 0<br />
<br />
==== How to fix it (The best way) ====<br />
<br />
This problem is caused by broken routers/firewalls, so let's change them. Some users have reported that the broken router was their very own DSL router.<br />
<br />
==== More about it ====<br />
<br />
This section is based on the LWN article [http://lwn.net/Articles/92727/ TCP window scaling and broken routers] and a Kernel Trap article: [http://kerneltrap.org/node/6723 Window Scaling on the Internet].<br />
<br />
There are also several relevant threads on the LKML.<br />
<br />
=== Realtek no link / WOL problem ===<br />
<br />
Users with Realtek 8168 8169 8101 8111(C) based NICs (cards / and on-board) may notice a problem where the NIC seems to be disabled on boot and has no Link light. This can usually be found on a dual boot system where Windows is also installed. It seems that using the offical Realtek drivers (dated anything after May 2007) under Windows is the cause. These newer drivers disable the Wake-On-LAN feature by disabling the NIC at Windows shutdown time, where it will remain disabled until the next time Windows boots. You will be able to notice if this problem is affecting you if the Link light remains off until Windows boots up; during Windows shutdown the Link light will switch off. Normal operation should be that the link light is always on as long as the system is on, even during POST. This problem will also affect other operative systems without newer drivers (eg. Live CDs). Here are a few fixes for this problem:<br />
<br />
==== Method 1 - Rollback/change Windows driver ====<br />
<br />
You can roll back your Windows NIC driver to the Microsoft provided one (if available), or roll back/install an official Realtek driver pre-dating May 2007 (may be on the CD that came with your hardware).<br />
<br />
==== Method 2 - Enable WOL in Windows driver ====<br />
<br />
Probably the best and the fastest fix is to change this setting in the Windows driver. This way it should be fixed system-wide and not only under Arch (eg. live CDs, other operative systems). In Windows, under Device Manager, find your Realtek network adapter and double-click it. Under the Advanced tab, change "Wake-on-LAN after shutdown" to Enable.<br />
<br />
In Windows XP (example)<br />
Right click my computer<br />
--> Hardware tab<br />
--> Device Manager<br />
--> Network Adapters<br />
--> "double click" Realtek ...<br />
--> Advanced tab<br />
--> Wake-On-Lan After Shutdown<br />
--> Enable<br />
<br />
{{Note|Newer Realtek Windows drivers (tested with ''Realtek 8111/8169 LAN Driver v5.708.1030.2008'', dated 2009/01/22, available from GIGABYTE) may refer to this option slightly differently, like ''Shutdown Wake-On-LAN --> Enable''. It seems that switching it to {{ic|Disable}} has no effect (you will notice the Link light still turns off upon Windows shutdown). One rather dirty workaround is to boot to Windows and just reset the system (perform an ungraceful restart/shutdown) thus not giving the Windows driver a chance to disable LAN. The Link light will remain on and the LAN adapter will remain accessible after POST - that is until you boot back to Windows and shut it down properly again.}}<br />
<br />
==== Method 3 - Newer Realtek Linux driver ====<br />
<br />
Any newer driver for these Realtek cards can be found for Linux on the realtek site. (untested but believed to also solve the problem).<br />
<br />
==== Method 4 - Enable ''LAN Boot ROM'' in BIOS/CMOS ====<br />
<br />
It appears that setting ''Integrated Peripherals --> Onboard LAN Boot ROM --> Enabled'' in BIOS/CMOS reactivates the Realtek LAN chip on system boot-up, despite the Windows driver disabling it on OS shutdown.<br />
<br><small>This was tested successfully multiple times with GIGABYTE system board GA-G31M-ES2L with BIOS version F8 released on 2009/02/05. YMMV.</small><br />
<br />
=== DLink G604T/DLink G502T DNS problem ===<br />
<br />
Users with a DLink G604T/DLink G502T router, using DHCP and have firmware v2.00+ (typically users with AUS firmware) may have problems with certain programs not resolving the DNS. One of these programs are unfortunatley pacman. The problem is basically the router in certain situations is not sending the DNS properly to DHCP, which causes programs to try and connect to servers with an IP address of 1.0.0.0 and fail with a connection timed out error<br />
<br />
==== How to diagnose the problem ====<br />
<br />
The best way to diagnose the problem is to use Firefox/Konqueror/links/seamonkey and to enable wget for pacman. If this is a fresh install of Arch Linux, then you may want to consider installing {{ic|links}} through the live CD.<br />
<br />
Firstly, enable wget for pacman (since it gives us info about pacman when it is downloading packages)<br />
Open {{ic|/etc/pacman.conf}} with your favourite editor and uncomment the following line (remove the # if it is there)<br />
<br />
XferCommand=/usr/bin/wget --passive-ftp -c -O %o %u<br />
<br />
While you are editing {{ic|/etc/pacman.conf}}, check the default mirror that pacman uses to download packages.<br />
<br />
Now open up the default mirror in an Internet browser to see if the mirror actually works. If it does work, then do {{ic|pacman -Syy}} (otherwise pick another working mirror and set it to the pacman default). If you get something similar to the following (notice the 1.0.0.0),<br />
<br />
<nowiki>ftp://mirror.pacific.net.au/linux/archlinux/extra/os/i686/extra.db.tar.gz</nowiki><br />
=> '/var/lib/pacman/community.db.tar.gz.part'<br />
Resolving mirror.pacific.net.au... 1.0.0.0<br />
<br />
then you most likely have this problem. The 1.0.0.0 means it is unable to resolve DNS, so we must add it to {{ic|/etc/resolv.conf}}.<br />
<br />
==== How to fix it ====<br />
<br />
Basically what we need to do is to manually add the DNS servers to our {{ic|/etc/resolv.conf}} file. The problem is that DHCP automatically deletes and replaces this file on boot, so we need to edit {{ic|/etc/conf.d/dhcpcd}} and change the flags to stop DHCP from doing this.<br />
<br />
When you open {{ic|/etc/conf.d/dhcpcd}}, you should see something close to the following:<br />
<br />
DHCPCD_ARGS="-t 30 -h $HOSTNAME"<br />
<br />
Add the {{ic|-R}} flag to the arguments, e.g.,<br />
<br />
DHCPCD_ARGS="-R -t 30 -h $HOSTNAME"<br />
<br />
{{Note|1=If you are using {{Pkg|dhcpcd}} >= 4.0.2, the {{ic|-R}} flag has been deprecated. Please see the [[#For DHCP assigned IP address]] section for information on how to use a custom {{ic|/etc/resolv.conf}} file.}}<br />
<br />
Save and close the file; now open {{ic|/etc/resolv.conf}}. You should see a single nameserver (most likely 10.1.1.1). This is the gateway to your router, which we need to connect to in order to get the DNS servers of your ISP. Paste the IP address into your browser and log in to your router. Go to the DNS section, and you should see an IP address in the Primary DNS Server field; copy it and paste it as a nameserver '''ABOVE''' the current gateway one.<br />
<br />
For example, {{ic|/etc/resolv.conf}} should look something along the lines of:<br />
<br />
nameserver 10.1.1.1<br />
<br />
If my primary DNS server is 211.29.132.12, then change {{ic|/etc/resolv.conf}} to:<br />
<br />
nameserver 211.29.132.12<br />
nameserver 10.1.1.1<br />
<br />
Now restart the network daemon by running {{ic|systemctl restart dhcpcd@<interface>}} and do {{ic|pacman -Syy}}. If it syncs correctly with the server, then the problem is solved.<br />
<br />
==== More about it ====<br />
<br />
This is the whirlpool forum (Australian ISP community) which talks about and gives the same solution to the problem:<br />
<br />
http://forums.whirlpool.net.au/forum-replies-archive.cfm/461625.html<br />
<br />
=== Check DHCP problem by releasing IP first ===<br />
<br />
Problem may occur when DHCP get wrong IP assignment. For example when two routers are tied together through VPN. The router that is connected to me by VPN may assigning IP address. To fix it. On a console, as root, release IP address:<br />
<br />
# dhcpcd -k<br />
<br />
Then request a new one:<br />
<br />
# dhcpcd<br />
<br />
Maybe you had to run those two commands many times.<br />
<br />
<br />
=== No eth0 with Atheros AR8161 ===<br />
<br />
With the Atheros AR8161 Gigabit Ethernet card, the ethernet connection is not working out-of-the-box (with the installation media of March 2013). The module "alx" needs to be loaded but is not present.<br />
<br />
The driver from [http://linuxwireless.org/en/users/Download/stable/#compat-wireless_stable_releases compat-wireless] (that has become [https://backports.wiki.kernel.org/index.php/Releases compat-drives] since linux 3.7) need to be installed. The "-u" postfix annotates that Qualcomm have applied a driver under a unified driver.<br />
$ wget https://www.kernel.org/pub/linux/kernel/projects/backports/2013/03/28/compat-drivers-2013-03-28-5-u.tar.bz2<br />
$ tar xjf compat*<br />
$ cd compat*<br />
$ ./scripts/driver-select alx<br />
$ make<br />
$ sudo make install<br />
$ sudo modprobe alx<br />
<br />
The alx driver has not been added to Linux kernel due to various problems. Compatibility between the different kernel versions has been spotty. For better support follow the [http://lists.infradead.org/mailman/listinfo/unified-drivers mailing list]and [http://www.linuxfoundation.org/collaborate/workgroups/networking/alx alx page]for latest working solution for alx.<br />
<br />
The driver must be built and installed after every kernel change.<br />
<br />
Alternatively you can use the AUR package for [https://aur.archlinux.org/packages/compat-drivers-patched/ compat drivers], which installs many other drivers.<br />
<br />
=== No eth0 with Atheros AR9485 ===<br />
<br />
The ethernet (eth0) for Atheros AR9485 are not working out-of-the-box (with installation media of March 2013). The working solution for this is to install the package [https://aur.archlinux.org/packages/compat-drivers-patched/ compat-drivers-patched] from AUR.<br />
<br />
=== No carrier / no connection after suspend ===<br />
After suspend to RAM no connection is found although the network cable is plugged in. <br />
This may be caused by PCI power management. What is the output of<br />
<br />
# ip link show eth0<br />
<br />
If the line contains "NO-CARRIER" even though there's a cable connected to your eth0 port, it is possible that the device was auto-suspended and the media sense feature doesn't work. To solve this, first you need to find your ethernet controllers PCI address by<br />
<br />
# lspci<br />
<br />
This should look similar to this:<br />
<br />
...<br />
00:19.0 Ethernet controller: Intel Corporation 82577LM Gigabit Network Connection (rev 06)<br />
...<br />
<br />
So the address is 00:19.0.<br />
Now check the PM status of the device by issuing<br />
<br />
# cat "/sys/bus/pci/devices/0000:00:19.0/power/control"<br />
<br />
substituting 00:19.0 with the address obtained from lspci.<br />
If the output reads "auto", you can try to bring the device out of suspend by<br />
<br />
# echo on > "/sys/bus/pci/devices/0000:00:19.0/power/control"<br />
<br />
Don't forget to substitute the address again.<br />
<br />
{{Note|1=This appears to be a bug in kernel 3.8.4.1- (3.8.8.1 is still affected): [https://bbs.archlinux.org/viewtopic.php?id=159837&p=2 Forum discussion.] It also appears a fix is [https://lkml.org/lkml/2013/1/18/147 on the way. (It will be likely fixed in 3.9.)] In the meantime, the above is a suitable workaround.}}<br />
<br />
=== PC Pingable by IP but not by hostname? ===<br />
This issue hunted me for months! Turns out to be a very simple fix IF you are using samba as well. Usually people only start smbd which is enough for network access to work, but does not advocate the pc's name to the router. nmbd is doing that so you should always have:<br />
systemctl enable smbd.service<br />
systemctl enable nmbd.service<br />
<br />
Which makes them run at startup. If you don't want to restart then you can start then right away with:<br />
systemctl start smbd.service<br />
systemctl start nmbd.service<br />
<br />
And that makes the computer available by name on the network.</div>Markg85https://wiki.archlinux.org/index.php?title=User:Techlive/IspCP&diff=169049User:Techlive/IspCP2011-11-06T22:50:53Z<p>Markg85: We need to CD in the dir otherwise perl can't find ispcp-setup-methods.pl ... and perhaps other files as well.</p>
<hr />
<div>[[Category:Daemons and system services (English)]]<br />
[[Category:Web Server (English)]]<br />
ispCP is an open source project founded to build a Multi Server Control and Administration Panel aimed to be usefull to Internel Service Provider.The project is a fork of dying Virtual Hosting Control Panel (VHCS) project,but it's future goal is a complete rewritten of the original VHCS.<br />
<br />
For more detail information,please visit [http://isp-control.net/project-info.html ispCP Project Info].<br />
<br />
==ispCP Omega Release==<br />
<br />
===Introduction===<br />
<br />
ispCP-Omega is the current release of the ispCP project which is a bridge between the VHCS project and the final rewritten ispCP project the comunity is currently working on. <br />
<br />
===Installation===<br />
<br />
ispCP-Omega is now in [http://aur.archlinux.org/packages.php?ID=48034 AUR].Download the PKGBUILD and then makepkg to install or use any of the aur wrapper to makepkg and install automatically.<br />
<br />
====Post Installation====<br />
<br />
After installing the package,we need to run the ispcp setup script to get it worked,but before that,we need to start the mysql server.<br />
<br />
/etc/rc.d/mysqld start<br />
<br />
then,run<br />
<br />
cd /srv/http/ispcp/engine/setup/<br />
./ispcp-setup<br />
<br />
After asking several questions about your server,the ispcp is completely installed.<br />
<br />
Due to thhe Arch Linux has not been support officially,there are some addition work to do after setup processtion complete.<br />
<br />
1. Edit `/etc/httpd/conf/httpd.conf`<br />
<br />
Add the following lines at the end of the file<br />
<br />
Include conf/extra/httpd-mods/*.conf<br />
Include conf/extra/httpd-vhosts/*.conf<br />
Include conf/extra/httpd-vhosts-ispcp/*.conf<br />
<br />
Make sure commented the following lines<br />
<br />
LoadModule php5_module modules/libphp5.so<br />
Include conf/extra/php5_module.conf<br />
<br />
2. Edit `/etc/conf.d/apache`<br />
<br />
Uncomment the following line<br />
<br />
HTTPD=/usr/sbin/httpd.worker<br />
<br />
3. Edit `/etc/services`<br />
<br />
Comment the following lines<br />
<br />
#urd 465/tcp # URL Rendesvous Directory for SSM<br />
#igmpv3lite 465/udp # IGMP over UDP for SSM <br />
<br />
Add the following lines<br />
<br />
smtps 465/tcp <br />
smtps 465/udp<br />
<br />
4. Edit `/etc/conf.d/postgrey`<br />
<br />
Change port from 10030 to 10023<br />
<br />
5. Edit `/etc/logrotate.d/proftpd`<br />
<br />
Comment all lines.<br />
<br />
6. Edit `/etc/logrotate.d/httpd`<br />
<br />
Change *log to *_log<br />
<br />
7. Edit `/etc/rc.conf`<br />
<br />
Add "named mysqld proftpd saslauthd authdaemond postfix pop3d !pop3d-ssl imapd !imapd-ssl postgrey ispcp_daemon ispcp_network httpd" to DAEMONS array if you want a autostart.<br />
<br />
8. Place any php extension configuration file in /etc/php/conf.d as *.ini,they will be autoloaded.<br />
<br />
===Configuration===<br />
<br />
The server has alwready been auto configured while setup pressodure,there is no more configureation work need to be done.<br />
<br />
===Troubleshooting===<br />
<br />
Frequently asked questions regarding the software <br />
<br />
===More resources===<br />
<br />
[http://ispcp-control.net ispCP Project]{{Linkrot|2011|09|04}}<br />
<br />
==ispCP Release==<br />
<br />
The full-rewritten ispCP has not yet been released,let's be patient and wait.</div>Markg85https://wiki.archlinux.org/index.php?title=User:Techlive/IspCP&diff=169048User:Techlive/IspCP2011-11-06T22:27:17Z<p>Markg85: /* Post Installation */</p>
<hr />
<div>[[Category:Daemons and system services (English)]]<br />
[[Category:Web Server (English)]]<br />
ispCP is an open source project founded to build a Multi Server Control and Administration Panel aimed to be usefull to Internel Service Provider.The project is a fork of dying Virtual Hosting Control Panel (VHCS) project,but it's future goal is a complete rewritten of the original VHCS.<br />
<br />
For more detail information,please visit [http://isp-control.net/project-info.html ispCP Project Info].<br />
<br />
==ispCP Omega Release==<br />
<br />
===Introduction===<br />
<br />
ispCP-Omega is the current release of the ispCP project which is a bridge between the VHCS project and the final rewritten ispCP project the comunity is currently working on. <br />
<br />
===Installation===<br />
<br />
ispCP-Omega is now in [http://aur.archlinux.org/packages.php?ID=48034 AUR].Download the PKGBUILD and then makepkg to install or use any of the aur wrapper to makepkg and install automatically.<br />
<br />
====Post Installation====<br />
<br />
After installing the package,we need to run the ispcp setup script to get it worked,but before that,we need to start the mysql server.<br />
<br />
/etc/rc.d/mysqld start<br />
<br />
then,run<br />
<br />
/srv/http/ispcp/engine/setup/ispcp-setup<br />
<br />
After asking several questions about your server,the ispcp is completely installed.<br />
<br />
Due to thhe Arch Linux has not been support officially,there are some addition work to do after setup processtion complete.<br />
<br />
1. Edit `/etc/httpd/conf/httpd.conf`<br />
<br />
Add the following lines at the end of the file<br />
<br />
Include conf/extra/httpd-mods/*.conf<br />
Include conf/extra/httpd-vhosts/*.conf<br />
Include conf/extra/httpd-vhosts-ispcp/*.conf<br />
<br />
Make sure commented the following lines<br />
<br />
LoadModule php5_module modules/libphp5.so<br />
Include conf/extra/php5_module.conf<br />
<br />
2. Edit `/etc/conf.d/apache`<br />
<br />
Uncomment the following line<br />
<br />
HTTPD=/usr/sbin/httpd.worker<br />
<br />
3. Edit `/etc/services`<br />
<br />
Comment the following lines<br />
<br />
#urd 465/tcp # URL Rendesvous Directory for SSM<br />
#igmpv3lite 465/udp # IGMP over UDP for SSM <br />
<br />
Add the following lines<br />
<br />
smtps 465/tcp <br />
smtps 465/udp<br />
<br />
4. Edit `/etc/conf.d/postgrey`<br />
<br />
Change port from 10030 to 10023<br />
<br />
5. Edit `/etc/logrotate.d/proftpd`<br />
<br />
Comment all lines.<br />
<br />
6. Edit `/etc/logrotate.d/httpd`<br />
<br />
Change *log to *_log<br />
<br />
7. Edit `/etc/rc.conf`<br />
<br />
Add "named mysqld proftpd saslauthd authdaemond postfix pop3d !pop3d-ssl imapd !imapd-ssl postgrey ispcp_daemon ispcp_network httpd" to DAEMONS array if you want a autostart.<br />
<br />
8. Place any php extension configuration file in /etc/php/conf.d as *.ini,they will be autoloaded.<br />
<br />
===Configuration===<br />
<br />
The server has alwready been auto configured while setup pressodure,there is no more configureation work need to be done.<br />
<br />
===Troubleshooting===<br />
<br />
Frequently asked questions regarding the software <br />
<br />
===More resources===<br />
<br />
[http://ispcp-control.net ispCP Project]{{Linkrot|2011|09|04}}<br />
<br />
==ispCP Release==<br />
<br />
The full-rewritten ispCP has not yet been released,let's be patient and wait.</div>Markg85https://wiki.archlinux.org/index.php?title=NFSv3&diff=150343NFSv32011-07-31T15:45:53Z<p>Markg85: /* Mounting using cifs */</p>
<hr />
<div>[[Category:Networking (English)]]<br />
{{i18n|NFS}}<br />
<br />
The goal of this article is to assist in setting up an nfs-server for sharing files over a network.<br />
<br />
*For NFSv4, see: [[NFSv4]]<br />
*nfs-utils has been upgraded since 2009-06-23, and NFS4 support is now implemented. Refer to the [http://www.archlinux.org/news/452/ news bulletin].<br />
*portmap has been replaced by rpcbind.<br />
<br />
==Required packages==<br />
Required packages for both the server and the client are minimal. You will only need to install:<br />
# pacman -S nfs-utils rpcbind<br />
{{Note|instead of rpcbind, you can also install portmap which was replaced}}<br />
<br />
==Setting up the server==<br />
You can now edit your configuration and then start the daemons.<br />
<br />
===Files===<br />
<br />
====/etc/exports====<br />
This file defines the various shares on the nfs server and their permissions. A few examples:<br />
/files *(ro,sync) # Read-only access to anyone<br />
/files 192.168.0.100(rw,sync) # Read-write access to a client on 192.168.0.100<br />
/files 192.168.1.1/24(rw,sync) # Read-write access to all clients from 192.168.1.1 to 192.168.1.255<br />
<br />
If you make changes to /etc/exports after starting the daemons, you can make them effective by issuing the following command:<br />
# exportfs -r<br />
<br />
If you decide to make your NFS share public and writable, you can use the all_squash option in combination with anonuid and the anongid option.<br />
For example, to set the privileges for the user nobody in the group nobody, you can do the following:<br />
; Read-write access to a client on 192.168.0.100, with rw access for the user 99 with gid 99<br />
/files 192.168.0.100(rw,sync,all_squash,anonuid=99,anongid=99))<br />
<br />
This also means, that if you want write access to this directory, nobody.nobody must be the owner of the share directory:<br />
# chown -R nobody.nobody /files<br />
<br />
Full details on the exports file are provided by the exports man page.<br />
<br />
====/etc/conf.d/nfs-common.conf====<br />
{{Note|This used to be in /etc/conf.d/nfs which is replaced by "/etc/conf.d/nfs-common.conf" and "/etc/conf.d/nfs-server.conf".}}<br />
<br />
Edit this file to pass appropriate run-time options to nfsd, mountd, statd, and sm-notify. The default Arch NFS init scripts require the --no-notify option for statd, as follows:<br />
STATD_OPTS="--no-notify"<br />
Others may be left at the provided defaults, or changed according to your requirements. Please refer to the relevant man pages for full details.<br />
<br />
===Daemons===<br />
You can now start the server with the following commands:<br />
# rc.d start rpcbind (or: rc.d start portmap)<br />
# rc.d start nfs-common (or: rc.d start nfslock)<br />
# rc.d start nfs-server (or: rc.d start nfsd)<br />
<br />
Please note that they must be started in that order. To start the server at boot time, add these daemons to the DAEMONS array in /etc/rc.conf.<br />
<br />
==Setting up the client==<br />
<br />
===Files===<br />
<br />
====/etc/conf.d/nfs-common.conf====<br />
Edit this file to pass appropriate run-time options to statd - the remaining options are for server use only. Do ''not'' use the --no-notify option on the client side, unless you are fully aware of the consequences of doing so.<br />
<br />
Please refer to the statd man page for full details.<br />
<br />
===Daemons===<br />
Start the rpcbind and nfs-common daemons:<br />
rc.d start rpcbind (or: rc.d start portmap)<br />
rc.d start nfs-common (or: rc.d start nfslock)<br />
<br />
Please note that they must be started in that order ''or'' start only ''nfs-common'', as ''rpcbind'' will be started as a dependency.<br />
<br />
To start the daemons at boot time, add them to the DAEMONS array in /etc/rc.conf.<br />
<br />
===Mounting===<br />
Then just mount as normal:<br />
mount server:/files /files<br />
<br />
Unlike CIFS shares or [[rsync]], NFS exports must be called by the full path on the server; example, if /home/fred/music is defined in /etc/exports on server ELROND, you must call:<br />
mount ELROND:/home/fred/music /mnt/point<br />
instead of just using:<br />
mount ELROND:music /mnt/point<br />
or you will get ''mount.nfs: access denied by server while mounting''<br />
<br />
{{Note|If you the the following message then you probably didn't start the Daemons from the previous section or something went wrong while starting them.<br />
mount: wrong fs type, bad option, bad superblock on 192.168.1.99:/media/raid5-4tb,<br />
missing codepage or helper program, or other error<br />
(for several filesystems (e.g. nfs, cifs) you might<br />
need a /sbin/mount.<type> helper program)<br />
In some cases useful info is found in syslog - try<br />
dmesg | tail or so<br />
}}<br />
<br />
===Mounting using cifs===<br />
Mounting the smae share using cifs works a bit differently then using NFS. First, you need to have the share defined in Samba. For that look at the [[Samba]] article.<br />
Lets say you made a share on "ELROND" with the name "music". To mount that share using cifs a command like the following should work<br />
mount -t cifs -v ELROND:music /mnt/point -o guest,iocharset=utf8<br />
<br />
You can try:<br />
mount -t cifs -v ELROND:music /mnt/point<br />
<br />
Or to login with a username and password:<br />
mount -t cifs -v ELROND:music /mnt/point -o username=USERNAME,password=PASSWORD,iocharset=utf8<br />
<br />
More information for this can be found in the [[Samba#Manual_share_mounting|manual mounting]] section of [[samba]].<br />
Now you have effectively made 1 folder accessible for NFS clients (mostly linux) and CIFS clients (mostly windows).<br />
<br />
===Auto-mount on boot===<br />
If you want to mount on boot, make sure network, rpcbind (portmap), nfs-common (nfslock) and netfs are in the DAEMONS array in /etc/rc.conf. Make sure the order is this one. It is better not to put any '@' in front of them (although you could safely use @netfs); for instance:<br />
DAEMONS=(... network rpcbind nfs-common @netfs ...)<br />
or<br />
DAEMONS=(... network portmap nfslock @netfs ...)<br />
<br />
Add an appropriate line in /etc/fstab, for example:<br />
server:/files /files nfs defaults 0 0<br />
<br />
If you wish to specify a packet size for read and write packets, specify them in your fstab entry. The values listed below are the defaults if none are specified:<br />
server:/files /files nfs rsize=32768,wsize=32768 0 0<br />
<br />
Read the nfs man page for further information, including all available mount options.<br />
<br />
==Troubleshooting==<br />
<br />
===Unreliable performance, slow data transfer, and/or high load when using NFS and gigabit===<br />
====Async====<br />
Verify that the async flag is used in {{Filename|/etc/exports}}<br />
Example:<br />
<br />
/nfs4exports 192.168.0.0/24(ro,fsid=0,no_subtree_check,async)<br />
/nfs4exports/data 192.168.0.0/24(rw,no_subtree_check,async,nohide)<br />
/nfs4exports/backup 192.168.0.0/24(rw,no_subtree_check,async,nohide)<br />
<br />
====Packetsize====<br />
This is a result of the default packetsize used by NFS, which causes significant fragmentation on gigabit networks. You can modify this behavior by the rsize and wsize mount parameters. Using rsize=32768,wsize=32768 should suffice. Please note that this problem does not occur on 100Mb networks, due to the lower packet transfer speed.<br />
<br />
Default value for NFS4 is 32768. Maximum is 65536. Increase from default in increments of 1024 until maximum transfer rate is achieved.<br />
<br />
===Portmap daemon fails to start at boot===<br />
Make sure you place portmap ''before'' netfs in the daemons array in /etc/rc.conf.<br />
<br />
===Nfsd fails to start with "nfssvc: No such device"===<br />
Make sure the nfs and nfsd modules are loaded in the kernel.<br />
<br />
===Nfsd seems to work, but I cannot connect from MacOS X clients===<br />
When trying to connect from a MacOS X client, you will see that everything is ok at logs, but MacOS X refuses to mount your NFS share. You have to add {{Codeline|insecure}} option to your share and re-run {{Codeline|exportfs -r}}.<br />
<br />
===mount.nfs: Operation not permitted===<br />
After updating to nfs-utils 1.2.1-2, mounting NFS shares stopped working. Henceforth, nfs-utils uses NFSv4 per default instead of NFSv3. The problem can be solved by using either mount option <code>'vers=3'</code> or <code>'nfsvers=3'</code> on the command line: <br />
# mount.nfs <remote target> <directory> -o ...,vers=3,...<br />
# mount.nfs <remote target> <directory> -o ...,nfsvers=3,...<br />
or in <code>/etc/fstab</code>:<br />
<remote target> <directory> nfs ...,vers=3,... 0 0<br />
<remote target> <directory> nfs ...,nfsvers=3,... 0 0<br />
<br />
===Ownership of mounted shares is 4294967294:4294967294===<br />
The following two values in /etc/conf.d/nfs-common.conf (on the client) need to be set:<br />
NEED_STATD="no"<br />
NEED_IDMAPD="yes"<br />
<br />
==Links and references==<br />
* See also [[Avahi]], a Zeroconf implementation which allows automatic discovery of NFS shares.<br />
* HOWTO: [[Diskless network boot NFS root]]<br />
* [http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.prftungd/doc/prftungd/nfs_perf.htm Very helpful]<br />
* If you are setting up the Archlinux NFS server for use by Windows clients through Microsoft's SFU, you will save a lot of time and hair-scratching by looking at [http://bbs.archlinux.org/viewtopic.php?pid=523934#p523934 this forum post] first !<br />
* [http://blogs.msdn.com/sfu/archive/2008/04/14/all-well-almost-about-client-for-nfs-configuration-and-performance.aspx Microsoft Services for Unix NFS Client info]<br />
* [http://blogs.msdn.com/sfu/archive/2007/05/01/unix-interoperability-and-windows-vista.aspx Unix interoperability and Windows Vista] Prerequisites to connect to NFS with Vista</div>Markg85https://wiki.archlinux.org/index.php?title=NFSv3&diff=150342NFSv32011-07-31T15:34:31Z<p>Markg85: /* Setting up the client */</p>
<hr />
<div>[[Category:Networking (English)]]<br />
{{i18n|NFS}}<br />
<br />
The goal of this article is to assist in setting up an nfs-server for sharing files over a network.<br />
<br />
*For NFSv4, see: [[NFSv4]]<br />
*nfs-utils has been upgraded since 2009-06-23, and NFS4 support is now implemented. Refer to the [http://www.archlinux.org/news/452/ news bulletin].<br />
*portmap has been replaced by rpcbind.<br />
<br />
==Required packages==<br />
Required packages for both the server and the client are minimal. You will only need to install:<br />
# pacman -S nfs-utils rpcbind<br />
{{Note|instead of rpcbind, you can also install portmap which was replaced}}<br />
<br />
==Setting up the server==<br />
You can now edit your configuration and then start the daemons.<br />
<br />
===Files===<br />
<br />
====/etc/exports====<br />
This file defines the various shares on the nfs server and their permissions. A few examples:<br />
/files *(ro,sync) # Read-only access to anyone<br />
/files 192.168.0.100(rw,sync) # Read-write access to a client on 192.168.0.100<br />
/files 192.168.1.1/24(rw,sync) # Read-write access to all clients from 192.168.1.1 to 192.168.1.255<br />
<br />
If you make changes to /etc/exports after starting the daemons, you can make them effective by issuing the following command:<br />
# exportfs -r<br />
<br />
If you decide to make your NFS share public and writable, you can use the all_squash option in combination with anonuid and the anongid option.<br />
For example, to set the privileges for the user nobody in the group nobody, you can do the following:<br />
; Read-write access to a client on 192.168.0.100, with rw access for the user 99 with gid 99<br />
/files 192.168.0.100(rw,sync,all_squash,anonuid=99,anongid=99))<br />
<br />
This also means, that if you want write access to this directory, nobody.nobody must be the owner of the share directory:<br />
# chown -R nobody.nobody /files<br />
<br />
Full details on the exports file are provided by the exports man page.<br />
<br />
====/etc/conf.d/nfs-common.conf====<br />
{{Note|This used to be in /etc/conf.d/nfs which is replaced by "/etc/conf.d/nfs-common.conf" and "/etc/conf.d/nfs-server.conf".}}<br />
<br />
Edit this file to pass appropriate run-time options to nfsd, mountd, statd, and sm-notify. The default Arch NFS init scripts require the --no-notify option for statd, as follows:<br />
STATD_OPTS="--no-notify"<br />
Others may be left at the provided defaults, or changed according to your requirements. Please refer to the relevant man pages for full details.<br />
<br />
===Daemons===<br />
You can now start the server with the following commands:<br />
# rc.d start rpcbind (or: rc.d start portmap)<br />
# rc.d start nfs-common (or: rc.d start nfslock)<br />
# rc.d start nfs-server (or: rc.d start nfsd)<br />
<br />
Please note that they must be started in that order. To start the server at boot time, add these daemons to the DAEMONS array in /etc/rc.conf.<br />
<br />
==Setting up the client==<br />
<br />
===Files===<br />
<br />
====/etc/conf.d/nfs-common.conf====<br />
Edit this file to pass appropriate run-time options to statd - the remaining options are for server use only. Do ''not'' use the --no-notify option on the client side, unless you are fully aware of the consequences of doing so.<br />
<br />
Please refer to the statd man page for full details.<br />
<br />
===Daemons===<br />
Start the rpcbind and nfs-common daemons:<br />
rc.d start rpcbind (or: rc.d start portmap)<br />
rc.d start nfs-common (or: rc.d start nfslock)<br />
<br />
Please note that they must be started in that order ''or'' start only ''nfs-common'', as ''rpcbind'' will be started as a dependency.<br />
<br />
To start the daemons at boot time, add them to the DAEMONS array in /etc/rc.conf.<br />
<br />
===Mounting===<br />
Then just mount as normal:<br />
mount server:/files /files<br />
<br />
Unlike CIFS shares or [[rsync]], NFS exports must be called by the full path on the server; example, if /home/fred/music is defined in /etc/exports on server ELROND, you must call:<br />
mount ELROND:/home/fred/music /mnt/point<br />
instead of just using:<br />
mount ELROND:music /mnt/point<br />
or you will get ''mount.nfs: access denied by server while mounting''<br />
<br />
{{Note|If you the the following message then you probably didn't start the Daemons from the previous section or something went wrong while starting them.<br />
mount: wrong fs type, bad option, bad superblock on 192.168.1.99:/media/raid5-4tb,<br />
missing codepage or helper program, or other error<br />
(for several filesystems (e.g. nfs, cifs) you might<br />
need a /sbin/mount.<type> helper program)<br />
In some cases useful info is found in syslog - try<br />
dmesg | tail or so<br />
}}<br />
<br />
===Mounting using cifs===<br />
Mounting using cifs works a bit differently then using NFS. First, you need to have a share defined on your server in Samba. For that look at the [[Samba]] article.<br />
Lets say you made a share on "ELROND" with the name "music". To mount that share using cifs a command like the following should work<br />
mount -t cifs -v ELROND:music /mnt/point -o guest,iocharset=utf8<br />
<br />
You can try:<br />
mount -t cifs -v ELROND:music /mnt/point<br />
<br />
Or to login with a username and password:<br />
mount -t cifs -v ELROND:music /mnt/point -o username=USERNAME,password=PASSWORD,iocharset=utf8<br />
<br />
===Auto-mount on boot===<br />
If you want to mount on boot, make sure network, rpcbind (portmap), nfs-common (nfslock) and netfs are in the DAEMONS array in /etc/rc.conf. Make sure the order is this one. It is better not to put any '@' in front of them (although you could safely use @netfs); for instance:<br />
DAEMONS=(... network rpcbind nfs-common @netfs ...)<br />
or<br />
DAEMONS=(... network portmap nfslock @netfs ...)<br />
<br />
Add an appropriate line in /etc/fstab, for example:<br />
server:/files /files nfs defaults 0 0<br />
<br />
If you wish to specify a packet size for read and write packets, specify them in your fstab entry. The values listed below are the defaults if none are specified:<br />
server:/files /files nfs rsize=32768,wsize=32768 0 0<br />
<br />
Read the nfs man page for further information, including all available mount options.<br />
<br />
==Troubleshooting==<br />
<br />
===Unreliable performance, slow data transfer, and/or high load when using NFS and gigabit===<br />
====Async====<br />
Verify that the async flag is used in {{Filename|/etc/exports}}<br />
Example:<br />
<br />
/nfs4exports 192.168.0.0/24(ro,fsid=0,no_subtree_check,async)<br />
/nfs4exports/data 192.168.0.0/24(rw,no_subtree_check,async,nohide)<br />
/nfs4exports/backup 192.168.0.0/24(rw,no_subtree_check,async,nohide)<br />
<br />
====Packetsize====<br />
This is a result of the default packetsize used by NFS, which causes significant fragmentation on gigabit networks. You can modify this behavior by the rsize and wsize mount parameters. Using rsize=32768,wsize=32768 should suffice. Please note that this problem does not occur on 100Mb networks, due to the lower packet transfer speed.<br />
<br />
Default value for NFS4 is 32768. Maximum is 65536. Increase from default in increments of 1024 until maximum transfer rate is achieved.<br />
<br />
===Portmap daemon fails to start at boot===<br />
Make sure you place portmap ''before'' netfs in the daemons array in /etc/rc.conf.<br />
<br />
===Nfsd fails to start with "nfssvc: No such device"===<br />
Make sure the nfs and nfsd modules are loaded in the kernel.<br />
<br />
===Nfsd seems to work, but I cannot connect from MacOS X clients===<br />
When trying to connect from a MacOS X client, you will see that everything is ok at logs, but MacOS X refuses to mount your NFS share. You have to add {{Codeline|insecure}} option to your share and re-run {{Codeline|exportfs -r}}.<br />
<br />
===mount.nfs: Operation not permitted===<br />
After updating to nfs-utils 1.2.1-2, mounting NFS shares stopped working. Henceforth, nfs-utils uses NFSv4 per default instead of NFSv3. The problem can be solved by using either mount option <code>'vers=3'</code> or <code>'nfsvers=3'</code> on the command line: <br />
# mount.nfs <remote target> <directory> -o ...,vers=3,...<br />
# mount.nfs <remote target> <directory> -o ...,nfsvers=3,...<br />
or in <code>/etc/fstab</code>:<br />
<remote target> <directory> nfs ...,vers=3,... 0 0<br />
<remote target> <directory> nfs ...,nfsvers=3,... 0 0<br />
<br />
===Ownership of mounted shares is 4294967294:4294967294===<br />
The following two values in /etc/conf.d/nfs-common.conf (on the client) need to be set:<br />
NEED_STATD="no"<br />
NEED_IDMAPD="yes"<br />
<br />
==Links and references==<br />
* See also [[Avahi]], a Zeroconf implementation which allows automatic discovery of NFS shares.<br />
* HOWTO: [[Diskless network boot NFS root]]<br />
* [http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.prftungd/doc/prftungd/nfs_perf.htm Very helpful]<br />
* If you are setting up the Archlinux NFS server for use by Windows clients through Microsoft's SFU, you will save a lot of time and hair-scratching by looking at [http://bbs.archlinux.org/viewtopic.php?pid=523934#p523934 this forum post] first !<br />
* [http://blogs.msdn.com/sfu/archive/2008/04/14/all-well-almost-about-client-for-nfs-configuration-and-performance.aspx Microsoft Services for Unix NFS Client info]<br />
* [http://blogs.msdn.com/sfu/archive/2007/05/01/unix-interoperability-and-windows-vista.aspx Unix interoperability and Windows Vista] Prerequisites to connect to NFS with Vista</div>Markg85https://wiki.archlinux.org/index.php?title=NFSv3&diff=150341NFSv32011-07-31T15:06:53Z<p>Markg85: /* Mounting */</p>
<hr />
<div>[[Category:Networking (English)]]<br />
{{i18n|NFS}}<br />
<br />
The goal of this article is to assist in setting up an nfs-server for sharing files over a network.<br />
<br />
*For NFSv4, see: [[NFSv4]]<br />
*nfs-utils has been upgraded since 2009-06-23, and NFS4 support is now implemented. Refer to the [http://www.archlinux.org/news/452/ news bulletin].<br />
*portmap has been replaced by rpcbind.<br />
<br />
==Required packages==<br />
Required packages for both the server and the client are minimal. You will only need to install:<br />
# pacman -S nfs-utils rpcbind<br />
{{Note|instead of rpcbind, you can also install portmap which was replaced}}<br />
<br />
==Setting up the server==<br />
You can now edit your configuration and then start the daemons.<br />
<br />
===Files===<br />
<br />
====/etc/exports====<br />
This file defines the various shares on the nfs server and their permissions. A few examples:<br />
/files *(ro,sync) # Read-only access to anyone<br />
/files 192.168.0.100(rw,sync) # Read-write access to a client on 192.168.0.100<br />
/files 192.168.1.1/24(rw,sync) # Read-write access to all clients from 192.168.1.1 to 192.168.1.255<br />
<br />
If you make changes to /etc/exports after starting the daemons, you can make them effective by issuing the following command:<br />
# exportfs -r<br />
<br />
If you decide to make your NFS share public and writable, you can use the all_squash option in combination with anonuid and the anongid option.<br />
For example, to set the privileges for the user nobody in the group nobody, you can do the following:<br />
; Read-write access to a client on 192.168.0.100, with rw access for the user 99 with gid 99<br />
/files 192.168.0.100(rw,sync,all_squash,anonuid=99,anongid=99))<br />
<br />
This also means, that if you want write access to this directory, nobody.nobody must be the owner of the share directory:<br />
# chown -R nobody.nobody /files<br />
<br />
Full details on the exports file are provided by the exports man page.<br />
<br />
====/etc/conf.d/nfs-common.conf====<br />
{{Note|This used to be in /etc/conf.d/nfs which is replaced by "/etc/conf.d/nfs-common.conf" and "/etc/conf.d/nfs-server.conf".}}<br />
<br />
Edit this file to pass appropriate run-time options to nfsd, mountd, statd, and sm-notify. The default Arch NFS init scripts require the --no-notify option for statd, as follows:<br />
STATD_OPTS="--no-notify"<br />
Others may be left at the provided defaults, or changed according to your requirements. Please refer to the relevant man pages for full details.<br />
<br />
===Daemons===<br />
You can now start the server with the following commands:<br />
# rc.d start rpcbind (or: rc.d start portmap)<br />
# rc.d start nfs-common (or: rc.d start nfslock)<br />
# rc.d start nfs-server (or: rc.d start nfsd)<br />
<br />
Please note that they must be started in that order. To start the server at boot time, add these daemons to the DAEMONS array in /etc/rc.conf.<br />
<br />
==Setting up the client==<br />
<br />
===Files===<br />
<br />
====/etc/conf.d/nfs-common.conf====<br />
Edit this file to pass appropriate run-time options to statd - the remaining options are for server use only. Do ''not'' use the --no-notify option on the client side, unless you are fully aware of the consequences of doing so.<br />
<br />
Please refer to the statd man page for full details.<br />
<br />
===Daemons===<br />
Start the rpcbind and nfs-common daemons:<br />
rc.d start rpcbind (or: rc.d start portmap)<br />
rc.d start nfs-common (or: rc.d start nfslock)<br />
<br />
Please note that they must be started in that order ''or'' start only ''nfs-common'', as ''rpcbind'' will be started as a dependency.<br />
<br />
To start the daemons at boot time, add them to the DAEMONS array in /etc/rc.conf.<br />
<br />
===Mounting===<br />
Then just mount as normal:<br />
mount server:/files /files<br />
<br />
Unlike CIFS shares or [[rsync]], NFS exports must be called by the full path on the server; example, if /home/fred/music is defined in /etc/exports on server ELROND, you must call:<br />
mount ELROND:/home/fred/music /mnt/point<br />
instead of just using:<br />
mount ELROND:music /mnt/point<br />
or you will get ''mount.nfs: access denied by server while mounting''<br />
<br />
{{Note|If you the the following message then you probably didn't start the Daemons from the previous section or something went wrong while starting them.<br />
mount: wrong fs type, bad option, bad superblock on 192.168.1.99:/media/raid5-4tb,<br />
missing codepage or helper program, or other error<br />
(for several filesystems (e.g. nfs, cifs) you might<br />
need a /sbin/mount.<type> helper program)<br />
In some cases useful info is found in syslog - try<br />
dmesg | tail or so<br />
}}<br />
<br />
===Auto-mount on boot===<br />
If you want to mount on boot, make sure network, rpcbind (portmap), nfs-common (nfslock) and netfs are in the DAEMONS array in /etc/rc.conf. Make sure the order is this one. It is better not to put any '@' in front of them (although you could safely use @netfs); for instance:<br />
DAEMONS=(... network rpcbind nfs-common @netfs ...)<br />
or<br />
DAEMONS=(... network portmap nfslock @netfs ...)<br />
<br />
Add an appropriate line in /etc/fstab, for example:<br />
server:/files /files nfs defaults 0 0<br />
<br />
If you wish to specify a packet size for read and write packets, specify them in your fstab entry. The values listed below are the defaults if none are specified:<br />
server:/files /files nfs rsize=32768,wsize=32768 0 0<br />
<br />
Read the nfs man page for further information, including all available mount options.<br />
<br />
==Troubleshooting==<br />
<br />
===Unreliable performance, slow data transfer, and/or high load when using NFS and gigabit===<br />
====Async====<br />
Verify that the async flag is used in {{Filename|/etc/exports}}<br />
Example:<br />
<br />
/nfs4exports 192.168.0.0/24(ro,fsid=0,no_subtree_check,async)<br />
/nfs4exports/data 192.168.0.0/24(rw,no_subtree_check,async,nohide)<br />
/nfs4exports/backup 192.168.0.0/24(rw,no_subtree_check,async,nohide)<br />
<br />
====Packetsize====<br />
This is a result of the default packetsize used by NFS, which causes significant fragmentation on gigabit networks. You can modify this behavior by the rsize and wsize mount parameters. Using rsize=32768,wsize=32768 should suffice. Please note that this problem does not occur on 100Mb networks, due to the lower packet transfer speed.<br />
<br />
Default value for NFS4 is 32768. Maximum is 65536. Increase from default in increments of 1024 until maximum transfer rate is achieved.<br />
<br />
===Portmap daemon fails to start at boot===<br />
Make sure you place portmap ''before'' netfs in the daemons array in /etc/rc.conf.<br />
<br />
===Nfsd fails to start with "nfssvc: No such device"===<br />
Make sure the nfs and nfsd modules are loaded in the kernel.<br />
<br />
===Nfsd seems to work, but I cannot connect from MacOS X clients===<br />
When trying to connect from a MacOS X client, you will see that everything is ok at logs, but MacOS X refuses to mount your NFS share. You have to add {{Codeline|insecure}} option to your share and re-run {{Codeline|exportfs -r}}.<br />
<br />
===mount.nfs: Operation not permitted===<br />
After updating to nfs-utils 1.2.1-2, mounting NFS shares stopped working. Henceforth, nfs-utils uses NFSv4 per default instead of NFSv3. The problem can be solved by using either mount option <code>'vers=3'</code> or <code>'nfsvers=3'</code> on the command line: <br />
# mount.nfs <remote target> <directory> -o ...,vers=3,...<br />
# mount.nfs <remote target> <directory> -o ...,nfsvers=3,...<br />
or in <code>/etc/fstab</code>:<br />
<remote target> <directory> nfs ...,vers=3,... 0 0<br />
<remote target> <directory> nfs ...,nfsvers=3,... 0 0<br />
<br />
===Ownership of mounted shares is 4294967294:4294967294===<br />
The following two values in /etc/conf.d/nfs-common.conf (on the client) need to be set:<br />
NEED_STATD="no"<br />
NEED_IDMAPD="yes"<br />
<br />
==Links and references==<br />
* See also [[Avahi]], a Zeroconf implementation which allows automatic discovery of NFS shares.<br />
* HOWTO: [[Diskless network boot NFS root]]<br />
* [http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.prftungd/doc/prftungd/nfs_perf.htm Very helpful]<br />
* If you are setting up the Archlinux NFS server for use by Windows clients through Microsoft's SFU, you will save a lot of time and hair-scratching by looking at [http://bbs.archlinux.org/viewtopic.php?pid=523934#p523934 this forum post] first !<br />
* [http://blogs.msdn.com/sfu/archive/2008/04/14/all-well-almost-about-client-for-nfs-configuration-and-performance.aspx Microsoft Services for Unix NFS Client info]<br />
* [http://blogs.msdn.com/sfu/archive/2007/05/01/unix-interoperability-and-windows-vista.aspx Unix interoperability and Windows Vista] Prerequisites to connect to NFS with Vista</div>Markg85https://wiki.archlinux.org/index.php?title=NFSv3&diff=150340NFSv32011-07-31T14:58:13Z<p>Markg85: /* Setting up the client */</p>
<hr />
<div>[[Category:Networking (English)]]<br />
{{i18n|NFS}}<br />
<br />
The goal of this article is to assist in setting up an nfs-server for sharing files over a network.<br />
<br />
*For NFSv4, see: [[NFSv4]]<br />
*nfs-utils has been upgraded since 2009-06-23, and NFS4 support is now implemented. Refer to the [http://www.archlinux.org/news/452/ news bulletin].<br />
*portmap has been replaced by rpcbind.<br />
<br />
==Required packages==<br />
Required packages for both the server and the client are minimal. You will only need to install:<br />
# pacman -S nfs-utils rpcbind<br />
{{Note|instead of rpcbind, you can also install portmap which was replaced}}<br />
<br />
==Setting up the server==<br />
You can now edit your configuration and then start the daemons.<br />
<br />
===Files===<br />
<br />
====/etc/exports====<br />
This file defines the various shares on the nfs server and their permissions. A few examples:<br />
/files *(ro,sync) # Read-only access to anyone<br />
/files 192.168.0.100(rw,sync) # Read-write access to a client on 192.168.0.100<br />
/files 192.168.1.1/24(rw,sync) # Read-write access to all clients from 192.168.1.1 to 192.168.1.255<br />
<br />
If you make changes to /etc/exports after starting the daemons, you can make them effective by issuing the following command:<br />
# exportfs -r<br />
<br />
If you decide to make your NFS share public and writable, you can use the all_squash option in combination with anonuid and the anongid option.<br />
For example, to set the privileges for the user nobody in the group nobody, you can do the following:<br />
; Read-write access to a client on 192.168.0.100, with rw access for the user 99 with gid 99<br />
/files 192.168.0.100(rw,sync,all_squash,anonuid=99,anongid=99))<br />
<br />
This also means, that if you want write access to this directory, nobody.nobody must be the owner of the share directory:<br />
# chown -R nobody.nobody /files<br />
<br />
Full details on the exports file are provided by the exports man page.<br />
<br />
====/etc/conf.d/nfs-common.conf====<br />
{{Note|This used to be in /etc/conf.d/nfs which is replaced by "/etc/conf.d/nfs-common.conf" and "/etc/conf.d/nfs-server.conf".}}<br />
<br />
Edit this file to pass appropriate run-time options to nfsd, mountd, statd, and sm-notify. The default Arch NFS init scripts require the --no-notify option for statd, as follows:<br />
STATD_OPTS="--no-notify"<br />
Others may be left at the provided defaults, or changed according to your requirements. Please refer to the relevant man pages for full details.<br />
<br />
===Daemons===<br />
You can now start the server with the following commands:<br />
# rc.d start rpcbind (or: rc.d start portmap)<br />
# rc.d start nfs-common (or: rc.d start nfslock)<br />
# rc.d start nfs-server (or: rc.d start nfsd)<br />
<br />
Please note that they must be started in that order. To start the server at boot time, add these daemons to the DAEMONS array in /etc/rc.conf.<br />
<br />
==Setting up the client==<br />
<br />
===Files===<br />
<br />
====/etc/conf.d/nfs-common.conf====<br />
Edit this file to pass appropriate run-time options to statd - the remaining options are for server use only. Do ''not'' use the --no-notify option on the client side, unless you are fully aware of the consequences of doing so.<br />
<br />
Please refer to the statd man page for full details.<br />
<br />
===Daemons===<br />
Start the rpcbind and nfs-common daemons:<br />
rc.d start rpcbind (or: rc.d start portmap)<br />
rc.d start nfs-common (or: rc.d start nfslock)<br />
<br />
Please note that they must be started in that order ''or'' start only ''nfs-common'', as ''rpcbind'' will be started as a dependency.<br />
<br />
To start the daemons at boot time, add them to the DAEMONS array in /etc/rc.conf.<br />
<br />
===Mounting===<br />
Then just mount as normal:<br />
mount server:/files /files<br />
<br />
Unlike CIFS shares or [[rsync]], NFS exports must be called by the full path on the server; example, if /home/fred/music is defined in /etc/exports on server ELROND, you must call:<br />
mount ELROND:/home/fred/music /mnt/point<br />
instead of just using:<br />
mount ELROND:music /mnt/point<br />
or you will get ''mount.nfs: access denied by server while mounting''<br />
<br />
{{Note|If you the the following message:<br />
mount: wrong fs type, bad option, bad superblock on 192.168.1.99:/media/raid5-4tb,<br />
missing codepage or helper program, or other error<br />
(for several filesystems (e.g. nfs, cifs) you might<br />
need a /sbin/mount.<type> helper program)<br />
In some cases useful info is found in syslog - try<br />
dmesg | tail or so<br />
Then you probably didn't start the Daemons from the previous section or something went wrong while starting them.}}<br />
<br />
===Auto-mount on boot===<br />
If you want to mount on boot, make sure network, rpcbind (portmap), nfs-common (nfslock) and netfs are in the DAEMONS array in /etc/rc.conf. Make sure the order is this one. It is better not to put any '@' in front of them (although you could safely use @netfs); for instance:<br />
DAEMONS=(... network rpcbind nfs-common @netfs ...)<br />
or<br />
DAEMONS=(... network portmap nfslock @netfs ...)<br />
<br />
Add an appropriate line in /etc/fstab, for example:<br />
server:/files /files nfs defaults 0 0<br />
<br />
If you wish to specify a packet size for read and write packets, specify them in your fstab entry. The values listed below are the defaults if none are specified:<br />
server:/files /files nfs rsize=32768,wsize=32768 0 0<br />
<br />
Read the nfs man page for further information, including all available mount options.<br />
<br />
==Troubleshooting==<br />
<br />
===Unreliable performance, slow data transfer, and/or high load when using NFS and gigabit===<br />
====Async====<br />
Verify that the async flag is used in {{Filename|/etc/exports}}<br />
Example:<br />
<br />
/nfs4exports 192.168.0.0/24(ro,fsid=0,no_subtree_check,async)<br />
/nfs4exports/data 192.168.0.0/24(rw,no_subtree_check,async,nohide)<br />
/nfs4exports/backup 192.168.0.0/24(rw,no_subtree_check,async,nohide)<br />
<br />
====Packetsize====<br />
This is a result of the default packetsize used by NFS, which causes significant fragmentation on gigabit networks. You can modify this behavior by the rsize and wsize mount parameters. Using rsize=32768,wsize=32768 should suffice. Please note that this problem does not occur on 100Mb networks, due to the lower packet transfer speed.<br />
<br />
Default value for NFS4 is 32768. Maximum is 65536. Increase from default in increments of 1024 until maximum transfer rate is achieved.<br />
<br />
===Portmap daemon fails to start at boot===<br />
Make sure you place portmap ''before'' netfs in the daemons array in /etc/rc.conf.<br />
<br />
===Nfsd fails to start with "nfssvc: No such device"===<br />
Make sure the nfs and nfsd modules are loaded in the kernel.<br />
<br />
===Nfsd seems to work, but I cannot connect from MacOS X clients===<br />
When trying to connect from a MacOS X client, you will see that everything is ok at logs, but MacOS X refuses to mount your NFS share. You have to add {{Codeline|insecure}} option to your share and re-run {{Codeline|exportfs -r}}.<br />
<br />
===mount.nfs: Operation not permitted===<br />
After updating to nfs-utils 1.2.1-2, mounting NFS shares stopped working. Henceforth, nfs-utils uses NFSv4 per default instead of NFSv3. The problem can be solved by using either mount option <code>'vers=3'</code> or <code>'nfsvers=3'</code> on the command line: <br />
# mount.nfs <remote target> <directory> -o ...,vers=3,...<br />
# mount.nfs <remote target> <directory> -o ...,nfsvers=3,...<br />
or in <code>/etc/fstab</code>:<br />
<remote target> <directory> nfs ...,vers=3,... 0 0<br />
<remote target> <directory> nfs ...,nfsvers=3,... 0 0<br />
<br />
===Ownership of mounted shares is 4294967294:4294967294===<br />
The following two values in /etc/conf.d/nfs-common.conf (on the client) need to be set:<br />
NEED_STATD="no"<br />
NEED_IDMAPD="yes"<br />
<br />
==Links and references==<br />
* See also [[Avahi]], a Zeroconf implementation which allows automatic discovery of NFS shares.<br />
* HOWTO: [[Diskless network boot NFS root]]<br />
* [http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.prftungd/doc/prftungd/nfs_perf.htm Very helpful]<br />
* If you are setting up the Archlinux NFS server for use by Windows clients through Microsoft's SFU, you will save a lot of time and hair-scratching by looking at [http://bbs.archlinux.org/viewtopic.php?pid=523934#p523934 this forum post] first !<br />
* [http://blogs.msdn.com/sfu/archive/2008/04/14/all-well-almost-about-client-for-nfs-configuration-and-performance.aspx Microsoft Services for Unix NFS Client info]<br />
* [http://blogs.msdn.com/sfu/archive/2007/05/01/unix-interoperability-and-windows-vista.aspx Unix interoperability and Windows Vista] Prerequisites to connect to NFS with Vista</div>Markg85https://wiki.archlinux.org/index.php?title=NFSv3&diff=150339NFSv32011-07-31T14:48:26Z<p>Markg85: A note in the install line is really.. not good. Changed to use a note template.</p>
<hr />
<div>[[Category:Networking (English)]]<br />
{{i18n|NFS}}<br />
<br />
The goal of this article is to assist in setting up an nfs-server for sharing files over a network.<br />
<br />
*For NFSv4, see: [[NFSv4]]<br />
*nfs-utils has been upgraded since 2009-06-23, and NFS4 support is now implemented. Refer to the [http://www.archlinux.org/news/452/ news bulletin].<br />
*portmap has been replaced by rpcbind.<br />
<br />
==Required packages==<br />
Required packages for both the server and the client are minimal. You will only need to install:<br />
# pacman -S nfs-utils rpcbind<br />
{{Note|instead of rpcbind, you can also install portmap which was replaced}}<br />
<br />
==Setting up the server==<br />
You can now edit your configuration and then start the daemons.<br />
<br />
===Files===<br />
<br />
====/etc/exports====<br />
This file defines the various shares on the nfs server and their permissions. A few examples:<br />
/files *(ro,sync) # Read-only access to anyone<br />
/files 192.168.0.100(rw,sync) # Read-write access to a client on 192.168.0.100<br />
/files 192.168.1.1/24(rw,sync) # Read-write access to all clients from 192.168.1.1 to 192.168.1.255<br />
<br />
If you make changes to /etc/exports after starting the daemons, you can make them effective by issuing the following command:<br />
# exportfs -r<br />
<br />
If you decide to make your NFS share public and writable, you can use the all_squash option in combination with anonuid and the anongid option.<br />
For example, to set the privileges for the user nobody in the group nobody, you can do the following:<br />
; Read-write access to a client on 192.168.0.100, with rw access for the user 99 with gid 99<br />
/files 192.168.0.100(rw,sync,all_squash,anonuid=99,anongid=99))<br />
<br />
This also means, that if you want write access to this directory, nobody.nobody must be the owner of the share directory:<br />
# chown -R nobody.nobody /files<br />
<br />
Full details on the exports file are provided by the exports man page.<br />
<br />
====/etc/conf.d/nfs-common.conf====<br />
{{Note|This used to be in /etc/conf.d/nfs which is replaced by "/etc/conf.d/nfs-common.conf" and "/etc/conf.d/nfs-server.conf".}}<br />
<br />
Edit this file to pass appropriate run-time options to nfsd, mountd, statd, and sm-notify. The default Arch NFS init scripts require the --no-notify option for statd, as follows:<br />
STATD_OPTS="--no-notify"<br />
Others may be left at the provided defaults, or changed according to your requirements. Please refer to the relevant man pages for full details.<br />
<br />
===Daemons===<br />
You can now start the server with the following commands:<br />
# rc.d start rpcbind (or: rc.d start portmap)<br />
# rc.d start nfs-common (or: rc.d start nfslock)<br />
# rc.d start nfs-server (or: rc.d start nfsd)<br />
<br />
Please note that they must be started in that order. To start the server at boot time, add these daemons to the DAEMONS array in /etc/rc.conf.<br />
<br />
==Setting up the client==<br />
<br />
===Files===<br />
<br />
====/etc/conf.d/nfs-common.conf====<br />
Edit this file to pass appropriate run-time options to statd - the remaining options are for server use only. Do ''not'' use the --no-notify option on the client side, unless you are fully aware of the consequences of doing so.<br />
<br />
Please refer to the statd man page for full details.<br />
<br />
===Daemons===<br />
Start the rpcbind and nfs-common daemons:<br />
rc.d start rpcbind (or: rc.d start portmap)<br />
rc.d start nfs-common (or: rc.d start nfslock)<br />
<br />
Please note that they must be started in that order ''or'' start only ''nfs-common'', as ''rpcbind'' will be started as a dependency.<br />
<br />
To start the daemons at boot time, add them to the DAEMONS array in /etc/rc.conf.<br />
<br />
Then just mount as normal:<br />
mount server:/files /files<br />
<br />
Unlike CIFS shares or [[rsync]], NFS exports must be called by the full path on the server; example, if /home/fred/music is defined in /etc/exports on server ELROND, you must call:<br />
mount ELROND:/home/fred/music /mnt/point<br />
instead of just using:<br />
mount ELROND:music /mnt/point<br />
or you will get ''mount.nfs: access denied by server while mounting''<br />
<br />
===Auto-mount on boot===<br />
If you want to mount on boot, make sure network, rpcbind (portmap), nfs-common (nfslock) and netfs are in the DAEMONS array in /etc/rc.conf. Make sure the order is this one. It is better not to put any '@' in front of them (although you could safely use @netfs); for instance:<br />
DAEMONS=(... network rpcbind nfs-common @netfs ...)<br />
or<br />
DAEMONS=(... network portmap nfslock @netfs ...)<br />
<br />
Add an appropriate line in /etc/fstab, for example:<br />
server:/files /files nfs defaults 0 0<br />
<br />
If you wish to specify a packet size for read and write packets, specify them in your fstab entry. The values listed below are the defaults if none are specified:<br />
server:/files /files nfs rsize=32768,wsize=32768 0 0<br />
<br />
Read the nfs man page for further information, including all available mount options.<br />
<br />
==Troubleshooting==<br />
<br />
===Unreliable performance, slow data transfer, and/or high load when using NFS and gigabit===<br />
====Async====<br />
Verify that the async flag is used in {{Filename|/etc/exports}}<br />
Example:<br />
<br />
/nfs4exports 192.168.0.0/24(ro,fsid=0,no_subtree_check,async)<br />
/nfs4exports/data 192.168.0.0/24(rw,no_subtree_check,async,nohide)<br />
/nfs4exports/backup 192.168.0.0/24(rw,no_subtree_check,async,nohide)<br />
<br />
====Packetsize====<br />
This is a result of the default packetsize used by NFS, which causes significant fragmentation on gigabit networks. You can modify this behavior by the rsize and wsize mount parameters. Using rsize=32768,wsize=32768 should suffice. Please note that this problem does not occur on 100Mb networks, due to the lower packet transfer speed.<br />
<br />
Default value for NFS4 is 32768. Maximum is 65536. Increase from default in increments of 1024 until maximum transfer rate is achieved.<br />
<br />
===Portmap daemon fails to start at boot===<br />
Make sure you place portmap ''before'' netfs in the daemons array in /etc/rc.conf.<br />
<br />
===Nfsd fails to start with "nfssvc: No such device"===<br />
Make sure the nfs and nfsd modules are loaded in the kernel.<br />
<br />
===Nfsd seems to work, but I cannot connect from MacOS X clients===<br />
When trying to connect from a MacOS X client, you will see that everything is ok at logs, but MacOS X refuses to mount your NFS share. You have to add {{Codeline|insecure}} option to your share and re-run {{Codeline|exportfs -r}}.<br />
<br />
===mount.nfs: Operation not permitted===<br />
After updating to nfs-utils 1.2.1-2, mounting NFS shares stopped working. Henceforth, nfs-utils uses NFSv4 per default instead of NFSv3. The problem can be solved by using either mount option <code>'vers=3'</code> or <code>'nfsvers=3'</code> on the command line: <br />
# mount.nfs <remote target> <directory> -o ...,vers=3,...<br />
# mount.nfs <remote target> <directory> -o ...,nfsvers=3,...<br />
or in <code>/etc/fstab</code>:<br />
<remote target> <directory> nfs ...,vers=3,... 0 0<br />
<remote target> <directory> nfs ...,nfsvers=3,... 0 0<br />
<br />
===Ownership of mounted shares is 4294967294:4294967294===<br />
The following two values in /etc/conf.d/nfs-common.conf (on the client) need to be set:<br />
NEED_STATD="no"<br />
NEED_IDMAPD="yes"<br />
<br />
==Links and references==<br />
* See also [[Avahi]], a Zeroconf implementation which allows automatic discovery of NFS shares.<br />
* HOWTO: [[Diskless network boot NFS root]]<br />
* [http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.prftungd/doc/prftungd/nfs_perf.htm Very helpful]<br />
* If you are setting up the Archlinux NFS server for use by Windows clients through Microsoft's SFU, you will save a lot of time and hair-scratching by looking at [http://bbs.archlinux.org/viewtopic.php?pid=523934#p523934 this forum post] first !<br />
* [http://blogs.msdn.com/sfu/archive/2008/04/14/all-well-almost-about-client-for-nfs-configuration-and-performance.aspx Microsoft Services for Unix NFS Client info]<br />
* [http://blogs.msdn.com/sfu/archive/2007/05/01/unix-interoperability-and-windows-vista.aspx Unix interoperability and Windows Vista] Prerequisites to connect to NFS with Vista</div>Markg85https://wiki.archlinux.org/index.php?title=QEMU&diff=135819QEMU2011-04-03T18:15:20Z<p>Markg85: /* Nitty Gritty */</p>
<hr />
<div>[[Category:Emulators (English)]]<br />
[[Category:HOWTOs (English)]]<br />
[[fr:Qemu]]<br />
{{i18n|QEMU}}<br />
<br />
From the [http://wiki.qemu.org/Main_Page QEMU about page],<br />
<blockquote><br />
QEMU is a generic and open source machine emulator and virtualizer.<br />
<br /><br /><br />
When used as a machine emulator, QEMU can run OSes and programs made for one machine (e.g. an ARM board) on a different machine (e.g. your own PC). By using dynamic translation, it achieves very good performances.<br />
<br /><br /><br />
When used as a virtualizer, QEMU achieves near native performances by executing the guest code directly on the host CPU. A host driver called the QEMU accelerator (also known as KQEMU) is needed in this case. QEMU supports virtualization when executing under the Xen hypervisor or using the KVM kernel module in Linux. When using KVM, QEMU can virtualize x86, server and embedded PowerPC, and S390 guests. The virtualizer mode requires that both the host and guest machine use x86 compatible processors.<br />
<br /><br />
</blockquote><br />
<br />
=== Difference between qemu and qemu-kvm ===<br />
<br />
Depending on your needs, you can choose either to install upstream qemu or qemu-kvm from the [extra] repository. Upstream qemu is a pure emulator, with no hardware acceleration (actually, it does have initial KVM support when qemu is started with -enable-kvm parameter, but this implementation is still buggy and nowhere as complete as in qemu-kvm, many functions still doesn't work). Upstream qemu is capable of emulating many different platforms (arm, i386, m68k, mips, ppc, sparc, x86_64, etc). On the other hand you have qemu-kvm, which is qemu (i386 and x86_64 architecture support only) with KVM (kernel virtual machine) additions, allowing you to run virtual machines at close to native speed. qemu-kvm is the version you want if you have a capable CPU and only need to run virtual machines for the i386 and x86_64 architecture (Linux, Windows, BSD, etc).<br />
<br />
Not all processor supports kvm. You will need an x86 machine running a recent Linux kernel on an Intel processor with VT (virtualization technology) extensions, or an AMD processor with SVM extensions (also called AMD-V). Xen has a [http://wiki.xensource.com/xenwiki/HVM_Compatible_Processors complete list ] of compatible processors. For Intel processors, see also the [http://ark.intel.com/VTList.aspx Intel® Virtualization Technology List].<br />
<br />
=== Installing QEMU ===<br />
<br />
To install the machine emulator version:<br />
<pre><br />
$ sudo pacman -S qemu<br />
</pre><br />
To install the KVM version (please see the page on [[Kvm]] for more details):<br />
<pre><br />
$ sudo pacman -S qemu-kvm<br />
</pre><br />
<br />
=== Choosing Windows version===<br />
Qemu can run any version of Windows. However, 98, Me and XP will run at quite a low speed. You should choose either Windows 95 or Windows 2000. Surprisingly, 2000 seems to run faster than 98. The fastest one is 95, which can from time to time make you forget that you are running an emulator :)<br />
<br />
If you own both Win95 and win98/winme, then 98lite (from http://www.litepc.com) might be worth trying. It decouples Internet Explorer from operating system and replaces it with original Windows 95 Explorer. It also enables you to do a minimal Windows installation, without all the bloat you normally cannot disable. This might be the best option, because you get the smallest, fastest and most stable Windows this way.<br />
<br />
=== Creating the hard disk image===<br />
To run qemu you will probably need a hard disk image. This is a file which stores the contents of the emulated hard disk.<br />
<br />
Use the command:<br />
<pre><br />
qemu-img create -f qcow2 win.qcow 4G<br />
</pre><br />
to create the image file named "win.qcow". The "4G" parameter specifies the size of the disk - in this case 4 GB. You can use suffix M for megabytes (for example "256M"). You shouldn't worry too much about the size of the disk - the qcow2 format compresses the image so that the empty space doesn't add up to the size of the file.<br />
<br />
=== Preparing the installation media===<br />
The installation CD-ROM/floppy shouldn't be mounted, because Qemu accesses the media directly. It is a good idea to dump CD-ROM and/or floppy to a file, because it both improves performance and doesn't require you to have direct access to the devices (that is, you can run Qemu as a regular user). For example, if the CD-ROM device node is named "/dev/cdrom", you can dump it to a file with the command:<br />
<pre><br />
dd if=/dev/cdrom of=win98icd.iso<br />
</pre><br />
<br />
Do the same for floppies:<br />
<br />
<pre><br />
dd if=/dev/fd of=win95d1.img<br />
...<br />
</pre><br />
<br />
When you need to replace floppies within qemu, just copy the contents of one floppy over another. For this reason, it is useful to create a special file that will hold the current floppy:<br />
<br />
<pre><br />
touch floppy.img<br />
</pre><br />
<br />
=== Installing the operating system===<br />
<br />
This is the first time you will need to start the emulator.<br />
One thing to keep in mind: when you click inside qemu window, the mouse pointer is grabbed. To release it press Ctrl+Alt.<br />
<br />
If you need to use a bootable floppy, run Qemu with:<br />
<pre><br />
qemu -cdrom [[cdrom''image]] -fda [[floppy''image]] -boot a [[hd_image]]<br />
</pre><br />
or if you are on a x86_64 system (will avoid many problems afterwards):<br />
<pre><br />
qemu-system-x86_64 -cdrom [[cdrom''image]] -fda [[floppy''image]] -boot a [[hd_image]]<br />
</pre><br />
<br />
If your CD-ROM is bootable or you are using iso files, run Qemu with:<br />
<pre><br />
qemu -cdrom [[cdrom''image]] -boot d [[hd''image]]<br />
</pre><br />
or if you are on a x86_64 system (will avoid many problems afterwards):<br />
<pre><br />
qemu-system-x86_64 -cdrom [[cdrom''image]] -boot d [[hd''image]]<br />
</pre><br />
Now partition the virtual hard disk, format the partitions and install the OS.<br />
<br />
A few hints:<br />
# If you are using Windows 95 boot floppy, then choosing SAMSUNG as the type of CD-ROM seems to work<br />
# There are problems when installing Windows 2000. Windows setup will generate a lot of edb*.log files, one after the other containing nothing but blank spaces in C:\WINNT\SECURITY which quickly fill the virtual harddisk. A workaround is to open a Windows command prompt as early as possible during setup (by pressing Shift-F10) which will allow you to remove these log files as they appear by typing :<br />
<pre><br />
del %windir%\security\*.log<br />
</pre><br />
<br />
{{Note| According to the official QEMU website, "Windows 2000 has a bug which gives a disk full problem during its installation. When installing it, use the `-win2k-hack' QEMU option to enable a specific workaround. After Windows 2000 is installed, you no longer need this option (this option slows down the IDE transfers)."}}<br />
<br />
=== Running the system===<br />
<br />
To run the system simply type:<br />
<pre><br />
qemu [hd_image]<br />
</pre><br />
<br />
A good idea is to use overlay images. This way you can create hard disk image once and tell Qemu to store changes in external file.<br />
You get rid of all the instability, because it is so easy to revert to previous system state :)<br />
<br />
To create an overlay image, type:<br />
<pre><br />
qemu-img create -b [[base''image]] -f qcow [[overlay''image]]<br />
</pre>2<br />
Substitute the hard disk image for base_image (in our case win.qcow). After that you can run qemu with:<br />
<pre><br />
qemu [overlay_image]<br />
</pre><br />
or if you are on a x86_64 system:<br />
<pre><br />
qemu-system-x86_64 [overlay_image]<br />
</pre><br />
and the original image will be left untouched. One hitch, the base image cannot be renamed or moved, the overlay remembers the base's full path.<br />
<br />
=== Moving data between host and guest OS===<br />
<br />
If you have servers on your host OS they will be accessible with the ip-address 10.0.2.2 without any further configuration. So you could just FTP or SSH, etc to 10.0.2.2 from windows to share data, or if you would like to use samba:<br />
<br />
==== Samba====<br />
<br />
Qemu supports SAMBA which allows you to mount host directories during the emulation. It seems that there is an incompatibility with SAMBA 3.x. and some versions of qemu. But at least with a current snapshot of qemu it should be working.<br />
<br />
First, you need to have a working samba installation. Then add the following section to your smb.conf:<br />
<pre><br />
[qemu]<br />
comment = Temporary file space<br />
path = /tmp<br />
read only = no<br />
public = yes<br />
</pre><br />
<br />
Now start qemu with:<br />
<pre><br />
qemu [hd_image] -smb qemu<br />
</pre><br />
<br />
Then you should be able to access your host's smb-server with the ip-address 10.0.2.2. If you're running Win9x as guest OS, you may need to add<br />
<pre><br />
10.0.2.2 smbserver<br />
</pre><br />
to c:\windows\lmhosts (Win9x has Lmhosts.sam as a SAMple, rename it!).<br />
<br />
==== Mounting the hard disk image====<br />
<br />
Fortunately there is a way to mount the hard disk image with a loopback device. Login as root, make a temporary directory and mount the image with the command:<br />
<pre><br />
mount -o loop,offset=32256 [[hd''image]] [[tmp''dir]]<br />
</pre><br />
Now you can copy data in both directions. When you are done, umount with:<br />
<pre><br />
umount [hd_image]<br />
</pre><br />
The drawback of this solution is that you cannot use it with qcow images (including overlay images). So you need to create you images without \"-f qcow\" option. Tip: create a second, raw harddrive image. This way you'll be able to transfer data easily and use qcow overlay images for the primary drive.<br />
<br />
REMEMBER: never run qemu when the image is mounted!<br />
<br />
==== Using any real partition as the single primary partition of a hard disk image ====<br />
<br />
Sometimes, you may wish to use one of your system partition from within qemu (for instance, if you wish booting both your real machine or qemu using a given partition as root). You can do this using software RAID in linear mode (you need the linear.ko kernel driver) and a loopback device: the trick is to dynamically prepend a master boot record (MBR) to the real partition you wish to embed in a qemu raw disk image.<br />
<br />
Suppose you have a plain, unmounted /dev/hdaN partition with some filesystem on it you wish to make part of a qemu disk image. First, you create some small file to hold the MBR:<br />
<br />
dd if=/dev/zero of=/path/to/mbr count=32<br />
<br />
Here, a 16 KB (32 * 512 bytes) file is created. It is important not to make it too small (even if the MBR only needs a single 512 bytes block), since the smaller it will be, the smaller the chunk size of the software RAID device will have to be, which could have an impact on performance. Then, you setup a loopback device to the MBR file:<br />
<br />
losetup -f /path/to/mbr<br />
<br />
Let's assume the resulting device is /dev/loop0, because we woudn't already have been using other loopbacks. Next step is to create the "merged" MBR + /dev/hdaN disk image using software RAID:<br />
<br />
modprobe linear<br />
mdadm --build --verbose /dev/md0 --chunk=16 --level=linear --raid-devices=2 /dev/loop0 /dev/hdaN<br />
<br />
The resulting /dev/md0 is what you will use as a qemu raw disk image (don't forget to set the permissions so that the emulator can access it). The last (and somewhat tricky) step is to set the disk configuration (disk geometry and partitions table) so that the primary partition start point in the MBR matches the one of /dev/hdaN inside /dev/md0 (an offset of exactly 16 * 512 = 16384 bytes in this example). Do this using fdisk on the host machine, not in the emulator: the default raw disc detection routine from qemu often results in non kilobyte-roundable offsets (such as 31.5 KB, as in the previous section) that cannot be managed by the software RAID code. Hence, from the the host:<br />
<br />
fdisk /dev/md0<br />
<br />
Press 'x' to enter the expert menu. Set number of 's'ectors per track so that the size of one<br />
cylinder matches the size of your mbr file. For two heads and the sector size is 512, the number of<br />
sectors per track should be 16, so we get cylinders of size 2x16x512=16k. Now, press 'r' to return<br />
to the main menu. Press 'p' and check that now the cylinder size is 16k.<br />
Now, create a single primary partition corresponding to /dev/hdaN. It should start at cylinder 2 and end at the end of the disk (note that the number of cylinders now differs from what it was when you entered fdisk. Finally, 'w'rite the result to the file: you are done. You know have a partition you can mount directly from your host, as well as part of a qemu disk image: <br />
<br />
qemu -hdc /dev/md0 [...]<br />
<br />
You can of course safely set any bootloader on this disk image using qemu, provided the original /boot/hdaN partition contains the necessary tools.<br />
<br />
=== Optimizing Windows 9x CPU usage===<br />
<br />
Windows 9x doesn't use hlt instruction, so the emulator always eats up 100% CPU even if no computation is being done. Grab the file http://www.user.cityline.ru/~maxamn/amnhltm.zip, unpack it, copy it to the image and run the .bat file.<br />
<br />
=== Using the QEmu Accelerator Module===<br />
<br />
{{Note|This method is no longer supported. The [[Kvm]] module should be used instead.}}<br />
<br />
The developers of qemu have created an optional kernel module to accelerate qemu to sometimes near native levels. This should be loaded with the option<br />
major=0<br />
to automate the creation of the required /dev/kqemu device. The following command<br />
echo "options kqemu major=0" >> /etc/modprobe.d/modprobe.conf<br />
will amend modprobe.conf to ensure that the module option is added every time the module is loaded.<br />
<br />
Append kqemu to the list of modules in /etc/rc.conf to have it loaded the next time the your system starts. To load it now without rebooting, do the following as root<br />
modprobe kqemu<br />
<br />
If you are using Linux, Windows 2000 or Windows XP as guest OS, start qemu with the command line option<br />
qemu [...] -kernel-kqemu<br />
or, if you are on a x86_64 system (will not work otherwise):<br />
qemu-system-x86_64 [...] -kernel-kqemu<br />
This enables full virtualization and thus improves speed considerably.<br />
<br />
=== Using the Kernel-based Virtual Machine ===<br />
<br />
[[Kvm]] is a full virtualization solution for Linux on x86 hardware containing virtualization extensions (Intel VT or AMD-V). It consists of a loadable kernel module, kvm.ko, that provides the core virtualization infrastructure and a processor specific module, kvm-intel.ko or kvm-amd.ko. Using [[Kvm]], one can run multiple virtual machines running unmodified Linux or Windows images. Each virtual machine has private virtualized hardware: a network card, disk, graphics adapter, etc.<br />
<br />
This technology requires an x86 machine running a recent Linux kernel on an Intel processor with VT (virtualization technology) extensions, or an AMD processor with SVM extensions. It is included in the mainline linux kernel since 2.6.20 and is enabled by default in the Arch Linux kernel.<br />
<br />
Even though qemu in recent versions do have initial KVM support (qemu --enable-kvm), it is not recommended to use this, as many KVM-related functions still haven't been implemented in upstream qemu. Instead, you should go for the qemu-kvm package in extra, which is released by the KVM development team and contain all of the latest features (and bugfixes) of KVM userspace. Please refer to the [[Kvm]] page itself, for more information on using QEMU with KVM on Arch Linux.<br />
<br />
To take advantage of [[Kvm]], you simply need a compatible processor (the following command must return something on screen)<br />
<br />
egrep '^flags.*(vmx|svm)' /proc/cpuinfo<br />
<br />
And load the appropriate module from your rc.conf<br />
<br />
* For Intel® processors add this module to your MODULES array in /etc/rc.conf<br />
<br />
kvm-intel<br />
<br />
* for AMD® processors add this module to your MODULES array in /etc/rc.conf<br />
<br />
kvm-amd<br />
<br />
Also, you will need to yourself to the group 'kvm'.<br />
<br />
===Basic Networking===<br />
To add basic networking to your virtual machine, you may have to simply load qemu with those options: -net nic,vlan=1 -net user,vlan=1. For example, to load a cdrom, you could use:<br />
qemu -kernel-kqemu -no-acpi -net nic,vlan=1 -net user,vlan=1 -cdrom dsl-4.3rc1.iso<br />
Note that this only supports the TCP and UDP protocols. In particular ICMP and thus ping will not work.<br />
<br />
=== Tap Networking with QEMU ===<br />
<br />
==== Basic Idea ====<br />
<br />
Tap networking in QEMU lets virtual machines register themselves as though with separate ethernet adapters and have their traffic bridged directly onto your local area network. This is sometimes very desireable, if you want your virtual machines to be able to talk to each other, or for other machines on your LAN to talk to virtual machines.<br />
<br />
==== Security Warning ====<br />
<br />
You probably <b>should not</b> use this networking method if your host Arch machine is directly on the Internet. It can expose your virtual machines directly to attack!<br />
<br />
In general, Arch disclaims any responsibility for security implications (or implications of any kind, really) from following these instructions.<br />
<br />
==== Nitty Gritty ====<br />
<br />
To set all this up, you'll need to install the following packages:<br />
bridge-utils (for brctl, to manipulate bridges)<br />
uml_utilities (for tunctl, to manipulate taps)<br />
sudo (for manipulating bridges and tunnels as root)<br />
<br />
# pacman -S bridge-utils uml_utilities sudo<br />
<br />
We will replace the normal ethernet adapter with a bridge adapter and bind the normal ethernet adapter to it. See http://en.gentoo-wiki.com/wiki/KVM#Networking_2 .<br />
<br />
Make sure IPv4 forwarding is set. You should have the line "systcl net.ipv4.ip_forward=1" in your /etc/sysctl.conf.<br />
<br />
Take the following steps:<br />
<br />
1. Add <code>bridge</code> and <code>tun</code> to your <code>MODULES</code> line in <code>/etc/rc.conf</code>:<br />
<br />
MODULES=( ... bridge tun)<br />
<br />
2. Configure your bridge <code>br0</code> to have your real ethernet adapter (herein assumed <code>eth0</code>) in it, in <code>/etc/conf.d/bridges</code>:<br />
bridge_br0="eth0"<br />
control_br0="setfd br0 0"<br />
BRIDGE_INTERFACES=(br0)<br />
<br />
{{Note|This is not described anywhere, but adding the control_br0 line is vital for the bridge to work! For more details look here: https://bugs.archlinux.org/task/16625}}<br />
<br />
3. Change your networking configuration so that you just bring up your real ethernet adapter without configuring it, allowing real configuration to happen on the bridge interface. In <code>/etc/rc.conf</code>:<br />
<br />
eth0="eth0 up"<br />
br0="dhcp"<br />
INTERFACES=(eth0 br0)<br />
<br />
Remember, especially if you're doing DHCP, it's essential that the bridge comes up AFTER the real adapter, otherwise the bridge won't be able to talk to anything to get a DHCP address!<br />
<br />
If DHCP does not work, try with a static IP address in <code>/etc/rc.conf</code>:<br />
<br />
eth0="eth0 0.0.0.0"<br />
br0="br0 192.168.0.3 netmask 255.255.255.0 broadcast 192.168.0.255"<br />
INTERFACES=(eth0 br0)<br />
gateway="default gw 192.168.0.1"<br />
ROUTES=(gateway)<br />
<br />
and then in <code>/etc/resolv.conf</code>:<br />
<br />
domain lan<br />
nameserver 192.168.0.1<br />
<br />
4. Install the script that QEMU uses to bring up the tap adapter in <code>/etc/qemu-ifup</code> with root:kvm 750 permissions:<br />
<br />
#!/bin/sh<br />
<br />
echo "Executing /etc/qemu-ifup"<br />
echo "Bringing up $1 for bridged mode..."<br />
sudo /sbin/ifconfig $1 0.0.0.0 promisc up<br />
echo "Adding $1 to br0..."<br />
sudo /usr/sbin/brctl addif br0 $1<br />
sleep 2<br />
<br />
5. Use <code>visudo</code> to add the following to your <code>sudoers</code> file:<br />
<br />
Cmnd_Alias QEMU=/sbin/ifconfig,/sbin/modprobe,/usr/sbin/brctl,/usr/bin/tunctl<br />
%kvm ALL=NOPASSWD: QEMU<br />
<br />
6. Make sure the user(s) wishing to use this new functionality are in the kvm group. Exit and log in again if necessary.<br />
<br />
7. You launch qemu using the following <code>run-qemu</code> script:<br />
<br />
#!/bin/bash<br />
USERID=`whoami`<br />
IFACE=$(sudo tunctl -b -u $USERID)<br />
<br />
qemu-kvm -net nic -net tap,ifname="$IFACE" $*<br />
<br />
sudo tunctl -d $IFACE &> /dev/null<br />
<br />
Then to launch a VM, do something like this<br />
$ run-qemu -hda myvm.img -m 512 -vga std<br />
<br />
8. If you can't get a DHCP address in the host, it might be because the iptables are up by default in the bridge. In that case (from http://www.linux-kvm.org/page/Networking ):<br />
<br />
# cd /proc/sys/net/bridge<br />
# ls<br />
bridge-nf-call-arptables bridge-nf-call-iptables<br />
bridge-nf-call-ip6tables bridge-nf-filter-vlan-tagged<br />
# for f in bridge-nf-*; do echo 0 > $f; done<br />
<br />
And when you still can't get networking to work, see: http://wiki.archlinux.org/index.php/Linux_Containers#Bridge_device_setup<br />
<br />
=== Networking with [[VDE2]] ===<br />
<br />
==== What is VDE? ====<br />
<br />
VDE stands for Virtual Distributed Ethernet. It started as an enhancement of [[User-mode Linux|uml]]_switch. It's a toolbox to manage virtual networks.<br />
<br />
The idea is to create virtual switches, which are basically sockets, and to "plug" both physical and virtual machines in them. The configuration I show here is quite simple; However, VDE is much more powerfull than this, it can plug virtual switches together, run them on different hosts and monitor the traffic in the switches. I let you read [http://wiki.virtualsquare.org/wiki/index.php/Main_Page the documentation of the project].<br />
<br />
The advantage of this method is you don't have to add sudo privileges to your users. Regular users should not be allowed to run modprobe.<br />
<br />
==== Basics ====<br />
<br />
VDE is in extra, so...<br />
<br />
# pacman vde2<br />
<br />
In my config, i use tun/tap to create a virtual interface on my host. Load the tun module ( or add it to your rc.conf ):<br />
<br />
# modprobe tun<br />
<br />
Let's create the virtual switch:<br />
<br />
# vde_switch -tap tap0 -daemon -mod 660 -group kvm<br />
<br />
This line creates the switch, create tap0, "plugs" it, and allows the users of the group kvm to use it.<br />
<br />
The interface is pluged, but not configured yet. Just do it:<br />
<br />
# ifconfig tap0 192.168.100.254 netmask 255.255.255.0<br />
<br />
That's all! Now, you just have to run kvm with this -net options as a normal user:<br />
<br />
$ qemu-kvm -net nic -net vde -hda ...<br />
<br />
Configure your guest as you would do in a physical network. I gave them static addresses and let them access the WAN using ip forwarding and masquerade on my host:<br />
<br />
# echo "1" > /proc/sys/net/ipv4/ip_forward<br />
# iptables -t nat -A POSTROUTING -s 192.168.100.0/24 -o eth0 -j MASQUERADE<br />
<br />
==== Putting it together ====<br />
<br />
I added this init script to run all this at startup :<br />
<br />
#!/bin/bash <br />
<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
case "$1" in<br />
start)<br />
stat_busy "Starting VDE Switch"<br />
vde_switch -tap tap0 -daemon -mod 660 -pidfile $PIDFILE -group kvm<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
echo "1" > /proc/sys/net/ipv4/ip_forward && \<br />
iptables -t nat -A POSTROUTING -s 192.168.100.0/24 -o eth0 -j MASQUERADE && \<br />
ifconfig tap0 192.168.100.254 netmask 255.255.255.0 && \<br />
stat_done || stat_fail<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Stopping VDE Switch"<br />
# err.. well, i should remove the switch here...<br />
stat_done<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 1<br />
# Aem.. As long as stop) isn't implemented, this just fails<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}" <br />
esac<br />
exit 0<br />
<br />
Well, i know it is dirty and could be more configurable. Feel free to improve it. Vde has a rc srcipt too, but i had to make one anyway for the ip forwarding stuff.<br />
<br />
=== Front-ends for Qemu ===<br />
<br />
There are a few GUI Front-ends for Qemu:<br />
<br />
* community/qemu-launcher<br />
* community/qemulator<br />
* community/qtemu<br />
<br />
===Keyboard seems broken / Arrow keys don't work===<br />
<br />
Should you find that some of your keys do not work or "press" the wrong key (in particular, the arrow keys), you likely need to specify your keyboard layout as an option. The keyboard layouts can be found in /usr/share/qemu/keymaps.<br />
<br />
<pre><br />
qemu -k [keymap] [disk_image]<br />
</pre><br />
<br />
===Starting qemu virtual machines on boot===<br />
To run qemu VM's on boot you can use following rc-script and config.<br />
<br />
{| border="1"<br />
|+ Config file options<br />
|-<br />
| QEMU_MACHINES || List of VMs to start<br />
|-<br />
| qemu_${vm}_type || QEMU binary to call. If specified will be prepended with '/usr/bin/qemu-' and that binary will be used to start VM. I.e. you can boot e.g. qemu-system-arm images with qemu_my_arm_vm_type="system-arm". If not specified, '/usr/bin/qemu' will be used.<br />
|-<br />
| qemu_${vm} || QEMU command line to start with. Will always be prepended with '-name ${vm} -pidfile /var/run/qemu/${vm}.pid -daemonize -nographic'.<br />
|-<br />
| qemu_${vm}_haltcmd || Command to shutdown VM safely. I'm using '-monitor telnet:..' and poweroff my VMs via acpi by sending 'system_powerdown' to monitor. You can use ssh or some other ways.<br />
|-<br />
| qemu_${vm}_haltcmd_wait || How much time to wait for safe VM shutdown. Default is 30 seconds. rc-script will kill qemu process after this timeout.<br />
|}<br />
<br />
Config file example:<br />
{{File|name=/etc/conf.d/qemu.conf|content=<nowiki><br />
# VM's that should be started on boot<br />
# use the ! prefix to disable starting/stopping a VM<br />
QEMU_MACHINES=(vm1 vm2)<br />
<br />
# NOTE: following options will be prepended to qemu_${vm}<br />
# -name ${vm} -pidfile /var/run/qemu/${vm}.pid -daemonize -nographic<br />
<br />
qemu_vm1_type="system-x86_64"<br />
<br />
qemu_vm1="-enable-kvm -m 512 -hda /dev/mapper/vg0-vm1 -net nic,macaddr=DE:AD:BE:EF:E0:00 \<br />
-net tap,ifname=tap0 -serial telnet:localhost:7000,server,nowait,nodelay \<br />
-monitor telnet:localhost:7100,server,nowait,nodelay -vnc :0"<br />
<br />
qemu_vm1_haltcmd="echo 'system_powerdown' | nc.openbsd localhost 7100" # or netcat/ncat<br />
<br />
# You can use other ways to shutdown your VM correctly<br />
#qemu_vm1_haltcmd="ssh powermanager@vm1 sudo poweroff"<br />
<br />
# By default rc-script will wait 30 seconds before killing VM. Here you can change this timeout.<br />
#qemu_vm1_haltcmd_wait="30"<br />
<br />
qemu_vm2="-enable-kvm -m 512 -hda /srv/kvm/vm2.img -net nic,macaddr=DE:AD:BE:EF:E0:01 \<br />
-net tap,ifname=tap1 -serial telnet:localhost:7001,server,nowait,nodelay \<br />
-monitor telnet:localhost:7101,server,nowait,nodelay -vnc :1"<br />
<br />
qemu_vm2_haltcmd="echo 'system_powerdown' | nc.openbsd localhost 7101"<br />
</nowiki>}}<br />
<br />
rc-script:<br />
{{File|name=/etc/rc.d/qemu|content=<nowiki><br />
#!/bin/bash<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
<br />
[ -f /etc/conf.d/qemu.conf ] && source /etc/conf.d/qemu.conf<br />
<br />
PIDDIR=/var/run/qemu<br />
QEMU_DEFAULT_FLAGS='-name ${vm} -pidfile ${PIDDIR}/${vm}.pid -daemonize -nographic'<br />
QEMU_HALTCMD_WAIT=30<br />
<br />
case "$1" in<br />
start)<br />
[ -d "${PIDDIR}" ] || mkdir -p "${PIDDIR}"<br />
for vm in "${QEMU_MACHINES[@]}"; do<br />
if [ "${vm}" = "${vm#!}" ]; then<br />
stat_busy "Starting QEMU vm: ${vm}"<br />
eval vm_cmdline="\$qemu_${vm}"<br />
eval vm_type="\$qemu_${vm}_type"<br />
<br />
if [ -n "${vm_type}" ]; then<br />
vm_cmd="/usr/bin/qemu-${vm_type}"<br />
else<br />
vm_cmd='/usr/bin/qemu'<br />
fi<br />
<br />
eval "qemu_flags=\"${QEMU_DEFAULT_FLAGS}\""<br />
<br />
${vm_cmd} ${qemu_flags} ${vm_cmdline} >/dev/null<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
stat_done<br />
fi<br />
fi<br />
done<br />
add_daemon qemu<br />
;;<br />
<br />
stop)<br />
for vm in "${QEMU_MACHINES[@]}"; do<br />
if [ "${vm}" = "${vm#!}" ]; then<br />
# check pidfile presence and permissions<br />
if [ ! -r "${PIDDIR}/${vm}.pid" ]; then<br />
continue<br />
fi<br />
<br />
stat_busy "Stopping QEMU vm: ${vm}"<br />
<br />
eval vm_haltcmd="\$qemu_${vm}_haltcmd"<br />
eval vm_haltcmd_wait="\$qemu_${vm}_haltcmd_wait"<br />
vm_haltcmd_wait=${vm_haltcmd_wait:-${QEMU_HALTCMD_WAIT}}<br />
vm_pid=$(cat ${PIDDIR}/${vm}.pid)<br />
<br />
# check process existence<br />
if ! kill -0 ${vm_pid} 2>/dev/null; then<br />
stat_done<br />
rm -f "${PIDDIR}/${vm}.pid"<br />
continue<br />
fi<br />
<br />
# Try to shutdown VM safely<br />
_vm_running='yes'<br />
if [ -n "${vm_haltcmd}" ]; then<br />
eval ${vm_haltcmd} >/dev/null<br />
<br />
_w=0<br />
while [ "${_w}" -lt "${vm_haltcmd_wait}" ]; do<br />
sleep 1<br />
if ! kill -0 ${vm_pid} 2>/dev/null; then<br />
# no such process<br />
_vm_running=''<br />
break<br />
fi<br />
_w=$((_w + 1))<br />
done<br />
<br />
else<br />
# No haltcmd - kill VM unsafely<br />
_vm_running='yes'<br />
fi<br />
<br />
if [ -n "${_vm_running}" ]; then<br />
# kill VM unsafely<br />
kill ${vm_pid} 2>/dev/null<br />
sleep 1<br />
fi<br />
<br />
# report status<br />
if kill -0 ${vm_pid} 2>/dev/null; then<br />
# VM is still alive<br />
#kill -9 ${vm_pid}<br />
stat_fail<br />
else<br />
stat_done<br />
fi<br />
<br />
# remove pidfile<br />
rm -f "${PIDDIR}/${vm}.pid"<br />
fi<br />
done<br />
rm_daemon qemu<br />
;;<br />
<br />
restart)<br />
$0 stop<br />
sleep 1<br />
$0 start<br />
;;<br />
<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
<br />
esac<br />
</nowiki>}}<br />
<br />
===External links===<br />
A very good qemu guide by AlienBOB: http://alien.slackbook.org/dokuwiki/doku.php?id=slackware:qemu</div>Markg85https://wiki.archlinux.org/index.php?title=Talk:Git&diff=132806Talk:Git2011-03-05T13:59:48Z<p>Markg85: Merge with Gitweb</p>
<hr />
<div>== Merge with Gitweb ==<br />
<br />
As said, the sections to get git working over ssh, http and the git protocol should in my opinion be placed in this article.</div>Markg85https://wiki.archlinux.org/index.php?title=Git&diff=132804Git2011-03-05T13:58:38Z<p>Markg85: </p>
<hr />
<div>[[Category: Development (English)]]<br />
{{Stub}}<br />
{{Article summary start}}<br />
{{Article summary text|Installing and using the Git VCS}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Super Quick Git Guide}}: Generally about contributing to pacman, although it still serves as a practical Git tutorial<br />
{{Article summary end}}<br />
{{Merge|Gitweb}}<br />
{{Note|Merge note. [[Gitweb]] contains parts to clone over http, ssh and the git protocol but those should be here in my opinion. What do you think?}}<br />
<br />
'''Git''' is the version control system (VCS) coded by Linus Torvalds (the creator of Linux) when he was criticized for using the proprietary BitKeeper with the Linux kernel. Git is now used by the Linux kernel and by many other projects, including [[Pacman]], Arch's package manager.<br />
<br />
==Gitk==<br />
If you get launching git's GUI '''gitk''' like<br />
/usr/bin/gitk: line 3: exec: wish: not found.<br />
you should make sure that '''tk''' is installed.<br />
<br />
==Bash Completion==<br />
To add command completion for bash download the following file: [http://repo.or.cz/w/git.git/blob_plain/HEAD:/contrib/completion/git-completion.bash git-completion.bash]. Then edit your .bashrc file so that it contains the following line:<br />
source git-completion.bash<br />
<br />
==Cheatsheet==<br />
Parts from everywhere, much from the wonderful tutorial here: http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html<br />
<br />
Additionally see [[Super Quick Git Guide]].<br />
<br />
Pull the network scripts with<br />
git clone http://archlinux.org/~james/projects/network.git<br />
Update an existing clone<br />
git pull origin<br />
Commit changes<br />
git commit -a -m "changelog message"<br />
To create a new branch<br />
git branch somebranch<br />
Change to a different branch<br />
git checkout differentbranch<br />
Merge a branch to current active branch<br />
git merge somebranch<br />
Delete a branch<br />
git branch -d somebranch<br />
Diff between two branches<br />
git diff master..somebranch<br />
Diff between two commit ID's (found in git log)<br />
git diff e9780c7cba2855350e914fde227a79bb63c1351d..8b014e40346b38b3b9bfc41359b4e8a68e804c0d<br />
Diff between the last two commits<br />
git diff HEAD^ HEAD<br />
Patchset between two branches (follows same syntax as git diff afaik)<br />
git format-patch master..somebranch<br />
Or better: http://wiki.winehq.org/GitWine#head-f7a29e7ed999b5924748a60c5a1cd4a019032d26<br />
git format-patch -o out origin<br />
Set nano as default editor<br />
git config --global core.editor "nano -w"<br />
Start remote repository<br />
http://www.adeal.eu/starting-with-git.php [broken as of 31DEC10]</div>Markg85https://wiki.archlinux.org/index.php?title=Talk:Gitweb&diff=132801Talk:Gitweb2011-03-05T13:55:52Z<p>Markg85: /* Merge with Git */ new section</p>
<hr />
<div>Might be nice to add some vhost config examples here as well<br />
::--[[User:Wsduvall|Wsduvall]] October 24 2010 10:53<br />
<br />
== SSH ==<br />
<br />
I added a section that explains how to checkout over SSH. Please do check it for errors if you want.<br />
<br />
== Merge with Git ==<br />
<br />
Hi,<br />
<br />
I marked a few section that i think would better fit the [[Git]] page rather then the [[Gitweb]] page. Those are the sections for cloning over the git protocol, over ssh and over http. It's neat but really not part of [[Gitweb]]. I made those sections even this article but now i think it's best to merge a part of it with [[Git]]. What do you think of it?</div>Markg85https://wiki.archlinux.org/index.php?title=Gitweb&diff=132799Gitweb2011-03-05T13:53:09Z<p>Markg85: </p>
<hr />
<div>Gitweb is the default web interface provided with git itself and is the basis for other git scripts like cgit, gitosis and others.<br />
=Installation=<br />
To install gitweb you fitst have to install git and a webserver. For this example we use apache but you can also use others:<br />
pacman -S git apache<br />
<br />
Next you need to link the current gitweb default to your webserver location. In this example i use the default folder locations:<br />
ln -s /usr/share/gitweb /srv/http/gitweb<br />
<br />
That's it for the "installation". Next is the configuration.<br />
<br />
=Configuration=<br />
==Apache==<br />
Add the following to the end of you /etc/httpd/conf/httpd.conf<br />
<Directory "/srv/http/gitweb"><br />
DirectoryIndex gitweb.cgi<br />
Allow from all<br />
AllowOverride all<br />
Order allow,deny<br />
Options ExecCGI<br />
<Files gitweb.cgi><br />
SetHandler cgi-script<br />
</Files><br />
SetEnv GITWEB_CONFIG /etc/conf.d/gitweb.conf<br />
</Directory><br />
<br />
You can put the configuration in it's own config file in /etc/httpd/conf/extra/ but that's up to you to decide.<br />
<br />
==Lighttpd==<br />
If you're using lighttpd, make sure mod_alias, mod_redirect, mod_cgi and mod_setenv are loaded. Add the following to /etc/lighttpd/lighttpd.conf:<br />
setenv.add-environment = ( "GITWEB_CONFIG" => "/etc/conf.d/gitweb.conf" )<br />
url.redirect += ( "^/gitweb$" => "/gitweb/" )<br />
alias.url += ( "/gitweb/" => "/usr/share/gitweb/" )<br />
$HTTP["url"] =~ "^/gitweb/" {<br />
cgi.assign = (".cgi" => "")<br />
server.indexfiles = ("gitweb.cgi")<br />
}<br />
<br />
==Gitweb config==<br />
Next we need to make a gitweb config file. Open (or create if not existing) the file /etc/conf.d/gitweb.conf and place this in it:<br />
$projectroot = "/path/to/your/repositories";<br />
$git_temp = "/tmp";<br />
$projects_list = $projectroot;<br />
our @git_base_url_list = qw(git://<your_server> git@<your_server>:~);<br />
<br />
{{Note|Replace "/path/to/your/repositories" with your path and replace "<your_server>" with your servername or ip (localhost for example). As for the ":~" part in the "git@<your_server>:~" line. It now expects the git repos to bei n your home folder! Also change that accordingly.}}<br />
<br />
Now the the configuration is done, please restart your webserver.<br />
For apache:<br />
/etc/rc.d/httpd restart<br />
<br />
Or for lighttpd:<br />
/etc/rc.d/lighttpd restart<br />
<br />
=Adding repositories=<br />
To add a repository go to your repository folder. There make your repository like so:<br />
mkdir my_repository.git<br />
git init --bare my_repository.git/<br />
cd my_repository.git/<br />
touch git-daemon-export-ok<br />
echo "Short project's description" > description<br />
<br />
Next open the "config" file and add this:<br />
[gitweb]<br />
owner = Your Name<br />
<br />
This will fill in the "Owner" field in gitweb. It's not required.<br />
<br />
I assumed that you want to have this repository as "central" repository storage where you push your commits to so the git-daemon-export-ok and --bare are here to have minimal overhead and to allow the git daemon to be used on it.<br />
<br />
That is all for making a repository. You can now see it on your http://localhost/gitweb (assuming everything went fine). You don't need to restart apache for new repositories since the gitweb cgi script simply reads your repository folder.<br />
<br />
=Git daemon=<br />
{{Merge|Git}}<br />
{{Note|Merge note. This section should belong in [[Git]] and this article should link to that page.}}<br />
{{Note|The git daemon only allows read access. For write access look at "Git SSH".}}<br />
This will allow url's like "git clone git://localhost/my_repository.git".<br />
<br />
Edit configuration file for git-dameon /etc/conf.d/git-daemon.conf (GIT_REPO is a place with your git projects), then start git-daemon with root privileges:<br />
/etc/rc.d/git-daemon start<br />
<br />
To run the git-daemon every time at boot, just append git-deamon to DAEMONS line in /etc/rc.conf file.<br />
<br />
Clients can now simply use:<br />
git clone git://localhost/my_repository.git<br />
<br />
=Git SSH=<br />
{{Merge|Git}}<br />
{{Note|Merge note. This section should belong in [[Git]] and this article should link to that page.}}<br />
You first need to have a public SSH key. For that follow the guide at [[Using SSH Keys]]. To setup SSH itself you need to follow the [[SSH]] guide. I assume you have a public SSH key now and your SSH is working.<br />
Open your SSH key in your favorite editor (default public key name is id_rsa.pub and is located in ~/.ssh) and copy it's content (CTRL + C).<br />
Now go to your user where you have made your git repository, since we now need to allow that SSH key to login on that user to access the GIT repository.<br />
Open this file in your favorite editor (i use nano)<br />
nano ~/.ssh/authorized_keys<br />
and paste the contents of id_rsa.pub in it. Be sure it is all on one line! That is important! It should look somewhat like this:<br />
{{Warning|Do not copy the line below! It is an example! It will not work if you use that line!}}<br />
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCboOH6AotCh4OcwJgsB4AtXzDo9Gzhl+BAHuEvnDRHNSYIURqGN4CrP+b5Bx/iLrRFOBv58TcZz1jyJ2PaGwT74kvVOe9JCCdgw4nSMBV44cy+6cTJiv6f1tw8pHRS2H6nHC9SCSAWkMX4rpiSQ0wkhjug+GtBWOXDaotIzrFwLw== username@hostname<br />
Now you can checkout your git repo this way (change where needed. Here it's using the git username and localhost):<br />
git clone git@localhost:my_repository.git<br />
You should now get an SSH yes/no question. Type yes followed by enter. Then you should have your repository checked out. Since this is with SSH you also do have commit rights now. For that look at [[Git]] and [[Super Quick Git Guide]].<br />
<br />
=Git HTTP=<br />
{{Merge|Git}}<br />
{{Note|Merge note. This section should belong in [[Git]] and this article should link to that page.}}<br />
This section will explain how to do a git clone over http. For now this is only reading (cloning), not writing (pushing).<br />
First you need to make your Git repositories accessable over your web server. So lets assume your git repositories are outside of the default apache documentroot. You can skip this part if they are within your apache documentroot.<br />
<br />
==Read access==<br />
Lets assume your git repositories are in /usr/git. You need to add an Alias to apache and a Directory section to make it accessable.<br />
Append the following to your /etc/httpd/conf/httpd/conf (change where your paths differ. the /git-repos is how it will be accessible in your browser like : http://localhost/git-repos):<br />
Alias /git-repos /usr/git<br />
<Directory "/usr/git"><br />
Options Indexes FollowSymLinks MultiViews ExecCGI<br />
AllowOverride All<br />
Order allow,deny<br />
Allow from all<br />
</Directory><br />
<br />
Save it and restart apache:<br />
/etc/rc.d/httpd restart<br />
<br />
Now you should see your git repositories at http://localhost/git-repos or whatever you choose as "git-repos" name in the above alias name.<br />
Next we need to do a "git update-server-info" in your local git repository. Note that you must do that where the actual git repo is created, not where you cloned it. So run this in your git repository:<br />
git update-server-info<br />
<br />
That command is needed to be able to clone over http so it's better to make a post-update hook for it so this command always runs when you do a push to the repository. To get that done go to your git repository in the "hooks" folder and run this:<br />
mv post-update.sample post-update<br />
<br />
We can do this because the default post-update.sample hook is doing exactly what we want (running git update-server-info after a commit).<br />
<br />
Last we need to make a change to gitweb.conf to show the url for http cloning. Open gitweb.conf in your favorite editor (i use nano):<br />
nano /etc/conf.d/gitweb.conf<br />
<br />
Find the line (the dots resamble some content in that line:<br />
our @git_base_url_list = qw(...)<br />
Add something like this (again depends on what you did with the Alias in Apache):<br />
our @git_base_url_list = qw(... http://localhost/git-repos)<br />
That will result in clone lines like so:<br />
git clone http://localhost/git-repos/your_repository.git<br />
<br />
==Write access==<br />
{{Note|Someone has to fill this one in. It's with DAV..?}}<br />
Possible sources for this part:<br />
http://kaeso.wordpress.com/2008/02/02/git-repository-with-apache-via-webdav-and-gitweb/<br />
http://www.kernel.org/pub/software/scm/git/docs/howto/setup-git-server-over-http.txt<br />
<br />
=Thanx to...=<br />
This howto was mainly based on the awesome howto from howtoforge: http://www.howtoforge.com/how-to-install-a-public-git-repository-on-a-debian-server I only picked the parts that are needed to get it working and left the additional things out.</div>Markg85https://wiki.archlinux.org/index.php?title=Gitweb&diff=132796Gitweb2011-03-05T13:40:51Z<p>Markg85: /* Write access */</p>
<hr />
<div>Gitweb is the default web interface provided with git itself and is the basis for other git scripts like cgit, gitosis and others.<br />
=Installation=<br />
To install gitweb you fitst have to install git and a webserver. For this example we use apache but you can also use others:<br />
pacman -S git apache<br />
<br />
Next you need to link the current gitweb default to your webserver location. In this example i use the default folder locations:<br />
ln -s /usr/share/gitweb /srv/http/gitweb<br />
<br />
That's it for the "installation". Next is the configuration.<br />
<br />
=Configuration=<br />
==Apache==<br />
Add the following to the end of you /etc/httpd/conf/httpd.conf<br />
<Directory "/srv/http/gitweb"><br />
DirectoryIndex gitweb.cgi<br />
Allow from all<br />
AllowOverride all<br />
Order allow,deny<br />
Options ExecCGI<br />
<Files gitweb.cgi><br />
SetHandler cgi-script<br />
</Files><br />
SetEnv GITWEB_CONFIG /etc/conf.d/gitweb.conf<br />
</Directory><br />
<br />
You can put the configuration in it's own config file in /etc/httpd/conf/extra/ but that's up to you to decide.<br />
<br />
==Lighttpd==<br />
If you're using lighttpd, make sure mod_alias, mod_redirect, mod_cgi and mod_setenv are loaded. Add the following to /etc/lighttpd/lighttpd.conf:<br />
setenv.add-environment = ( "GITWEB_CONFIG" => "/etc/conf.d/gitweb.conf" )<br />
url.redirect += ( "^/gitweb$" => "/gitweb/" )<br />
alias.url += ( "/gitweb/" => "/usr/share/gitweb/" )<br />
$HTTP["url"] =~ "^/gitweb/" {<br />
cgi.assign = (".cgi" => "")<br />
server.indexfiles = ("gitweb.cgi")<br />
}<br />
<br />
==Gitweb config==<br />
Next we need to make a gitweb config file. Open (or create if not existing) the file /etc/conf.d/gitweb.conf and place this in it:<br />
$projectroot = "/path/to/your/repositories";<br />
$git_temp = "/tmp";<br />
$projects_list = $projectroot;<br />
our @git_base_url_list = qw(git://<your_server> git@<your_server>:~);<br />
<br />
{{Note|Replace "/path/to/your/repositories" with your path and replace "<your_server>" with your servername or ip (localhost for example). As for the ":~" part in the "git@<your_server>:~" line. It now expects the git repos to bei n your home folder! Also change that accordingly.}}<br />
<br />
Now the the configuration is done, please restart your webserver.<br />
For apache:<br />
/etc/rc.d/httpd restart<br />
<br />
Or for lighttpd:<br />
/etc/rc.d/lighttpd restart<br />
<br />
=Adding repositories=<br />
To add a repository go to your repository folder. There make your repository like so:<br />
mkdir my_repository.git<br />
git init --bare my_repository.git/<br />
cd my_repository.git/<br />
touch git-daemon-export-ok<br />
echo "Short project's description" > description<br />
<br />
Next open the "config" file and add this:<br />
[gitweb]<br />
owner = Your Name<br />
<br />
This will fill in the "Owner" field in gitweb. It's not required.<br />
<br />
I assumed that you want to have this repository as "central" repository storage where you push your commits to so the git-daemon-export-ok and --bare are here to have minimal overhead and to allow the git daemon to be used on it.<br />
<br />
That is all for making a repository. You can now see it on your http://localhost/gitweb (assuming everything went fine). You don't need to restart apache for new repositories since the gitweb cgi script simply reads your repository folder.<br />
<br />
=Git daemon=<br />
{{Note|The git daemon only allows read access. For write access look at "Git SSH".}}<br />
This will allow url's like "git clone git://localhost/my_repository.git".<br />
<br />
Edit configuration file for git-dameon /etc/conf.d/git-daemon.conf (GIT_REPO is a place with your git projects), then start git-daemon with root privileges:<br />
/etc/rc.d/git-daemon start<br />
<br />
To run the git-daemon every time at boot, just append git-deamon to DAEMONS line in /etc/rc.conf file.<br />
<br />
Clients can now simply use:<br />
git clone git://localhost/my_repository.git<br />
<br />
=Git SSH=<br />
You first need to have a public SSH key. For that follow the guide at [[Using SSH Keys]]. To setup SSH itself you need to follow the [[SSH]] guide. I assume you have a public SSH key now and your SSH is working.<br />
Open your SSH key in your favorite editor (default public key name is id_rsa.pub and is located in ~/.ssh) and copy it's content (CTRL + C).<br />
Now go to your user where you have made your git repository, since we now need to allow that SSH key to login on that user to access the GIT repository.<br />
Open this file in your favorite editor (i use nano)<br />
nano ~/.ssh/authorized_keys<br />
and paste the contents of id_rsa.pub in it. Be sure it is all on one line! That is important! It should look somewhat like this:<br />
{{Warning|Do not copy the line below! It is an example! It will not work if you use that line!}}<br />
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCboOH6AotCh4OcwJgsB4AtXzDo9Gzhl+BAHuEvnDRHNSYIURqGN4CrP+b5Bx/iLrRFOBv58TcZz1jyJ2PaGwT74kvVOe9JCCdgw4nSMBV44cy+6cTJiv6f1tw8pHRS2H6nHC9SCSAWkMX4rpiSQ0wkhjug+GtBWOXDaotIzrFwLw== username@hostname<br />
Now you can checkout your git repo this way (change where needed. Here it's using the git username and localhost):<br />
git clone git@localhost:my_repository.git<br />
You should now get an SSH yes/no question. Type yes followed by enter. Then you should have your repository checked out. Since this is with SSH you also do have commit rights now. For that look at [[Git]] and [[Super Quick Git Guide]].<br />
<br />
=Git HTTP=<br />
This section will explain how to do a git clone over http. For now this is only reading (cloning), not writing (pushing).<br />
First you need to make your Git repositories accessable over your web server. So lets assume your git repositories are outside of the default apache documentroot. You can skip this part if they are within your apache documentroot.<br />
<br />
==Read access==<br />
Lets assume your git repositories are in /usr/git. You need to add an Alias to apache and a Directory section to make it accessable.<br />
Append the following to your /etc/httpd/conf/httpd/conf (change where your paths differ. the /git-repos is how it will be accessible in your browser like : http://localhost/git-repos):<br />
Alias /git-repos /usr/git<br />
<Directory "/usr/git"><br />
Options Indexes FollowSymLinks MultiViews ExecCGI<br />
AllowOverride All<br />
Order allow,deny<br />
Allow from all<br />
</Directory><br />
<br />
Save it and restart apache:<br />
/etc/rc.d/httpd restart<br />
<br />
Now you should see your git repositories at http://localhost/git-repos or whatever you choose as "git-repos" name in the above alias name.<br />
Next we need to do a "git update-server-info" in your local git repository. Note that you must do that where the actual git repo is created, not where you cloned it. So run this in your git repository:<br />
git update-server-info<br />
<br />
That command is needed to be able to clone over http so it's better to make a post-update hook for it so this command always runs when you do a push to the repository. To get that done go to your git repository in the "hooks" folder and run this:<br />
mv post-update.sample post-update<br />
<br />
We can do this because the default post-update.sample hook is doing exactly what we want (running git update-server-info after a commit).<br />
<br />
Last we need to make a change to gitweb.conf to show the url for http cloning. Open gitweb.conf in your favorite editor (i use nano):<br />
nano /etc/conf.d/gitweb.conf<br />
<br />
Find the line (the dots resamble some content in that line:<br />
our @git_base_url_list = qw(...)<br />
Add something like this (again depends on what you did with the Alias in Apache):<br />
our @git_base_url_list = qw(... http://localhost/git-repos)<br />
That will result in clone lines like so:<br />
git clone http://localhost/git-repos/your_repository.git<br />
<br />
==Write access==<br />
{{Note|Someone has to fill this one in. It's with DAV..?}}<br />
Possible sources for this part:<br />
http://kaeso.wordpress.com/2008/02/02/git-repository-with-apache-via-webdav-and-gitweb/<br />
http://www.kernel.org/pub/software/scm/git/docs/howto/setup-git-server-over-http.txt<br />
<br />
=Thanx to...=<br />
This howto was mainly based on the awesome howto from howtoforge: http://www.howtoforge.com/how-to-install-a-public-git-repository-on-a-debian-server I only picked the parts that are needed to get it working and left the additional things out.</div>Markg85https://wiki.archlinux.org/index.php?title=Gitweb&diff=132794Gitweb2011-03-05T13:36:09Z<p>Markg85: </p>
<hr />
<div>Gitweb is the default web interface provided with git itself and is the basis for other git scripts like cgit, gitosis and others.<br />
=Installation=<br />
To install gitweb you fitst have to install git and a webserver. For this example we use apache but you can also use others:<br />
pacman -S git apache<br />
<br />
Next you need to link the current gitweb default to your webserver location. In this example i use the default folder locations:<br />
ln -s /usr/share/gitweb /srv/http/gitweb<br />
<br />
That's it for the "installation". Next is the configuration.<br />
<br />
=Configuration=<br />
==Apache==<br />
Add the following to the end of you /etc/httpd/conf/httpd.conf<br />
<Directory "/srv/http/gitweb"><br />
DirectoryIndex gitweb.cgi<br />
Allow from all<br />
AllowOverride all<br />
Order allow,deny<br />
Options ExecCGI<br />
<Files gitweb.cgi><br />
SetHandler cgi-script<br />
</Files><br />
SetEnv GITWEB_CONFIG /etc/conf.d/gitweb.conf<br />
</Directory><br />
<br />
You can put the configuration in it's own config file in /etc/httpd/conf/extra/ but that's up to you to decide.<br />
<br />
==Lighttpd==<br />
If you're using lighttpd, make sure mod_alias, mod_redirect, mod_cgi and mod_setenv are loaded. Add the following to /etc/lighttpd/lighttpd.conf:<br />
setenv.add-environment = ( "GITWEB_CONFIG" => "/etc/conf.d/gitweb.conf" )<br />
url.redirect += ( "^/gitweb$" => "/gitweb/" )<br />
alias.url += ( "/gitweb/" => "/usr/share/gitweb/" )<br />
$HTTP["url"] =~ "^/gitweb/" {<br />
cgi.assign = (".cgi" => "")<br />
server.indexfiles = ("gitweb.cgi")<br />
}<br />
<br />
==Gitweb config==<br />
Next we need to make a gitweb config file. Open (or create if not existing) the file /etc/conf.d/gitweb.conf and place this in it:<br />
$projectroot = "/path/to/your/repositories";<br />
$git_temp = "/tmp";<br />
$projects_list = $projectroot;<br />
our @git_base_url_list = qw(git://<your_server> git@<your_server>:~);<br />
<br />
{{Note|Replace "/path/to/your/repositories" with your path and replace "<your_server>" with your servername or ip (localhost for example). As for the ":~" part in the "git@<your_server>:~" line. It now expects the git repos to bei n your home folder! Also change that accordingly.}}<br />
<br />
Now the the configuration is done, please restart your webserver.<br />
For apache:<br />
/etc/rc.d/httpd restart<br />
<br />
Or for lighttpd:<br />
/etc/rc.d/lighttpd restart<br />
<br />
=Adding repositories=<br />
To add a repository go to your repository folder. There make your repository like so:<br />
mkdir my_repository.git<br />
git init --bare my_repository.git/<br />
cd my_repository.git/<br />
touch git-daemon-export-ok<br />
echo "Short project's description" > description<br />
<br />
Next open the "config" file and add this:<br />
[gitweb]<br />
owner = Your Name<br />
<br />
This will fill in the "Owner" field in gitweb. It's not required.<br />
<br />
I assumed that you want to have this repository as "central" repository storage where you push your commits to so the git-daemon-export-ok and --bare are here to have minimal overhead and to allow the git daemon to be used on it.<br />
<br />
That is all for making a repository. You can now see it on your http://localhost/gitweb (assuming everything went fine). You don't need to restart apache for new repositories since the gitweb cgi script simply reads your repository folder.<br />
<br />
=Git daemon=<br />
{{Note|The git daemon only allows read access. For write access look at "Git SSH".}}<br />
This will allow url's like "git clone git://localhost/my_repository.git".<br />
<br />
Edit configuration file for git-dameon /etc/conf.d/git-daemon.conf (GIT_REPO is a place with your git projects), then start git-daemon with root privileges:<br />
/etc/rc.d/git-daemon start<br />
<br />
To run the git-daemon every time at boot, just append git-deamon to DAEMONS line in /etc/rc.conf file.<br />
<br />
Clients can now simply use:<br />
git clone git://localhost/my_repository.git<br />
<br />
=Git SSH=<br />
You first need to have a public SSH key. For that follow the guide at [[Using SSH Keys]]. To setup SSH itself you need to follow the [[SSH]] guide. I assume you have a public SSH key now and your SSH is working.<br />
Open your SSH key in your favorite editor (default public key name is id_rsa.pub and is located in ~/.ssh) and copy it's content (CTRL + C).<br />
Now go to your user where you have made your git repository, since we now need to allow that SSH key to login on that user to access the GIT repository.<br />
Open this file in your favorite editor (i use nano)<br />
nano ~/.ssh/authorized_keys<br />
and paste the contents of id_rsa.pub in it. Be sure it is all on one line! That is important! It should look somewhat like this:<br />
{{Warning|Do not copy the line below! It is an example! It will not work if you use that line!}}<br />
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCboOH6AotCh4OcwJgsB4AtXzDo9Gzhl+BAHuEvnDRHNSYIURqGN4CrP+b5Bx/iLrRFOBv58TcZz1jyJ2PaGwT74kvVOe9JCCdgw4nSMBV44cy+6cTJiv6f1tw8pHRS2H6nHC9SCSAWkMX4rpiSQ0wkhjug+GtBWOXDaotIzrFwLw== username@hostname<br />
Now you can checkout your git repo this way (change where needed. Here it's using the git username and localhost):<br />
git clone git@localhost:my_repository.git<br />
You should now get an SSH yes/no question. Type yes followed by enter. Then you should have your repository checked out. Since this is with SSH you also do have commit rights now. For that look at [[Git]] and [[Super Quick Git Guide]].<br />
<br />
=Git HTTP=<br />
This section will explain how to do a git clone over http. For now this is only reading (cloning), not writing (pushing).<br />
First you need to make your Git repositories accessable over your web server. So lets assume your git repositories are outside of the default apache documentroot. You can skip this part if they are within your apache documentroot.<br />
<br />
==Read access==<br />
Lets assume your git repositories are in /usr/git. You need to add an Alias to apache and a Directory section to make it accessable.<br />
Append the following to your /etc/httpd/conf/httpd/conf (change where your paths differ. the /git-repos is how it will be accessible in your browser like : http://localhost/git-repos):<br />
Alias /git-repos /usr/git<br />
<Directory "/usr/git"><br />
Options Indexes FollowSymLinks MultiViews ExecCGI<br />
AllowOverride All<br />
Order allow,deny<br />
Allow from all<br />
</Directory><br />
<br />
Save it and restart apache:<br />
/etc/rc.d/httpd restart<br />
<br />
Now you should see your git repositories at http://localhost/git-repos or whatever you choose as "git-repos" name in the above alias name.<br />
Next we need to do a "git update-server-info" in your local git repository. Note that you must do that where the actual git repo is created, not where you cloned it. So run this in your git repository:<br />
git update-server-info<br />
<br />
That command is needed to be able to clone over http so it's better to make a post-update hook for it so this command always runs when you do a push to the repository. To get that done go to your git repository in the "hooks" folder and run this:<br />
mv post-update.sample post-update<br />
<br />
We can do this because the default post-update.sample hook is doing exactly what we want (running git update-server-info after a commit).<br />
<br />
Last we need to make a change to gitweb.conf to show the url for http cloning. Open gitweb.conf in your favorite editor (i use nano):<br />
nano /etc/conf.d/gitweb.conf<br />
<br />
Find the line (the dots resamble some content in that line:<br />
our @git_base_url_list = qw(...)<br />
Add something like this (again depends on what you did with the Alias in Apache):<br />
our @git_base_url_list = qw(... http://localhost/git-repos)<br />
That will result in clone lines like so:<br />
git clone http://localhost/git-repos/your_repository.git<br />
<br />
==Write access==<br />
{{Note|Someone has to fill this one in. It's with DAV..?}}<br />
<br />
=Thanx to...=<br />
This howto was mainly based on the awesome howto from howtoforge: http://www.howtoforge.com/how-to-install-a-public-git-repository-on-a-debian-server I only picked the parts that are needed to get it working and left the additional things out.</div>Markg85https://wiki.archlinux.org/index.php?title=Gitweb&diff=132678Gitweb2011-03-04T17:45:43Z<p>Markg85: You now have the git:// and ssh clone lines in gitweb. Along with a little restructuring of this page.</p>
<hr />
<div>Gitweb is the default web interface provided with git itself and is the basis for other git scripts like cgit, gitosis and others.<br />
=Installation=<br />
To install gitweb you fitst have to install git and a webserver. For this example we use apache but you can also use others:<br />
pacman -S git apache<br />
<br />
Next you need to link the current gitweb default to your webserver location. In this example i use the default folder locations:<br />
ln -s /usr/share/gitweb /srv/http/gitweb<br />
<br />
That's it for the "installation". Next is the configuration.<br />
<br />
=Configuration=<br />
==Apache==<br />
Add the following to the end of you /etc/httpd/conf/httpd.conf<br />
<Directory "/srv/http/gitweb"><br />
DirectoryIndex gitweb.cgi<br />
Allow from all<br />
AllowOverride all<br />
Order allow,deny<br />
Options ExecCGI<br />
<Files gitweb.cgi><br />
SetHandler cgi-script<br />
</Files><br />
SetEnv GITWEB_CONFIG /etc/conf.d/gitweb.conf<br />
</Directory><br />
<br />
You can put the configuration in it's own config file in /etc/httpd/conf/extra/ but that's up to you to decide.<br />
<br />
==Lighttpd==<br />
If you're using lighttpd, make sure mod_alias, mod_redirect, mod_cgi and mod_setenv are loaded. Add the following to /etc/lighttpd/lighttpd.conf:<br />
setenv.add-environment = ( "GITWEB_CONFIG" => "/etc/conf.d/gitweb.conf" )<br />
url.redirect += ( "^/gitweb$" => "/gitweb/" )<br />
alias.url += ( "/gitweb/" => "/usr/share/gitweb/" )<br />
$HTTP["url"] =~ "^/gitweb/" {<br />
cgi.assign = (".cgi" => "")<br />
server.indexfiles = ("gitweb.cgi")<br />
}<br />
<br />
==Gitweb config==<br />
Next we need to make a gitweb config file. Open (or create if not existing) the file /etc/conf.d/gitweb.conf and place this in it:<br />
$projectroot = "/path/to/your/repositories";<br />
$git_temp = "/tmp";<br />
$projects_list = $projectroot;<br />
our @git_base_url_list = qw(git://<your_server> git@<your_server>:~);<br />
<br />
{{Note|Replace "/path/to/your/repositories" with your path and replace "<your_server>" with your servername or ip (localhost for example). As for the ":~" part in the "git@<your_server>:~" line. It now expects the git repos to bei n your home folder! Also change that accordingly.}}<br />
<br />
Now the the configuration is done, please restart your webserver.<br />
For apache:<br />
/etc/rc.d/httpd restart<br />
<br />
Or for lighttpd:<br />
/etc/rc.d/lighttpd restart<br />
<br />
=Adding repositories=<br />
To add a repository go to your repository folder. There make your repository like so:<br />
mkdir my_repository.git<br />
git init --bare my_repository.git/<br />
cd my_repository.git/<br />
touch git-daemon-export-ok<br />
echo "Short project's description" > description<br />
<br />
Next open the "config" file and add this:<br />
[gitweb]<br />
owner = Your Name<br />
<br />
This will fill in the "Owner" field in gitweb. It's not required.<br />
<br />
I assumed that you want to have this repository as "central" repository storage where you push your commits to so the git-daemon-export-ok and --bare are here to have minimal overhead and to allow the git daemon to be used on it.<br />
<br />
That is all for making a repository. You can now see it on your http://localhost/gitweb (assuming everything went fine). You don't need to restart apache for new repositories since the gitweb cgi script simply reads your repository folder.<br />
<br />
=Git daemon=<br />
{{Note|The git daemon only allows read access. For write access look at "Git SSH".}}<br />
This will allow url's like "git clone git://localhost/my_repository.git".<br />
<br />
Edit configuration file for git-dameon /etc/conf.d/git-daemon.conf (GIT_REPO is a place with your git projects), then start git-daemon with root privileges:<br />
/etc/rc.d/git-daemon start<br />
<br />
To run the git-daemon every time at boot, just append git-deamon to DAEMONS line in /etc/rc.conf file.<br />
<br />
Clients can now simply use:<br />
git clone git://localhost/my_repository.git<br />
<br />
=Git SSH=<br />
You first need to have a public SSH key. For that follow the guide at [[Using SSH Keys]]. To setup SSH itself you need to follow the [[SSH]] guide. I assume you have a public SSH key now and your SSH is working.<br />
Open your SSH key in your favorite editor (default public key name is id_rsa.pub and is located in ~/.ssh) and copy it's content (CTRL + C).<br />
Now go to your user where you have made your git repository, since we now need to allow that SSH key to login on that user to access the GIT repository.<br />
Open this file in your favorite editor (i use nano)<br />
nano ~/.ssh/authorized_keys<br />
and paste the contents of id_rsa.pub in it. Be sure it is all on one line! That is important! It should look somewhat like this:<br />
{{Warning|Do not copy the line below! It is an example! It will not work if you use that line!}}<br />
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCboOH6AotCh4OcwJgsB4AtXzDo9Gzhl+BAHuEvnDRHNSYIURqGN4CrP+b5Bx/iLrRFOBv58TcZz1jyJ2PaGwT74kvVOe9JCCdgw4nSMBV44cy+6cTJiv6f1tw8pHRS2H6nHC9SCSAWkMX4rpiSQ0wkhjug+GtBWOXDaotIzrFwLw== username@hostname<br />
Now you can checkout your git repo this way (change where needed. Here it's using the git username and localhost):<br />
git clone git@localhost:my_repository.git<br />
You should now get an SSH yes/no question. Type yes followed by enter. Then you should have your repository checked out. Since this is with SSH you also do have commit rights now. For that look at [[Git]] and [[Super Quick Git Guide]].<br />
<br />
=Thanx to...=<br />
This howto was mainly based on the awesome howto from howtoforge: http://www.howtoforge.com/how-to-install-a-public-git-repository-on-a-debian-server I only picked the parts that are needed to get it working and left the additional things out.</div>Markg85https://wiki.archlinux.org/index.php?title=Talk:Gitweb&diff=132635Talk:Gitweb2011-03-04T16:49:30Z<p>Markg85: /* SSH */ new section</p>
<hr />
<div>Might be nice to add some vhost config examples here as well<br />
::--[[User:Wsduvall|Wsduvall]] October 24 2010 10:53<br />
<br />
== SSH ==<br />
<br />
I added a section that explains how to checkout over SSH. Please do check it for errors if you want.</div>Markg85https://wiki.archlinux.org/index.php?title=Gitweb&diff=132634Gitweb2011-03-04T16:48:13Z<p>Markg85: </p>
<hr />
<div>Gitweb is the default web interface provided with git itself and is the basis for other git scripts like cgit, gitosis and others.<br />
=Installation=<br />
To install gitweb you fitst have to install git and a webserver. For this example we use apache but you can also use others:<br />
pacman -S git apache<br />
<br />
Next you need to link the current gitweb default to your webserver location. In this example i use the default folder locations:<br />
ln -s /usr/share/gitweb /srv/http/gitweb<br />
<br />
That's it for the "installation". Next is the configuration.<br />
<br />
=Configuration=<br />
Add the following to the end of you /etc/httpd/conf/httpd.conf<br />
<Directory "/srv/http/gitweb"><br />
DirectoryIndex gitweb.cgi<br />
Allow from all<br />
AllowOverride all<br />
Order allow,deny<br />
Options ExecCGI<br />
<Files gitweb.cgi><br />
SetHandler cgi-script<br />
</Files><br />
SetEnv GITWEB_CONFIG /etc/conf.d/gitweb.conf<br />
</Directory><br />
<br />
You can put the configuration in it's own config file in /etc/httpd/conf/extra/ but that's up to you to decide.<br />
<br />
If you're using lighttpd, make sure mod_alias, mod_redirect, mod_cgi and mod_setenv are loaded. Add the following to /etc/lighttpd/lighttpd.conf:<br />
setenv.add-environment = ( "GITWEB_CONFIG" => "/etc/conf.d/gitweb.conf" )<br />
url.redirect += ( "^/gitweb$" => "/gitweb/" )<br />
alias.url += ( "/gitweb/" => "/usr/share/gitweb/" )<br />
$HTTP["url"] =~ "^/gitweb/" {<br />
cgi.assign = (".cgi" => "")<br />
server.indexfiles = ("gitweb.cgi")<br />
}<br />
<br />
<br />
Next we need to make a gitweb config file. Open (or create if not existing) the file /etc/conf.d/gitweb.conf and place this in it:<br />
$projectroot = "/path/to/your/repositories";<br />
$git_temp = "/tmp";<br />
$projects_list = $projectroot;<br />
<br />
Be sure to change the "/path/to/your/repositories" to the path you want your repositories in.<br />
<br />
Now the the configuration is done, please restart apache or lighttpd by executing:<br />
/etc/rc.d/httpd restart (apache) or /etc/rc.d/lighttpd restart (lighttpd)<br />
<br />
=Adding repositories=<br />
To add a repository go to your repository folder. There make your repository like so:<br />
mkdir my_repository.git<br />
git init --bare my_repository.git/<br />
cd my_repository.git/<br />
touch git-daemon-export-ok<br />
echo "Short project's description" > description<br />
<br />
Next open the "config" file and add this:<br />
[gitweb]<br />
owner = Your Name<br />
<br />
This will fill in the "Owner" field in gitweb. It's not required.<br />
<br />
I assumed that you want to have this repository as "central" repository storage where you push your commits to so the git-daemon-export-ok and --bare are here to have minimal overhead and to allow the git daemon to be used on it.<br />
<br />
That is all for making a repository. You can now see it on your http://localhost/gitweb (assuming everything went fine). You don't need to restart apache for new repositories since the gitweb cgi script simply reads your repository folder.<br />
<br />
=Git daemon=<br />
{{Note|The git daemon only allows read access. For write access look at "Git SSH".}}<br />
This will allow url's like "git clone git://localhost/my_repository.git".<br />
<br />
Edit configuration file for git-dameon /etc/conf.d/git-daemon.conf (GIT_REPO is a place with your git projects), then start git-daemon with root privileges:<br />
/etc/rc.d/git-daemon start<br />
<br />
To run the git-daemon every time at boot, just append git-deamon to DAEMONS line in /etc/rc.conf file.<br />
<br />
Clients can now simply use:<br />
git clone git://localhost/my_repository.git<br />
<br />
=Git SSH=<br />
You first need to have a public SSH key. For that follow the guide at [[Using SSH Keys]]. To setup SSH itself you need to follow the [[SSH]] guide. I assume you have a public SSH key now and your SSH is working.<br />
Open your SSH key in your favorite editor (default public key name is id_rsa.pub and is located in ~/.ssh) and copy it's content (CTRL + C).<br />
Now go to your user where you have made your git repository, since we now need to allow that SSH key to login on that user to access the GIT repository.<br />
Open this file in your favorite editor (i use nano)<br />
nano ~/.ssh/authorized_keys<br />
and paste the contents of id_rsa.pub in it. Be sure it is all on one line! That is important! It should look somewhat like this:<br />
{{Warning|Do not copy the line below! It is an example! It will not work if you use that line!}}<br />
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCboOH6AotCh4OcwJgsB4AtXzDo9Gzhl+BAHuEvnDRHNSYIURqGN4CrP+b5Bx/iLrRFOBv58TcZz1jyJ2PaGwT74kvVOe9JCCdgw4nSMBV44cy+6cTJiv6f1tw8pHRS2H6nHC9SCSAWkMX4rpiSQ0wkhjug+GtBWOXDaotIzrFwLw== username@hostname<br />
Now you can checkout your git repo this way (change where needed. Here it's using the git username and localhost):<br />
git clone git@localhost:my_repository.git<br />
You should now get an SSH yes/no question. Type yes followed by enter. Then you should have your repository checked out. Since this is with SSH you also do have commit rights now. For that look at [[Git]] and [[Super Quick Git Guide]].<br />
<br />
=Thanx to...=<br />
This howto was mainly based on the awesome howto from howtoforge: http://www.howtoforge.com/how-to-install-a-public-git-repository-on-a-debian-server I only picked the parts that are needed to get it working and left the additional things out.</div>Markg85https://wiki.archlinux.org/index.php?title=ATI&diff=119781ATI2010-10-23T14:16:15Z<p>Markg85: -0 to 0 --- makes cpoy/paste easier since now it works!</p>
<hr />
<div>[[Category: Graphics (English)]]<br />
[[Category: X Server (English)]]<br />
[[Category: HOWTOs (English)]]<br />
{{i18n|ATI}}<br />
{{Article summary start}}<br />
{{Article summary text|An overview of open source ATI/AMD video card drivers.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|ATI Catalyst}}<br />
{{Article summary wiki|Intel}}<br />
{{Article summary wiki|NVIDIA}}<br />
{{Article summary wiki|Xorg}}<br />
{{Article summary end}}<br />
<br />
Owners of '''ATI''' video cards have a choice between ATI's proprietary driver ({{Package AUR|catalyst}}) and open source alternatives ({{Package Official|xf86-video-ati}} or {{Package Official|xf86-video-radeonhd}}).<br />
<br />
Currently, the performance of the open source drivers are not ''on par'' with the proprietary driver in terms of 3D performance and lack certain features, such as reliable TV-out support. They do, however, offer better dual-head support (<tt>xf86-video-ati</tt>), excellent 2D acceleration, and provide sufficient 3D acceleration for OpenGL-accelerated [[window manager]]s, such as [[Compiz]] or KWin. Currently, [http://www.archlinux.org/news/439/ the ATI Catalyst package is available in the AUR].<br />
<br />
If unsure, try the open source drivers first; they will suit most needs and are generally less problematic. (See the [http://www.x.org/wiki/RadeonFeature feature matrix] for details.) For an overview of ATI's proprietary "Catalyst" video card driver, see [[ATI Catalyst]]; this article covers the open source drivers.<br />
<br />
==Naming conventions==<br />
ATI's [[Wikipedia:Radeon|Radeon]] brand follows a naming scheme that relates each product to a market segment. Within this article, readers will see both ''product'' names (e.g. HD 4850, X1900) and ''code'' or ''core'' names (e.g. RV770, R580). Traditionally, a ''product series'' will correspond to a ''core series'' (e.g. the "X1000" product series includes the X1300, X1600, X1800, and X1900 products which utilize the "R500" core series &ndash; including the RV515, RV530, R520, and R580 cores).<br />
<br />
For a table of core and product series, see [[Wikipedia:Comparison of AMD graphics processing units]].<br />
<br />
== Differences between open source drivers ==<br />
<br />
<div style="width: 50%; float: left"><br />
===<tt>xf86-video-ati</tt> (radeon)===<br />
*Works with Radeon chipsets up to HD 4xxx (latest R700 chipsets) as well as HD 5xxx (latest R800 chipsets). <br />
*Radeons up to the X1xxx series are fully supported, stable, and full 2D and 3D acceleration are provided. <br />
*Radeons from HD 2xxx to X4xxx have full 2D acceleration and functional 3D acceleration, but are not supported by all the features that the proprietary driver provides (for example, powersaving is still in a testing phase). <br />
*Supports DRI1, RandR 1.2/1.3, EXA acceleration and [[KMS|kernel mode-setting]]/DRI2 (with the latest Linux kernel, libdrm and Mesa versions).<br />
*All cards from HD 5xxx (R800) and newer are supported, but for now, with 2D support only.<br />
*'''HDMI''' support will soon be implemented in '''xf86-video-ati''' over AtomBIOS. It is already working for some chipsets (RV620 at least are working fine).<br />
</div><br />
<br />
<div style="width: 50%; float: right"><br />
===<tt>xf86-video-radeonhd</tt> (radeonhd)===<br />
*Driver for ATI R500 chipsets (Radeon X1000 series) and '''newer'''. <br />
*Written by Novell with specifications provided to the public by AMD. <br />
*Supports RandR 1.2. It does also support HDMI with sound (if your hardware is so equipped, except RV730 based chip sets).<br />
*Is not actively developed, since September 2010. [http://www.x.org/wiki/radeonhd Xorg wiki] recommends to get xf86-video-ati as the main alternative now.<br />
</div><br />
<br />
<div style="clear: both"></div> <!-- prevent overlapping paragraphs --><br />
<br />
Generally, '''xf86-video-ati''' seems to offer more consistent performance as compared to '''xf86-video-radeonhd''' and is more actively developed, so it should be your first choice, no matter which ATI card you own. xf86-video-radeonhd should be used as a "fallback" driver in case you encounter errors with xf86-video-ati and it '''should not be used''' as a primary driver - radeonhd's development has been unofficially halted. In case you need to use a driver for newer ATI cards, you should prefer the proprietary '''catalyst''' driver.<br />
<br />
{{Note|xf86-video-ati is recognized as "'''radeon'''" by Xorg (in xorg.conf) and xf86-video-radeonhd as "'''radeonhd'''". }}<br />
<br />
== Installation and configuration ==<br />
<br />
=== Installation ===<br />
{{Note| If you have previously installed the proprietary driver, make sure to remove <code>catalyst</code> and '''reboot'''.}}<br />
<br />
To install <code>xf86-video-ati</code> :<br />
pacman -S xf86-video-ati<br />
<br />
To install <code>xf86-video-radeonhd</code> : <br />
pacman -S xf86-video-radeonhd libgl ati-dri<br />
<br />
{{Note|All cards from HD3xxx (R600) and newer need to install additional firmware files.}}<br />
To install <code>linux-firmware</code> :<br />
pacman -S linux-firmware <br />
{{Note|The GIT versions of these drivers can be found on [[AUR]].}}<br />
<br />
=== Configuration ===<br />
You now have the choice between creating an xorg.conf, or attempting to use the recently enabled '''Xorg''' autodetection. <br />
<br />
==== Running Xorg without xorg.conf ====<br />
In most cases, Xorg can '''autodetect''' your hardware settings. The Xorg.conf configuration file in /etc/X11 is optional since Xorg-server 1.5.x.<br />
<br />
Always make sure you have '''mesa''', the group '''xorg''' and the group '''xorg-input-drivers''' installed:<br />
pacman -S xorg-input-drivers mesa xorg<br />
<br />
{{Note| With KMS (Kernel Mode Setting) enabled, '''xorg.conf may not be needed at all.''' For more info on Radeon Kernel mode-setting, read [[#Kernel mode-setting (KMS)]].}}<br />
<br />
==== Running Xorg with expanded xorg.conf ====<br />
{{Note| '''/etc/X11/xorg.conf''' no longer requires sections for all input devices because Udev can configure some/all via hotplugging. (Ensure '''xorg-input-drivers''' are installed.)}}<br />
<br />
In case you want manual configuration, edit your [[xorg.conf]], and add or make sure you have the following in their given sections:<br />
Section "Module"<br />
Load "glx"<br />
Load "dri"<br />
Load "drm"<br />
EndSection<br />
<br />
Device section for <code>xf86-video-ati</code> :<br />
Section "Device"<br />
Identifier "name" # your alias<br />
Driver "radeon"<br />
EndSection<br />
<br />
Device section for <code>xf86-video-radeonhd</code> :<br />
Section "Device"<br />
Identifier "name" # your alias<br />
Driver "radeonhd"<br />
Option "AccelMethod" "exa" # to enable 2D and Xv acceleration on R6xx/R7xx - default AccelMethod shadowfb<br />
Option "DRI" "on" # to enable 2D and Xv acceleration on R6xx/R7xx - default DRI disabled<br />
EndSection<br />
<br />
{{Note|Try below for smooth performance,over Option "DRI", for RS780M/MN [Radeon HD 3200] using the radeonhd driver(as of 3rd May 2009)}}<br />
<br />
This section (DRI) is not needed (thus deprecated), but use it if you encounter DRI related problems.<br />
Section "DRI"<br />
Group "video"<br />
Mode 0666<br />
EndSection<br />
<br />
Adding '''only''' the '''Device''' Section in the xorg.conf should fit most cases. Using that Section, you can enable features and tweak the driver's performance or behaviour.<br />
<br />
When using the opensource drivers, ensure <code>catalyst</code> is ''not'' installed -- '''ati-dri''' is being used instead. Otherwise, the wrong <code>libGL.so</code> will be installed, which will cause direct rendering to fail.<br />
<br />
== Kernel mode-setting (KMS) ==<br />
<br />
[[KMS]] enables native resolution in the framebuffer and allows for instant console (tty) switching. KMS also enables newer technologies (such as DRI2) which will help reduce artifacts and increase 3D performance, even kernel space power-saving. <br />
<br />
KMS for ATI video cards requires the [[Xorg]] free video user space driver {{Package Official|xf86-video-ati}} version 6.12.4 or later. <br />
<br />
=== Enabling experimental KMS ===<br />
<br />
Since kernel26 v.2.6.33, KMS is '''enabled''' by default for ATI cards. <br />
<br />
==== Early KMS start ====<br />
<br />
''This method will start KMS as early as possible in the [[boot process]] (when the [[initramfs]] is loaded).''<br />
<br />
If you have a special kernel (e.g. kernel26-zen), remember to use appropriate mkinitcpio configuration file, e.g. {{Filename|/etc/mkinitcpio-zen.conf}}. These instructions are written for the default kernel (kernel26).<br />
<br />
# Remove all {{Codeline|<nowiki>vga=</nowiki>}} options from the ''kernel'' line in the bootloader configuration file ({{Filename|/boot/grub/menu.lst}} for [[GRUB]] users). Using other framebuffer drivers (such as <tt>[[uvesafb]]</tt> or <tt>radeonfb</tt>) will conflict with KMS. Remove any framebuffer related modules from {{Filename|/etc/mkinitcpio.conf}}. {{Codeline|<nowiki>video=</nowiki>}} can now be used in conjunction with KMS.<br />
# Add {{Codeline|radeon}} to MODULES array in {{Filename|/etc/mkinitcpio.conf}}. Depending on motherboard chipset, it may be necessary to add {{Codeline|intel_agp}} before the {{Codeline|radeon}} module. Previously, the {{Codeline|fbcon}} module also needed to be listed to be able to switch to the console after X has started, but is now compiled into the default kernel.<br />
#* ''Following is probably not true since Linux 2.6.33, at least author didn't run into any problems:'' For newer ATI cards ('''R6xx''' and '''newer''') extra microcode is currently needed. Install <code>linux-firmware</code> and grab [http://aur.archlinux.org/packages.php?ID=31708 radeon-initrd] from AUR, '''build''' and '''install''' them and add {{Codeline|radeon}} to HOOKS array in {{Filename|/etc/mkinitcpio.conf}}.<br />
# Re-generate your initramfs: <pre># mkinitcpio -p kernel26</pre><br />
# Add {{Codeline|<nowiki>radeon.modeset=1</nowiki>}} to the kernel options in the bootloader configuration file to enable KMS.<br />
# '''Reboot''' the system.<br />
<br />
==== Late start ====<br />
<br />
''With this choice, KMS will be enabled when modules are loaded during the [[boot process]].''<br />
<br />
If you have a special kernel (e.g. kernel26-zen), remember to use appropriate mkinitcpio configuration file, e.g. {{Filename|/etc/mkinitcpio-zen.conf}}. These instructions are written for the default kernel (kernel26).<br />
<br />
# Remove all {{Codeline|<nowiki>vga=</nowiki>}} options from the ''kernel'' line in the bootloader configuration file ({{Filename|/boot/grub/menu.lst}} for [[GRUB]] users). Using other framebuffer drivers (such as <tt>[[uvesafb]]</tt> or <tt>radeonfb</tt>) will conflict with KMS. Remove any framebuffer related modules from {{Filename|/etc/mkinitcpio.conf}}. {{Codeline|<nowiki>video=</nowiki>}} can now be used in conjunction with KMS.<br />
# Add {{Codeline|radeon}} to MODULES array in {{Filename|/etc/rc.conf}}. Depending on motherboard chipset, it may be necessary to add {{Codeline|intel_agp}} before the {{Codeline|radeon}} module. Previously, the {{Codeline|fbcon}} module also needed to be listed to be able to switch to the console after X has started, but is now compiled into the default kernel.<br />
# '''Reboot''' the system.<br />
<br />
{{Tip|Some users have reported faster [[udev]] module loading by adding {{Codeline|<nowiki>options radeon modeset=1</nowiki>}} to {{Filename|/etc/modprobe.d/modprobe.conf}}.}}<br />
<br />
=== Troubleshooting KMS ===<br />
<br />
=== Generic problem solution ===<br />
<br />
If your card often crashes when loading the '''radeon''' module, starting your login manager, entering desktop or crashes when you start 3D apps like glxgears you can try if the kernel boot option "pci=nomsi" solves your problems. See https://bugzilla.kernel.org/show_bug.cgi?id=15626 for X200m cards.<br />
<br />
{{Note|As of kernel 2.6.35 (and probably .34), "pci=nomsi" is most likely to be the default setting, enabled upstream.}}<br />
<br />
==== Disable KMS ====<br />
<br />
Users should consider disabling kernel mode-setting if encountering kernel panics, distorted framebuffer on boot, no GPU signal, [[Xorg]] refusing to start, Xorg falling back to Mesa software rasterizer (no 3D acceleration) or 'POWER OFF' problem (kernel 2.6.33-2)at shutdown.<br />
<br />
# Add {{Codeline|<nowiki>radeon.modeset=0</nowiki>}} (or {{Codeline|nomodeset}}, if this does not work) to the kernel options line in the bootloader configuration file ({{Filename|/boot/grub/menu.lst}} for [[GRUB]] users). That should work. If you want to remove KMS support from the initramfs, follow the next two steps.<br />
# If {{Codeline|radeon}} was added to the MODULES array in {{Filename|mkinitcpio.conf}} to enable ''early start'', remove it.<br />
# Rebuild the [[initramfs]] with <pre># mkinitcpio -p kernel26</pre><br />
<br />
{{Warning|Catalyst users will likely need to blacklist the {{Codeline|radeon}} module by adding {{Codeline|'''!'''radeon}} to the MODULES array in {{Filename|/etc/rc.conf}}.}}<br />
<br />
Alternatively, module options can be specified in a file within the {{Filename|/etc/modprobe.d}} directory. If using the '''radeon''' module ({{Codeline|<nowiki>lsmod | grep radeon</nowiki>}}) disable KMS by creating a file containing the above code:<br />
<br />
{{File|name=/etc/modprobe.d/radeon.conf|content=options radeon modeset=0}}<br />
<br />
==== Renaming {{Filename|xorg.conf}} ====<br />
<br />
Renaming {{Filename|/etc/X11/xorg.conf}}, which may include options that conflict with KMS, will force Xorg to autodetect hardware with sane defaults. After renaming, '''restart''' Xorg.<br />
<br />
== Performance tuning ==<br />
The following options apply to Section "'''Device'''" in /etc/X11/'''xorg.conf'''.<br />
<br />
=== Tuning performance with xf86-video-ati ===<br />
By design, xf86-video-ati runs at AGP 1x speed. It is generally safe to modify this. If you notice hangs, try reducing the value or removing the line entirely (you can use values 1, 2, 4, 8).<br />
Option "AGPMode" "4"<br />
<br />
'''ColorTiling''' is completely safe to enable and supposedly is enabled by default. People have noticed a performance increase when enabled via xorg.conf.<br />
Option "ColorTiling" "on"<br />
<br />
'''Acceleration architecture'''; this will work only on '''newer''' cards. If you enable this and then can't get back into X, remove it.<br />
Option "AccelMethod" "EXA"<br />
<br />
'''Page Flip''' is generally safe to enable. This would mostly be used on older cards, as enabling this would disable EXA. With recent drivers can be used together with EXA.<br />
Option "EnablePageFlip" "on" <br />
<br />
'''AGPFastWrite''' will enable fast writes for AGP cards. This one can be problematic, so be prepared to remove it if you can't get into X.<br />
Option "AGPFastWrite" "yes"<br />
<br />
'''EXAVSync ''' option attempts to avoid tearing by stalling the engine until the display controller has passed the destination region. It reduces tearing at the cost of performance and has been know to cause instability on some chips.<br />
Really useful when enabling Xv overlay on videos on a 3D accelerated desktop. It is not necessary when KMS (thus DRI2 acceleration) is enabled.<br />
<br />
Option "EXAVSync" "yes"<br />
<br />
See an example Device Section in xorg.conf:<br />
<pre><br />
Section "Device"<br />
Identifier "My Graphics Card"<br />
Driver "radeon"<br />
Option "DRI" "on" <br />
Option "DynamicPM" "on" # Dynamic powersaving.<br />
Option "ClockGating" "on" # Assisting option for powersaving.<br />
Option "AccelMethod" "EXA" # EXA should fit most cases.<br />
Option "EXAVSync" "on" # EXAVSync is explained above.<br />
Option "DMAForXv" "on" # Forced option in order to enable Xv overlay.<br />
Option "ScalerWidth" "2048" # That should fix some very rare bugs.<br />
Option "EnablePageFlip" "on" # It will not be enabled on R5xx cards.<br />
Option "RenderAccel" "on" # Optional. It should be enabled by default.<br />
Option "AccelDFS" "on" #Optional. See the man page.<br />
BusID "PCI:1:0:0"<br />
EndSection<br />
</pre><br />
<br />
<br />
'''See the manpage for more configuration options.'''<br />
<code>man radeon</code><br />
<br />
A fine tool to try is [http://aur.archlinux.org/packages.php?do_Details=1&ID=2994 driconf]. It will allow you to modify several settings, like vsync, anisotropic filtering, texture compression, etc. Using this tool it is also possible to "disable Low Impact fallback" needed by some programs (e.g. Google Earth).<br />
<br />
== Powersaving ==<br />
<br />
The powersaving part is totally different with and without KMS.<br />
<br />
=== With KMS enabled ===<br />
<br />
With the radeon driver, power saving is disabled by default but the stock kernel (2.6.35 as of this writing) provides a "sysfs" utility to enable it.<br />
<br />
Power saving through KMS is still a work in progress for the most part. It should work, but some chips do have problems with it. A common issue for all is screen blinking when the kernel switches between power states, and in some configurations it even causes system freezes. But KMS is awesome, so it's your choice. The UMS method is generally more stable, however its power savings might not be as good as those provided by KMS options.<br />
<br />
There are two ways to enable power management:<br />
<br />
1. Try adding radeon.dynpm=1 to the kernel parameters (if using the stock kernel < 2.6.35). If you are using kernel26>=2.6.35 this option is no longer needed and the sysfs interface will be present by default. If this option is passed to a kernel >= 2.6.35, the driver will fail and fall back to software rendering.<br />
<br />
2. Use the (unsupported) [radeon] repo:<br />
<br />
This repository will grant you up-to-date packages of the radeon driver and it's dependencies, from (mostly) git snapshots.<br />
<br />
[radeon]<br />
Server = http://gtklocker.tiven.org/radeon-repo/$arch/<br />
<br />
You can select the methods via sysfs.<br />
<br />
With root access, you have two choices:<br />
<br />
1. '''Dynamic frequency switching (depending on GPU load)'''<br />
<br />
<code><br />
echo dynpm > /sys/class/drm/card0/device/power_method<br />
</code><br />
<br />
The "dynpm" method dynamically changes the clocks based on the number of pending fences, so performance is ramped up when running GPU intensive apps, and ramped down when the GPU is idle. The re-clocking is attempted during vertical blanking periods, but due to the timing of the re-clocking functions, doesn't not always complete in the blanking period, which can lead to flicker in the display. Due to this, dynpm only works when a single head is active.<br />
<br />
{{Note|The "profile" method mentioned below is not as aggressive as "dynpm," but is currently much more stable and flicker free and works with multiple heads active.}}<br />
<br />
2. '''Profile-based frequency switching'''<br />
<br />
<code><br />
echo profile > /sys/class/drm/card0/device/power_method<br />
</code><br />
<br />
<br />
The "profile" mode will allow you to select one of the five profiles below.<br />
Different profiles, for the most part, end up changing the frequency/voltage of the card.<br />
<br />
* "default" uses the default clocks and does not change the power state. This is the default behavior.<br />
* "auto" selects between "mid" and "high" power states based on the whether the system is on battery power or not. The "low" power state are selected when the monitors are in the dpms off state.<br />
* "low" forces the gpu to be in the low power state all the time. Note that "low" can cause display problems on some laptops; this is why auto only uses "low" when displays are off.<br />
* "mid" forces the gpu to be in the "mid" power state all the time. The "low" power state is selected when the monitors are in the dpms off state.<br />
* "high" forces the gpu to be in the "high" power state all the time. The "low" power state is selected when the monitors are in the dpms off state. <br />
<br />
So lets say we want the "low" option...for this, run the following command:<br />
<br />
<code><br />
echo low > /sys/class/drm/card0/device/power_profile<br />
</code><br />
<br />
Replace "low" with any of the aforementioned profiles as necessary.<br />
<br />
{{Note|Echoing a profile value to this file is not permanent, so when you find something that fits your needs, you will need to add it to /etc/rc.local, so it's executed at system startup.}}<br />
<br />
Power management is supported on all asics (r1xx-evergreen) that include the appropriate power state tables in the vbios; not all boards do (especially older desktop cards).<br />
<br />
To view the voltage that the GPU is running at, perform the following command and you will get something like this output:<br />
<br />
<code><br />
~$ cat /sys/kernel/debug/dri/0/radeon_pm_info<br />
state: PM_STATE_ENABLED<br />
default engine clock: 300000 kHz<br />
current engine clock: 300720 kHz<br />
default memory clock: 200000 kHz<br />
</code><br />
<br />
If /sys/kernel/debug is empty...run this command(this was my case, don't know why):<br />
<code><br />
mount -t debugfs none /sys/kernel/debug<br />
</code><br />
<br />
It depends on which GPU line yours is, however. Along with the radeon driver versions, kernel versions, etc. So it may not have much/any voltage regulation at all.<br />
<br />
Thermal sensors are implemented via external i2c chips or via the internal thermal sensor (rv6xx-evergreen only). To get the temperature on asics that use i2c chips, you need to load the appropriate hwmon driver for the sensor used on your board (lm63, lm64, etc.). The drm will attempt to load the appropriate hwmon driver. On boards that use the internal thermal sensor, the drm will set up the hwmon interface automatically. When the appropriate driver is loaded, the temperatures can be accessed via lm_sensors tools or via sysfs in /sys/class/hwmon .<br />
<br />
=== Without KMS ===<br />
<br />
In your xorg.conf file, add 2 lines to "Device" Section:<br />
Option "DynamicPM" "on"<br />
Option "ClockGating" "on"<br />
<br />
If the two options are enabled successfully, you will see following lines in /var/log/Xorg.0.log:<br />
<br />
(**) RADEON(0): Option "ClockGating" "on"<br />
(**) RADEON(0): Option "DynamicPM" "on"<br />
<br />
Static power management enable success<br />
(II) RADEON(0): Dynamic Clock Gating Enabled<br />
(II) RADEON(0): Dynamic Power Management Enabled<br />
<br />
If you desire low power cost, you can add an extra line to "Device" Section of xorg.conf:<br />
Option "ForceLowPowerMode" "on"<br />
<br />
== TV out ==<br />
Since August 2007, there is TV-out support for all Radeons with integrated TV-out.<br />
<br />
It is somewhat limited for now, it doesn't always autodetect the output correctly and only NTSC mode works.<br />
<br />
First, check that you have an S-video output: <code>xrandr</code> should give you something like<br />
Screen 0: minimum 320x200, current 1024x768, maximum 1280x1200<br />
...<br />
S-video disconnected (normal left inverted right x axis y axis)<br />
<br />
Now we should tell Xorg that it is actually connected (it ''is'', right?)<br />
xrandr --output S-video --set load_detection 1<br />
<br />
Setting tv standard to use:<br />
xrandr --output S-video --set tv_standard ntsc<br />
<br />
Adding a mode for it (currently it supports only 800x600):<br />
xrandr --addmode S-video 800x600<br />
<br />
I'll go for a clone mode:<br />
xrandr --output S-video --same-as VGA-0<br />
<br />
So far so good. Now let's try to see what we have:<br />
xrandr --output S-video --mode 800x600<br />
<br />
At this point you should see a 800x600 version of your desktop on your TV.<br />
<br />
To disable the output, do<br />
xrandr --output S-video --off<br />
<br />
Also you may notice that the video is being played on monitor only and not on the TV. Where the Xv overlay is sent is controlled by XV_CRTC attribute.<br />
<br />
To send the output to the TV, I do<br />
xvattr -a XV_CRTC -v 1<br />
<br />
{{Note| you need to install '''xvattr''' from [[AUR]] to execute this command.}}<br />
<br />
To switch back to my monitor, I change this to <code>0</code>. <code>-1</code> is used for automatic switching in dualhead setups.<br />
<br />
Please see [http://www.x.org/wiki/radeonTV Enabling TV-Out Statically] for how to enable TV-out in your xorg config file.<br />
<br />
== HDMI with sound ==<br />
Given that your hardware supports it, and you have installed '''xf86-video-radeonhd''' (note: The driver '''xf86-video-ati''' will soon get HDMI support.) you can insert the following into xorg.conf to enable HDMI with sound:<br />
Section "Device"<br />
# ...<br />
Option "Audio" "on"<br />
Option "HDMI" "all"<br />
EndSection<br />
<br />
Restart X when you have done this, try to see if there is sound transmitted to TV via HDMI cable.<br />
# Connect your PC to the TV via HDMI cable (duh).<br />
# Use xrandr to get picture to the TV. Ex: <code>xrandr --output DVI-D_1 --mode 1280x768 --right-of PANEL</code>. Simply typing <code>xrandr</code> will give you a list of your valid outputs.<br />
# Run <code>aplay -l</code> to get the list of your sound devices. Find HDMI and note the card number and corresponding device number. Example of what you want to see: <code>card 1: HDMI [HDA ATI HDMI], device 3: ATI HDMI [ATI HDMI]</code><br />
# Try sending sound to this device: <code>aplay -D plughw:1,3 /usr/share/sounds/alsa/Front_Center.wav</code>. Be sure to change plughw:z,y to match your hardware number found with last command. You should be able to hear the test sound from your TV.<br />
<br />
=== Using '''xf86-video-ati''' ===<br />
'''xf86-video-ati''' can enable HDMI output for some chipsets (RV620 for instance, and therefore probably R*600) . Using [[ATI#Kernel_mode-setting_.28KMS.29|KMS]], add radeon.audio=1 to your kernel line in /boot/grub/menu.lst. Then, use xrandr and aplay to get HDMI output, as explained above. <br />
<br />
=== Note on RV730 and RV710 ===<br />
<br />
'''xf86-video-radeonhd''' does not support yet audio through HDMI for these chipsets, but work is in progress.<br />
<br />
== Troubleshooting ==<br />
<br />
=== I encounter artifacts when logging into my DE or WM ===<br />
<br />
If you encounter artifacts, first try starting X without {{Filename|/etc/X11/xorg.conf}}. Recent versions of Xorg are capable of reliable auto-detection and auto-configuration for most use cases. Outdated or improperly configured {{Filename|xorg.conf}} files are known to cause trouble.<br />
<br />
In order to run without a configuration tile, it is recommended that the <tt>xorg-input-drivers</tt> package group be installed.<br />
<br />
Artifacts may also be related to [[kernel mode setting]]. Consider [[#Disable KMS|disabling KMS]].<br />
<br />
=== I have switched from catalyst to radeonhd or radeon and some things don't work ===<br />
<br />
First of all, don't panic. Uninstall catalyst, install xf86-video-radeonhd or xf86-video-ati and then '''''reboot'''''.<br />
<br />
Make sure you are not using the xorg.conf generated by catalyst. Your original should have been backed up and you can recall it:<br />
cp /etc/X11/xorg.conf.original-0 /etc/X11/xorg.conf<br />
<br />
Otherwise, stop your graphical server if running, and in a tty, type as root:<br />
Xorg -configure<br />
mv xorg.conf.new /etc/X11/xorg.conf<br />
and make sure you put the required options.<br />
<br />
If it still doesn't solve your problem, know that apparently catalyst has the bad idea to replace Xorg files with symbolic links pointing to its own files. The easiest at this point is to uninstall all catalyst stuff (just to be on the safe side) and then to reinstall xorg, libgl, ati-dri and xf86-video-radeonhd or xf86-video-ati.<br />
<br />
If it still doesn't work, then have a look into the forum, your problem might be a configuration issue.<br />
<br />
{{Note| When you switch to '''xf86-video-ati''' or '''xf86-video-radeonhd''', remember that you can login without xorg.conf as well (without problems in most cases), since Xorg can autodetect your settings. So '''xorg.conf''' is optional.}}<br />
<br />
=== I have installed a free driver and my card is painfully slow ===<br />
<br />
Some cards can be installed by default trying to use [[ATI#AMD/Ati cards and kernel mode-setting (KMS)|KMS]]. You can check whether this is your case running:<br />
dmesg | egrep "drm|radeon"<br />
<br />
This command might show something ''like'' this, meaning it is trying to default to KMS:<br />
[drm] radeon default to kernel modesetting.<br />
...<br />
[drm:radeon_driver_load_kms] *ERROR* Failed to initialize radeon, disabling IOCTL<br />
<br />
If your card is not supported by KMS (anything older than r100), then you can [[ATI#Disable KMS|disable KMS]]. This should fix the problem.<br />
<br />
If you're getting and error message in dmesg like this:<br />
platform radeon_cp.0: firmware: requesting radeon/R600_rlc.bin<br />
r600_cp: Failed to load firmware "radeon/R600_rlc.bin"<br />
[drm:r600_startup] *ERROR* Failed to load firmware!<br />
radeon 0000:01:00.0: disabling GPU acceleration<br />
Install linux-firmware or linux-firmware-git from [http://aur.archlinux.org/packages.php?ID=37306 AUR].</div>Markg85https://wiki.archlinux.org/index.php?title=DVB-S&diff=119010DVB-S2010-10-10T19:16:34Z<p>Markg85: /* Switching channels */</p>
<hr />
<div>[[Category:Audio/Video (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
{{Article summary start}}<br />
{{Article summary text|Covers the setup and use of DVB-S (sat TV) cards on Arch Linux.}}<br />
{{Article summary heading|Important}}<br />
{{Article summary text|This was only tested with the Pinnacle PCTV Sat, and may not work or won't help you with different cards.}}<br />
{{Article summary heading|Available in languages}}<br />
[[de:DVB-S]]<br />
{{i18n_entry|English|DVB-S}}<br />
{{Article summary heading|Related articles}}<br />
{{Article summary wiki|MythTV Walkthrough}}<br />
{{Article summary end}}<br />
<br />
==Load required Modules==<br />
You have to lookup the chipset of your specific card; tools like '''lshwd''' may help you.<br />
<br />
===Pinnacle PCTV Sat===<br />
This card uses bt878 and cx24110 as chipset.<br />
<br />
Load them (under root) with:<br />
# modprobe dvb-bt8xx<br />
# modprobe cx24110<br />
If you want Arch to boot them on startup, add both modules to {{Codeline|MODULES}} in {{Filename|/etc/rc.conf}}.<br />
<br />
==Setup Permissions==<br />
To use your DVB-S card as user add him to the {{Codeline|video}} group:<br />
# gpasswd -a [username] video<br />
<br />
==Scanning channels==<br />
{{Note | You can skip this part if you use Kaffeine.}}<br />
<br />
Most applications like szap or xine are needing a channel list created by '''scan''', which is part of '''dvb-utils'''.<br />
You'll find the dvb-utils package under the name {{Package Official|linuxtv-dvb-apps}} in the Community-Repo.<br />
<br />
Install it with:<br />
# pacman -S linuxtv-dvb-apps<br />
<br />
===Using scan===<br />
'''scan''' needs an channel to initialize scanning. In <tt>/usr/share/dvb/dvb-s/</tt> are some files which contain these channels; you will need that one that fits the satellite you are watching from.<br />
<br />
The following command will scan all channels and save them to {{Filename|channels.conf}}:<br />
$ scan -x0 -t1 -s1 /usr/share/dvb/dvb-s/[your satellite] | tee channels.conf<br />
{{Note | The channel file doesn't have to be called {{Filename|channels.conf}} but it's more convenient as you will see later.}}<br />
{{Note | Depending on your satellite dish setup you may have to try other arguments.}}<br />
<br />
===Using w_scan===<br />
[http://aur.archlinux.org/packages.php?ID=12028 w_scan] allows for automatic scanning of channels without configuration. Install it then issue:<br />
<br />
# w_scan -c [your country] > ~/someChannels.conf<br />
<br />
Alternatively you can also scan using the satellite position like 19.5E for Astra 1. Scans like that can be done as follows:<br />
<br />
# w_scan -fs -s S19E5 > ~/someChannels.conf<br />
<br />
You can also add the -X flag to generate tzap/czap/xine output instead of vdr output.<br />
<br />
# w_scan -X -c AU > ~/AustraliaChannels.conf<br />
<br />
====DiSEqC switch scanning (AKA multiple satellite LNB)====<br />
If you have a LNB with a DiSEqC switch in it you can manually select that using the -D option like so:<br />
<br />
# w_scan -fs -s S23E5 -D 1c > ~/someChannels.conf<br />
<br />
The above line should work but not all found channels where actually saved. The line below worked perfectly for me:<br />
<br />
# w_scan -fs -s S23E5 -a 0 -D 1c -o 7 -e 2 > ~/someChannels.conf<br />
<br />
{{Warning|I did found out that when using a LNB with a DiSEqC switch it's way more convenient to use -X ouptut which you can use in for example mplayer. Just append "-X" before the ">" that you see above.}}<br />
<br />
==Switching channels==<br />
{{Note | szap only works with satellite TV.}}<br />
<br />
By using '''zap''', which comes with '''dvb-utils''', you can switch channels, so you don't have to rely on the abilities of your player.<br />
<br />
'''szap''' needs the channel file we created earlier; it will try {{Filename|~/.szap/channels.conf}} by default. You can move the {{Filename|channels.conf}} there or you can use the {{Codeline|"-c"}} command-line option.<br />
<br />
Switching channels works like this:<br />
$ szap -r [channel]<br />
{{Note | szap needs to keep running.}}<br />
<br />
You can list all available channels with:<br />
$ szap -q<br />
<br />
Now you can watch the stream for example with xine:<br />
$ xine -g stdin://mpeg2 < /dev/dvb/adapter0/dvr0<br />
or with mplayer:<br />
$ mplayer /dev/dvb/adapter0/dvr0<br />
or with mplayer, but using DVB directly:<br />
$ mplayer "dvb://RTL Television"<br />
You can find all the channel names by running szap -q (assuming the channel list is also in ~/.szap/channels.conf).<br />
<br />
==Software==<br />
<br />
===Kaffeine===<br />
Kaffeine is a really nice player; it supports EPG, time-shifting, and recording. Additionally Kaffeine has built-in channel-searching.<br />
<br />
Install it with:<br />
# pacman -S kaffeine<br />
<br />
*[http://archlinux.org/packages/search/?q=kaffeine More Information]<br />
*[http://kaffeine.sourceforge.net/ Project page]<br />
<br />
====Importing channel list====<br />
* Linosaw.de provides [http://www.linowsat.de/settings/vdr.html channels.conf] files for [[VDR]]<br />
* [http://free.pages.at/cleditor/vdr2kaffeine.htm conv2conf] converts these files into kaffeine channel list format<br />
<br />
===Klear===<br />
Klear is also a really nice player; it supports EPG, time-shifting, and recording, videotext. Channel-searching is still missing. Install it from AUR:<br />
*[http://aur.archlinux.org/packages.php?do_Details=1&ID=2415&O=0&L=0&C=0&K=klear&SB=&SO=&PP=25&do_MyPackages=0&do_Orphans=0&SeB=nd AUR package]<br />
*[http://klear.org Project page]<br />
<br />
===Xine===<br />
Copy your channel file to {{Filename|~/.xine/channels.conf}}.<br />
<br />
Watch a specific channel with following command:<br />
$ xine dvb://[channel]<br />
<br />
or use the playlist editor in Xine<br />
<br />
==Additional Resources==<br />
<br />
===TV Cards in general===<br />
*[http://wiki.ubuntuusers.de/TV-Karten Ubuntuusers.de-Wiki] (german)<br />
<br />
===Pinnacle Cards===<br />
*[http://pinnaclefanboard.com/ PinnacleFanBoard] (german, but you can ask in english as well)</div>Markg85https://wiki.archlinux.org/index.php?title=DVB-S&diff=119009DVB-S2010-10-10T19:14:13Z<p>Markg85: /* DiSEqC switch scanning (AKA multiple satellite LNB) */</p>
<hr />
<div>[[Category:Audio/Video (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
{{Article summary start}}<br />
{{Article summary text|Covers the setup and use of DVB-S (sat TV) cards on Arch Linux.}}<br />
{{Article summary heading|Important}}<br />
{{Article summary text|This was only tested with the Pinnacle PCTV Sat, and may not work or won't help you with different cards.}}<br />
{{Article summary heading|Available in languages}}<br />
[[de:DVB-S]]<br />
{{i18n_entry|English|DVB-S}}<br />
{{Article summary heading|Related articles}}<br />
{{Article summary wiki|MythTV Walkthrough}}<br />
{{Article summary end}}<br />
<br />
==Load required Modules==<br />
You have to lookup the chipset of your specific card; tools like '''lshwd''' may help you.<br />
<br />
===Pinnacle PCTV Sat===<br />
This card uses bt878 and cx24110 as chipset.<br />
<br />
Load them (under root) with:<br />
# modprobe dvb-bt8xx<br />
# modprobe cx24110<br />
If you want Arch to boot them on startup, add both modules to {{Codeline|MODULES}} in {{Filename|/etc/rc.conf}}.<br />
<br />
==Setup Permissions==<br />
To use your DVB-S card as user add him to the {{Codeline|video}} group:<br />
# gpasswd -a [username] video<br />
<br />
==Scanning channels==<br />
{{Note | You can skip this part if you use Kaffeine.}}<br />
<br />
Most applications like szap or xine are needing a channel list created by '''scan''', which is part of '''dvb-utils'''.<br />
You'll find the dvb-utils package under the name {{Package Official|linuxtv-dvb-apps}} in the Community-Repo.<br />
<br />
Install it with:<br />
# pacman -S linuxtv-dvb-apps<br />
<br />
===Using scan===<br />
'''scan''' needs an channel to initialize scanning. In <tt>/usr/share/dvb/dvb-s/</tt> are some files which contain these channels; you will need that one that fits the satellite you are watching from.<br />
<br />
The following command will scan all channels and save them to {{Filename|channels.conf}}:<br />
$ scan -x0 -t1 -s1 /usr/share/dvb/dvb-s/[your satellite] | tee channels.conf<br />
{{Note | The channel file doesn't have to be called {{Filename|channels.conf}} but it's more convenient as you will see later.}}<br />
{{Note | Depending on your satellite dish setup you may have to try other arguments.}}<br />
<br />
===Using w_scan===<br />
[http://aur.archlinux.org/packages.php?ID=12028 w_scan] allows for automatic scanning of channels without configuration. Install it then issue:<br />
<br />
# w_scan -c [your country] > ~/someChannels.conf<br />
<br />
Alternatively you can also scan using the satellite position like 19.5E for Astra 1. Scans like that can be done as follows:<br />
<br />
# w_scan -fs -s S19E5 > ~/someChannels.conf<br />
<br />
You can also add the -X flag to generate tzap/czap/xine output instead of vdr output.<br />
<br />
# w_scan -X -c AU > ~/AustraliaChannels.conf<br />
<br />
====DiSEqC switch scanning (AKA multiple satellite LNB)====<br />
If you have a LNB with a DiSEqC switch in it you can manually select that using the -D option like so:<br />
<br />
# w_scan -fs -s S23E5 -D 1c > ~/someChannels.conf<br />
<br />
The above line should work but not all found channels where actually saved. The line below worked perfectly for me:<br />
<br />
# w_scan -fs -s S23E5 -a 0 -D 1c -o 7 -e 2 > ~/someChannels.conf<br />
<br />
{{Warning|I did found out that when using a LNB with a DiSEqC switch it's way more convenient to use -X ouptut which you can use in for example mplayer. Just append "-X" before the ">" that you see above.}}<br />
<br />
==Switching channels==<br />
{{Note | szap only works with satellite TV.}}<br />
<br />
By using '''zap''', which comes with '''dvb-utils''', you can switch channels, so you don't have to rely on the abilities of your player.<br />
<br />
'''szap''' needs the channel file we created earlier; it will try {{Filename|~/.szap/channels.conf}} by default. You can move the {{Filename|channels.conf}} there or you can use the {{Codeline|"-c"}} command-line option.<br />
<br />
Switching channels works like this:<br />
$ szap -r [channel]<br />
{{Note | szap needs to keep running.}}<br />
<br />
You can list all available channels with:<br />
$ szap -q<br />
<br />
Now you can watch the stream for example with xine:<br />
$ xine -g stdin://mpeg2 < /dev/dvb/adapter0/dvr0<br />
or with mplayer:<br />
$ mplayer /dev/dvb/adapter0/dvr0<br />
<br />
==Software==<br />
<br />
===Kaffeine===<br />
Kaffeine is a really nice player; it supports EPG, time-shifting, and recording. Additionally Kaffeine has built-in channel-searching.<br />
<br />
Install it with:<br />
# pacman -S kaffeine<br />
<br />
*[http://archlinux.org/packages/search/?q=kaffeine More Information]<br />
*[http://kaffeine.sourceforge.net/ Project page]<br />
<br />
====Importing channel list====<br />
* Linosaw.de provides [http://www.linowsat.de/settings/vdr.html channels.conf] files for [[VDR]]<br />
* [http://free.pages.at/cleditor/vdr2kaffeine.htm conv2conf] converts these files into kaffeine channel list format<br />
<br />
===Klear===<br />
Klear is also a really nice player; it supports EPG, time-shifting, and recording, videotext. Channel-searching is still missing. Install it from AUR:<br />
*[http://aur.archlinux.org/packages.php?do_Details=1&ID=2415&O=0&L=0&C=0&K=klear&SB=&SO=&PP=25&do_MyPackages=0&do_Orphans=0&SeB=nd AUR package]<br />
*[http://klear.org Project page]<br />
<br />
===Xine===<br />
Copy your channel file to {{Filename|~/.xine/channels.conf}}.<br />
<br />
Watch a specific channel with following command:<br />
$ xine dvb://[channel]<br />
<br />
or use the playlist editor in Xine<br />
<br />
==Additional Resources==<br />
<br />
===TV Cards in general===<br />
*[http://wiki.ubuntuusers.de/TV-Karten Ubuntuusers.de-Wiki] (german)<br />
<br />
===Pinnacle Cards===<br />
*[http://pinnaclefanboard.com/ PinnacleFanBoard] (german, but you can ask in english as well)</div>Markg85https://wiki.archlinux.org/index.php?title=DVB-S&diff=119003DVB-S2010-10-10T16:43:38Z<p>Markg85: /* DiSEqC switch scanning (AKA multiple satellite LNB) */</p>
<hr />
<div>[[Category:Audio/Video (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
{{Article summary start}}<br />
{{Article summary text|Covers the setup and use of DVB-S (sat TV) cards on Arch Linux.}}<br />
{{Article summary heading|Important}}<br />
{{Article summary text|This was only tested with the Pinnacle PCTV Sat, and may not work or won't help you with different cards.}}<br />
{{Article summary heading|Available in languages}}<br />
[[de:DVB-S]]<br />
{{i18n_entry|English|DVB-S}}<br />
{{Article summary heading|Related articles}}<br />
{{Article summary wiki|MythTV Walkthrough}}<br />
{{Article summary end}}<br />
<br />
==Load required Modules==<br />
You have to lookup the chipset of your specific card; tools like '''lshwd''' may help you.<br />
<br />
===Pinnacle PCTV Sat===<br />
This card uses bt878 and cx24110 as chipset.<br />
<br />
Load them (under root) with:<br />
# modprobe dvb-bt8xx<br />
# modprobe cx24110<br />
If you want Arch to boot them on startup, add both modules to {{Codeline|MODULES}} in {{Filename|/etc/rc.conf}}.<br />
<br />
==Setup Permissions==<br />
To use your DVB-S card as user add him to the {{Codeline|video}} group:<br />
# gpasswd -a [username] video<br />
<br />
==Scanning channels==<br />
{{Note | You can skip this part if you use Kaffeine.}}<br />
<br />
Most applications like szap or xine are needing a channel list created by '''scan''', which is part of '''dvb-utils'''.<br />
You'll find the dvb-utils package under the name {{Package Official|linuxtv-dvb-apps}} in the Community-Repo.<br />
<br />
Install it with:<br />
# pacman -S linuxtv-dvb-apps<br />
<br />
===Using scan===<br />
'''scan''' needs an channel to initialize scanning. In <tt>/usr/share/dvb/dvb-s/</tt> are some files which contain these channels; you will need that one that fits the satellite you are watching from.<br />
<br />
The following command will scan all channels and save them to {{Filename|channels.conf}}:<br />
$ scan -x0 -t1 -s1 /usr/share/dvb/dvb-s/[your satellite] | tee channels.conf<br />
{{Note | The channel file doesn't have to be called {{Filename|channels.conf}} but it's more convenient as you will see later.}}<br />
{{Note | Depending on your satellite dish setup you may have to try other arguments.}}<br />
<br />
===Using w_scan===<br />
[http://aur.archlinux.org/packages.php?ID=12028 w_scan] allows for automatic scanning of channels without configuration. Install it then issue:<br />
<br />
# w_scan -c [your country] > ~/someChannels.conf<br />
<br />
Alternatively you can also scan using the satellite position like 19.5E for Astra 1. Scans like that can be done as follows:<br />
<br />
# w_scan -fs -s S19E5 > ~/someChannels.conf<br />
<br />
You can also add the -X flag to generate tzap/czap/xine output instead of vdr output.<br />
<br />
# w_scan -X -c AU > ~/AustraliaChannels.conf<br />
<br />
====DiSEqC switch scanning (AKA multiple satellite LNB)====<br />
If you have a LNB with a DiSEqC switch in it you can manually select that using the -D option like so:<br />
<br />
# w_scan -fs -s S23E5 -D 1c > ~/someChannels.conf<br />
<br />
The above line should work but not all found channels where actually saved. The line below worked perfectly for me:<br />
<br />
# w_scan -fs -s S23E5 -a 0 -D 1c -o 7 -e 2 > ~/someChannels.conf<br />
<br />
==Switching channels==<br />
{{Note | szap only works with satellite TV.}}<br />
<br />
By using '''zap''', which comes with '''dvb-utils''', you can switch channels, so you don't have to rely on the abilities of your player.<br />
<br />
'''szap''' needs the channel file we created earlier; it will try {{Filename|~/.szap/channels.conf}} by default. You can move the {{Filename|channels.conf}} there or you can use the {{Codeline|"-c"}} command-line option.<br />
<br />
Switching channels works like this:<br />
$ szap -r [channel]<br />
{{Note | szap needs to keep running.}}<br />
<br />
You can list all available channels with:<br />
$ szap -q<br />
<br />
Now you can watch the stream for example with xine:<br />
$ xine -g stdin://mpeg2 < /dev/dvb/adapter0/dvr0<br />
or with mplayer:<br />
$ mplayer /dev/dvb/adapter0/dvr0<br />
<br />
==Software==<br />
<br />
===Kaffeine===<br />
Kaffeine is a really nice player; it supports EPG, time-shifting, and recording. Additionally Kaffeine has built-in channel-searching.<br />
<br />
Install it with:<br />
# pacman -S kaffeine<br />
<br />
*[http://archlinux.org/packages/search/?q=kaffeine More Information]<br />
*[http://kaffeine.sourceforge.net/ Project page]<br />
<br />
====Importing channel list====<br />
* Linosaw.de provides [http://www.linowsat.de/settings/vdr.html channels.conf] files for [[VDR]]<br />
* [http://free.pages.at/cleditor/vdr2kaffeine.htm conv2conf] converts these files into kaffeine channel list format<br />
<br />
===Klear===<br />
Klear is also a really nice player; it supports EPG, time-shifting, and recording, videotext. Channel-searching is still missing. Install it from AUR:<br />
*[http://aur.archlinux.org/packages.php?do_Details=1&ID=2415&O=0&L=0&C=0&K=klear&SB=&SO=&PP=25&do_MyPackages=0&do_Orphans=0&SeB=nd AUR package]<br />
*[http://klear.org Project page]<br />
<br />
===Xine===<br />
Copy your channel file to {{Filename|~/.xine/channels.conf}}.<br />
<br />
Watch a specific channel with following command:<br />
$ xine dvb://[channel]<br />
<br />
or use the playlist editor in Xine<br />
<br />
==Additional Resources==<br />
<br />
===TV Cards in general===<br />
*[http://wiki.ubuntuusers.de/TV-Karten Ubuntuusers.de-Wiki] (german)<br />
<br />
===Pinnacle Cards===<br />
*[http://pinnaclefanboard.com/ PinnacleFanBoard] (german, but you can ask in english as well)</div>Markg85https://wiki.archlinux.org/index.php?title=DVB-S&diff=119001DVB-S2010-10-10T16:05:56Z<p>Markg85: /* Using w_scan */</p>
<hr />
<div>[[Category:Audio/Video (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
{{Article summary start}}<br />
{{Article summary text|Covers the setup and use of DVB-S (sat TV) cards on Arch Linux.}}<br />
{{Article summary heading|Important}}<br />
{{Article summary text|This was only tested with the Pinnacle PCTV Sat, and may not work or won't help you with different cards.}}<br />
{{Article summary heading|Available in languages}}<br />
[[de:DVB-S]]<br />
{{i18n_entry|English|DVB-S}}<br />
{{Article summary heading|Related articles}}<br />
{{Article summary wiki|MythTV Walkthrough}}<br />
{{Article summary end}}<br />
<br />
==Load required Modules==<br />
You have to lookup the chipset of your specific card; tools like '''lshwd''' may help you.<br />
<br />
===Pinnacle PCTV Sat===<br />
This card uses bt878 and cx24110 as chipset.<br />
<br />
Load them (under root) with:<br />
# modprobe dvb-bt8xx<br />
# modprobe cx24110<br />
If you want Arch to boot them on startup, add both modules to {{Codeline|MODULES}} in {{Filename|/etc/rc.conf}}.<br />
<br />
==Setup Permissions==<br />
To use your DVB-S card as user add him to the {{Codeline|video}} group:<br />
# gpasswd -a [username] video<br />
<br />
==Scanning channels==<br />
{{Note | You can skip this part if you use Kaffeine.}}<br />
<br />
Most applications like szap or xine are needing a channel list created by '''scan''', which is part of '''dvb-utils'''.<br />
You'll find the dvb-utils package under the name {{Package Official|linuxtv-dvb-apps}} in the Community-Repo.<br />
<br />
Install it with:<br />
# pacman -S linuxtv-dvb-apps<br />
<br />
===Using scan===<br />
'''scan''' needs an channel to initialize scanning. In <tt>/usr/share/dvb/dvb-s/</tt> are some files which contain these channels; you will need that one that fits the satellite you are watching from.<br />
<br />
The following command will scan all channels and save them to {{Filename|channels.conf}}:<br />
$ scan -x0 -t1 -s1 /usr/share/dvb/dvb-s/[your satellite] | tee channels.conf<br />
{{Note | The channel file doesn't have to be called {{Filename|channels.conf}} but it's more convenient as you will see later.}}<br />
{{Note | Depending on your satellite dish setup you may have to try other arguments.}}<br />
<br />
===Using w_scan===<br />
[http://aur.archlinux.org/packages.php?ID=12028 w_scan] allows for automatic scanning of channels without configuration. Install it then issue:<br />
<br />
# w_scan -c [your country] > ~/someChannels.conf<br />
<br />
Alternatively you can also scan using the satellite position like 19.5E for Astra 1. Scans like that can be done as follows:<br />
<br />
# w_scan -fs -s S19E5 > ~/someChannels.conf<br />
<br />
You can also add the -X flag to generate tzap/czap/xine output instead of vdr output.<br />
<br />
# w_scan -X -c AU > ~/AustraliaChannels.conf<br />
<br />
====DiSEqC switch scanning (AKA multiple satellite LNB)====<br />
If you have a LNB with a DiSEqC switch in it you can manually select that using the -D option like so:<br />
<br />
# w_scan -fs -s S23E5 -D 1c > ~/someChannels.conf<br />
<br />
In my case the above line did the trick to scan all Astra 3 (a lot in HD) channels.<br />
<br />
==Switching channels==<br />
{{Note | szap only works with satellite TV.}}<br />
<br />
By using '''zap''', which comes with '''dvb-utils''', you can switch channels, so you don't have to rely on the abilities of your player.<br />
<br />
'''szap''' needs the channel file we created earlier; it will try {{Filename|~/.szap/channels.conf}} by default. You can move the {{Filename|channels.conf}} there or you can use the {{Codeline|"-c"}} command-line option.<br />
<br />
Switching channels works like this:<br />
$ szap -r [channel]<br />
{{Note | szap needs to keep running.}}<br />
<br />
You can list all available channels with:<br />
$ szap -q<br />
<br />
Now you can watch the stream for example with xine:<br />
$ xine -g stdin://mpeg2 < /dev/dvb/adapter0/dvr0<br />
or with mplayer:<br />
$ mplayer /dev/dvb/adapter0/dvr0<br />
<br />
==Software==<br />
<br />
===Kaffeine===<br />
Kaffeine is a really nice player; it supports EPG, time-shifting, and recording. Additionally Kaffeine has built-in channel-searching.<br />
<br />
Install it with:<br />
# pacman -S kaffeine<br />
<br />
*[http://archlinux.org/packages/search/?q=kaffeine More Information]<br />
*[http://kaffeine.sourceforge.net/ Project page]<br />
<br />
====Importing channel list====<br />
* Linosaw.de provides [http://www.linowsat.de/settings/vdr.html channels.conf] files for [[VDR]]<br />
* [http://free.pages.at/cleditor/vdr2kaffeine.htm conv2conf] converts these files into kaffeine channel list format<br />
<br />
===Klear===<br />
Klear is also a really nice player; it supports EPG, time-shifting, and recording, videotext. Channel-searching is still missing. Install it from AUR:<br />
*[http://aur.archlinux.org/packages.php?do_Details=1&ID=2415&O=0&L=0&C=0&K=klear&SB=&SO=&PP=25&do_MyPackages=0&do_Orphans=0&SeB=nd AUR package]<br />
*[http://klear.org Project page]<br />
<br />
===Xine===<br />
Copy your channel file to {{Filename|~/.xine/channels.conf}}.<br />
<br />
Watch a specific channel with following command:<br />
$ xine dvb://[channel]<br />
<br />
or use the playlist editor in Xine<br />
<br />
==Additional Resources==<br />
<br />
===TV Cards in general===<br />
*[http://wiki.ubuntuusers.de/TV-Karten Ubuntuusers.de-Wiki] (german)<br />
<br />
===Pinnacle Cards===<br />
*[http://pinnaclefanboard.com/ PinnacleFanBoard] (german, but you can ask in english as well)</div>Markg85https://wiki.archlinux.org/index.php?title=Udev&diff=118520Udev2010-10-02T14:56:31Z<p>Markg85: /* UDisks */</p>
<hr />
<div>[[Category:Hardware detection and troubleshooting (English)]]<br />
[[Category:HOWTOs (English)]]<br />
[[Category:Auto-mounting (English)]]<br />
{{i18n|Udev}}<br />
<br />
== Introduction ==<br />
''"udev is the device manager for the Linux 2.6 kernel series. Primarily, it manages device nodes in {{Filename|/dev}}. It is the successor of devfs and hotplug, which means that it handles the {{Filename|/dev}} directory and all user space actions when adding/removing devices, including firmware load."'' Source: [http://en.wikipedia.org/wiki/Udev Wikipedia]<br />
<br />
udev replaces the functionality of both {{Codeline|hotplug}} and {{Codeline|hwdetect}}.<br />
<br />
udev loads kernel modules by utilizing coding parallelism to provide a potential performance advantage versus loading these modules serially. The modules are therefore loaded asynchronously. The inherent disadvantage of this method is that udev does not always load modules in the same order on each boot. If the machine has multiple block devices, this may manifest itself in the form of device nodes changing designations randomly. For example, if the machine has two hard drives, /dev/sda may randomly become /dev/sdb. See below for more info on this.<br />
<br />
==About modules auto-loading==<br />
udev will not do ''any'' module loading for you unless {{Codeline|MOD_AUTOLOAD}} is enabled in {{Filename|/etc/rc.conf}}. If you disable auto-loading you must manually load the modules you want/need by putting the list in the {{Codeline|MODULES}} array in {{Filename|[[rc.conf]]}}, you can generate this list with the {{Codeline|hwdetect --modules}} command.<br />
<br />
==About udev rules==<br />
udev rules go in {{Filename|/etc/udev/rules.d/}}, their file name has to end with {{Filename|.rules}}.<br />
<br />
If you want to learn how to write udev rules see [http://www.reactivated.net/writing_udev_rules.html Writing udev rules].<br />
<br />
To get a list of all the attributes of a device you can use to write rules:<br />
# udevadm info -a -p $(udevadm info -q path -n [device name])<br />
<br />
Replace [device name] with the device present in the system, such as '/dev/sda' or '/dev/ttyUSB0'.<br />
<br />
To restart the udev system once you create or modify udev rules, run the following command. Hotpluggable devices, such as USB devices, will probably have to be reconnected for the new rules to take effect.<br />
# udevadm control restart<br />
<br />
== Tips & Tricks ==<br />
=== UDisks ===<br />
Simply install UDisks:<br />
pacman -S udisks<br />
and all your media should be auto mounted in gnome and KDE SC 4.6. No need for any additional rules this way.<br />
As an extra bonus you can remove hal if you where only using that for auto mounting purposes.<br />
<br />
=== Auto mounting USB devices ===<br />
{{Note|In the following rules the mount options are defined as {{Codeline|<nowiki>ENV{mount_options}="relatime"</nowiki>}}, see {{Codeline|man mount}} (and possibly {{Codeline|man ntfs-3g}}) for all available options and [[Maximizing Performance#Mount options]] for performance-related options.}}<br />
{{Note|The {{Codeline|users}} mount option will '''not''' allow users to unmount the filesystem.}}<br />
{{Tip|The {{Codeline|noexec}} mount option prevents execution of binaries on the mounted filesystem.}}<br />
<br />
==== Mount under {{Filename|/media}}; use partition label if present ====<br />
The following udev rule set automatically mounts devices/partitions that are represented by /dev/sd* (USB drives, external hard drives and sometimes SD cards). If a partition label is available, it mounts the device to /media/<label> and otherwise to /media/usbhd-sd* (ex: /media/usbhd-sdb1):<br />
{{File|name=/etc/udev/rules.d/11-media-by-label-auto-mount.rules|content=<nowiki><br />
KERNEL!="sd[a-z][0-9]", GOTO="media_by_label_auto_mount_end"<br />
<br />
# Import FS infos<br />
IMPORT{program}="/sbin/blkid -o udev -p %N"<br />
<br />
# Get a label if present, otherwise specify one<br />
ENV{ID_FS_LABEL}!="", ENV{dir_name}="%E{ID_FS_LABEL}"<br />
ENV{ID_FS_LABEL}=="", ENV{dir_name}="usbhd-%k"<br />
<br />
# Global mount options<br />
ACTION=="add", ENV{mount_options}="relatime"<br />
# Filesystem-specific mount options<br />
ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs", ENV{mount_options}="$env{mount_options},utf8,gid=100,umask=002"<br />
<br />
# Mount the device<br />
ACTION=="add", RUN+="/bin/mkdir -p /media/%E{dir_name}", RUN+="/bin/mount -o $env{mount_options} /dev/%k /media/%E{dir_name}"<br />
<br />
# Clean up after removal<br />
ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/umount -l /media/%E{dir_name}", RUN+="/bin/rmdir /media/%E{dir_name}"<br />
<br />
# Exit<br />
LABEL="media_by_label_auto_mount_end"<br />
</nowiki>}}<br />
<br />
==== Mount under {{Filename|/media}}; use partition label if present; support LUKS encryption ====<br />
Similar to the above rule set, but if the device is a LUKS-encrypted partition it will open an xterm window to ask for the passphrase (provided that xterm is installed). Also see [http://bbs.archlinux.org/viewtopic.php?pid=696239#p696239 this post] and the follow-ups.<br />
<br />
{{Note|You may need to modify the path to cryptsetup, depending on the version installed (e.g., < 1.1.1_rc2-1).}}<br />
<br />
{{File|name=/etc/udev/rules.d/11-media-by-label-auto-mount.rules|content=<nowiki><br />
KERNEL!="sd[a-z]*", GOTO="media_by_label_auto_mount_end"<br />
ACTION=="add", PROGRAM!="/sbin/blkid %N", GOTO="media_by_label_auto_mount_end"<br />
<br />
# Do not mount devices on boot because otherwise fsck may fail<br />
ACTION=="add", PROGRAM!="/bin/grep ' / / rw[, ]' /proc/self/mountinfo", GOTO="media_by_label_auto_mount_end"<br />
<br />
# Open LUKS partition if necessary<br />
PROGRAM=="/sbin/blkid -o value -s TYPE %N", RESULT=="crypto_LUKS", ENV{crypto}="mapper/", ENV{device}="/dev/mapper/%k"<br />
ENV{crypto}=="", ENV{device}="%N"<br />
ACTION=="add", ENV{crypto}!="", PROGRAM=="/usr/bin/xterm -display :0.0 -e 'echo Password for /dev/%k; /sbin/cryptsetup luksOpen %N %k'"<br />
ACTION=="add", ENV{crypto}!="", TEST!="/dev/mapper/%k", GOTO="media_by_label_auto_mount_end"<br />
<br />
# Global mount options<br />
ACTION=="add", ENV{mount_options}="noatime"<br />
# Filesystem-specific mount options<br />
ACTION=="add", PROGRAM=="/sbin/blkid -o value -s TYPE %E{device}", RESULT=="vfat|ntfs", ENV{mount_options}="%E{mount_options},utf8,gid=100,umask=002"<br />
<br />
# Get label if present, otherwise assign one<br />
PROGRAM=="/sbin/blkid -o value -s LABEL %E{device}", ENV{dir_name}="%c"<br />
# Use basename to correctly handle labels such as ../mnt/foo<br />
PROGRAM=="/usr/bin/basename '%E{dir_name}'", ENV{dir_name}="%c"<br />
ENV{dir_name}=="", ENV{dir_name}="usbhd-%k"<br />
<br />
# Mount the device<br />
ACTION=="add", ENV{dir_name}!="", RUN+="/bin/mkdir -p '/media/%E{dir_name}'", RUN+="/bin/mount -o %E{mount_options} /dev/%E{crypto}%k '/media/%E{dir_name}'"<br />
<br />
# Clean up after removal<br />
ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/umount -l '/media/%E{dir_name}'"<br />
ACTION=="remove", ENV{crypto}!="", RUN+="/sbin/cryptsetup luksClose %k"<br />
ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/rmdir '/media/%E{dir_name}'"<br />
<br />
# Exit<br />
LABEL="media_by_label_auto_mount_end"<br />
</nowiki>}}<br />
<br />
==== Mount under {{Filename|/media}}; use partition label if present; support user un-mounting ====<br />
This is a variation on the above rule set. It uses pmount (which will need to be installed) instead of mount, allowing a non-root user to unmount udev-mounted devices. The required username must be hard-coded in the RUN command, so this rule set may not be suitable for multi-user systems. LUKS support has also been removed from the example, but can be easily reinstated as above. You must edit the /bin/su invocation to run as the correct user for your system.<br />
{{File|name=/etc/udev/rules.d/11-media-by-label-with-pmount.rules|content=<nowiki><br />
KERNEL!="sd[a-z]*", GOTO="media_by_label_auto_mount_end"<br />
ACTION=="add", PROGRAM!="/sbin/blkid %N", GOTO="media_by_label_auto_mount_end"<br />
<br />
# Get label<br />
PROGRAM=="/sbin/blkid -o value -s LABEL %N", ENV{dir_name}="%c"<br />
# use basename to correctly handle labels such as ../mnt/foo<br />
PROGRAM=="/usr/bin/basename '%E{dir_name}'", ENV{dir_name}="%c"<br />
ENV{dir_name}=="", ENV{dir_name}="usbhd-%k"<br />
<br />
ACTION=="add", ENV{dir_name}!="", RUN+="/bin/su tomk -c '/usr/bin/pmount %N %E{dir_name}'"<br />
ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/su tomk -c '/usr/bin/pumount /media/%E{dir_name}'"<br />
LABEL="media_by_label_auto_mount_end"<br />
</nowiki>}}<br />
<br />
==== Mount under {{Filename|/mnt}}; create symbolic link under {{Filename|/media}} ====<br />
The following rule set does not make use of partition labels; instead it mounts devices as usbhd-sdXY under the /mnt directory (ex: /mnt/usbhd-sdb1) and creates a symbolic link under /media.<br />
{{File|name=/etc/udev/rules.d/11-mnt-auto-mount.rules|content=<nowiki><br />
KERNEL!="sd[a-z][0-9]", GOTO="mnt_auto_mount_end"<br />
<br />
# Global mount options<br />
ACTION=="add", ENV{mount_options}="relatime"<br />
# Filesystem-specific mount options<br />
ACTION=="add", IMPORT{program}="/sbin/blkid -o udev -p %N"<br />
ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs", ENV{mount_options}="$env{mount_options},utf8,gid=100,umask=002"<br />
<br />
# Mount under /mnt and create the symbolic link in /media <br />
ACTION=="add", RUN+="/bin/mount -o $env{mount_options} /dev/%k /mnt/usbhd-%k", RUN+="/bin/ln -s /mnt/usbhd-%k /media/usbhd-%k"<br />
<br />
# Clean up after removal<br />
ACTION=="remove", RUN+="/bin/rm -f /media/usbhd-%k", RUN+="/bin/umount -l /mnt/usbhd-%k", RUN+="/bin/rmdir /mnt/usbhd-%k"<br />
<br />
# Exit<br />
LABEL="mnt_auto_mount_end"<br />
</nowiki>}}<br />
<br />
==== Mount under {{Filename|/media}} ''only'' if the partition has a label ====<br />
{{File|name=/etc/udev/rules.d/11-media-by-label-only-auto-mount.rules|content=<nowiki><br />
KERNEL!="sd[a-z][0-9]", GOTO="media_by_label_only_auto_mount_end"<br />
<br />
# Import FS infos<br />
IMPORT{program}="/sbin/blkid -o udev -p %N"<br />
ENV{ID_FS_LABEL}=="", GOTO="media_by_label_only_auto_mount_end"<br />
<br />
# Global mount options<br />
ACTION=="add", ENV{mount_options}="relatime"<br />
# Filesystem-specific mount options<br />
ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs", ENV{mount_options}="$env{mount_options},utf8,gid=100,umask=002"<br />
<br />
# Mount the device<br />
ACTION=="add", RUN+="/bin/mkdir -p /media/$env{ID_FS_LABEL}", RUN+="/bin/mount -o $env{mount_options} /dev/%k /media/$env{ID_FS_LABEL}"<br />
<br />
# Clean up after removal<br />
ACTION=="remove", ENV{ID_FS_LABEL}!="", RUN+="/bin/umount -l /media/$env{ID_FS_LABEL}", RUN+="/bin/rmdir /media/$env{ID_FS_LABEL}"<br />
<br />
# Exit<br />
LABEL="media_by_label_only_auto_mount_end"<br />
</nowiki>}}<br />
<br />
==== Mount under {{Filename|/media}}; use partition label if present; ntfs-3g ====<br />
Yet another example, this time making use of ntfs-3g read/write drivers for NTFS filesystems:<br />
<br />
{{File|name=/etc/udev/rules.d/10-my-media-automount.rules|content=<nowiki><br />
# vim:enc=utf-8:nu:ai:si:et:ts=4:sw=4:ft=udevrules:<br />
#<br />
# /etc/udev/rules.d/10-my-media-automount.rules<br />
<br />
# start at sdb to ignore the system hard drive<br />
KERNEL!="sd[b-z]*", GOTO="my_media_automount_end"<br />
ACTION=="add", PROGRAM!="/sbin/blkid %N", GOTO="my_media_automount_end"<br />
<br />
# import some useful filesystem info as variables<br />
IMPORT{program}="/sbin/blkid -o udev -p %N"<br />
<br />
# get the label if present, otherwise assign one based on device/partition<br />
ENV{ID_FS_LABEL}!="", ENV{dir_name}="%E{ID_FS_LABEL}"<br />
ENV{ID_FS_LABEL}=="", ENV{dir_name}="usbhd-%k"<br />
<br />
# create the dir in /media and symlink it to /mnt<br />
ACTION=="add", RUN+="/bin/mkdir -p '/media/%E{dir_name}'"<br />
<br />
# global mount options<br />
ACTION=="add", ENV{mount_options}="relatime"<br />
# filesystem-specific mount options (777/666 dir/file perms for ntfs/vfat) <br />
ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs", ENV{mount_options}="$env{mount_options},gid=100,dmask=000,fmask=111,utf8"<br />
<br />
# automount ntfs filesystems using ntfs-3g driver<br />
ACTION=="add", ENV{ID_FS_TYPE}=="ntfs", RUN+="/bin/mount -t ntfs-3g -o %E{mount_options} /dev/%k '/media/%E{dir_name}'"<br />
# automount all other filesystems<br />
ACTION=="add", ENV{ID_FS_TYPE}!="ntfs", RUN+="/bin/mount -t auto -o %E{mount_options} /dev/%k '/media/%E{dir_name}'"<br />
<br />
# clean up after device removal<br />
ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/umount -l '/media/%E{dir_name}'", RUN+="/bin/rmdir '/media/%E{dir_name}'"<br />
<br />
# exit<br />
LABEL="my_media_automount_end"<br />
<br />
</nowiki>}}<br />
<br />
==== Mount SD cards ====<br />
The same rules as above can be used to auto-mount SD cards, you just need to replace {{Codeline|sd[a-z][0-9]}} by {{Codeline|mmcblk[0-9]p[0-9]}}:<br />
{{File|name=/etc/udev/rules.d/11-sd-cards-auto-mount.rules|content=<nowiki><br />
KERNEL!="mmcblk[0-9]p[0-9]", GOTO="sd_cards_auto_mount_end"<br />
<br />
# Global mount options<br />
ACTION=="add", ENV{mount_options}="relatime"<br />
# Filesystem specific options<br />
ACTION=="add", IMPORT{program}="/sbin/blkid -o udev -p %N"<br />
ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs", ENV{mount_options}="$env{mount_options},utf8,gid=100,umask=002"<br />
<br />
ACTION=="add", RUN+="/bin/mkdir -p /media/sd-%k", RUN+="/bin/ln -s /media/sd-%k /mnt/sd-%k", RUN+="/bin/mount -o $env{mount_options} /dev/%k /media/sd-%k"<br />
ACTION=="remove", RUN+="/bin/umount -l /media/sd-%k", RUN+="/bin/rmdir /media/sd-%k"<br />
LABEL="sd_cards_auto_mount_end"<br />
</nowiki>}}<br />
<br />
==== Mount CDs ====<br />
{{Note|This does not work. Udev sends a "DeviceChanged" signal, not "Add" or "DeviceAdded", when a disc is inserted. See [[https://bbs.archlinux.org/viewtopic.php?pid=807780#p807780 here]].}}<br />
{{File|name=/etc/udev/rules.d/11-discs-auto-mount.rules|content=<nowiki><br />
KERNEL!="sr[0-9]*", GOTO="disc_by_label_auto_mount_end"<br />
<br />
# Import FS infos<br />
IMPORT{program}="/sbin/blkid -o udev -p %N"<br />
<br />
# Get a label if present, otherwise specify one<br />
ENV{ID_FS_LABEL}!="", ENV{dir_name}="%E{ID_FS_LABEL}"<br />
ENV{ID_FS_LABEL}=="", ENV{dir_name}="%k"<br />
<br />
# Mount the device<br />
ACTION=="add", RUN+="/bin/mkdir -p /media/%E{dir_name}", RUN+="/bin/mount /dev/%k /media/%E{dir_name}"<br />
ACTION=="add", RUN+="/bin/ln -s /media/%E{dir_name} /media/disc"<br />
<br />
# Clean up after removal<br />
ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/umount -l /media/%E{dir_name}", RUN+="/bin/rmdir /media/%E{dir_name}"<br />
<br />
# Exit<br />
LABEL="disc_by_label_auto_mount_end"<br />
</nowiki>}}<br />
<br />
==== Accessing Firmware Programmers and USB Virtual Comm Devices ====<br />
The following ruleset will allow normal users (within the "users" group) the ability to access the [http://www.ladyada.net/make/usbtinyisp/ USBtinyISP] USB programmer for AVR microcontrollers and a generic (SiLabs [http://www.silabs.com/products/interface/usbtouart CP2102]) USB to UART adapter. Adjust the permissions accordingly. Verified as of 2010-02-11.<br />
<br />
{{File|name=/etc/udev/rules.d/50-embedded_devices.rules|content=<nowiki><br />
# USBtinyISP Programmer rules<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1781", ATTRS{idProduct}=="0c9f", GROUP="users", MODE="0666"<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="0479", GROUP="users", MODE="0666"<br />
<br />
# Mdfly.com Generic (SiLabs CP2102) 3.3v/5v USB VComm adapter<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", GROUP="users", MODE="0666"<br />
</nowiki>}}<br />
<br />
=== Speed Up udev ===<br />
<br />
Performance gains can be realized by bypassing the blacklisting logic present in the {{Filename|/lib/udev/load-modules.sh}} script. See [[Speed_Up_udev]] for additional details.<br />
<br />
==Troubleshooting==<br />
=== Disabling modules auto-loading with the load_modules boot parameter ===<br />
If you pass {{Codeline|<nowiki>load_modules=off</nowiki>}} on your kernel boot line, then udev will skip all the auto-loading business. This is to provide you with a big ripcord to pull if something goes wrong. If udev loads a problematic module that hangs your system or something equally awful, then you can bypass auto-loading with this parameter, then go in and blacklist the offensive module(s).<br />
<br />
=== Blacklisting Modules ===<br />
In rare cases, Udev can make mistakes and load the wrong modules. To prevent it from doing this, you can blacklist modules. Once blacklisted, udev will never load that module. Not at boot-time ''or'' later on when a hotplug event is received (eg, you plug in your USB flash drive).<br />
<br />
To blacklist a module, just prefix it with a bang (!) in your {{Codeline|MODULES}} array in {{Filename|[[rc.conf]]}}:<br />
MODULES=(!moduleA !moduleB)<br />
<br />
=== Known Problems with Hardware ===<br />
====BusLogic devices can be broken and will cause a freeze during startup====<br />
This is a kernel bug and no fix has been provided yet.<br />
====PCMCIA Card readers are not treated as removable devices====<br />
To get access to them with hal's pmount backend add them to {{Filename|/etc/pmount.allow}}<br />
<br />
=== Known Problems with Auto-Loading ===<br />
==== CPU frequency modules ====<br />
The current detection method for the various CPU frequency controllers is inadequate, so this has been omitted from the auto-loading process for the time being. To use CPU frequency scaling, load the proper module explicitly in your {{Codeline|MODULES}} array in {{Filename|[[rc.conf]]}}.<br />
<br />
==== Sound Problems or Some Modules Not Loaded Automatically ====<br />
Some users have traced this problem to old entries in {{Codeline|/etc/modprobe.conf}}. Try cleaning that file out and trying again.<br />
<br />
==== Mixed Up Devices, Sound/Network Cards Changing Order Each Boot ====<br />
Because udev loads all modules asynchronously, they are initialized in a different order. This can result in devices randomly switching names. For example, with two network cards, you may notice a switching of designations between {{Codeline|eth0}} and {{Codeline|eth1}}.<br />
<br />
Arch Linux provides the advantage of specifying the module load order by listing the modules in the {{Codeline|MODULES}} array in {{Filename|[[rc.conf]]}}. Modules in this array are loaded before udev begins auto-loading, so you have full control over the load order.<br />
<br />
# Always load 8139too before e100<br />
MODULES=(8139too e100)<br />
<br />
<br />
Another method for network card ordering is to use the udev-sanctioned method of statically-naming each interface. Create the following file to bind the MAC address of each of your cards to a certain interface name:<br />
{{File|name=/etc/udev/rules.d/10-network.rules|content=<nowiki><br />
SUBSYSTEM=="net", ATTR{address}=="aa:bb:cc:dd:ee:ff", NAME="lan0"<br />
SUBSYSTEM=="net", ATTR{address}=="ff:ee:dd:cc:bb:aa", NAME="wlan0"<br />
</nowiki>}}<br />
<br />
A couple things to note:<br />
* To get the MAC address of each card, use this command: {{Codeline|<nowiki>udevadm info -a -p /sys/class/net/<yourdevice> | grep address | tr [A-Z] [a-z]</nowiki>}}<br />
* Make sure to use the lower-case hex values in your udev rules. It doesn't like upper-case.<br />
* Some people have problems naming their interfaces after the old style: eth0, eth1, etc. Try something like "lan" or "wlan" if you experience this problem.<br />
<br />
Don't forget to update your {{Filename|/etc/rc.conf}} and other configuration files using the old ethX notation!<br />
<br />
<br />
Another method for setting network interface names is described in the Configuring Network wiki entry.<br />
http://wiki.archlinux.org/index.php/Configuring_Network<br/><br />
http://wiki.archlinux.org/index.php/Configuring_Network#Interface_names_varying<br />
<br />
=== Known Problems for Custom Kernel Users ===<br />
==== Udev doesn't start at all ====<br />
Make sure you have a kernel version later than or equal to 2.6.15. Earlier kernels do not have the necessary uevent stuff that udev needs for auto-loading.<br />
<br />
==== CD/DVD symlinks and permissions are broken ====<br />
If you're using a 2.6.15 kernel, you'll need the uevent patch from ABS (which backports certain uevent functionality from 2.6.16). Just sync up your ABS tree with the {{Codeline|abs}} command, then you'll find the patch in {{Codeline|/var/abs/kernels/kernel26/}}.<br />
<br />
==Other Resources==<br />
* [http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html Udev Homepage]<br />
* [http://www.linux.com/news/hardware/peripherals/180950-udev An Introduction to Udev]<br />
* [http://vger.kernel.org/vger-lists.html#linux-hotplug Udev mailing list information]</div>Markg85https://wiki.archlinux.org/index.php?title=Udev&diff=118519Udev2010-10-02T14:55:35Z<p>Markg85: /* Tips & Tricks */</p>
<hr />
<div>[[Category:Hardware detection and troubleshooting (English)]]<br />
[[Category:HOWTOs (English)]]<br />
[[Category:Auto-mounting (English)]]<br />
{{i18n|Udev}}<br />
<br />
== Introduction ==<br />
''"udev is the device manager for the Linux 2.6 kernel series. Primarily, it manages device nodes in {{Filename|/dev}}. It is the successor of devfs and hotplug, which means that it handles the {{Filename|/dev}} directory and all user space actions when adding/removing devices, including firmware load."'' Source: [http://en.wikipedia.org/wiki/Udev Wikipedia]<br />
<br />
udev replaces the functionality of both {{Codeline|hotplug}} and {{Codeline|hwdetect}}.<br />
<br />
udev loads kernel modules by utilizing coding parallelism to provide a potential performance advantage versus loading these modules serially. The modules are therefore loaded asynchronously. The inherent disadvantage of this method is that udev does not always load modules in the same order on each boot. If the machine has multiple block devices, this may manifest itself in the form of device nodes changing designations randomly. For example, if the machine has two hard drives, /dev/sda may randomly become /dev/sdb. See below for more info on this.<br />
<br />
==About modules auto-loading==<br />
udev will not do ''any'' module loading for you unless {{Codeline|MOD_AUTOLOAD}} is enabled in {{Filename|/etc/rc.conf}}. If you disable auto-loading you must manually load the modules you want/need by putting the list in the {{Codeline|MODULES}} array in {{Filename|[[rc.conf]]}}, you can generate this list with the {{Codeline|hwdetect --modules}} command.<br />
<br />
==About udev rules==<br />
udev rules go in {{Filename|/etc/udev/rules.d/}}, their file name has to end with {{Filename|.rules}}.<br />
<br />
If you want to learn how to write udev rules see [http://www.reactivated.net/writing_udev_rules.html Writing udev rules].<br />
<br />
To get a list of all the attributes of a device you can use to write rules:<br />
# udevadm info -a -p $(udevadm info -q path -n [device name])<br />
<br />
Replace [device name] with the device present in the system, such as '/dev/sda' or '/dev/ttyUSB0'.<br />
<br />
To restart the udev system once you create or modify udev rules, run the following command. Hotpluggable devices, such as USB devices, will probably have to be reconnected for the new rules to take effect.<br />
# udevadm control restart<br />
<br />
== Tips & Tricks ==<br />
=== UDisks ===<br />
Simply install UDisks:<br />
pacman -S udisks<br />
and all your media should be auto mounted in gnome and KDE SC 4.6. No need for any additional rules this way.<br />
As an extra bonus you can remove hal if you where anly using that for auto mounting purposes.<br />
=== Auto mounting USB devices ===<br />
{{Note|In the following rules the mount options are defined as {{Codeline|<nowiki>ENV{mount_options}="relatime"</nowiki>}}, see {{Codeline|man mount}} (and possibly {{Codeline|man ntfs-3g}}) for all available options and [[Maximizing Performance#Mount options]] for performance-related options.}}<br />
{{Note|The {{Codeline|users}} mount option will '''not''' allow users to unmount the filesystem.}}<br />
{{Tip|The {{Codeline|noexec}} mount option prevents execution of binaries on the mounted filesystem.}}<br />
<br />
==== Mount under {{Filename|/media}}; use partition label if present ====<br />
The following udev rule set automatically mounts devices/partitions that are represented by /dev/sd* (USB drives, external hard drives and sometimes SD cards). If a partition label is available, it mounts the device to /media/<label> and otherwise to /media/usbhd-sd* (ex: /media/usbhd-sdb1):<br />
{{File|name=/etc/udev/rules.d/11-media-by-label-auto-mount.rules|content=<nowiki><br />
KERNEL!="sd[a-z][0-9]", GOTO="media_by_label_auto_mount_end"<br />
<br />
# Import FS infos<br />
IMPORT{program}="/sbin/blkid -o udev -p %N"<br />
<br />
# Get a label if present, otherwise specify one<br />
ENV{ID_FS_LABEL}!="", ENV{dir_name}="%E{ID_FS_LABEL}"<br />
ENV{ID_FS_LABEL}=="", ENV{dir_name}="usbhd-%k"<br />
<br />
# Global mount options<br />
ACTION=="add", ENV{mount_options}="relatime"<br />
# Filesystem-specific mount options<br />
ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs", ENV{mount_options}="$env{mount_options},utf8,gid=100,umask=002"<br />
<br />
# Mount the device<br />
ACTION=="add", RUN+="/bin/mkdir -p /media/%E{dir_name}", RUN+="/bin/mount -o $env{mount_options} /dev/%k /media/%E{dir_name}"<br />
<br />
# Clean up after removal<br />
ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/umount -l /media/%E{dir_name}", RUN+="/bin/rmdir /media/%E{dir_name}"<br />
<br />
# Exit<br />
LABEL="media_by_label_auto_mount_end"<br />
</nowiki>}}<br />
<br />
==== Mount under {{Filename|/media}}; use partition label if present; support LUKS encryption ====<br />
Similar to the above rule set, but if the device is a LUKS-encrypted partition it will open an xterm window to ask for the passphrase (provided that xterm is installed). Also see [http://bbs.archlinux.org/viewtopic.php?pid=696239#p696239 this post] and the follow-ups.<br />
<br />
{{Note|You may need to modify the path to cryptsetup, depending on the version installed (e.g., < 1.1.1_rc2-1).}}<br />
<br />
{{File|name=/etc/udev/rules.d/11-media-by-label-auto-mount.rules|content=<nowiki><br />
KERNEL!="sd[a-z]*", GOTO="media_by_label_auto_mount_end"<br />
ACTION=="add", PROGRAM!="/sbin/blkid %N", GOTO="media_by_label_auto_mount_end"<br />
<br />
# Do not mount devices on boot because otherwise fsck may fail<br />
ACTION=="add", PROGRAM!="/bin/grep ' / / rw[, ]' /proc/self/mountinfo", GOTO="media_by_label_auto_mount_end"<br />
<br />
# Open LUKS partition if necessary<br />
PROGRAM=="/sbin/blkid -o value -s TYPE %N", RESULT=="crypto_LUKS", ENV{crypto}="mapper/", ENV{device}="/dev/mapper/%k"<br />
ENV{crypto}=="", ENV{device}="%N"<br />
ACTION=="add", ENV{crypto}!="", PROGRAM=="/usr/bin/xterm -display :0.0 -e 'echo Password for /dev/%k; /sbin/cryptsetup luksOpen %N %k'"<br />
ACTION=="add", ENV{crypto}!="", TEST!="/dev/mapper/%k", GOTO="media_by_label_auto_mount_end"<br />
<br />
# Global mount options<br />
ACTION=="add", ENV{mount_options}="noatime"<br />
# Filesystem-specific mount options<br />
ACTION=="add", PROGRAM=="/sbin/blkid -o value -s TYPE %E{device}", RESULT=="vfat|ntfs", ENV{mount_options}="%E{mount_options},utf8,gid=100,umask=002"<br />
<br />
# Get label if present, otherwise assign one<br />
PROGRAM=="/sbin/blkid -o value -s LABEL %E{device}", ENV{dir_name}="%c"<br />
# Use basename to correctly handle labels such as ../mnt/foo<br />
PROGRAM=="/usr/bin/basename '%E{dir_name}'", ENV{dir_name}="%c"<br />
ENV{dir_name}=="", ENV{dir_name}="usbhd-%k"<br />
<br />
# Mount the device<br />
ACTION=="add", ENV{dir_name}!="", RUN+="/bin/mkdir -p '/media/%E{dir_name}'", RUN+="/bin/mount -o %E{mount_options} /dev/%E{crypto}%k '/media/%E{dir_name}'"<br />
<br />
# Clean up after removal<br />
ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/umount -l '/media/%E{dir_name}'"<br />
ACTION=="remove", ENV{crypto}!="", RUN+="/sbin/cryptsetup luksClose %k"<br />
ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/rmdir '/media/%E{dir_name}'"<br />
<br />
# Exit<br />
LABEL="media_by_label_auto_mount_end"<br />
</nowiki>}}<br />
<br />
==== Mount under {{Filename|/media}}; use partition label if present; support user un-mounting ====<br />
This is a variation on the above rule set. It uses pmount (which will need to be installed) instead of mount, allowing a non-root user to unmount udev-mounted devices. The required username must be hard-coded in the RUN command, so this rule set may not be suitable for multi-user systems. LUKS support has also been removed from the example, but can be easily reinstated as above. You must edit the /bin/su invocation to run as the correct user for your system.<br />
{{File|name=/etc/udev/rules.d/11-media-by-label-with-pmount.rules|content=<nowiki><br />
KERNEL!="sd[a-z]*", GOTO="media_by_label_auto_mount_end"<br />
ACTION=="add", PROGRAM!="/sbin/blkid %N", GOTO="media_by_label_auto_mount_end"<br />
<br />
# Get label<br />
PROGRAM=="/sbin/blkid -o value -s LABEL %N", ENV{dir_name}="%c"<br />
# use basename to correctly handle labels such as ../mnt/foo<br />
PROGRAM=="/usr/bin/basename '%E{dir_name}'", ENV{dir_name}="%c"<br />
ENV{dir_name}=="", ENV{dir_name}="usbhd-%k"<br />
<br />
ACTION=="add", ENV{dir_name}!="", RUN+="/bin/su tomk -c '/usr/bin/pmount %N %E{dir_name}'"<br />
ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/su tomk -c '/usr/bin/pumount /media/%E{dir_name}'"<br />
LABEL="media_by_label_auto_mount_end"<br />
</nowiki>}}<br />
<br />
==== Mount under {{Filename|/mnt}}; create symbolic link under {{Filename|/media}} ====<br />
The following rule set does not make use of partition labels; instead it mounts devices as usbhd-sdXY under the /mnt directory (ex: /mnt/usbhd-sdb1) and creates a symbolic link under /media.<br />
{{File|name=/etc/udev/rules.d/11-mnt-auto-mount.rules|content=<nowiki><br />
KERNEL!="sd[a-z][0-9]", GOTO="mnt_auto_mount_end"<br />
<br />
# Global mount options<br />
ACTION=="add", ENV{mount_options}="relatime"<br />
# Filesystem-specific mount options<br />
ACTION=="add", IMPORT{program}="/sbin/blkid -o udev -p %N"<br />
ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs", ENV{mount_options}="$env{mount_options},utf8,gid=100,umask=002"<br />
<br />
# Mount under /mnt and create the symbolic link in /media <br />
ACTION=="add", RUN+="/bin/mount -o $env{mount_options} /dev/%k /mnt/usbhd-%k", RUN+="/bin/ln -s /mnt/usbhd-%k /media/usbhd-%k"<br />
<br />
# Clean up after removal<br />
ACTION=="remove", RUN+="/bin/rm -f /media/usbhd-%k", RUN+="/bin/umount -l /mnt/usbhd-%k", RUN+="/bin/rmdir /mnt/usbhd-%k"<br />
<br />
# Exit<br />
LABEL="mnt_auto_mount_end"<br />
</nowiki>}}<br />
<br />
==== Mount under {{Filename|/media}} ''only'' if the partition has a label ====<br />
{{File|name=/etc/udev/rules.d/11-media-by-label-only-auto-mount.rules|content=<nowiki><br />
KERNEL!="sd[a-z][0-9]", GOTO="media_by_label_only_auto_mount_end"<br />
<br />
# Import FS infos<br />
IMPORT{program}="/sbin/blkid -o udev -p %N"<br />
ENV{ID_FS_LABEL}=="", GOTO="media_by_label_only_auto_mount_end"<br />
<br />
# Global mount options<br />
ACTION=="add", ENV{mount_options}="relatime"<br />
# Filesystem-specific mount options<br />
ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs", ENV{mount_options}="$env{mount_options},utf8,gid=100,umask=002"<br />
<br />
# Mount the device<br />
ACTION=="add", RUN+="/bin/mkdir -p /media/$env{ID_FS_LABEL}", RUN+="/bin/mount -o $env{mount_options} /dev/%k /media/$env{ID_FS_LABEL}"<br />
<br />
# Clean up after removal<br />
ACTION=="remove", ENV{ID_FS_LABEL}!="", RUN+="/bin/umount -l /media/$env{ID_FS_LABEL}", RUN+="/bin/rmdir /media/$env{ID_FS_LABEL}"<br />
<br />
# Exit<br />
LABEL="media_by_label_only_auto_mount_end"<br />
</nowiki>}}<br />
<br />
==== Mount under {{Filename|/media}}; use partition label if present; ntfs-3g ====<br />
Yet another example, this time making use of ntfs-3g read/write drivers for NTFS filesystems:<br />
<br />
{{File|name=/etc/udev/rules.d/10-my-media-automount.rules|content=<nowiki><br />
# vim:enc=utf-8:nu:ai:si:et:ts=4:sw=4:ft=udevrules:<br />
#<br />
# /etc/udev/rules.d/10-my-media-automount.rules<br />
<br />
# start at sdb to ignore the system hard drive<br />
KERNEL!="sd[b-z]*", GOTO="my_media_automount_end"<br />
ACTION=="add", PROGRAM!="/sbin/blkid %N", GOTO="my_media_automount_end"<br />
<br />
# import some useful filesystem info as variables<br />
IMPORT{program}="/sbin/blkid -o udev -p %N"<br />
<br />
# get the label if present, otherwise assign one based on device/partition<br />
ENV{ID_FS_LABEL}!="", ENV{dir_name}="%E{ID_FS_LABEL}"<br />
ENV{ID_FS_LABEL}=="", ENV{dir_name}="usbhd-%k"<br />
<br />
# create the dir in /media and symlink it to /mnt<br />
ACTION=="add", RUN+="/bin/mkdir -p '/media/%E{dir_name}'"<br />
<br />
# global mount options<br />
ACTION=="add", ENV{mount_options}="relatime"<br />
# filesystem-specific mount options (777/666 dir/file perms for ntfs/vfat) <br />
ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs", ENV{mount_options}="$env{mount_options},gid=100,dmask=000,fmask=111,utf8"<br />
<br />
# automount ntfs filesystems using ntfs-3g driver<br />
ACTION=="add", ENV{ID_FS_TYPE}=="ntfs", RUN+="/bin/mount -t ntfs-3g -o %E{mount_options} /dev/%k '/media/%E{dir_name}'"<br />
# automount all other filesystems<br />
ACTION=="add", ENV{ID_FS_TYPE}!="ntfs", RUN+="/bin/mount -t auto -o %E{mount_options} /dev/%k '/media/%E{dir_name}'"<br />
<br />
# clean up after device removal<br />
ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/umount -l '/media/%E{dir_name}'", RUN+="/bin/rmdir '/media/%E{dir_name}'"<br />
<br />
# exit<br />
LABEL="my_media_automount_end"<br />
<br />
</nowiki>}}<br />
<br />
==== Mount SD cards ====<br />
The same rules as above can be used to auto-mount SD cards, you just need to replace {{Codeline|sd[a-z][0-9]}} by {{Codeline|mmcblk[0-9]p[0-9]}}:<br />
{{File|name=/etc/udev/rules.d/11-sd-cards-auto-mount.rules|content=<nowiki><br />
KERNEL!="mmcblk[0-9]p[0-9]", GOTO="sd_cards_auto_mount_end"<br />
<br />
# Global mount options<br />
ACTION=="add", ENV{mount_options}="relatime"<br />
# Filesystem specific options<br />
ACTION=="add", IMPORT{program}="/sbin/blkid -o udev -p %N"<br />
ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs", ENV{mount_options}="$env{mount_options},utf8,gid=100,umask=002"<br />
<br />
ACTION=="add", RUN+="/bin/mkdir -p /media/sd-%k", RUN+="/bin/ln -s /media/sd-%k /mnt/sd-%k", RUN+="/bin/mount -o $env{mount_options} /dev/%k /media/sd-%k"<br />
ACTION=="remove", RUN+="/bin/umount -l /media/sd-%k", RUN+="/bin/rmdir /media/sd-%k"<br />
LABEL="sd_cards_auto_mount_end"<br />
</nowiki>}}<br />
<br />
==== Mount CDs ====<br />
{{Note|This does not work. Udev sends a "DeviceChanged" signal, not "Add" or "DeviceAdded", when a disc is inserted. See [[https://bbs.archlinux.org/viewtopic.php?pid=807780#p807780 here]].}}<br />
{{File|name=/etc/udev/rules.d/11-discs-auto-mount.rules|content=<nowiki><br />
KERNEL!="sr[0-9]*", GOTO="disc_by_label_auto_mount_end"<br />
<br />
# Import FS infos<br />
IMPORT{program}="/sbin/blkid -o udev -p %N"<br />
<br />
# Get a label if present, otherwise specify one<br />
ENV{ID_FS_LABEL}!="", ENV{dir_name}="%E{ID_FS_LABEL}"<br />
ENV{ID_FS_LABEL}=="", ENV{dir_name}="%k"<br />
<br />
# Mount the device<br />
ACTION=="add", RUN+="/bin/mkdir -p /media/%E{dir_name}", RUN+="/bin/mount /dev/%k /media/%E{dir_name}"<br />
ACTION=="add", RUN+="/bin/ln -s /media/%E{dir_name} /media/disc"<br />
<br />
# Clean up after removal<br />
ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/umount -l /media/%E{dir_name}", RUN+="/bin/rmdir /media/%E{dir_name}"<br />
<br />
# Exit<br />
LABEL="disc_by_label_auto_mount_end"<br />
</nowiki>}}<br />
<br />
==== Accessing Firmware Programmers and USB Virtual Comm Devices ====<br />
The following ruleset will allow normal users (within the "users" group) the ability to access the [http://www.ladyada.net/make/usbtinyisp/ USBtinyISP] USB programmer for AVR microcontrollers and a generic (SiLabs [http://www.silabs.com/products/interface/usbtouart CP2102]) USB to UART adapter. Adjust the permissions accordingly. Verified as of 2010-02-11.<br />
<br />
{{File|name=/etc/udev/rules.d/50-embedded_devices.rules|content=<nowiki><br />
# USBtinyISP Programmer rules<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1781", ATTRS{idProduct}=="0c9f", GROUP="users", MODE="0666"<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="0479", GROUP="users", MODE="0666"<br />
<br />
# Mdfly.com Generic (SiLabs CP2102) 3.3v/5v USB VComm adapter<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", GROUP="users", MODE="0666"<br />
</nowiki>}}<br />
<br />
=== Speed Up udev ===<br />
<br />
Performance gains can be realized by bypassing the blacklisting logic present in the {{Filename|/lib/udev/load-modules.sh}} script. See [[Speed_Up_udev]] for additional details.<br />
<br />
==Troubleshooting==<br />
=== Disabling modules auto-loading with the load_modules boot parameter ===<br />
If you pass {{Codeline|<nowiki>load_modules=off</nowiki>}} on your kernel boot line, then udev will skip all the auto-loading business. This is to provide you with a big ripcord to pull if something goes wrong. If udev loads a problematic module that hangs your system or something equally awful, then you can bypass auto-loading with this parameter, then go in and blacklist the offensive module(s).<br />
<br />
=== Blacklisting Modules ===<br />
In rare cases, Udev can make mistakes and load the wrong modules. To prevent it from doing this, you can blacklist modules. Once blacklisted, udev will never load that module. Not at boot-time ''or'' later on when a hotplug event is received (eg, you plug in your USB flash drive).<br />
<br />
To blacklist a module, just prefix it with a bang (!) in your {{Codeline|MODULES}} array in {{Filename|[[rc.conf]]}}:<br />
MODULES=(!moduleA !moduleB)<br />
<br />
=== Known Problems with Hardware ===<br />
====BusLogic devices can be broken and will cause a freeze during startup====<br />
This is a kernel bug and no fix has been provided yet.<br />
====PCMCIA Card readers are not treated as removable devices====<br />
To get access to them with hal's pmount backend add them to {{Filename|/etc/pmount.allow}}<br />
<br />
=== Known Problems with Auto-Loading ===<br />
==== CPU frequency modules ====<br />
The current detection method for the various CPU frequency controllers is inadequate, so this has been omitted from the auto-loading process for the time being. To use CPU frequency scaling, load the proper module explicitly in your {{Codeline|MODULES}} array in {{Filename|[[rc.conf]]}}.<br />
<br />
==== Sound Problems or Some Modules Not Loaded Automatically ====<br />
Some users have traced this problem to old entries in {{Codeline|/etc/modprobe.conf}}. Try cleaning that file out and trying again.<br />
<br />
==== Mixed Up Devices, Sound/Network Cards Changing Order Each Boot ====<br />
Because udev loads all modules asynchronously, they are initialized in a different order. This can result in devices randomly switching names. For example, with two network cards, you may notice a switching of designations between {{Codeline|eth0}} and {{Codeline|eth1}}.<br />
<br />
Arch Linux provides the advantage of specifying the module load order by listing the modules in the {{Codeline|MODULES}} array in {{Filename|[[rc.conf]]}}. Modules in this array are loaded before udev begins auto-loading, so you have full control over the load order.<br />
<br />
# Always load 8139too before e100<br />
MODULES=(8139too e100)<br />
<br />
<br />
Another method for network card ordering is to use the udev-sanctioned method of statically-naming each interface. Create the following file to bind the MAC address of each of your cards to a certain interface name:<br />
{{File|name=/etc/udev/rules.d/10-network.rules|content=<nowiki><br />
SUBSYSTEM=="net", ATTR{address}=="aa:bb:cc:dd:ee:ff", NAME="lan0"<br />
SUBSYSTEM=="net", ATTR{address}=="ff:ee:dd:cc:bb:aa", NAME="wlan0"<br />
</nowiki>}}<br />
<br />
A couple things to note:<br />
* To get the MAC address of each card, use this command: {{Codeline|<nowiki>udevadm info -a -p /sys/class/net/<yourdevice> | grep address | tr [A-Z] [a-z]</nowiki>}}<br />
* Make sure to use the lower-case hex values in your udev rules. It doesn't like upper-case.<br />
* Some people have problems naming their interfaces after the old style: eth0, eth1, etc. Try something like "lan" or "wlan" if you experience this problem.<br />
<br />
Don't forget to update your {{Filename|/etc/rc.conf}} and other configuration files using the old ethX notation!<br />
<br />
<br />
Another method for setting network interface names is described in the Configuring Network wiki entry.<br />
http://wiki.archlinux.org/index.php/Configuring_Network<br/><br />
http://wiki.archlinux.org/index.php/Configuring_Network#Interface_names_varying<br />
<br />
=== Known Problems for Custom Kernel Users ===<br />
==== Udev doesn't start at all ====<br />
Make sure you have a kernel version later than or equal to 2.6.15. Earlier kernels do not have the necessary uevent stuff that udev needs for auto-loading.<br />
<br />
==== CD/DVD symlinks and permissions are broken ====<br />
If you're using a 2.6.15 kernel, you'll need the uevent patch from ABS (which backports certain uevent functionality from 2.6.16). Just sync up your ABS tree with the {{Codeline|abs}} command, then you'll find the patch in {{Codeline|/var/abs/kernels/kernel26/}}.<br />
<br />
==Other Resources==<br />
* [http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html Udev Homepage]<br />
* [http://www.linux.com/news/hardware/peripherals/180950-udev An Introduction to Udev]<br />
* [http://vger.kernel.org/vger-lists.html#linux-hotplug Udev mailing list information]</div>Markg85https://wiki.archlinux.org/index.php?title=Talk:Font_configuration&diff=118488Talk:Font configuration2010-10-01T16:37:58Z<p>Markg85: /* Merge with Fonts */ new section</p>
<hr />
<div>== Suggestions ==<br />
<br />
Suggestions for edits to this page.<br />
<br />
=== xtt ===<br />
<br />
The word "xtt" is used at the beginning but not defined. I must admit that I'm unfamiliar with it. - [[User:KitchM|KitchM]] 10:29, 23 August 2009 (EDT)<br />
<br />
=== Softlinks ===<br />
They shouldn't be done in relation to {{Filename|/}}; i.e., {{Codeline|ln -s /dir/dir2/file file}}. These are dangerous when cleaning a chroot, or deleting a mounted file-system in general. [[User:Time|Time]] 21:31, 5 December 2009 (EST)<br />
<br />
And the seemingly superfluous {{Codeline|cd}} is added for ease of use with auto-complete. [[User:Time|Time]] 21:36, 5 December 2009 (EST)<br />
<br />
== Comments ==<br />
<br />
LlamaZorz, when making edits please consider other users. This section is about installing, not about special considerations for those that use the Gnome desktop. A couple things too about your edit: not everybody's monitor is 96 DPI, not everyone's screen is of type RGB, hintslight is usually preferable but not always. All three of these have already been mentioned in the article. Please read the entire article before adding content to help save on repetative content.<br />
<br />
--[[User:Gen2ly|Gen2ly]] 21:46, 14 December 2009 (EST)<br />
<br />
I cant see how that really matters, Ubuntu gives those settings no matter what the computer or monitor used. The point of the patch was to get fonts in Arch to look<br />
like that of Ubuntu. If you don't choose the settings I provided then you will never get fonts that look like that in Ubuntu. I am simply trying to fill in gaps in your documentation, which their are many and I mean many. Just because you mention a topic on one section, doesn't imply that you cant qualify it in another place. I stand by my submission. I am going to resubmit it.<br />
LlamaZorz<br />
<br />
: ''Just because you mention a topic on one section, doesn't imply that you cant qualify it in another place.''<br />
: From the heading [[Font_Configuration#LCD_filter_patched_packages]] and sub-heading [[Font_Configuration#Installation]] this section is about installing the LCD-patched packages. Putting configuration in this section does not fit in the form of this documentation and would divert most readers attention unnecessarily. If you look at [http://bbs.archlinux.org/viewtopic.php?pid=672924#p672924 this post] in the forums, Arch users use a variety of DE, DE-like setups. Though GNOME isn't high on the list, this guide isn't written with it's exclusion or any other, it is written inclusively and for almost all reasons doesn't doesn't need to be desktop biased.<br />
<br />
: ''... Ubuntu gives those settings no matter what the computer or monitor used.''<br />
: Actually this is GNOME that does this, except for the 'Rendering' and 'Smoothing' settings as LCD which by the last LTS release, Ubuntu hadn't modified. Perhaps this has changed by then but the argument is void because: 1) Matching a desktop environments Font Control Panel has already been mentioned [[Font_Configuration#Fontconfig_configuration|here]]; 2) Setting DPI, RGB, and hintslight have already been mentioned in this same section. Setting the correct DPI is critical to font hinting. If you follow the DPI link, read about how DPI effects font rendering and how 96 DPI was a previous standard that seldom gets used anymore.<br />
<br />
: ''The point of the patch was to get fonts in Arch to look like that of Ubuntu.''<br />
: Yes and no. By Ubuntu, I believe you might be referring to the GNOME desktop. The Ubuntu patches packages only differ slightly from the 'Original LCD' package and are actually built upon it with a few extra fontconfig configurations included. As to the direct correlation to the GNOME desktop there is none and will work for other desktops like XFCE, KDE...<br />
<br />
: ''I am simply trying to fill in gaps in your documentation, which their are many and I mean many.''<br />
: This statement I can't use LlamaZorz because it gives no references, details... What sections, descriptions are omitted? How does one section not describe the details you think that most users will need?<br />
<br />
: Going to revert to previous version. Please, give information and details if you believe that this information is a good idea to this article. Particularly: how it doesn't repeat information unnecessarily (DPI, RGB, hintslight, previous mention of Font Control Panel); and where you think it should be included.<br />
<br />
: --[[User:Gen2ly|Gen2ly]] 09:35, 16 December 2009 (EST)<br />
<br />
== Merge with Fonts ==<br />
<br />
Hi,<br />
<br />
Right now there are the pages: Fonts and Font_Configuration. Both try to explain the same thing and both have way different (and valuable) information. Both have the same goal: setting up your fonts so therefore i suggest to merge this "Font_Configuration" with "Fonts" and delete this "Font_Configuration" page.<br />
<br />
I guess people search on "fonts" first before searching on "font configuration".<br />
<br />
Regards,<br />
Mark</div>Markg85https://wiki.archlinux.org/index.php?title=Font_configuration&diff=118487Font configuration2010-10-01T16:35:01Z<p>Markg85: </p>
<hr />
<div>{{merge|Fonts}}<br />
[[Category:Font_Configuration (English)]]<br />
<br />
[[Category:X Server (English)]]<br />
[[Category:Fonts (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|Font Configuration}}<br />
{{Article summary start}}<br />
{{Article summary text|An overview of font configuration options and various techniques for improving the readability of fonts}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Fonts}}: Information on adding fonts and font recommendations<br />
{{Article summary wiki|Java Fonts - Sun JRE}}: Fonts specific to Sun's Java machine<br />
{{Article summary wiki|MS Fonts}}: Adding Microsoft fonts and mimicking Windows' font settings<br />
{{Article summary end}}<br />
<br />
== Font paths ==<br />
<br />
For fonts to be known to applications, they must be cataloged for easy and quick access. [[Wikipedia:Fontconfig|Fontconfig]] is a library designed to provide a list of available fonts to applications, and also for configuration for how fonts get rendered. Though fontconfig is the standard in today's Linux, some applications still rely on the original method of font categorization: the Xorg server configuration file ({{Filename|/etc/X11/xorg.conf}}).<br />
<br />
=== Fontconfig ===<br />
<br />
Fontconfig gathers all it's configurations in a central file ({{Filename|/etc/fonts/fonts.conf}}). Fontconfig-aware applications source this file to know available fonts and how they get rendered. This file is a conglomeration of rules from the various fontconfig configurations (the global configuration ({{Filename|/etc/fonts/local.conf}}), the configured presets in {{Filename|/etc/fonts/conf.d/}}, and the user configuration file ({{Filename|~/.fonts.conf}}).<br />
<br />
The font paths initially known to fontconfig are: {{Filename|/usr/share/fonts/}} and {{Filename|~/.fonts/}} (of which fontconfig will scan recursively). For ease of organization and installation, it is recommended to use these font paths when [[Fonts|installing new fonts]].<br />
<br />
To see a list of known fontconfig fonts in an easy to read format, type:<br />
<br />
fc-list | sed 's,:.*,,' | sort -u<br />
<br />
=== Xorg ===<br />
<br />
Check for Xorg's known font paths by reviewing its log:<br />
<br />
$ grep /fonts /var/log/Xorg.0.log<br />
<br />
Keep in mind that Xorg does not search recursively through the {{Filename|/usr/share/fonts}} directory like fontconfig does. To add a path, the full path must be used:<br />
<br />
<pre><br />
Section "Files"<br />
FontPath "/usr/share/fonts/example-font-directory"<br />
EndSection<br />
</pre><br />
<br />
To see a list of known Xorg fonts use {{Codeline|xlsfonts}}.<br />
<br />
== Fontconfig configuration ==<br />
<br />
The font rendering packages on Arch Linux includes support for ''freetype2'' with the bytecode interpreter (BCI) enabled. However, defining your own font configuration may at times be necessary. If you have an LCD monitor, consider additionally using the [[#LCD_filter_patched_packages|LCD filter packages]] for better readability. <br />
<br />
Configuration can be done either per-user through {{Filename|~/.fonts.conf}}, or globally with {{Filename|/etc/fonts/local.conf}}. The settings in the per-user configuration have precedence over the global configuration. Both these files use the same syntax. Remember not to edit the {{filename|/etc/fonts/fonts.conf}} file; it is a temporary file and shouldn't be edited since it's replaced during fontconfig updates.<br />
<br />
There are already a number of configured presets in the directory {{Filename|/etc/fonts/conf.avail}}. These presets can be linked to both per-user and globally for quicker configuration. Take note that these presets will override matching settings in their respective configuration files.<br />
<br />
For example, to enable sub-pixel RGB rendering globally:<br />
<br />
# cd /etc/fonts/conf.d<br />
# ln -s ../conf.avail/10-sub-pixel-rgb.conf<br />
<br />
To do the same but instead for a per-user configuration:<br />
<br />
$ mkdir ~/.fonts.conf.d<br />
$ ln -s /etc/fonts/conf.avail/10-sub-pixel-rgb.conf ~/.fonts.conf.d<br />
<br />
{{Note|For some desktop environments (such as [[Gnome]] and [[KDE]]) using the ''Font Control Panel'' will automatically create or overwrite the user font configuration file. For these desktop environments, it is best to match your already defined font configurations to get the expected behavior.}}<br />
<br />
=== Basic settings ===<br />
<br />
The configuration files will need informational headers before settings can be entered:<br />
<br />
<pre><br />
<?xml version="1.0"?><br />
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"><br />
<fontconfig><br />
<br />
... <br />
<br />
</fontconfig><br />
</pre><br />
<br />
To avoid repetition, the rest of the configuration examples in this article will omit these tags.<br />
<br />
==== Anti-aliasing ====<br />
<br />
[[Wikipedia:Antialiased font|Anti-aliasing]] (aka font rasterization) converts vectors fonts to bitmap for display purposes and in doing so provides a font smoothing effect. Without anti-aliasing (even at higher DPIs) fonts will appear jagged so anti-aliasing is enabled by default.<br />
<br />
<pre><br />
<match target="font"><br />
<edit name="antialias" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
</match><br />
</pre><br />
<br />
==== Hinting ====<br />
<br />
[[Wikipedia:Font hinting|Font hinting]] adjusts the spacing of fonts so that they line up with the pixel grid. Fonts will not line up correctly without hinting until displays have 300 [[Xorg#Display_size_and_DPI|DPI]] or greater. Two types of hinting are available:<br />
<br />
* {{Codeline|hinting}} - Normal, preset hinting, with several types available.<br />
* {{Codeline|autohint}} - Auto discovery for hinting.<br />
<br />
To enable normal hinting:<br />
<br />
<pre><br />
<match target="font"><br />
<edit name="hinting" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
</match><br />
</pre><br />
<br />
==== Auto-hinting ====<br />
<br />
To enable auto-hinting:<br />
<br />
<pre><br />
<match target="font"><br />
<edit name="autohint" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
</match><br />
</pre><br />
<br />
===== Hint style =====<br />
<br />
Hint style is the amount of influence the '''hinting''' mode has. Hinting can be set to: {{Codeline|hintfull}}, {{Codeline|hintmedium}}, {{Codeline|hintslight}} (recommended) and {{Codeline|hintnone}}.<br />
<br />
<pre><br />
<match target="font"><br />
<edit name="hintstyle" mode="assign"><br />
<const>hintslight</const><br />
</edit><br />
</match><br />
</pre><br />
<br />
==== Subpixel rendering ====<br />
<br />
''RGB, BGR, V-RGB (vertical), or V-BGR''<br />
<br />
Most monitors manufactured today use the Red, Green, Blue (RGB) specification. Fontconfig will need to know your monitor type to be able to display your fonts correctly. If you notice unusual colors around font's borders, discover you monitor type [http://www.lagom.nl/lcd-test/subpixel.php here] and define it in your font configuration:<br />
<br />
<pre><br />
<match target="font"><br />
<edit name="rgba" mode="assign"><br />
<const>rgb</const><br />
</edit><br />
</match><br />
</pre><br />
<br />
Like the automatic settings most DE font control panels establish, it is recommended to disable subpixel rendering when using the auto hinter since the combination of the two may result in unsatisfactory rendering.<br />
<br />
== LCD filter patched packages ==<br />
<br />
Some distributions choose not to use the LCD filter patches for font rendering due to patent ambiguity. If you choose, you can add these patched packages on your own. These patched packages are available in the [[AUR]] and easily installable by using an [[AUR helper]]. A few considerations:<br />
<br />
* All of these methods are designed for LCD displays but some CRT users may see improvements using the ''ClearType'' packages.<br />
* Configuration is sometimes necessary.<br />
* The new font effects will not be displayed until the application restarts.<br />
<br />
=== Original LCD packages ===<br />
{{Note|cairo-lcd is no longer being maintained on AUR. You could consider using the Ubuntu-patched packages instead.}}<br />
<br />
These are the vanilla LCD packages and have less pre-configured options and will not have any experimental patches applied.<br />
<br />
Remove the conflicting packages:<br />
<br />
pacman -Rd libxft cairo<br />
<br />
Install the patched packages from the AUR using the AUR helper of your choice. The package names are:<br />
<br />
fontconfig-lcd cairo-lcd<br />
<br />
Then install the patched packages from the repositories using pacman:<br />
<br />
pacman -S libxft-lcd<br />
<br />
=== Ubuntu patched packages ===<br />
<br />
Ubuntu uses the original LCD patched packages and adds extra configurations, and occasionally patches.<br />
<br />
First, the conflicting packages need to be removed:<br />
<br />
pacman -Rd libxft cairo fontconfig freetype2<br />
<br />
Then install the patched packages from the [[AUR]] using an AUR helper of your choice. The package names are:<br />
<br />
freetype2-ubuntu fontconfig-ubuntu libxft-ubuntu cairo-ubuntu<br />
<br />
=== ClearType packages ===<br />
<br />
Cleartype is a different type of font rendering that is used in Windows systems and is designed to work on both LCD and CRT monitors.<br />
<br />
Remove the conflicting packages:<br />
<br />
pacman -Rd cairo libxft freetype2<br />
<br />
And then install the patched packages from the AUR. Package names:<br />
<br />
freetype2-cleartype libxft-cleartype cairo-cleartype<br />
<br />
=== Infinality patched package ===<br />
<br />
From [http://www.infinality.net/blog/?p=67 infinality.net],<br />
<br />
:This patch makes Freetype's (http://www.freetype.org) Truetype interpreter render fonts similarly to MS Cleartype. It is not perfect, and needs some work on certain fonts, however, in my opinion it renders much, much better than the bi-level Freetype hinting does when doing subpixel rendering. Anything previous to this that I've worked on is simply a hack. This is the ''real'' thing finally.<br />
<br />
Install the patched packages from the AUR. Package name:<br />
<br />
freetype2-infinality<br />
<br />
=== Reverting to original packages ===<br />
<br />
To restore the unpatched packages, first uninstall the patched versions then reinstall the originals:<br />
<br />
pacman -S freetype2 libxft cairo<br />
<br />
== Additional fontconfig configuration ==<br />
<br />
=== Disable auto-hinter for bold fonts ===<br />
<br />
The auto-hinter uses sophisticated methods for font rendering, but often makes bold fonts too wide. Fortunately, a solution can be turning off the auto-hinter for bold fonts while leaving it on for the rest:<br />
...<br />
<match target="font"><br />
<test name="weight" compare="more"><br />
<const>medium</const><br />
</test><br />
<edit name="autohint" mode="assign"><br />
<bool>false</bool><br />
</edit><br />
</match><br />
...<br />
<br />
=== Enable anti-aliasing only for bigger fonts ===<br />
<br />
''See also [http://sharpfonts.co.cc/ sharpfonts.co.cc] for related information''<br />
<br />
Some users prefer the sharper rendering that anti-aliasing doesn't offer:<br />
<br />
<pre><br />
...<br />
<match target="font"><br />
<edit name="antialias" mode="assign"><br />
<bool>false</bool><br />
</edit> <br />
</match><br />
<br />
<match target="font" ><br />
<test name="size" qual="any" compare="more"><br />
<double>12</double><br />
</test><br />
<edit name="antialias" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
</match><br />
<br />
<match target="font" ><br />
<test name="pixelsize" qual="any" compare="more"><br />
<double>17</double><br />
</test><br />
<edit name="antialias" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
</match><br />
...<br />
</pre><br />
<br />
=== Replace fonts ===<br />
<br />
The most reliable way to do this is to add an XML fragment similar to the one below. This will cause Bitstream Vera Sans to be used in place of Helvetica:<br />
...<br />
<match target="pattern" name="family" ><br />
<test name="family" qual="any" ><br />
<string>Helvetica</string><br />
</test><br />
<edit name="family" mode="assign"><br />
<string>Bitstream Vera Sans</string><br />
</edit><br />
</match><br />
...<br />
An alternate approach is to set the "preferred" font, but ''this only works if the original font is not on the system'', in which case the one specified will be substituted:<br />
...<br />
< !-- Replace Helvetica with Bitstream Vera Sans Mono --><br />
< !-- Note, an alias for Helvetica should already exist in default conf files --><br />
<alias><br />
<family>Helvetica</family><br />
<prefer><family>Bitstream Vera Sans Mono</family></prefer><br />
<default><family>fixed</family></default><br />
</alias><br />
...<br />
<br />
=== LCD Type ===<br />
<br />
The fontconfig-lcd package by default uses the {{Codeline|lcddefault}} (very possible Ubuntu's does too) filter that will work for most users. Other filters are available that can be used in special situations: {{Codeline|lcdlight}}; a lighter filter ideal for fonts that look too bold or fuzzy, {{Codeline|lcdlegacy}}, the original Cairo filter; and {{Codeline|lcdnone}} to disable it entirely.<br />
<br />
<pre><br />
<match target="font"><br />
<edit mode="assign" name="lcdfilter"><br />
<const>lcddefault</const><br />
</edit><br />
</match><br />
</pre><br />
<br />
=== Disable bitmap fonts ===<br />
<br />
To disable bitmap fonts in fontconfig, use {{filename|70-no-bitmaps.conf}} (which is not placed by fontconfig by default):<br />
<br />
# rm /etc/fonts/conf.d/70-yes-bitmaps.conf <br />
# ln -s /etc/fonts/conf.avail/70-no-bitmaps.conf /etc/fonts/conf.d<br />
<br />
Depending on the type of fontconfig you are using (default, or -lcd patched) you can choose which fonts to replace bitmaps fonts with (Helvetica, Courier and Times bitmap mapts to TTF fonts) by:<br />
<br />
# ln -s /etc/fonts/conf.avail/29-replace-bitmap-fonts.conf /etc/fonts/conf.d<br />
<br />
=== Create bold and italic styles for incomplete fonts ===<br />
<br />
Freetype has the ability to automatically create ''italic'' and '''bold''' styles for fonts that do not have them, but only if explicitly required by the application. Given programs rarely send these requests, this section covers manually forcing generation of missing styles.<br />
<br />
Start by editing {{Filename|/usr/share/fonts/fonts.cache-1}} as explained below. Store a copy of the modifications on another file, because a font update with {{Codeline|fc-cache}} will overwrite {{Filename|/usr/share/fonts/fonts.cache-1}}.<br />
<br />
Assuming the Dupree font is installed:<br />
"dupree.ttf" 0 "Dupree:style=Regular:slant=0:weight=80:width=100:foundry=unknown:index=0:outline=True:''etc...''<br />
<br />
Duplicate the line, change {{Codeline|<nowiki>style=Regular</nowiki>}} to {{Codeline|<nowiki>style=Bold</nowiki>}} or any other style. Also change {{Codeline|<nowiki>slant=0</nowiki>}} to {{Codeline|<nowiki>slant=100</nowiki>}} for italic, {{Codeline|<nowiki>weight=80</nowiki>}} to {{Codeline|<nowiki>weight=200</nowiki>}} for bold, or combine them for '''''bold italic''''':<br />
"dupree.ttf" 0 "Dupree:style=Bold Italic:slant=100:weight=200:width=100:foundry=unknown:index=0:outline=True:''etc...''<br />
<br />
Now add necessary modifications to {{Filename|~/.fonts.conf}}:<br />
<pre><br />
...<br />
<match target="font"><br />
<test name="family" qual="any"><br />
<string>Dupree</string><br />
&lt;!-- other fonts here .... --&gt;<br />
</test><br />
<test name="weight" compare="more_eq"><int>140</int></test><br />
<edit name="embolden" mode="assign"><bool>true</bool></edit><br />
</match><br />
<br />
<match target="font"><br />
<test name="family" qual="any"><br />
<string>Dupree</string><br />
&lt;!-- other fonts here .... --&gt;<br />
</test><br />
<test name="slant" compare="more_eq"><int>80</int></test><br />
<edit name="matrix" mode="assign"><br />
<times><br />
<name>matrix</name><br />
<matrix><br />
<double>1</double><double>0.2</double><br />
<double>0</double><double>1</double><br />
</matrix><br />
</times><br />
</edit><br />
</match><br />
...<br />
</pre><br />
{{Tip| Use the value 'embolden' for existing bold fonts in order to make them even bolder.}}<br />
<br />
===Change rule overriding===<br />
<br />
Fontconfig processes files in {{Filename|/etc/fonts/conf.d}} in reverse numerical order. This enables rules or files to override one another, but often confuses users about what file gets parsed last.<br />
<br />
To guarantee that personal settings take precedence over any other rules, change their ordering:<br />
# cd /etc/fonts/conf.d<br />
# mv 50-user.conf 00-user.conf<br />
<br />
This change seems however to be unnecessary for the most of the cases, because a user is given enough control by default to set up own font preferences, hinting and antialiasing properties, alias new fonts to generic font families, etc.<br />
<br />
=== Example fontconfig configurations ===<br />
<br />
Example fontconfig configurations can be found on this [[Font_Configuration/fontconfig_Examples|page]].<br />
<br />
== Troubleshooting ==<br />
<br />
=== Ubuntu-patched fonts ===<br />
<br />
Edits to improve Ubuntu lcd-patched fonts.<br />
<br />
==== Blurry fonts after install ====<br />
<br />
The Ubuntu fontconfig by default doesn't set sub-pixel rendering in it's global configuration. I'm not sure why exactly, I've noticed the same configurations in {{Filename|/etc/fonts/conf.d}} as when I've loaded and Ubuntu CD but my Ubuntu fonts have always looked blurry after the install. Perhaps it's because I'm using a different desktop environment than Gnome, but to fix this I've always had to set my sub-pixel rendering type on:<br />
<br />
ln -s /etc/fonts/conf.avail/10-sub-pixel-rgb.conf /etc/fonts/conf.d/<br />
<br />
Then logout and back in again.<br />
<br />
=== Distorted fonts ===<br />
''Main article: [[Xorg#Display size and DPI]]<br />
<br />
Fontconfig should be able to detect DPI parameters as discovered by the Xorg server and be able to display the fonts correctly. Those having problems can still fall back to setting it manually:<br />
<br />
...<br />
<!-- Setup for DPI=96 --><br />
<match target="pattern"><br />
<edit name="dpi" mode="assign"><double>96</double></edit><br />
</match><br />
...<br />
<br />
If fonts are still unexpectedly large or small, or are poorly proportioned, the Xorg server may be incorrectly detecting the DPI setting.<br />
<br />
=== Missing characters ===<br />
<br />
If using [[Emacs]], the {{Package Official|xorg-fonts-75dpi}} and {{Package Official|xorg-fonts-100dpi}} packages need to be installed.<br />
<br />
=== Older GTK and QT applications ===<br />
<br />
Modern GTK apps enable Xft by default but this was not the case before version 2.2. If it is not possible to update these applications, force Xft for old GNOME applications by adding to {{Filename|~/.bashrc}}:<br />
<br />
export GDK_USE_XFT=1<br />
<br />
For older QT applications:<br />
<br />
export QT_XFT=true<br />
<br />
== Resources ==<br />
<br />
*[http://www.x.org/X11R6.8.2/doc/fonts.html Fonts in X11R6.8.2] - Official Xorg font information<br />
*[http://freetype.sourceforge.net/freetype2/ FreeType 2 Overview]<br />
*[http://avi.alkalay.net/linux/docs/font-howto/Font.html Optimal Use of Fonts on Linux]<br />
*[http://www.linuxsir.org/bbs/showthread.php?t=266659 Advanced Font Configuration] Great resource but mostly in Simplified Chinese. Still has some good English examples.</div>Markg85https://wiki.archlinux.org/index.php?title=Font_configuration/Examples&diff=118486Font configuration/Examples2010-10-01T16:18:53Z<p>Markg85: </p>
<hr />
<div>Configurations can vary to a degree. Please feel free to post your fontconfig configurations and the rationale behind them.<br />
<br />
== Web developer's ==<br />
<br />
A web developer's configuration (modified) taken from the forums. Back up current settings before testing the ones below:<br />
<br />
<pre><br />
<?xml version="1.0"?><br />
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"><br />
<br />
<!-- The cathectic LCD tweaks, from linuxquestions.org,<br />
http://www.linuxquestions.org/questions/showthread.php?postid=1361098#post1361098 --><br />
<br />
<fontconfig><br />
<br />
<match target="font" ><br />
<!-- Disable sub-pixel rendering.<br />
X detects it anyway, and if you set this as well, it just looks really horrible --><br />
<edit mode="assign" name="rgba" ><br />
<const>none</const><br />
</edit><br />
<br />
<!-- Autohinter is not turned on automatically.<br />
Only disable this if you have recompiled Freetype with the bytecode interpreter,<br />
which is run automatically. --><br />
<edit mode="assign" name="autohint"><br />
<bool>true</bool><br />
</edit><br />
<!-- Change hintstyle to full --><br />
<edit mode="assign" name="hintstyle"><br />
<const>hintfull</const><br />
</edit><br />
</match><br />
<br />
<match target="font"><br />
<!-- Disable auto hinting for bold fonts --><br />
<test name="weight" compare="more"><br />
<const>medium</const><br />
</test><br />
<edit name="autohint" mode="assign"><br />
<bool>false</bool><br />
</edit><br />
</match><br />
<br />
<!-- Helvetica is a non true type font, and will look bad.<br />
This replaces it with whatever is the default sans-serif font --><br />
<match target="pattern" name="family" ><br />
<test name="family" qual="any" ><br />
<string>Helvetica</string><br />
</test><br />
<edit mode="assign" name="family" ><br />
<string>sans-serif</string><br />
</edit><br />
</match><br />
<br />
</fontconfig><br />
</pre><br />
<br />
== brebs' configuration ==<br />
<br />
This is a quest to get all fonts looking beautiful at all sizes, weights, etc., by tweaking the fontconfig rules. The latest version is [http://forums.gentoo.org/viewtopic-p-6183606.html#6183606 maintained here] -- brebs<br />
<br />
== Basic config with no hinting for ''italic'' or '''bold''' and some other tuning==<br />
<br />
<pre><br />
<?xml version='1.0'?><br />
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'><br />
<fontconfig><br />
<match target="font" ><br />
<edit mode="assign" name="autohint"> <bool>true</bool></edit><br />
<edit mode="assign" name="hinting"> <bool>false</bool></edit><br />
<edit mode="assign" name="lcdfilter"> <const>lcddefault</const></edit><br />
<edit mode="assign" name="hintstyle"> <const>hintslight</const></edit><br />
<edit mode="assign" name="antialias"> <bool>true</bool></edit><br />
<edit mode="assign" name="rgba"> <const>rgb</const></edit><br />
</match><br />
<br />
<match target="font"><br />
<test name="pixelsize" qual="any" compare="more"><double>15</double></test><br />
<edit mode="assign" name="lcdfilter"><const>lcdlight</const></edit><br />
<edit mode="assign" name="hintstyle"><const>hintnone</const></edit></match><br />
<br />
<match target="font"><br />
<test name="weight" compare="more"><const>medium</const></test><br />
<edit mode="assign" name="hintstyle"><const>hintnone</const></edit><br />
<edit mode="assign" name="lcdfilter"><const>lcdlight</const></edit></match><br />
<br />
<match target="font"><br />
<test name="slant" compare="not_eq"><double>0</double></test><br />
<edit mode="assign" name="hintstyle"><const>hintnone</const></edit><br />
<edit mode="assign" name="lcdfilter"><const>lcdlight</const></edit></match><br />
<br />
</fontconfig><br />
</pre><br />
<br />
==Sharp fonts==<br />
It took me a while to find font settings that are sharp and not overly blurred. This font config does exactly that and seems to work fine everywhere. I searched for this because "Chromium" wasn't looking good with no aliasing at all. The below config fixes that as well.<br />
<br />
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"><br />
<fontconfig><br />
<match target="font"><br />
<edit name="antialias" mode="assign"><bool>true</bool></edit><br />
<edit name="hinting" mode="assign"><bool>true</bool></edit><br />
<edit name="hintstyle" mode="assign"><const>hintfull</const></edit><br />
<edit name="lcdfilter" mode="assign"><const>lcddefault</const></edit><br />
<edit name="rgba" mode="assign"><const>rgb</const></edit><br />
</match><br />
</fontconfig></div>Markg85https://wiki.archlinux.org/index.php?title=Advanced_Linux_Sound_Architecture_(Nederlands)&diff=118378Advanced Linux Sound Architecture (Nederlands)2010-09-30T16:33:06Z<p>Markg85: /* Configuren, volume instellen en testen */</p>
<hr />
<div>[[Category:Nederlands]]<br />
{{i18n|ALSA}}<br />
Dit document legt uit hoe je ALSA aan de praat kan krijgen.<br />
<br />
==Installatie==<br />
<br />
===Kernel stuurprogramma's===<br />
<br />
ALSA zit standaard in alle 2.6 kernels. Als je je eigen kernel wil compileren, moet je niet vergeten ALSA aan te zetten.<br />
<br />
===Gebruikersapparatuur===<br />
<br />
* Gebruik pacman om de volgende software te installeren.<br />
# pacman -S alsa-lib alsa-utils alsa-oss<br />
<br />
==Configuratie==<br />
<br />
===Configuren, volume instellen en testen===<br />
* Draai alsaconf:<br />
# alsaconf<br />
<br />
* Stel het volume in met:<br />
# alsamixer<br />
<br />
* Probeer een bestand te spelen:<br />
# aplay /usr/share/sounds/alsa/Front_Center.wav<br />
<br />
===Permissies instellen===<br />
<br />
Om ervoor te zorgen dat normale gebruikers ook de geluidskaart kunnen gebruiken, volg deze stappen:<br />
<br />
* Voeg de gebruiker toe aan de audiogroep:<br />
# gpasswd -a GEBRUIKERSNAAM audio<br />
<br />
* Log uit en weer in om ervoor te zorgen dat de audiogroep geladen is.<br />
<br />
===Ervoor zorgen dat de volumeinstellingen hersteld worden bij het opstarten===<br />
<br />
* Voer als root 'alsactl' uit om '/etc/asound.state' te creëren:<br />
# alsactl store<br />
<br />
* Bewerk '/etc/rc.conf' en voeg 'alsa' toe aan de lijst met daemons die starten bij het opstarten van de computer. Dit zorgt ervoor dat de volumeinstellingen worden opgeslagen als de computer wordt afgesloten en weer worden geladen als de computer opstart.</div>Markg85https://wiki.archlinux.org/index.php?title=Installing_with_Software_RAID_or_LVM&diff=117629Installing with Software RAID or LVM2010-09-18T13:17:55Z<p>Markg85: /* Troubleshooting */</p>
<hr />
<div>[[Category:Getting and installing Arch (English)]]<br />
[[Category:File systems (English)]]<br />
[[Category:HOWTOs (English)]]<br />
== Disclaimer==<br />
<br />
{{ Warning | Installing a system with RAID is a complex process which can destroy data. Be sure to backup all data beforehand. It is also good practice to ensure that only the drives involved in the installation are attached while performing the install. }}<br />
<br />
This document is up-to-date with all Arch versions as of 2008.06 'Overlord'. It may not be applicable to previous releases of Arch Linux.<br />
<br />
=== RAID ===<br />
<br />
RAID (Redundant Array of Independent Disks) is designed to prevent data loss in the event of a hard disk failure. There are different "levels" of RAID. RAID 0 (striping) isn't really RAID at all, because it provides no redundancy. It does, however, provide a speed benefit. The example will utilize RAID 0 for swap, on the assumption that a desktop system is being used, where the speed increase is worth the possibility of system crash if one of your drives fails. On a server, a RAID 1 or RAID 5 array is more appropriate. The size of a RAID 0 array block device is the size of the smallest component partition times the number of component partitions.<br />
<br />
RAID 1 is the most straightforward RAID level: straight mirroring. As with other RAID levels, it only makes sense if the partitions are on different physical disk drives. If one of those drives fails, the block device provided by the RAID array will continue to function as normal. The example will be using RAID 1 for everything except swap. Note that RAID 1 is the only option for the boot partition, because bootloaders (which read the boot partition) do not understand RAID, but a RAID 1 component partition can be read as a normal partition. The size of a RAID 1 array block device is the size of the smallest component partition.<br />
<br />
RAID 5 requires 3 or more physical drives, and provides the redundancy of RAID 1 combined with the speed and size benefits of RAID 0. RAID 5 uses striping, like RAID 0, but also stores parity blocks distributed across each member disk. In the event of a failed disk, these parity blocks are used to reconstruct the data on a replacement disk. RAID 5 can withstand the loss of one member disk.<br />
<br />
'''ATTENTION: Do not be lulled into a false sense of security. Using RAID does not mean that you do not need backups - read the CAVEATS section below!'''<br />
<br />
=== LVM ===<br />
<br />
[http://sourceware.org/lvm2/ LVM] (Logical Volume Management) makes use of the [http://sources.redhat.com/dm/ device-mapper] feature of the Linux kernel. It provides a system of specifying partitions independently of the layout of the underlying disk. What this means for you is that you can extend and shrink partitions (subject to the filesystem you use allowing this) and add and remove partitions without worrying about whether you have enough contiguous space on a particular disk, without getting caught up in the problems of fdisking a disk that is in use (and wondering whether the kernel is using the old or new partition table) and without having to move other partition out of the way.<br />
<br />
This is strictly an ease-of-management issue: it doesn't provide any addition security. However, it sits nicely with the other two technologies we are using.<br />
<br />
Note that LVM is not used for the boot partition (because of the bootloader problem).<br />
<br />
==CAVEATS==<br />
<br />
=== Security (redundancy) ===<br />
<br />
Again, RAID does not provide a guarantee that your data is safe. If there is a fire, if your computer is stolen or if you have multiple hard drive failures, RAID won't protect you. So '''make backups'''. Whether you use tape drives, DVDs, CDROMs or another computer, keep a copy of your data out of your computer (and preferably offsite) and keep it up to date. Get into the habit of making regular backups. If you organize the data on your computer in a way that separates things you are currently working on from "archived" things that are unlikely to change, you can back up the "current" data frequently, and the "archived" data occasionally.<br />
<br />
== General Approach==<br />
<br />
For starters, note that this document seeks primarily to give you a good example walkthrough of how to install Arch with Software RAID or LVM support for a typical case. It won't try to explain all the possible things you can do -- it's more to give you an example of something that will work that you can then tweak to your own purposes.<br />
<br />
In this example, the machine I'm using will have three similar IDE hard drives, at least 80GB each in size, installed as primary master, primary slave, and secondary master, with my installation CD-ROM drive as the secondary slave. I will assume these can be reached as /dev/sda, /dev/sdb, and /dev/sdc, and that the cdrom drive is /dev/cdrom.<br />
<br />
We'll create a 100MB /boot partition, a 2048MB (2GB) swap partition and a ~ 78GB root partition using LVM. The boot and swap partitions will be RAID1, while the root partition will be RAID5. Why RAID1? For boot, it's so you can boot the kernel from grub (which has no RAID drivers!), and for swap, it's for redundancy, so that your machine will not lose its swap state even if 1 or 2 drives fail.<br />
<br />
Each RAID1 redundant partition will have three physical partitions, all the same size, one on each of the drives. The total storage capacity will be the size of a single one of these physical partitions. A RAID1 redundant partition with 3 physical partitions can lose any two of its physical partitions and still function.<br />
<br />
Each RAID5 redundant partition will also have three physical partitions, all the same size, one on each of the drives. The total storage capacity will be the combined size of ''two'' of these physical partitions, with the third drive being consumed to provide parity information. A RAID5 redundant partition with 3 physical partitions can lose any one of its physical partitions and still function.<br />
<br />
== Get the Arch Installer CD ==<br />
<br />
Please note that in order to use LVM, you need the <code>lvm2</code> and <code>dev-mapper</code> packages installed, otherwise you will be unable to see any LVM partitions on reboot.<br />
<br />
== Outline ==<br />
<br />
Just to give you an idea of how all this will work, I'll outline the steps. The details for these will be filled in below.<br />
<br />
# Boot the Installer CD<br />
# Partition the Hard Drives<br />
# Create the RAID Redundant Partitions<br />
# Create and Mount the Main Filesystems<br />
# Setup LVM and Create the / (root) LVM Volume<br />
# Install and Configure Arch<br />
# Install Grub on the Primary Hard Drive<br />
# Unmount Filesystems and Reboot<br />
# Install Grub on the Alternate Boot Drives<br />
# Archive your Filesystem Partition Scheme<br />
<br />
== Procedure==<br />
<br />
=== Boot the Installer CD===<br />
<br />
First, load all your drives in the machine. Then boot the Arch Linux installation CD.<br />
<br />
At the syslinux boot prompt, hit enter: we want to use the SCSI kernel, which has support for RAID and LVM built in.<br />
<br />
So far, this is easy. Don't worry, it gets harder.<br />
<br />
=== Partition the Hard Drives===<br />
If your hard drives are already prepared and all you want to do is activate RAID and LVM jump to [[Installing_with_Software_RAID_or_LVM#Activate_existing_RAID_devices_and_LVM_volumes|Activate existing RAID devices and LVM volumes]].<br />
<br />
We'll use <code>cfdisk</code> to do this partitioning. We want to create 3 partitions on each of the three drive:<br />
<br />
Partition 1 (/boot): 100MB, type FD, bootable<br><br />
Partition 2 (swap): 2048MB, type FD<br><br />
Partition 3 (RAID): <Rest of the drive>, type FD<br />
<br />
Note that in general, in <code>cfdisk</code>, you can use the first letter of each <code>[[Bracketed Option]]</code> to select it; however, this is not true for the <code>[[Write]]</code> command, you have to hold SHIFT as well to select it.<br />
<br />
First run:<br />
<pre><br />
# cfdisk /dev/sda<br />
</pre><br />
<br />
Create each partition in order:<br />
<br />
# Select <code>'''New'''</code>.<br />
# Hit Enter to make it a <code>'''Primary'''</code> partition.<br />
# Type the appropriate size (in MB), or for Partition 3, just hit enter to select the remainder of the drive.<br />
# Hit Enter to choose to place the partition at the <code>'''Beginning'''</code>.<br />
# Select <code>'''Type'''</code>, hit enter to see the second page of the list, and then type <code>fd</code> for the Linux RAID Autodetect type.<br />
# ''For Partition 1 on each drive'', select <code>'''Bootable'''</code>.<br />
# Hit down arrow (selecting the remaining free space) to go on to the next partition to be created.<br />
<br />
When you're done, select <code>'''Write'''</code>, and confirm <code>y-e-s</code> that you want to write the partition information to disk.<br />
<br />
Then select <code>'''Quit'''</code>.<br />
<br />
Repeat this for the other two drives:<br />
<br />
<pre><br />
# cfdisk /dev/sdb<br />
# cfdisk /dev/sdc<br />
</pre><br />
<br />
Create the same exact partitions on each disk. If a group of partitions of different sizes are assembled to create a redundant RAID partition, it ''will'' work, but the redundant partition will be in multiples of the size of the smallest one, leaving the rest of the allocated drive space to waste.<br />
<br />
You can also use sfdisk to clone the partition table from your first drive to the other drives.<br />
Use:<br />
<pre><br />
# sfdisk -d /dev/sda > table<br />
</pre><br />
to dump the partition from the first drive into table, and then<br />
<pre><br />
# sfdisk /dev/sdb < table<br />
# sfdisk /dev/sdc < table<br />
</pre><br />
to write the partition table to the other disks.<br />
<br />
=== Load the RAID Modules ===<br />
<br />
Before using <code>mdadm</code>, you need load the modules for the RAID levels you'll be using. In this example, we're using levels 1 and 5, so we'll load those. You can ignore any modprobe errors like <code>"cannot insert md-mod.ko: File exists"</code>. Busybox's modprobe can be a little slow sometimes.<br />
<br />
<pre><br />
# modprobe raid1<br />
# modprobe raid5<br />
</pre><br />
<br />
=== Create the RAID Redundant Partitions ===<br />
<br />
Now that you've created all the physical partitions, you're ready to set up RAID. The tool you use to create RAID arrays is <code>mdadm</code>.<br />
<br />
To create /dev/md0 (/):<br />
<pre><br />
# mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/sda3 /dev/sdb3 /dev/sdc3<br />
</pre><br />
<br />
To create /dev/md1 (/boot):<br />
<pre><br />
# mdadm --create /dev/md1 --level=1 --raid-devices=3 --metadata=0.90 /dev/sda1 /dev/sdb1 /dev/sdc1<br />
</pre><br />
If you want to use Grub 0.97 (default in the Arch Linux 2010.05 release) on RAID 1, you need to specify an older version of metadata than the default. Add the option "--metadata=0.90" to the above command. Otherwise Grub will respond with "Filesystem type unknown, partition type 0xfd" and refuse to install. This is supposedly not necessary with Grub 2.<br />
<br />
To create /dev/md2 (swap):<br />
<pre><br />
# mdadm --create /dev/md2 --level=1 --raid-devices=3 /dev/sda2 /dev/sdb2 /dev/sdc2<br />
</pre><br />
<br />
At this point, you should have working RAID partitions. When you create the RAID partitions, they need to sync themselves so the contents of all three physical partitions are the same on all three drives. The hard drives lights will come on as they try to sync up. You can monitor the progress by typing:<br />
<pre><br />
# cat /proc/mdstat<br />
</pre><br />
<br />
You can also get particular information about, say, the root partition by typing:<br />
<pre><br />
# mdadm --misc --detail /dev/md0<br />
</pre><br />
<br />
You don't have to wait for synchronization to finish -- you may proceed with the installation while syncronization is still occurring. You can even reboot at the end of the installation with synchronization still going.<br />
<br />
=== Setup LVM and Create the / (root) LVM Volume===<br />
This is where you create the LVM volumes. LVM works with abstract layers, check out [[LVM|LVM]] and/or its documentation to discover more. What you will be doing in short:<br />
* Turn block devices (e.g. /dev/sda1 or /dev/md0) into Physical Volume(s) that can be used by LVM<br />
* Create a Volume Group consisting of Physical Volume(s)<br />
* Create Logical Volume(s) within the Volume Group <br />
<br />
'''Note:'''<br />
If you are using an Arch Linux install CD <= 0.7.1, you have to create and mount a sysfs partition on /sys, to keep lvm from getting cranky. Otherwise you can skip this mounting of sysfs, unless you run into trouble. If you forget to do this, instead of giving you an intelligent error message, lvm will simply Segmentation fault at various inconvenient times.<br />
<br />
To mount the sysfs partition, do:<br />
<pre><br />
# mkdir /sys<br />
# mount -t sysfs none /sys<br />
</pre><br />
<br />
'''Let's get started:'''<br />
<br />
Make sure that the device-mapper module is loaded:<br />
<pre><br />
# modprobe dm-mod<br />
</pre><br />
<br />
Now you need to do is tell LVM you have a Physical Volume for it to use. It's really a virtual RAID volume (<code>/dev/md0</code>), but LVM doesn't know this, or really care. Do:<br />
<pre><br />
# pvcreate /dev/md0<br />
</pre><br />
<br />
This might fail if you're using raid or creating PV on an existing Volume Group. If so you might want to add -ff option.<br />
<br />
LVM should report back that it has added the Physical Volume. You can confirm this with:<br />
<pre><br />
# pvdisplay<br />
</pre><br />
<br />
Now it's time to create a Volume Group (which I'll call <code>array</code>) which has control over the LVM Physical Volume we created. Do:<br />
<pre><br />
# vgcreate array /dev/md0<br />
</pre><br />
<br />
LVM should report that it has created the Volume Group <code>array</code>. You can confirm this with:<br />
<pre><br />
# vgdisplay<br />
</pre><br />
<br />
Next, we create a Logical Volume called <code>root</code> in Volume Group <code>array</code> which is 50GB in size:<br />
<pre><br />
# lvcreate --size 50G --name root array<br />
</pre><br />
<br />
LVM should report that it created the Logical Volume <code>root</code>. You can confirm this with:<br />
<pre><br />
# lvdisplay<br />
</pre><br />
<br />
The LVM volume should now be available as <code>/dev/mapper/array-root</code>. Or something similar, LVM will also be able to tell you which when you issue the display command.<br />
<br />
=== Activate existing RAID devices and LVM volumes ===<br />
<br />
If you already have RAID partitions created on your system and you've also set up LVM and all you want is enabling them<br />
follow this simple procedure. ''This might come in handy if you're switching distros and don't want to lose data in /home<br />
for example.'' <br />
<br />
First you need to enable RAID support. RAID1 and RAID5 in this case.<br />
<pre><br />
modprobe raid1<br />
modprobe raid5<br />
</pre><br />
<br />
Activate RAID devices: md1 for /boot and md0 for LVM where two logical volumes will reside.<br />
<pre><br />
mdadm --assemble /dev/md0 /dev/sda3 /dev/sdb3 /dev/sdc3<br />
mdadm --assemble /dev/md1 /dev/sda1 /dev/sdb1 /dev/sdc1<br />
</pre><br />
<br />
RAID devices should now be enabled. Check /proc/mdstat.<br />
<br />
If you haven't loaded kernel LVM support do so now.<br />
<pre><br />
modprobe dm-mod<br />
</pre><br />
Startup of LVM requires just the following two commands: <br />
<pre><br />
vgscan<br />
vgchange -ay<br />
</pre><br />
<br />
You can now jump to '''[3] Set Filesystem Mountpoints''' in your menu based setup and mount created<br />
partitions as needed.<br />
<br />
=== Create and Mount the Filesystems ===<br />
'''When you are using a setup that is newer then 2008.03; this step is optional!'''<br />
<br />
Example using ReiserFS (V3):<br />
<br />
To create /boot:<br />
<pre><br />
# mkreiserfs /dev/md1<br />
</pre><br />
<br />
To create swap space:<br />
<pre><br />
# mkswap /dev/md2<br />
</pre><br />
<br />
To create /:<br />
<pre><br />
# mkreiserfs /dev/array/root<br />
</pre><br />
<br />
Now, mount the boot and root partitions where the installer expects them:<br />
<pre><br />
# mount /dev/array/root /mnt<br />
# mkdir /mnt/boot<br />
# mount /dev/md1 /mnt/boot<br />
</pre><br />
<br />
We've created all our filesystems! And we're ready to install the OS!<br />
<br />
=== Install and Configure Arch ===<br />
<br />
This section doesn't attempt to teach you all about the Arch Installer. It leaves out some details here and there for brevity, but still seeks to be basically follow-able. If you're having trouble with the installer, you may wish to seek help elsewhere in the Wiki or forums.<br />
<br />
Now you can continue using the installer to set-up the system and install the packages you need.<br />
Here's the walkthrough:<br />
<br />
* Type <code>/arch/setup</code> to launch the main installer.<br />
* Select <code> < OK ></code> at the opening screen.<br />
* Select <code>1 CD_ROM</code> to install from CD-ROM (or <code>2 FTP</code> if you have a local Arch mirror on FTP).<br />
* If you have skipped the optional step (''Create and Mount the Filesystems'') above, and haven't created a fileystem yet, select <code>1 Prepare Hard Drive</code> > <code>3 Set Filesystem Mountpoints</code> and create your filesystems and mountpoints here'''<br />
* Now at the main menu, Select <code>2 Select Packages</code> and select all the packages in the ''base'' category, as well as the <code>mdadm</code> and <code>lvm2</code> packages from the ''system'' category. Note: mdadm & lvm2 are included in ''base'' category since arch-base-0.7.2.<br />
* Select <code>3 Install Packages</code>. This will take a little while.<br />
* '''Note:''' Because the installer builds the initrd using /etc/mdadm.conf in the target system, you should update that file with your RAID configuration. The original file can simply be deleted because it contains comments on how to fill it correctly, and that is something mdadm can do automaticly for you. So let's delete the original and have mdadm create you a new one with the currect setup:<br>Press '''Alt-F2''' to get a new terminal an log in, then do<br />
<pre><br />
rm /mnt/etc/mdadm.conf<br />
mdadm --examine --scan >> /mnt/etc/mdadm.conf<br />
</pre><br />
* Select <code>4 Configure System</code>:<br />
<br />
Add the ''dm_mod'' module to the MODULES list in /etc/mkinitcpio.conf.<br />
<br />
Add the ''mdadm'' and ''lvm2'' hook to the HOOKS list in /etc/mkinitcpio.conf '''(before 'filesystems', NOT after)'''.<br />
See [[Configuring_mkinitcpio#Using_raid|Configuring mkinitpcio using RAID]] for more details. <br />
<br />
Edit your <code>/etc/rc.conf</code>. It should contain a <code>USELVM</code> entry already, which you should change to:<br />
<pre><br />
USELVM="yes"<br />
</pre><br />
''Please Note'': The <code>rc.sysinit</code> script that parses the <code>USELVM</code> variable entry will accept either <code>yes</code> or <code>YES</code>, however it will not accept mixed case. Please be sure you've got your capitalization correct.<br />
<br />
Edit your <code>/etc/fstab</code> to contain the entries:<br />
<pre><br />
/dev/array/root / reiserfs defaults 0 1<br />
/dev/md2 swap swap defaults 0 0<br />
/dev/md1 /boot reiserfs defaults 0 0<br />
</pre><br />
<br />
At this point, make any other configuration changes you need to other files.<br />
<br />
Then exit the configuration menu.<br />
<br />
Since you will not be installing Grub from the installer, select <code>7 Exit Install</code> to leave the installer program.<br />
<br />
<br />
'''Old style:'''<br />
<br />
Then specify the raid array you're booting from in /mnt/boot/grub/menu.lst like:<br />
# Example with /dev/array/root for ''/'' & /dev/md1 for ''/boot'':<br />
kernel /kernel26 root=/dev/array/root ro md=1,/dev/sda1,/dev/sdb1,/dev/sdc1 md=0,/dev/sda3,/dev/sdb3,/dev/sdc3<br />
<br />
<br />
'''Nowadays (2009.02), with the mdadm hook in the initrd it it no longer necessary to add kernel parameters concerning the RAID array(s).''' <br />
<br />
The arrays can be assembled on boot by the kernel using that hook and the contents of /etc/mdadm.conf, which is included in the initrd image when it's build. (See [[Configuring_mkinitcpio#Using_raid|Configuring mkinitpcio using RAID]] )<br />
<br />
An example of a GRUB boot configuration for booting of a RAIDed root like this:<br />
<pre><br />
# (0) Arch Linux<br />
title Arch Linux<br />
root (hd0,0)<br />
kernel /vmlinuz26 root=/dev/md0 ro<br />
initrd /kernel26.img<br />
</pre><br />
<br />
=== Install Grub on the Primary Hard Drive ===<br />
<b>This can also be done from the installer just fine now (2009.08 and should also work for 2009.02)</b><br />
<br />
This is the last and final step before you have a bootable system!<br />
<br />
As an overview, the basic concept is to copy over the grub bootloader files into /boot/grub, mount a procfs and a device tree inside of /mnt, then chroot to /mnt so you're effectively inside your new system. Once in your new system, you will run grub to install the bootloader in the boot area of your first hard drive. <br />
<br />
Copy the GRUB files into place and get into our chroot:<br />
<pre><br />
# cp -a /mnt/usr/lib/grub/i386-pc/* /mnt/boot/grub<br />
# sync<br />
# mount -o bind /dev /mnt/dev<br />
# mount -t proc none /mnt/proc<br />
# chroot /mnt /bin/bash<br />
</pre><br />
<br />
At this point, you may no longer be able to see keys you type at your console. I'm not sure of the reason for this (NOTE: try "chroot /mnt /bin/<shell>"), but it you can fix it by typing <code>reset</code> at the prompt.<br />
<br />
Once you've got console echo back on, type:<br />
<pre><br />
# grub<br />
</pre><br />
<br />
After a short wait while grub does some looking around, it should come back with a grub prompt. Do:<br />
<br />
<pre><br />
grub> root (hd0,0)<br />
grub> setup (hd0)<br />
grub> quit<br />
</pre><br />
<br />
That's it. You can exit your chroot now by hitting <code>CTRL-D</code> or typing <code>exit</code>.<br />
<br />
=== Reboot ===<br />
<br />
The hard part is all over! Now remove the CD from your CD-ROM drive, and type:<br />
<pre><br />
# reboot<br />
</pre><br />
<br />
=== Install Grub on the Alternate Boot Drives===<br />
<br />
Once you've successfully booted your new system for the first time, you will want to install Grub onto the other two disks (or on the other disk if you have only 2 HDDs) so that, in the event of disk failure, the system can be booted from another drive. Log in to your new system as root and do:<br />
<br />
<pre><br />
# grub<br />
grub> device (hd0) /dev/sdb<br />
grub> root (hd0,0)<br />
grub> setup (hd0)<br />
grub> device (hd0) /dev/sdc<br />
grub> root (hd0,0)<br />
grub> setup (hd0)<br />
grub> quit<br />
</pre><br />
<br />
=== Archive your Filesystem Partition Scheme ===<br />
<br />
Now that you're done, it's worth taking a second to archive off the partition state of each of your drives. This guarantees that it will be trivially easy to replace/rebuild a disk in the event that one fails. You do this with the <code>sfdisk</code> tool and the following steps:<br />
<br />
<pre><br />
# mkdir /etc/partitions<br />
# sfdisk --dump /dev/sda >/etc/partitions/disc0.partitions<br />
# sfdisk --dump /dev/sdb >/etc/partitions/disc1.partitions<br />
# sfdisk --dump /dev/sdc >/etc/partitions/disc2.partitions<br />
</pre><br />
<br />
== Management ==<br />
<br />
For LVM management, please have a look at [[LVM]]<br />
<br />
== Mounting from a Live CD ==<br />
<br />
If you want to mount your RAID partition from a Live CD, use<br />
<br />
<pre><br />
mdadm --assemble /dev/md0 /dev/sda3 /dev/sdb3 /dev/sdc3<br />
</pre><br />
<br />
(or whatever mdX and drives apply to you)<br />
<br />
{{Note | Live CDs like [http://www.sysresccd.org/Main_Page SystemrescueCD] assemble the RAID arrays automatically at boot time if you used the partition type fd at the install of the array)}}<br />
<br />
==Removing device, stop using the array==<br />
<br />
You can remove a device from the array after you mark it as faulty.<br />
<br />
mdadm --fail /dev/md0 /dev/sdxx<br />
<br />
Then you can remove it from the array.<br />
<br />
mdadm -r /dev/md0 /dev/sdxx<br />
<br />
Remove device permanently (for example in the case you want to use it individally from now on).<br />
Issue the two commands described above then:<br />
<br />
mdadm --zero-superblock /dev/sdxx<br />
<br />
After this you can use the disk as you did before creating the array.<br />
<br />
{{Warning | If you reuse the removed disk without zeroing the superblock you will '''LOSE''' all your data next boot. (After mdadm will try to use it as the part of the raid array). '''DO NOT''' issue this command on linear or RAID0 arrays or you will '''LOSE''' all your data on the raid array. }}<br />
<br />
Stop using an array:<br />
<br />
1. Umount target array<br />
2. Stop the array with: <code>mdadm --stop /dev/md0</code><br />
3. Repeat the three command described in the beginning of this section on each device.<br />
4. Remove the corresponding line from /etc/mdadm.conf<br />
<br />
== Adding a device to the array ==<br />
Adding new devices with mdadm can be done on a running system with the devices mounted.<br />
Partition the new device "/dev/sdx" using the same layout as one of those already in the arrays "/dev/sda".<br />
<pre><br />
sfdisk -d /dev/sda > table<br />
sdfisk /dev/sdx < table<br />
</pre><br />
Assemble the RAID arrays if they are not already assembled:<br />
<pre><br />
mdadm --assemble /dev/md1 /dev/sda1 /dev/sdb1 /dev/sdc1<br />
mdadm --assemble /dev/md2 /dev/sda2 /dev/sdb2 /dev/sdc2<br />
mdadm --assemble /dev/md0 /dev/sda3 /dev/sdb3 /dev/sdc3<br />
</pre><br />
First, add the new device as a Spare Device to all of the arrays. We will assume you have followed the guide and use separate arrays for /boot RAID 1 (/dev/md1), swap RAID 1 (/dev/md2) and root RAID 5 (/dev/md0).<br />
<pre><br />
mdadm --add /dev/md1 /dev/sdx1<br />
mdadm --add /dev/md2 /dev/sdx2<br />
mdadm --add /dev/md0 /dev/sdx3<br />
</pre><br />
This should not take long for mdadm to do. Check the progress with:<br />
<pre><br />
cat /proc/mdstat<br />
</pre><br />
Check that the device has been added with the command:<br />
<pre><br />
mdadm --misc --detail /dev/md0<br />
</pre><br />
It should be listed as a Spare Device.<br />
<br />
Tell mdadm to grow the arrays from 3 devices to 4 (or however many devices you want to use):<br />
<pre><br />
mdadm --grow -n 4 /dev/md1<br />
mdadm --grow -n 4 /dev/md2<br />
mdadm --grow -n 4 /dev/md0<br />
</pre><br />
This will probably take several hours. You need to wait for it to finish before you can continue. Check the progress in /proc/mdstat. The RAID 1 arrays should automatically sync /boot and swap but you need to install Grub on the MBR of the new device manually. [[Installing_with_Software_RAID_or_LVM#Install_Grub_on_the_Alternate_Boot_Drives]]<br />
<br />
The rest of this guide will explain how to resize the underlying LVM and filesystem on the RAID 5 array.<br />
{{Note|I am not sure if this can be done with the volumes mounted and will assume you are booting from a live-cd/usb}}<br />
<br />
If you are have encrypted your LVM volumes with LUKS, you need resize the LUKS volume first. Otherwise, ignore this step.<br />
<pre><br />
cryptsetup luksOpen /dev/md0 cryptedlvm<br />
cryptsetup resize cryptedlvm<br />
</pre><br />
Activate the LVM volume groups:<br />
<pre><br />
vgscan<br />
vgchange -ay<br />
</pre><br />
Resize the LVM Physical Volume /dev/md0 (or e.g. /dev/mapper/cryptedlvm if using LUKS) to take up all the available space on the array. You can list them with the command "pvdisplay".<br />
<pre><br />
pvresize /dev/md0<br />
</pre><br />
Resize the Logical Volume you wish to allocate the new space to. You can list them with "lvdisplay". Assuming you want to put it all to your /home volume:<br />
<pre><br />
lvresize -l +100%FREE /dev/array/home<br />
</pre><br />
To resize the filesystem to allocate the new space use the appropriate tool. If using ext2 you can resize a mounted filesystem with ext2online. For ext3 you can use resize2fs or ext2resize but not while mounted.<br />
<br />
You should check the filesystem before resizing.<br />
<pre><br />
e2fsck -f /dev/array/home<br />
resize2fs /dev/array/home<br />
</pre><br />
Read the manuals for lvresize and resize2fs if you want to customize the sizes for the volumes.<br />
<br />
== Conclusion==<br />
<br />
Done.<br />
<br />
==Troubleshooting==<br />
If you are getting error when you reboot about "invalid raid superblock magic" and you have additional hard drives other than the ones you installed to, check that your hard drive order is correct. During installation, your RAID devices may be hdd, hde and hdf, but during boot they may be hda, hdb and hdc. Adjust your kernel line in /boot/grub/menu.lst accordingly. This is what happened to me anyway.<br />
<br />
===Recovering from a broken or missing drive in the raid===<br />
You might get the above mentioned error also when one of the drives breaks for whatever reason. In that case you will have to fore the raid to still turn on even with one disk short. Type this (change where needed):<br />
mdadm --manage /dev/md0 --run<br />
<br />
Now you should be able to mount it again with something like this (if you had it in fstab):<br />
mount /dev/md0<br />
<br />
Now the raid should be working again and available to use, however with one disk short! So, to add that one disc partition it the way like described above in #Partition_the_Hard_Drives. Once that's done you can add the new disk to the raid by doing:<br />
mdadm --manage --add /dev/md0 /dev/sdd1<br />
<br />
If you type:<br />
cat /proc/mdstat<br />
you probably see that the raid is now active and rebuilding.<br />
<br />
You also might want to update your /etc/mdadm.conf file by typing:<br />
mdadm --examine --scan > /etc/mdadm.conf<br />
<br />
That should be about all steps required to recover your raid. It certainly worked for me when i had lost a dive due to a partition table corruption.<br />
<br />
== Additional Resources==<br />
<br />
* [http://en.gentoo-wiki.com/wiki/RAID/Software Gentoo wiki entry]<br />
* [http://yannickloth.be/blog/2010/08/01/installing-archlinux-with-software-raid1-encrypted-filesystem-and-lvm2/ Setup Archlinux on top of raid, LVM2 and encrypted partitions]</div>Markg85https://wiki.archlinux.org/index.php?title=Git&diff=116099Git2010-08-31T17:09:27Z<p>Markg85: /* Cheatsheet */</p>
<hr />
<div>[[Category: Development (English)]]<br />
{{Stub}}<br />
{{Article summary start}}<br />
{{Article summary text|Installing an using the Git VCS}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Super Quick Git Guide}}: Generally about contributing to pacman, although it still serves as a practical Git tutorial<br />
{{Article summary end}}<br />
<br />
'''Git''' is the version control system (VCS) coded by Linus Torvalds (the creator of Linux) when he was criticized for using the proprietary BitKeeper with the Linux kernel. Git is now used by the Linux kernel and by many other projects, including [[Pacman]], Arch's package manager.<br />
<br />
==Gitk==<br />
If you get launching git's GUI '''gitk''' like<br />
/usr/bin/gitk: line 3: exec: wish: not found.<br />
you should make sure that '''tk''' is installed.<br />
<br />
==Bash Completion==<br />
To add command completion for bash download the following file: [http://repo.or.cz/w/git.git/blob_plain/HEAD:/contrib/completion/git-completion.bash git-completion.bash]. Then edit your .bashrc file so that it contains the following line:<br />
source git-completion.bash<br />
<br />
==Cheatsheet==<br />
Parts from everywhere, much from the wonderful tutorial here: http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html<br />
<br />
Additionally see [[Super Quick Git Guide]].<br />
<br />
Pull the network scripts with<br />
git clone http://archlinux.org/~james/projects/network.git<br />
Update an existing clone<br />
git pull origin<br />
Commit changes<br />
git commit -a -m "changelog message"<br />
To create a new branch<br />
git branch somebranch<br />
Change to a different branch<br />
git checkout differentbranch<br />
Merge a branch to current active branch<br />
git merge somebranch<br />
Delete a branch<br />
git branch -d somebranch<br />
Diff between two branches<br />
git diff master..somebranch<br />
Diff between two commit ID's (found in git log)<br />
git diff e9780c7cba2855350e914fde227a79bb63c1351d..8b014e40346b38b3b9bfc41359b4e8a68e804c0d<br />
Diff between the last two commits<br />
git diff HEAD^ HEAD<br />
Patchset between two branches (follows same syntax as git diff afaik)<br />
git format-patch master..somebranch<br />
Or better: http://wiki.winehq.org/GitWine#head-f7a29e7ed999b5924748a60c5a1cd4a019032d26<br />
git format-patch -o out origin<br />
Set nano as default editor<br />
git config --global core.editor "nano -w"<br />
Start remote repository<br />
http://www.adeal.eu/starting-with-git.php</div>Markg85https://wiki.archlinux.org/index.php?title=Gitweb&diff=116094Gitweb2010-08-31T17:01:14Z<p>Markg85: /* Installation */</p>
<hr />
<div>Gitweb is the default web interface provided with git itself and is the basis for other git scripts like cgit, gitosis and others.<br />
=Installation=<br />
To install gitweb you fitst have to install git and a webserver. For this example we use apache but you can also use others:<br />
pacman -S git apache<br />
<br />
Next you need to copy the current gitweb default to your webserver location. In this example i use the default folder locations:<br />
cp -R /usr/share/gitweb/ /src/http/<br />
<br />
That's it for the "installation". Next is the configuration.<br />
<br />
=Configuration=<br />
Add the following to the end of you /etc/httpd/conf/httpd.conf<br />
<Directory "/src/http/gitweb"><br />
DirectoryIndex gitweb.cgi<br />
Allow from all<br />
AllowOverride all<br />
Order allow,deny<br />
Options ExecCGI<br />
<Files gitweb.cgi><br />
SetHandler cgi-script<br />
</Files><br />
SetEnv GITWEB_CONFIG /etc/conf.d/gitweb.conf<br />
</Directory><br />
<br />
You can put the configuration in it's own config file in /etc/httpd/conf/extra/ but that's up to you to decide.<br />
<br />
Next we need to make a gitweb config file. Open (or create if not existing) the file /etc/conf.d/gitweb.conf and place this in it:<br />
$projectroot = "/path/to/your/repositories";<br />
$git_temp = "/tmp";<br />
$projects_list = $projectroot;<br />
<br />
Be sure to change the "/path/to/your/repositories" to the path you want your repositories in.<br />
<br />
Now the the configuration is done, please restart apache by executing:<br />
/etc/rc.d/httpd restart<br />
<br />
=Adding repositories=<br />
To add a repository go to your repository folder. There make your repository like so:<br />
mkdir my_repository.git<br />
git init --bare my_repository.git/<br />
cd my_repository.git/<br />
touch git-daemon-export-ok<br />
echo "Short project's description" > description<br />
<br />
Next open the "config" file and add this:<br />
[gitweb]<br />
owner = Your Name<br />
<br />
This will fill in the "Owner" field in gitweb. It's not required.<br />
<br />
I assumed that you want to have this repository as "central" repository storage where you push your commits to so the git-daemon-export-ok and --bare are here to have minimal overhead and to allow the git daemon to be used on it.<br />
<br />
That is all for making a repository. You can now see it on your http://localhost/gitweb (assuming everything went fine). You don't need to restart apache for new repositories since the gitweb cgi script simply reads your repository folder.<br />
<br />
=Git daemon=<br />
This will allow url's like "git clone git://localhost/my_repository.git".<br />
Do know that this git:// protocol is read only!<br />
Execute this line:<br />
git daemon --base-path=/path/to/your/repositories --detach --syslog --export-all<br />
<br />
Again be sure to change the "/path/to/your/repositories" to what you used.<br />
<br />
Note: I don't know yet how to run this every time at boot. I hope someone else can fill that in?<br />
<br />
Now you can simply use:<br />
git clone git://localhost/my_repository.git<br />
<br />
=Thanx to...=<br />
This howto was mainly based on the awesome howto from howtoforge: http://www.howtoforge.com/how-to-install-a-public-git-repository-on-a-debian-server I only picked the parts that are needed to get it working and left the additional things out.</div>Markg85https://wiki.archlinux.org/index.php?title=Gitweb&diff=115995Gitweb2010-08-30T22:59:03Z<p>Markg85: /* Git daemon */</p>
<hr />
<div>Gitweb is the default web interface provided with git itself and is the basis for other git scripts like cgit, gitosis and others.<br />
=Installation=<br />
To install gitweb you fitst have to install git and a webserver. For this example we use apache but you can also use others:<br />
pacman -S git apache<br />
<br />
Next you need to copy the current gitweb default to your webserver location. In this example i use the default folder locations:<br />
cp -R /usr/share/gitweb/ /src/http/<br />
<br />
That's is for the "installation". Next is the configuration.<br />
<br />
=Configuration=<br />
Add the following to the end of you /etc/httpd/conf/httpd.conf<br />
<Directory "/src/http/gitweb"><br />
DirectoryIndex gitweb.cgi<br />
Allow from all<br />
AllowOverride all<br />
Order allow,deny<br />
Options ExecCGI<br />
<Files gitweb.cgi><br />
SetHandler cgi-script<br />
</Files><br />
SetEnv GITWEB_CONFIG /etc/conf.d/gitweb.conf<br />
</Directory><br />
<br />
You can put the configuration in it's own config file in /etc/httpd/conf/extra/ but that's up to you to decide.<br />
<br />
Next we need to make a gitweb config file. Open (or create if not existing) the file /etc/conf.d/gitweb.conf and place this in it:<br />
$projectroot = "/path/to/your/repositories";<br />
$git_temp = "/tmp";<br />
$projects_list = $projectroot;<br />
<br />
Be sure to change the "/path/to/your/repositories" to the path you want your repositories in.<br />
<br />
Now the the configuration is done, please restart apache by executing:<br />
/etc/rc.d/httpd restart<br />
<br />
=Adding repositories=<br />
To add a repository go to your repository folder. There make your repository like so:<br />
mkdir my_repository.git<br />
git init --bare my_repository.git/<br />
cd my_repository.git/<br />
touch git-daemon-export-ok<br />
echo "Short project's description" > description<br />
<br />
Next open the "config" file and add this:<br />
[gitweb]<br />
owner = Your Name<br />
<br />
This will fill in the "Owner" field in gitweb. It's not required.<br />
<br />
I assumed that you want to have this repository as "central" repository storage where you push your commits to so the git-daemon-export-ok and --bare are here to have minimal overhead and to allow the git daemon to be used on it.<br />
<br />
That is all for making a repository. You can now see it on your http://localhost/gitweb (assuming everything went fine). You don't need to restart apache for new repositories since the gitweb cgi script simply reads your repository folder.<br />
<br />
=Git daemon=<br />
This will allow url's like "git clone git://localhost/my_repository.git".<br />
Do know that this git:// protocol is read only!<br />
Execute this line:<br />
git daemon --base-path=/path/to/your/repositories --detach --syslog --export-all<br />
<br />
Again be sure to change the "/path/to/your/repositories" to what you used.<br />
<br />
Note: I don't know yet how to run this every time at boot. I hope someone else can fill that in?<br />
<br />
Now you can simply use:<br />
git clone git://localhost/my_repository.git<br />
<br />
=Thanx to...=<br />
This howto was mainly based on the awesome howto from howtoforge: http://www.howtoforge.com/how-to-install-a-public-git-repository-on-a-debian-server I only picked the parts that are needed to get it working and left the additional things out.</div>Markg85https://wiki.archlinux.org/index.php?title=Gitweb&diff=115994Gitweb2010-08-30T22:56:23Z<p>Markg85: Created page with "Gitweb is the default web interface provided with git itself and is the basis for other git scripts like cgit, gitosis and others. =Installation= To install gitweb you fitst have..."</p>
<hr />
<div>Gitweb is the default web interface provided with git itself and is the basis for other git scripts like cgit, gitosis and others.<br />
=Installation=<br />
To install gitweb you fitst have to install git and a webserver. For this example we use apache but you can also use others:<br />
pacman -S git apache<br />
<br />
Next you need to copy the current gitweb default to your webserver location. In this example i use the default folder locations:<br />
cp -R /usr/share/gitweb/ /src/http/<br />
<br />
That's is for the "installation". Next is the configuration.<br />
<br />
=Configuration=<br />
Add the following to the end of you /etc/httpd/conf/httpd.conf<br />
<Directory "/src/http/gitweb"><br />
DirectoryIndex gitweb.cgi<br />
Allow from all<br />
AllowOverride all<br />
Order allow,deny<br />
Options ExecCGI<br />
<Files gitweb.cgi><br />
SetHandler cgi-script<br />
</Files><br />
SetEnv GITWEB_CONFIG /etc/conf.d/gitweb.conf<br />
</Directory><br />
<br />
You can put the configuration in it's own config file in /etc/httpd/conf/extra/ but that's up to you to decide.<br />
<br />
Next we need to make a gitweb config file. Open (or create if not existing) the file /etc/conf.d/gitweb.conf and place this in it:<br />
$projectroot = "/path/to/your/repositories";<br />
$git_temp = "/tmp";<br />
$projects_list = $projectroot;<br />
<br />
Be sure to change the "/path/to/your/repositories" to the path you want your repositories in.<br />
<br />
Now the the configuration is done, please restart apache by executing:<br />
/etc/rc.d/httpd restart<br />
<br />
=Adding repositories=<br />
To add a repository go to your repository folder. There make your repository like so:<br />
mkdir my_repository.git<br />
git init --bare my_repository.git/<br />
cd my_repository.git/<br />
touch git-daemon-export-ok<br />
echo "Short project's description" > description<br />
<br />
Next open the "config" file and add this:<br />
[gitweb]<br />
owner = Your Name<br />
<br />
This will fill in the "Owner" field in gitweb. It's not required.<br />
<br />
I assumed that you want to have this repository as "central" repository storage where you push your commits to so the git-daemon-export-ok and --bare are here to have minimal overhead and to allow the git daemon to be used on it.<br />
<br />
That is all for making a repository. You can now see it on your http://localhost/gitweb (assuming everything went fine). You don't need to restart apache for new repositories since the gitweb cgi script simply reads your repository folder.<br />
<br />
=Git daemon=<br />
This will allow url's like "git clone git://localhost/my_repository.git".<br />
Execute this line:<br />
git daemon --base-path=/path/to/your/repositories --detach --syslog --export-all<br />
<br />
Again be sure to change the "/path/to/your/repositories" to what you used.<br />
<br />
Note: I don't know yet how to run this every time at boot. I hope someone else can fill that in?<br />
<br />
Now you can simply use:<br />
git clone git://localhost/my_repository.git<br />
<br />
=Thanx to...=<br />
This howto was mainly based on the awesome howto from howtoforge: http://www.howtoforge.com/how-to-install-a-public-git-repository-on-a-debian-server I only picked the parts that are needed to get it working and left the additional things out.</div>Markg85https://wiki.archlinux.org/index.php?title=AMD_Catalyst&diff=113640AMD Catalyst2010-08-10T13:39:38Z<p>Markg85: /* Video acceleration */</p>
<hr />
<div>[[Category: Graphics (English)]]<br />
[[Category: X Server (English)]]<br />
[[Category: HOWTOs (English)]]<br />
{{i18n|ATI Catalyst}}<br />
{{Article summary start}}<br />
{{Article summary text|An overview of ATI's proprietary "Catalyst" video card driver.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|ATI}}<br />
{{Article summary wiki|Intel}}<br />
{{Article summary wiki|NVIDIA}}<br />
{{Article summary wiki|Xorg}}<br />
{{Article summary heading|Resources}}<br />
{{Article summary link|cchtml.com - Unofficial Wiki for the ATI Linux Driver|http://wiki.cchtml.com/index.php/Main_Page}}<br />
{{Article summary link|Unofficial ATI Linux Driver Bugzilla|http://ati.cchtml.com/query.cgi}}<br />
{{Article summary end}}<br />
Formerly known as ''fglrx'', ATI has rebranded their proprietary Linux driver, which is now known as ''Catalyst''. Currently, only the package name has changed, while the kernel module retains its original ''fglrx'' name, therefore any mention of fglrx below is specifically in reference to the kernel module, ''not the package.''<br />
<br />
==Naming conventions==<br />
ATI's [[Wikipedia:Radeon|Radeon]] brand follows a naming scheme that relates each product to a market segment. Within this article, readers will see both ''product'' names (e.g. HD 4850, X1900) and ''code'' or ''core'' names (e.g. RV770, R580). Traditionally, a ''product series'' will correspond to a ''core series'' (e.g. the "X1000" product series includes the X1300, X1600, X1800, and X1900 products which utilize the "R500" core series &ndash; including the RV515, RV530, R520, and R580 cores).<br />
<br />
For a table of core and product series, see [[Wikipedia:Comparison of AMD graphics processing units]].<br />
<br />
== Supported devices ==<br />
Since v. '''9.4''', the proprietary ATI driver '''supports only R600 and newer devices''' (that means, '''HD2xxx''' and '''newer'''). For older cards, you can only use '''xf86-video-ati'''.<br />
<br />
== Installation ==<br />
Catalyst was once a precompiled package offered by Arch in the <code>extra</code> repository, but as of March 2009, official support has been dropped because of dissatisfaction with the quality and speed of development of the proprietary driver. The [http://aur.archlinux.org/packages.php?ID=29111 catalyst driver] is available on AUR.<br />
<br />
=== Stock and Custom Kernels ===<br />
<br />
[http://aur.archlinux.org/packages.php?ID=29111 AUR's catalyst] will automatically re-compile fglrx module whenever kernel is updated and whenever new kernel is installed, this functionality is provided by a '''fglrx hook''' on [[mkinitcpio]]. The hook will call '''catalyst_build_module''' command to update fglrx module for the version of your new kernel. It means that you no longer need to rebuild whole catalyst package whenever kernel is updated/installed. Also fglrx module is created while installing catalyst package (and for kernel you are using in the moment of installing catalyst package), not while building package like it was earlier. You can build AUR's catalyst package via [[makepkg]] (recommended) or by using popular AUR's packages manager like bauerbill/yaourt.<br />
<br />
{{Note| You may get an error about the Catalyst package conflicting with ''libgl''. In that case, run the following code to remove libgl without checking dependencies (Catalyst provides libgl package, so this is safe):<br />
# pacman -Rd libgl<br />
After doing this you can install catalyst package using ie. # pacman -U /patch/to/builded/catalyst_package.tar.xz}}<br />
<br />
Now you probably need to configure xorg. Using provided '''aticonfig''' tool is recommended:<br />
<pre><br />
# aticonfig --initial <br />
(or for Dual Head: # aticonfig --initial=dual-head)<br />
# aticonfig -v<br />
</pre><br />
And add '''nomodeset''' to your kernel line in /boot/grub/menu.lst , ie.:<br />
<code>kernel /boot/vmlinuz26 root=/dev/sda1 ro nomodeset</code><br />
Plus add '''fglrx''' to the MODULES list in /etc/rc.conf."<br />
<br />
You may now reboot your system, or just load fglrx module with:<br />
# modprobe fglrx<br />
and restart/start X.<br />
<br />
{{Note|There is some '''disadvantage of using fglrx hook''' - but exist only when kernel26 gots some main update (ie. 2.6.33->2.6.34, not 2.6.34.1->2.6.34.2) because package kernel26-headers is installed after kernel26 installation, and so fglrx hook have no headers to build fglrx module. In that situation run:<br />
# catalyst_build_module ''new_kernel_version''<br />
ie. # catalyst_build_module 2.6.34-ARCH<br />
just after main kernel26/kernel26-headers update.}}<br />
<br />
Now if you have got x86_64 architecture system and want to use some 32-bit opengl programs or wine games you will have to install [http://aur.archlinux.org/packages.php?ID=24824 AUR's lib32-catalyst-utils] <br />
<br />
<br />
If you are using '''more than one kernel''' - you can simply build fglrx module for whatever kernel you've got without even booting that kernel, do it as root with this command:<br />
# catalyst_build_module ''kernel_version''<br />
where ''kernel_version'' is version of kernel for which you want to build fglrx module, more precise example:<br />
# catalyst_build_module 2.6.35-rc4-rc<br />
Also:<br />
# catalyst_build_module<br />
will build fglrx module for kernel that is currently running.<br />
<br />
'''Unused fglrx modules''' will be removed automatically whenever kernel is installed/updated - with '''catalyst_build_module remove''' command called by fglrx hook. Ofcourse you can also use<br />
# catalyst_build_module remove<br />
manually.<br />
<br />
If you '''aren't using stock kernel''' (kernel26) at all - you can remove it from dependency array (depends=) in catalyst's PKGBUILD.<br />
<br />
Please also note that if your custom kernel is using some '''non-standard mkinitcpio configuration file''' (ie. kernel26-zen is using /etc/mkinitcpio-zen.conf) you'll have to manually add '''fglrx''' to HOOKS array so it can be auto-recompiled with kernel's update.<br />
<br />
''If you need more information on catalyst, visit [http://bbs.archlinux.org/viewtopic.php?id=57084 this thread] or create a new one, and ask there.''<br />
<br />
=== Catalyst's repositories ===<br />
<br />
There are some unofficial repositories containing the newest (or older) catalyst packages along with the appropriate libs and software in order to use the driver.<br />
<br />
{{Note| If you want to know what packages are inside any given repository you need to first add repository to pacman.conf and then list repository with pacman -Sl command, ie.:<br />
# pacman -Sl catalyst<br />
}}<br />
==== Main repository ====<br />
There is a repository called '''[catalyst]''' which contains '''newest stable catalyst driver''' and some additional packages like '''patched xorg-server'''.<br />
This repository should now work with any kernel and with multiple-kernels systems (read [http://wiki.archlinux.org/index.php/ATI_Catalyst#Stock_and_Custom_Kernels Stock and Custom Kernels] section) and it is updated most frequently.<br />
To use it you need as root:<br />
<br />
'''1)''' Edit /etc/pacman.conf and add those lines above all other repositories:<br />
<br />
For i686 systems:<br />
[catalyst]<br />
Server = http://catalyst.apocalypsus.net/repo/catalyst/i686<br />
<br />
For x86_64 systems:<br />
[catalyst]<br />
Server = http://catalyst.apocalypsus.net/repo/catalyst/x86_64<br />
<br />
ie. for x86_64 systems pacman.conf should look like:<br />
<br />
(...)<br />
[catalyst]<br />
Server = http://catalyst.apocalypsus.net/repo/catalyst/x86_64<br />
[core]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist<br />
[extra]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist<br />
(...)<br />
<br />
'''2)''' Update repositories and packages with:<br />
# pacman -Syy<br />
# pacman -Suu<br />
<br />
'''3)''' Remove libgl package and install catalyst:<br />
# pacman -Rd libgl<br />
# pacman -S catalyst<br />
<br />
'''4)''' '''Don't forget''' to prepare your /etc/X11/xorg.conf for catalyst. Use aticonfig --initial if you don't have prepared xorg.conf.<br />
Also add fglrx module to MODULES array in /etc/rc.conf<br />
<br />
'''5) Reboot'''<br />
<br />
For '''x86_64''' users '''[catalyst]''' provides lib32-catalyst-utils package needed to run 32-bit opengl applications and wine games.<br />
<br />
Repository also contains '''mplayer-vaapi''' (or '''mplayer-vaapi-pulse''' if you are using PulseAudio) and '''xvba-video''' packages so you may easily use '''video acceleration''' described [http://wiki.archlinux.org/index.php/ATI_Catalyst#Video_acceleration below].<br />
<br />
<br />
===== Troubleshooting =====<br />
<br />
====== Black/grey/white boxes/artifacts mainly in firefox/thunderbird ======<br />
With catalyst 10.6 AMD/ATi announce new method of 2D acceleration for radeons, that funcionality has fixed problems with maximizing/resizing windows. Unfortunately this step causes bugs for some users. To turn on old (slower xaa) method of 2d rendering please kill your desktop environment and Xserver and type this command as root:<br />
aticonfig --set-pcs-str=DDX,ForceXAA,TRUE<br />
<br />
If you do that '''it's better to use one of patched xorg-server packages''' delivered by [catalyst] repository.<br />
<br />
'''[catalyst]''' repository contains [http://catalyst.apocalypsus.net/tarball/xorg-server-backclear.tar.gz xorg-server-backclear] (patched with backclear patch) and [http://aur.archlinux.org/packages.php?ID=36328 xorg-server-1.8-'''catalyst-maximize-fix'''] (patched with fedora patch) packages. Both this patches are fixing problems with '''maximizing/resizing''' but they are doing it in different way - you may choose which patched xserver is best for you. To remove xorg-server and install xorg-server-backclear just type:<br />
# pacman -Rd xorg-server<br />
# pacman -S xorg-server-backclear<br />
Similar with xorg-server-1.8-catalyst-maximize-fix.<br />
<br />
====== Xserver segmentation fault ======<br />
Rebuild your xorg.conf with:<br />
aticonfig --initial<br />
or: <br />
aticonfig --initial --force<br />
(if its still not woking then remove /etc/X11/xorg.conf and use one of these two commands mentioned above)<br />
<br />
====== Keyboard/mouse not working ======<br />
Please remember that old hal's input config''' doesn't work with new xorg-server'''.<br />
<br />
Well it should work out of the box with provided with xorg-server 1.8 package files: /etc/X11/xorg.conf.d/'''10-evdev.conf''' and /etc/X11/xorg.conf.d/'''10-quirks.conf'''<br />
but it could happen that's not working / fitting to you so read more here [http://wiki.archlinux.org/index.php/Xorg Arch's Xorg wiki] or here [https://fedoraproject.org/wiki/Input_device_configuration Fedora's wiki for Input device configuration] but don't forget that in archlinux we are using '''/etc/X11/xorg.conf.d''' directory instead of fedora's /etc/xorg.conf.d<br />
<br />
{{Warning| '''Do not''' add any new xserver Section into your /etc/X11/xorg.conf - this file is still used by catalyst - i mean ie dont add any Section "InputClass" into xorg.conf because when you do this both aticonfig and amdcccle wont start cause of parsing xorg.conf error (just use /etc/X11/xorg.conf.d directory for it)}}<br />
<br />
==== Archive repositories ====<br />
<br />
'''[catalyst-10.5]''' repository works fine with 2.6.34-ARCH kernel and xserver 1.8. xorg-server package here is patched with backclear patch, and xorg-server-1.8-catalyst-maximize-fix package is patched with fedora's backfill patch.<br />
<br />
For i686:<br />
[catalyst-10.5]<br />
http://catalyst.apocalypsus.net/repo/catalyst/i686<br />
For x86_64:<br />
[catalyst-10.5]<br />
http://catalyst.apocalypsus.net/repo/catalyst/x86_64<br />
<br />
<br />
{{Note| Archive repositories listed below '''work only with kernel 2.6.33-ARCH and xserver 1.7'''. You may find xserver 1.7 packages in '''[xorg17]''' repository mentioned below. If you are using kernel other than 2.6.33-ARCH please use one of [http://catalyst.apocalypsus.net/tarball/ archive tarballs] to build catalyst for your kernel.<br />
}}<br />
<br />
<br />
'''[xorg17] repository''' contains xserver 1.7 packages, use it only if you are experiencing problems with newer xserver 1.8.<br />
<br />
'''[xorg17]''' repository contains [http://catalyst.apocalypsus.net/tarball/xorg-server-1.7-backclear.tar.gz xorg-server-backclear] (patched with backclear patch) and [http://aur.archlinux.org/packages.php?ID=35686 xorg-server-1.7-catalyst-maximize-fix] (patched with fedora patch) packages. Both this patches fix problems with '''maximizing/resizing''' but they are doing it in different way - you may choose which patched xserver is best for you. To remove xorg-server and install xorg-server-backclear just type:<br />
# pacman -Rd xorg-server<br />
# pacman -S xorg-server-backclear<br />
Similar with xorg-server-1.7-catalyst-maximize-fix<br />
<br />
To use [xorg17] repo please put those lines at the top of all other repositories in '''/etc/pacman.conf''':<br />
<br />
For i686:<br />
[xorg17]<br />
Server = http://catalyst.apocalypsus.net/repo/xorg17/i686<br />
<br />
For x86_64:<br />
[xorg17]<br />
Server = http://catalyst.apocalypsus.net/repo/xorg17/x86_64<br />
<br />
<br />
'''catalyst-10.6''' works well with xserver-1.7, got opengl 3.3/4 support, brings new 2D acceleration support, got some problems with gamma, wine games, and texturing in basing on q3a engine games:<br />
<br />
For i686:<br />
[catalyst-10.6]<br />
Server = http://catalyst.apocalypsus.net/repo/catalyst-archive/i686<br />
<br />
For x86_64:<br />
[catalyst-10.6]<br />
Server = http://catalyst.apocalypsus.net/repo/catalyst-archive/x86_64<br />
<br />
<br />
If you are experiencing known bugs/errors (ie. lots of artifacts) with catalyst 10.6 you may still use older '''catalyst-10.5''' or '''catalyst-10.4''' or '''catalyst-10.3''' repositories.<br />
<br />
'''catalyst-10.5''' and '''catalyst-10.4''' repositories contain [http://aur.archlinux.org/packages.php?ID=26687 xorg-server] (for this repositories patched with backclear patch) and [http://aur.archlinux.org/packages.php?ID=35686 xorg-server-1.7-catalyst-maximize-fix] (patched with fedora patch) packages. Both this patches fix problems with '''maximizing/resizing''' but they are doing it in different way - you may choose which patched xserver is best for you. To remove xorg-server and install xorg-server-1.7-catalyst-maximize-fix just type:<br />
# pacman -Rd xorg-server<br />
# pacman -S xorg-server-1.7-catalyst-maximize-fix<br />
<br />
<br />
'''catalyst-10.5''' works well with xserver-1.7, got opengl 3.3/4 support, but still got some problems with gamma, wine games, and texturing in basing on q3a engine games:<br />
<br />
For i686:<br />
[catalyst-10.5]<br />
Server = http://catalyst.apocalypsus.net/repo/catalyst-archive/i686<br />
<br />
For x86_64:<br />
[catalyst-10.5]<br />
Server = http://catalyst.apocalypsus.net/repo/catalyst-archive/x86_64<br />
<br />
'''catalyst-10.5''' repository also contains '''libva-sds''', '''mplayer-vaapi''' and '''xvba-video''' packages so you may easily use '''video acceleration''' described [http://wiki.archlinux.org/index.php/ATI_Catalyst#Video_acceleration below].<br />
<br />
<br />
If you don't like catalyst-10.5 you may still use older '''catalyst 10.4''' which work well with xserver-1.7, but still got some problems with gamma and wine games:<br />
<br />
For i686:<br />
[catalyst-10.4]<br />
Server = http://catalyst.apocalypsus.net/repo/catalyst-archive/i686<br />
<br />
For x86_64:<br />
[catalyst-10.4]<br />
Server = http://catalyst.apocalypsus.net/repo/catalyst-archive/x86_64<br />
<br />
<br />
Or '''catalyst-10.3'''. Catalyst 10.3 is still using old''' xserver 1.6''', which is also provided by '''[catalyst-10.3]''' repository.<br />
<br />
To use '''catalyst-10.3''' you need as root:<br />
<br />
'''1)''' Edit /etc/pacman.conf and add those lines above all other repositories:<br />
For i686:<br />
[catalyst-10.3]<br />
Server = http://catalyst.apocalypsus.net/repo/catalyst-archive/i686<br />
<br />
For x86_64:<br />
[catalyst-10.3]<br />
Server = http://catalyst.apocalypsus.net/repo/catalyst-archive/x86_64<br />
<br />
'''2)''' Sync and downgrade packages with this commands<br />
# pacman -Syy<br />
# pacman -Suu<br />
<br />
'''3)''' Remove xf86-video-ati and ati-dri packages if you have them installed.<br />
<br />
'''4)''' (Recommended) If you dont like speed of xorg-server - remove it:<br />
# pacman -Rd xorg-server<br />
and try xorg-server-catalyst-maximize-fix:<br />
# pacman -S xorg-server-catalyst-maximize-fix<br />
<br />
'''5)''' Remove libgl and install catalyst:<br />
# pacman -Rd libgl<br />
# pacman -S catalyst<br />
'''6)''' '''Don't forget''' to prepare your /etc/X11/xorg.conf for catalyst. Use aticonfig --initial if you don't have prepared xorg.conf.<br />
Also add fglrx module to MODULES array in /etc/rc.conf<br />
<br />
'''7)''' Reboot<br />
<br />
=== ATI/AMD Installer ===<br />
{{Warning| Using the installer from ati.com/amd.com is NOT recommended for inexperienced users! Doing so may cause file conflicts and X failures. The packages available through pacman are configured specifically for Arch Linux and so should be used instead.}}<br />
<br />
If you have attempted a manual install from the official installer, and are finding that nothing works correctly anymore, there should be an uninstall script placed at /usr/share/ati - run that, then try the pacman packages.<br />
<br />
If you ''must'' use the installer from ATI/AMD for some reason, the following steps '''might''' work for you:<br />
<br />
*Download AMD/ATI driver installer from the official site only.<br />
*Make it executable.<br />
*Execute a terminal emulator (e.g Konsole) and be root.<br />
*Install mesa package<br />
pacman -S mesa<br />
*(Re)Install Xorg <br />
*Check for other required things for ATI/AMD installer listed on their website<br />
#pacman -Q | grep NameOfPackage<br />
*Use aticonfig as described below to update xorg.conf<br />
*Add ModulesPath into xorg.conf pointing at fglrx.so module if necessary<br />
<br />
== Configuration ==<br />
ATI provides the <code>aticonfig</code> tool to create new basic <code>xorg.conf</code> file or modify an existing <code>xorg.conf</code> file and configure essentially every aspect of the card. For a complete list of <code>aticonfig</code> options, run:<br />
$ aticonfig --help<br />
<br />
If you want to create new xorg.conf file with specific for your system options, run the following command to generate one:<br />
# Xorg -configure<br />
<br />
{{Warning| '''Xorg -configure''' isn't actually recommended - sometimes it doesn't work good with catalyst and could cause your Xserver to break at start with black screen of death. So use it only if you are 100% sure of what you are doing. In most cases '''aticonfig --initiall''' mentioned below should build working xorg.conf file and Xserver should automatically and correctly detect all your input devices.}}<br />
<br />
The simplest way to use <code>aticonfig</code> to adapt your <code>xorg.conf</code> file is listed in the examples at the end of the output if you run <code>aticonfig</code> without any command-line parameters:<br />
Examples:<br />
1. Setting up fglrx for the first time.<br />
Single head : aticonfig --initial --input=/etc/X11/xorg.conf<br />
Dual head : aticonfig --initial=dual-head --screen-layout=above<br />
This command will generate a dual head configuration<br />
file with the second screen located above the first<br />
screen.<br />
<br />
Just adapt one of those two lines for your personal setup.<br />
<br />
{{Warning| Please check the generated xorg.conf file before you copy it to /etc/X11/xorg.conf and happily startx or reboot. Otherwise, you'll probably get a locked blank screen and won't be able to use your system anymore.}} The config files generated by preceding steps are sometimes incorrect. If you want, you can compare the generated files to one of the [http://wiki.archlinux.org/index.php?title=Xorg7#Sample_Xorg.conf_Files Sample Xorg.conf files] listed on the Xorg wiki page.<br />
<br />
Please ensure that in the "Screen" section you have "DefaultDepth 24" and there is a "DRI" section with "Mode 666" in it. The fglrx driver needs those lines to work, but the generated files by preceding programs don't have it. Without those lines, you might get an unresponsive black screen after reboot. Besides, since most of the parts are now automatically detected in modern Xorg, you don't need to write so many things in xorg.conf as you did before with ancient Xorg versions.<br />
So, some config sections/values in the generated xorg.conf are redundant.<br />
<br />
Here is a minimal working example:<br />
<pre><br />
Section "ServerLayout"<br />
Identifier "X.org Configured"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "Mouse0" "CorePointer"<br />
InputDevice "Keyboard0" "CoreKeyboard"<br />
EndSection<br />
<br />
Section "Files"<br />
RgbPath "/usr/share/X11/rgb"<br />
ModulePath "/usr/lib/xorg/modules"<br />
FontPath "/usr/share/fonts/misc"<br />
FontPath "/usr/share/fonts/100dpi:unscaled"<br />
FontPath "/usr/share/fonts/75dpi:unscaled"<br />
FontPath "/usr/share/fonts/TTF"<br />
FontPath "/usr/share/fonts/Type1"<br />
EndSection<br />
<br />
Section "Module"<br />
Load "extmod"<br />
Load "dbe"<br />
Load "xtrap"<br />
Load "record"<br />
Load "dri"<br />
Load "glx"<br />
Load "GLcore"<br />
Load "freetype"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "Keyboard0"<br />
Driver "kbd"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "Mouse0"<br />
Driver "mouse"<br />
Option "Protocol" "auto"<br />
Option "Device" "/dev/input/mice"<br />
Option "ZAxisMapping" "4 5 6 7"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
VendorName "Monitor Vendor"<br />
ModelName "Monitor Model"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Card0"<br />
Driver "fglrx"<br />
VendorName "ATI Technologies Inc"<br />
BoardName "Radeon Mobility X1400"<br />
BusID "PCI:1:0:0"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Card0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Viewport 0 0<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
<br />
Section "DRI"<br />
Mode 0666<br />
EndSection<br />
</pre><br />
<br />
Next, make sure the fglrx module and any needed agp modules are loaded. <br />
# modprobe fglrx <br />
<br />
Add them to the '''MODULES''' array of your /etc/rc.conf to ensure that they load when you boot. <br />
<br />
Finally, run Xorg with <code>startx</code> or by using GDM/KDM and verify that direct rendering is enabled by running the following command in a terminal:<br />
$ glxinfo | grep direct<br />
<br />
If it says "direct rendering: yes" then you're good to go! If the glxinfo command is not found, you may need to install the mesa package as well.<br />
<br />
{{Warning| In recent versions of Xorg, the paths of libs are changed. So, sometimes '''libGL.so''' cannot be correctly loaded even if it's installed. Don't forget to check this if your GL is not working. Please read "Troubleshooting" section for details.}}<br />
<br />
== Video acceleration ==<br />
'''[http://en.wikipedia.org/wiki/Video_Acceleration_API Video Acceleration API] (VA API)''' is an open source software library ("libVA") and API specification which enables and provides access to '''graphics hardware (GPU) acceleration''' for video processing on Linux and UNIX based operating systems.<br />
The main motivation for VA API is to enable hardware accelerated video decode at various entry-points (VLD, IDCT, Motion Compensation, deblocking) for the prevailing coding standards today (MPEG-2, MPEG-4 ASP/H.263, MPEG-4 AVC/H.264, and VC-1/WMV3).<br />
<br />
In November 2009, VA-API gained a new proprietary '''xvba-video''' backend which allows VA-API powered applications to take advantage of AMD Radeon's UVD2 chipsets via the [http://en.wikipedia.org/wiki/XvBA XvBA (X-Video Bitstream Acceleration API designed by AMD)] library.<br />
<br />
XvBA support and xvba-video is still under development, however in nowadays it is '''working very well in most cases''' and with '''mplayer''' (and mplayer front-ends), so feel free to check it. You have to build following packages: [http://aur.archlinux.org/packages.php?ID=31723 xvba-video] and [http://aur.archlinux.org/packages.php?ID=35321 mplayer-vaapi].<br />
Then just set your video player to use vaapi:gl as video output.<br />
<br />
Ie. for '''mplayer''':<br />
$ mplayer -vo vaapi:gl -va vaapi movie.avi<br />
<br />
Ie. for '''smplayer''':<br />
Options -> Preferences -> General -> Video (tab) -> Output driver: User Defined : vaapi:gl<br />
Options -> Preferences -> General -> Video (tab) -> Double buffering '''on'''<br />
Options -> Preferences -> Advanced -> Options for MPlayer -> Options: -va vaapi<br />
Options -> Preferences -> General -> General -> Screenshots -> Turn screenshots '''off'''<br />
<br />
Don't forget to enable v-sync in '''amdcccle''':<br />
3D -> More Settings -> Wait for vertical refresh = Always On<br />
<br />
Note: If you are using '''compiz/kwin''' please note that the only way to '''avoid video flickering''' is to watch videos in '''full-screen''', and only when '''Unredirect Fullscreen is off'''.<br />
<br />
In '''compiz''' you need to set '''Redirected Direct Rendering''' in General Options of ccsm.<br />
<br />
Its off by default in '''kwin''', but if you see flickering you need to add UnredirectFullscreen=off line to [Compositing] section in ~/.kde4/share/config/kwinrc file.<br />
<br />
If its still flickering try to disable this option in ccsm (or change UnredirectFullscreen=off to UnredirectFullscreen=on in kwinrc).<br />
<br />
=== Repository ===<br />
{{Note| for editors: Do not remove this section since it works and make it easier for users to get it working!<br />
}}<br />
[catalyst] repository mentioned above contain all files (xvba-video and mplayer-vaapi) needed to serve video acceleration, those files should work fine with libva package from '''[extra]''' repository. Unfortunately libva from [extra] repository has been downgraded because its not working for intel users.<br />
<br />
New libva and xvba-video packages contains '''some important fixes''' with which mplayer's osd should always work fine and what's most important should always '''show subtitles correctly''' (this osd errors touches also smplayer's subtitles)<br />
<br />
That's why '''[new_xvba] repository''' with '''newest libva, xvba-video and mplayer-vaapi''' packages showed up. To use it please put those lines above ALL other repos (yes, also above [catalyst] repo) in /etc/pacman.conf:<br />
<br />
For i686:<br />
[new_xvba]<br />
Server = http://catalyst.apocalypsus.net/repo/new_xvba/i686<br />
<br />
For x86_64:<br />
[new_xvba]<br />
Server = http://catalyst.apocalypsus.net/repo/new_xvba/x86_64<br />
<br />
{{Note| Please note that after doing this ie. VLC player from [extra] won't work - simply because it's compiled for older version of libva - so if you want to use VLC with those newest packages you will have to rebuild VLC manually.<br />
}}<br />
<br />
=== Troubleshooting ===<br />
==== Problems with video colours ====<br />
You may still use vaapi:gl to avoid video flickering, but without video acceleration<br />
<br />
Run '''mplayer''' without '''-va vaapi''' switch.<br />
<br />
For '''smplayer''' remove '''-va vaapi''' from Options -> Preferences -> Advanced -> Options for MPlayer -> Options: -va vaapi<br />
<br />
Plus for '''smplayer''' you may now safely turn screenshots on.<br />
<br />
== Troubleshooting (catalyst) ==<br />
<br />
=== Rectangle/Checkerbox corruption with OpenGL programs ===<br />
''This was fixed in catalyst '' 8.9.'' It may occur though in later versions.''<br />
<br />
OpenGL programs like e.g. blender in windowed mode, show a rectangle/checkerbox corruption.<br />
This can be solved by using a Virtual display setting with a multiple of 64 bigger than your actual resolution like 1664 instead 1600 for width:<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Card0"<br />
Monitor "Monitor0"<br />
SubSection "Display"<br />
Depth 24<br />
Virtual 1664 1200<br />
EndSubSection<br />
EndSection<br />
<br />
===Black screen with complete lockups / hangs after reboot or startx===<br />
<br />
==== Faulty or corrupted amdpcsdb database ====<br />
Fglrx and its Catalyst Control Center stores data on a database called '''amdpcsdb''', located under '''/etc/ati'''. It isn't human readable, but only parsable by Catalyst Control Center. Sometimes, after updates, the settings in there aren't compatible with the new version of fglrx, so you end up with a black screen when starting X. <br />
<br />
So, there is one thing to do.<br />
<br />
Boot to init3, add the number 3 at the end of the menu.lst kernel options:<br />
# rm /etc/ati/amdpcsdb<br />
and restart Xorg (or even reboot).<br />
<br />
{{Warning|Be careful. If you have saved settings through Catalyst Control Center, which are stored under that file, they may now have been lost. You should edit xorg.conf instead, by using '''aticonfig'''.}}<br />
<br />
Be careful though. '''aticonfig''' stores its settings in '''amdpcsdb''' database like Catalyst Control Center. If you want that they're stored in xorg.conf instead, each time you use the aticonfig tool, add '''--input=/etc/X11/xorg.conf''' in the end of the command options as well.<br />
<br />
==== Faulty ACPI hardware calls ====<br />
It is possible that fglrx doesn't cooperate well with the system's ACPI hardware calls, so it autodisables itself and there is no screen output. <br />
<br />
So try to run this:<br />
aticonfig --acpi-services=off<br />
<br />
==== nForce 4 Incompatibility ====<br />
Starting with 9.10 onward, the fglrx drivers are incompatible with nForce 4 chipsets. Use the open source drivers until a fix is created.<br />
<br />
See [http://ati.cchtml.com/show_bug.cgi?id=1794 bug report].<br />
<br />
===KDM disappears after logout===<br />
If you are running the '''catalyst''' proprietary driver and you get a console (tty1) instead of the expected KDM greeting when you log out, you must instruct KDM to restart the X server after each logout:<br />
$ sudo nano /usr/share/config/kdm/kdmrc<br />
<br />
Uncomment the following line under the section titled [X-:*-Core]:<br />
TerminateServer=True<br />
<br />
KDM should now appear when you log out of KDE.<br />
<br />
=== Bad screen resolution at login manager ===<br />
If the resolution for your login manager is for example 1600x1200 and you want 1280x1024 you can fix it by using a xorg.conf (newer X-servers using the open source drivers normally don't need a xorg.conf, so if you don't have a xorg.conf you need to create one). In the "Screen" section add a modes lines:<br />
Section "Screen"<br />
Identifier "aticonfig-Screen[0]-0"<br />
Device "aticonfig-Device[0]-0"<br />
Monitor "aticonfig-Monitor[0]-0"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Viewport 0 0<br />
Depth 24<br />
Modes "1280x1024" "2048x1536"#<-add this line to change the default login screen resolution<br />
EndSubSection<br />
EndSection<br />
The first argument of modes is the resolution, which will be used by default. The second argument is the maximum resolution supported by your monitor. This is needed so that you are able to choose higher screen resolutions using for example the KDE systemsettings.<br />
<br />
===Direct Rendering Doesn't Work===<br />
This problem may occur when using the proprietary '''catalyst''' driver. <br />
<br />
{{Warning|Make sure that you own a '''R6xx''' ('''HD2xxx''') or newer card or the driver '''won't''' be enabled. You may encounter that error if you try to enable your display by using catalyst and a card older than the R6xx ones.}}<br />
<br />
{{Warning|This error would also appear if you haven't '''rebooted''' your system after the installation or upgrade of catalyst. The system needs to load the fglrx.ko module in order to make the driver work.}}<br />
<br />
If you have problem with direct rendering, run:<br />
$ LIBGL_DEBUG=verbose glxinfo > /dev/null<br />
at the command prompt. At the very start of the output, it'll usually give you a nice error message saying why you don't have direct rendering.<br />
<br />
Common errors, and their solutions, are:<br />
'''libGL error: XF86DRIQueryDirectRenderingCapable returned false'''<br />
<br />
* Ensure that you are loading the correct agp modules for your AGP chipset before you load the fglrx kernel module. To determine which agp modules you'll need, run <code>hwdetect --show-agp</code>, then ensure that all modules listed from that command are in the <code>MODULES=</code> array in rc.conf, '''before''' fglrx.<br />
'''libGL error: failed to open DRM: Operation not permitted'''<br />
'''libGL error: reverting to (slow) indirect rendering'''<br />
<br />
* For this, make sure you have the following section in your <code>xorg.conf</code> somewhere:<br />
Section "DRI"<br />
Mode 0666<br />
EndSection<br />
<br />
'''libGL: OpenDriver: trying /usr/lib/xorg/modules/dri//fglrx_dri.so'''<br />
'''libGL error: dlopen /usr/lib/xorg/modules/dri//fglrx_dri.so failed (/usr/lib/xorg/modules/dri//fglrx_dri.so: cannot open shared object file: No such file or directory)'''<br />
'''libGL error: unable to find driver: fglrx_dri.so'''<br />
<br />
* Something hasn't been installed correctly. If the paths in the error message are <code>/usr/X11R6/lib/modules/dri/fglrx_dri.so</code>, then ensure you've logged completely out of your system, then back in. If you're using a graphical login manager (gdm, kdm, xdm), ensure that /etc/profile is sourced every time you log in. This is usually accomplished by adding <code>source /etc/profile</code> into <code>~/.xsession</code> or <code>~/.xinitrc</code>, but may vary between login managers.<br />
<br />
* If the paths above in your error message _are_ <code>/usr/lib/xorg/modules/dri/fglrx_dri.so</code>, then something hasn't been correctly installed. Try reinstalling the <code>catalyst</code> package.<br />
<br />
Errors such as:<br />
'''fglrx: libGL version undetermined - OpenGL module is using glapi fallback'''<br />
could be caused by having multiple versions of <code>libGL.so</code> on your system. Run:<br />
$ sudo updatedb<br />
$ locate libGL.so<br />
<br />
This should return the following output:<br />
$ locate libGL.so<br />
/usr/lib/libGL.so<br />
/usr/lib/libGL.so.1<br />
/usr/lib/libGL.so.1.2<br />
$<br />
<br />
These are the only three libGL.so files you should have on your system. If you have any more (e.g. <code>/usr/X11R6/lib/libGL.so.1.2</code>), then remove them. This should fix your problem. <br />
<br />
You might not get any error to indicate that this is a problem. If you are using X11R7, make sure you do '''not''' have these files on your system:<br />
/usr/X11R6/lib/libGL.so.1.2<br />
/usr/X11R6/lib/libGL.so.1<br />
<br />
===Hibernate/Sleep Issues===<br />
<br />
==== Video fails to enter suspend/hibernate ====<br />
If <code>fglrx</code> returns an error when attempting to suspend through hibernate scripts, a solution may be to add the following line to your "Device" section in <code>/etc/X11/xorg.conf</code>, which should allow the <tt>fglrx</tt> module to enter suspend mode.<br />
Option "UseInternalAGPGart" "no"<br />
<br />
==== Video fails to resume from suspend2ram ====<br />
ATI's proprietary <tt>catalyst</tt> driver cannot resume from suspend if the framebuffer is enabled. To disable the framebuffer, add '''vga=0''' to your kernel options in <code>/boot/grub/menu.lst</code>, for example:<br />
# (0) Arch Linux<br />
title Arch Linux<br />
root (hd0,0)<br />
kernel /vmlinuz26 root=/dev/sda3 resume=/dev/sda2 ro '''''vga=0'''''<br />
initrd /kernel26.img<br />
<br />
===System Freezes/Hard locks===<br />
* To prevent system lockups, try adding the following lines to your fglrx "Device" section in <code>xorg.conf</code><br />
Option "UseInternalAGPGART" "no"<br />
Option "KernelModuleParm" "agplock=0" # AGP locked user pages: disabled<br />
<br />
{{Note|Neither option is necessary anymore since 8.24.18 because ATI has removed the internal AGP GART support from the driver.}}<br />
<br />
* As well, the <code>radeonfb</code> framebuffer drivers have been known in the past to cause problems of this nature. If your kernel has radeonfb support compiled in, you may want to try a different kernel and see if this helps. <br />
<br />
===Hardware Conflicts===<br />
Radeon cards used in conjunction with some versions of the nForce3 chipset (e.g. nForce 3 250Gb) won't have 3D acceleration. Currently the cause of this issue is unknown, but some sources indicate that it may be possible to get acceleration with this combination of hardware by booting Windows with the drivers from nVIDIA and then rebooting the system. This can be verified by issuing in a root console the following command:<br />
dmesg | grep agp<br />
<br />
If you get something similar to this (using an nForce3-based system)<br />
agpgart: Detected AGP bridge 0<br />
agpgart: Setting up Nforce3 AGP.<br />
agpgart: aperture base > 4G<br />
<br />
and also if issuing this command...<br />
tail -n 100 /var/log/Xorg.0.log | grep agp<br />
<br />
...gets something similar to:<br />
(EE) fglrx(0): [agp] unable to acquire AGP, error "xf86_ENODEV"<br />
<br />
Then you have this bug.<br />
<br />
Some sources indicate that in some situations, downgrading the motherboard BIOS may help, but this cannot be verified in all cases. Also, a bad BIOS downgrade can render your hardware useless, so beware.<br />
<br />
See bug http://bugzilla.kernel.org/show_bug.cgi?id=6350 for more information and a potential fix.<br />
<br />
===Temporary hangs when playing video===<br />
This problem may occur when using the proprietary '''catalyst''' driver.<br />
<br />
If you experience temporary hangs lasting from a few seconds to several minutes occuring randomly during playback with mplayer, check /var/log/messages.log for output like:<br />
Nov 28 18:31:56 pandemonium [<c01c64a6>] ? proc_get_sb+0xc6/0x160<br />
Nov 28 18:31:56 pandemonium [<c01c64a6>] ? proc_get_sb+0xc6/0x160<br />
Nov 28 18:31:56 pandemonium [<f8bc628c>] ? ip_firegl_ioctl+0x1c/0x30 [fglrx]<br />
Nov 28 18:31:56 pandemonium [<c01c64a6>] ? proc_get_sb+0xc6/0x160<br />
Nov 28 18:31:56 pandemonium [<c0197038>] ? vfs_ioctl+0x78/0x90<br />
Nov 28 18:31:56 pandemonium [<c01970b7>] ? do_vfs_ioctl+0x67/0x2f0<br />
Nov 28 18:31:56 pandemonium [<c01973a6>] ? sys_ioctl+0x66/0x70<br />
Nov 28 18:31:56 pandemonium [<c0103ef3>] ? sysenter_do_call+0x12/0x33<br />
Nov 28 18:31:56 pandemonium [<c01c64a6>] ? proc_get_sb+0xc6/0x160<br />
Nov 28 18:31:56 pandemonium =======================<br />
<br />
Adding the nopat kerneloption to /boot/grub/menu.lst and rebooting fixed the problem at least for me.<br />
<br />
===After a kernel upgrade: X doesn't start/modprobe doesn't find fglrx===<br />
Reinstall the catalyst drivers.<br />
<br />
Or since catalyst 10.6-3 use:<br />
# catalyst_build_module<br />
<br />
===Catalyst 10.6/10.7 : black/grey/white boxes/artifacts in firefox/thunderbird===<br />
With catalyst 10.6 AMD/ATi announce new method of 2D acceleration for radeons, unfortunately this step causes bugs for some users. To turn on old (slower xaa) method of 2d rendering please kill your desktop environment and Xserver and type this command as root:<br />
aticonfig --set-pcs-str=DDX,ForceXAA,TRUE<br />
Now you'll probably need patched xorg-server to fix problems with resizing/maximizing windows, read about it ie. [http://wiki.archlinux.org/index.php/ATI_Catalyst#Black.2Fgrey.2Fwhite_boxes.2Fartifacts_mainly_in_firefox.2Fthunderbird here].</div>Markg85https://wiki.archlinux.org/index.php?title=Talk:AMD_Catalyst&diff=113636Talk:AMD Catalyst2010-08-10T13:31:57Z<p>Markg85: /* XvBA-Video Repository */ new section</p>
<hr />
<div>I love you guys for putting this wiki entry together and maintaining the repositories with the Catalyst driver and the patched mplayer with support for hardware acceleration. It would have taken me many, many hours to make it work as flawlessly as it does.<br />
<br />
[[User:Foutrelis|Foutrelis]] 06:11, 21 June 2010 (EDT)<br />
<br />
== XvBA-Video Repository ==<br />
<br />
Note to editors: DO NOT REMOVE that since it works and helps users getting it working!</div>Markg85https://wiki.archlinux.org/index.php?title=Network_configuration&diff=85465Network configuration2009-11-27T16:06:57Z<p>Markg85: /* Troubleshooting */</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:Getting and installing Arch (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{Article summary start}}<br />
{{Article summary text|A simple guide for setting up and troubleshooting network.}}<br />
{{Article summary heading|Languages}}<br />
{{i18n_entry|Česky|Konfigurace_sítě_(Česky)}}<br />
{{i18n_entry|English|Configuring_network}}<br />
{{i18n_entry|Español|Configurando la Red}}<br />
{{i18n_entry|Italiano|Configuring_network_(Italiano)}}<br />
{{i18n_entry|Nederlands|Netwerk_configureren_(Nederlands)}}<br />
{{i18n_entry|Русский|Настройка_сети_(Русский)}}<br />
{{i18n_entry|Slovensky|Statická IP a DHCP}}<br />
{{i18n_entry|Türkçe|Ağ Ayarları}}<br />
{{i18n_entry|简体中文|网络配置_(简体中文)}}<br />
{{Article summary end}}<br />
<br />
==Set the hostname==<br />
A hostname is a unique name created to identify a machine on a network. With Arch Linux, a machine's hostname is set in {{Filename|/etc/[[rc.conf]]}} or until a restart using the ''hostname'' command.<br />
Hostnames are restricted to alphanumeric characters. The dash ({{Codeline|-}}) can be used but a hostname cannot start or end with it. Length is restricted to 63 characters.<br />
<br />
Edit {{Filename|/etc/rc.conf}} and set HOSTNAME (archlinux in this example):<br />
HOSTNAME="archlinux"<br />
<br />
After setting a hostname, it is also a good idea to include the same name in {{Filename|/etc/hosts}}. This will help processes that refer to the computer by its hostname to find its IP.<br />
<br />
Edit {{Filename|/etc/hosts}} and add the same HOSTNAME you entered in {{Filename|/etc/rc.conf}}:<br />
127.0.0.1 archlinux.domain.org localhost.localdomain localhost archlinux<br />
<br />
To set the hostname temporarily (until the next reboot) use the ''hostname'' command as root:<br />
# hostname archlinux<br />
<br />
==Load the device module==<br />
Udev should detect your network card (NIC) module and load it automatically at startup. Otherwise, you will need to know which module is needed for your particular model:<br />
hwdetect --show-net<br />
<br />
when you know which module to use, you can load it with:<br />
# modprobe <modulename><br />
<br />
If udev is not detecting and loading the proper module automatically, you can add it into the '''MODULES=''' array in <code>/etc/rc.conf</code>, so you do not need to modprobe it everytime you boot. For example, if tg3 is the network module:<br />
MODULES=(!usbserial tg3 snd-cmipci)<br />
<br />
Other common modules are 8139too for cards with the Realtek chipset or sis900 for SiS cards.<br />
<br />
==Configure IP==<br />
<br />
===For DHCP IP===<br />
For this, you need the dhcpcd package (already available on most installations). Edit <code>/etc/rc.conf</code> like this:<br />
eth0="dhcp"<br />
INTERFACES=(eth0)<br />
ROUTES=(!gateway)<br />
<br />
If you use DHCP and you do '''not''' want your DNS servers automatically assigned every time you start your network, be sure to add the following to the last section of /etc/dhcpcd.conf:<br />
nohook resolv.conf<br />
<br />
Then add your own DNS nameserver to /etc/resolv.conf.<br />
<br />
Make sure to test your new settings by stopping and starting the <code>/etc/rc.d/network</code> daemon as opposed to bringing down your interface and starting dhcp manually. To restart the network daemon: <br />
# /etc/rc.d/network restart<br />
<br />
You may use openresolv package from AUR if several things wants to control resolv.conf (i.e. dhcpcd and VPN client). No additional configuration for dhcpcd is needed to use openresolv.<br />
<br />
===For Static IP===<br />
If you share your internet connection from a Windows box without a router, be sure to use static IPs on both computers. Otherwise you will have LAN issues.<br />
<br />
You need:<br />
* Your static IP address,<br />
* The netmask,<br />
* The broadcast address,<br />
* Your gateway,<br />
* Your nameservers' IP addresses,<br />
* Your domain name.<br />
<br />
If you are running a private network, it is safe to use IP addresses in 192.168.*.'* for your IPs, with a netmask of 255.255.255.0 and broadcast address of 192.168.*.255. Unless your network has a router, the gateway address does not matter. Edit <code>/etc/rc.conf</code> like this, substituting your own values for the IP, netmask, broadcast, and gateway:<br />
eth0="eth0 192.168.100.2 netmask 255.255.255.0 broadcast 192.168.100.255"<br />
INTERFACES=(eth0)<br />
gateway="default gw 192.168.100.1"<br />
ROUTES=(gateway)<br />
<br />
To add additional static routes, use the normal syntax for the 'route add' command such as:<br />
static-route1="-net 192.168.200.0/24 gw 192.168.100.15"<br />
<br />
Then add <code>static-route1</code> to your ROUTES array. Note that a route name can not begin with a number, <code>static-route1</code> is ok, <code>1static-route</code> is not.<br />
<br />
Edit your <code>/etc/resolv.conf</code> like this, substituting your nameservers' IPs and your domain name:<br />
nameserver 61.23.173.5<br />
nameserver 61.95.849.8<br />
search example.com<br />
<br />
You may include as many nameserver lines as you wish.<br />
<br />
==Load configuration==<br />
To test your settings either reboot the computer, or as root, run <code>/etc/rc.d/network restart</code>.<br />
Try pinging your gateway, DNS server, ISP provider and other Internet sites, in that order, to detect any connection problems along the way.<br />
$ ping google.com<br />
<br />
==Additional settings==<br />
<br />
===Firewall===<br />
You can install and configure a [[Firewalls|firewall]] to feel more secure.<br />
<br />
===Wireless Setup===<br />
See the [[Wireless Setup]] article for more information.<br />
<br />
===Laptops, 'ifplugd'===<br />
You can install a daemon which will automatically configure your Ethernet device when a cable is plugged in and automatically unconfigure it if the cable is pulled. This is useful on laptops with onboard network adapters, since it will only configure the interface when a cable is really connected. Another use is when you just need to restart the network but do not want to restart the computer or do it from the shell.<br />
<br />
Installation is very simple since it is in [extra]:<br />
# pacman -S ifplugd<br />
<br />
By default it is configured to work for eth0 device. This and other settings like delays can be configured in <code>/etc/ifplugd/ifplugd.conf</code>.<br />
<br />
Start it with:<br />
# /etc/rc.d/ifplugd start<br />
<br />
or add it into DAEMONS array in <code>/etc/rc.conf</code>.<br />
<br />
===Jumbo Frames===<br />
See the [[Jumbo Frames]] article for more information.<br />
<br />
===Bonding===<br />
You can install 'ifenslave' to bind two real Ethernet cables with one IP address.<br />
/etc/conf.d/bonding:<br />
bond_bond0="eth0 eth1"<br />
BOND_INTERFACES=(bond0)<br />
<br />
/etc/modprobe.d/modprobe.conf:<br />
{{Note | The new module-init-tools 3.8 package changes the location of the configuration file: /etc/modprobe.conf is no longer read, instead /etc/modprobe.d/modprobe.conf is used. [http://www.archlinux.org/news/450/ link]}}<br />
options bonding miimon=100<br />
<br />
/etc/rc.conf:<br />
MODULES=(... bonding ...)<br />
bond0="bond0 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255"<br />
INTERFACES=(bond0)<br />
<br />
Restart network by:<br />
/etc/rc.d/network restart<br />
<br />
===IP aliasing===<br />
One IP on one card:<br />
<br />
# nano /etc/rc.conf<br />
<br />
eth0="eth0 192.168.0.1 netmask 255.255.255.0 broadcast 192.168.0.255"<br />
INTERFACES=(lo eth0)<br />
<br />
Two IPs on one card: (BUG:/etc/rc.d/network stop)<br />
# nano /etc/rc.conf<br />
<br />
eth0="eth0 192.168.0.1 netmask 255.255.255.0 broadcast 192.168.0.255"<br />
eth0_0="eth0:0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255"<br />
INTERFACES=(lo eth0 eth0_0)<br />
<br />
One IP on two cards:<br />
# pacman -S ifenslave<br />
# nano /etc/rc.conf<br />
<br />
bond0="bond0 192.168.0.1 netmask 255.255.255.0 broadcast 192.168.0.255"<br />
INTERFACES=(lo bond0)<br />
MODULES=(... bonding ...)<br />
<br />
Two IPs on two cards: (BUG:/etc/rc.d/network stop)<br />
# pacman -S ifenslave<br />
# nano /etc/rc.conf<br />
<br />
bond0="bond0 192.168.0.1 netmask 255.255.255.0 broadcast 192.168.0.255"<br />
bond01="bond0:1 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255"<br />
INTERFACES=(lo bond0 bond01)<br />
MODULES=(... bonding ...)<br />
<br />
{{Note| After setting these options (bonding, etc.), adjust firewall settings so that they are in-tune with the changes, else the network will not work properly.}}<br />
<br />
===Change MAC/hardware address===<br />
Useful in some situations, for example when your ISP binds the access to one of your computers to identify you, but you need to use the connection on more than one computer without running '''ifconfig''' every time. Add the usual '''ifconfig''' option to your card configuration.<br />
<br />
For a ethernet card:<br />
eth0="eth0 192.168.0.1 netmask 255.255.255.0 broadcast 192.168.0.255 '''hw ether 01:23:45:67:89:ab'''"<br />
<br />
==Troubleshooting==<br />
<br />
=== DHCP fails at boot ===<br />
First, check all the steps that the computer normally executes at boot in order to find out which one failed. These steps are:<br />
1. detect the network device and load its driver, 2. bring up the interface and 3. call dhcp<br />
<br />
For step 1 check the "Ethernet controller" entry in the output of <code>lspci -v</code>.<br />
It should tell you which kernel module contains the driver of you network device. For example:<br />
02:00.0 Ethernet controller: Attansic Technology Corp. L1 Gigabit Ethernet Adapter (rev b0)<br />
...<br />
Kernel driver in use: atl1<br />
Kernel modules: atl1<br />
<br />
Next, check the the driver was loaded via <code>dmesg | grep <module name> </code>. For example:<br />
$ dmesg |grep atl1<br />
...<br />
atl1 0000:02:00.0: eth0 link is up 100 Mbps full duplex<br />
<br />
For step 2, check the output of dmesg for the interface associated with your network device and bring it up via (as root) <code>ifconfig <interface> up</code>. Check the result with <code>ifconfig -a</code>. For example:<br />
$ ifconfig -a<br />
eth0 Link encap:Ethernet ...<br />
inet6 addr: f.../64 Scope:Link<br />
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1<br />
...<br />
<br />
What you probably will not see here is an inet address. You need to get that from your router in step 3: <br />
<br />
To be on the safe side, start by releasing the lease of your interface with <code>dhcpcd --release</code>, then try to get a lease with <code>dhcpcd</code>. As always, the man page is your friend. If all goes well it will look like this:<br />
$ dhcpcd --release eth0<br />
dhcpcd: dhcpcd not running<br />
$ dhcpcd eth0<br />
dhcpcd: version 5.1.1 starting<br />
dhcpcd: eth0: broadcasting for a lease<br />
...<br />
dhcpcd: eth0: leased 192.168.1.70 for 86400 seconds<br />
<br />
And now <code>ifconfig <interface></code> should show your inet address.<br />
Probably things will not work as described somewhere along these steps, or else the network would have started automatically at boot.<br />
<br />
If dhcp works using the steps above but not at boot, add the following to <code>/etc/rc.local</code><br />
dhcpcd -k eth0 <br />
dhcpcd -nd eth0<br />
See http://bbs.archlinux.org/viewtopic.php?id=63940 for more information.<br />
<br />
For some people, dhclient (available in [extra]) works where dhcpcd fails.<br />
<br />
===Swapping computers on the cable modem===<br />
Most domestic cable ISPs (videotron for example) have the cable modem configured to recognise only one client PC, by the MAC address of its network interface. Once the cable modem has learnt the MAC address of the first PC or equipment that talks to it, it will not respond to another MAC address in any way. Thus if you swap one PC for another (or for a router), the new PC (or router) will not work with the cable modem, because the new PC (or router) has a different MAC address to the old one. To reset the cable modem so that it will recognise the new PC, you must power the cable modem off and on again. Once the cable modem has rebooted and gone fully online again (indicator lights settled down), reboot the newly connected PC so that it makes a DHCP request, or manually make it request a new DHCP lease.<br />
<br />
If this method does not work, you will need to clone the MAC address of the original machine.<br />
<br />
===The TCP window scaling issue===<br />
TCP packets contain a "window" value in their headers indicating how much data the other host may send in return. This value is represented with only 16 bits, hence the window size is at most 64Kb. TCP packets are cached for a while (they have to be reordered), and as memory is (or used to be) limited, one host could easily run out of it.<br />
<br />
Back in 1992, as more and more memory became available, [http://www.faqs.org/rfcs/rfc1323.html RFC 1323] was written to improve the situation: Window Scaling. The "window" value, provided in all packets, will be modified by a Scale Factor defined once, at the very beginning of the connection.<br />
<br />
That 8-bit Scale Factor allows the Window to be up to 32 times higher than the initial 64Kb.<br />
<br />
It appears that some broken routers and firewalls on the Internet are rewriting the Scale Factor to 0 which causes misunderstandings between hosts.<br />
<br />
The Linux kernel 2.6.17 introduced a new calculation scheme generating higher Scale Factors, virtually making the aftermaths of the broken routers and firewalls more visible. <br />
<br />
The resulting connection is at best very slow or broken.<br />
<br />
====How to diagnose the problem?====<br />
First of all, lets make it clear: this problem is odd. In some cases, you will not be able to use TCP connections (HTTP, FTP, ...) at all and in others, you will be able to communicate with some hosts (very few).<br />
<br />
'''Warning''': <code>dmesg</code>'s output is OK, logs are clean and <code>ifconfig</code> will report normal status &mdash; and actually everything is normal.<br />
<br />
If you can not browse any website, but you can ping some rare hosts, chances are great that you're experiencing this issue: ping uses the ICMP protocol and is not affected by TCP issues.<br />
<br />
You can try to use WireShark. You might see successful UDP and ICMP communications but unsuccessful TCP communications (only to foreign hosts).<br />
<br />
====How to fix it? (The bad way)====<br />
To fix it the bad way, you can change the tcp_rmem value, on which Scale Factor calculation is based. Although it should work for most hosts, it is not guaranteed, especially for very distant ones.<br />
<br />
echo "4096 87380 174760" > /proc/sys/net/ipv4/tcp_rmem<br />
<br />
Or you can try to remove one of your RAM sticks (yes, sir).<br />
<br />
====How to fix it? (The good way)====<br />
Simply disable Window Scaling. Even if Window Scaling is a nice TCP feature, it may be uncomfortable especially if you can not fix the broken router. There are several ways to disable Window Scaling, and it seems that the most bulletproof (which will work with most kernels) is to add the following lines to your <code>/etc/rc.local</code>:<br />
<br />
echo 0 > /proc/sys/net/ipv4/tcp_window_scaling<br />
<br />
====How to fix it? (The best way)====<br />
This issue is caused by broken routers/firewalls, so lets change them. Some users have reported that the broken router was their very own DSL router.<br />
<br />
====More about it?====<br />
This section is based on the LWN article [http://lwn.net/Articles/92727/ TCP window scaling and broken routers] and a Kernel Trap article: [http://kerneltrap.org/node/6723 Window Scaling on the Internet].<br />
<br />
And more recently, some Archers have been hit by this issue:<br />
<br />
* [http://www.archlinux.org/pipermail/arch/2006-June/011250.html Odd network issue]<br />
* [http://www.archlinux.org/pipermail/arch/2006-September/011943.html Kernel 2.6.17 and TCP window scaling] &mdash; the topic which initiated this article<br />
<br />
There are also several relevant threads on the LKML.<br />
<br />
===Realtek no link / WOL issue===<br />
Users with Realtek 8168 8169 8101 8111(C) based NICs (cards / and on-board) may notice an issue where the NIC seems to be disabled on boot and has no Link light. This can usually be found on a dual boot system where Windows is also installed. It seems that using the offical Realtek drivers (dated anything after May 2007) under Windows is the cause. These newer drivers disable the Wake-On-LAN feature by disabling the NIC at Windows shutdown time, where it will remain disabled until the next time Windows boots. You will be able to notice if this issue is affecting you if the Link light remains off until Windows boots up; during Windows shutdown the Link light will switch off. Normal operation should be that the link light is always on as long as the system is on, even during POST. This issue will also affect other operative systems without newer drivers (eg. Live CDs). Here are a few fixes for this issue:<br />
<br />
====Method 1 - Rollback/change Windows driver====<br />
You can roll back your Windows NIC driver to the Microsoft provided one (if available), or roll back/install an official Realtek driver pre-dating May 2007 (may be on the CD that came with your hardware).<br />
<br />
====Method 2 - Enable WOL in Windows driver====<br />
Probably the best and the fastest fix is to change this setting in the Windows driver. This way it should be fixed system-wide and not only under Arch (eg. live CDs, other operative systems). In Windows, under Device Manager, find your Realtek network adapter and double-click it. Under the Advanced tab, change "Wake-on-LAN after shutdown" to Enable.<br />
In Windows XP (example)<br />
Right click my computer<br />
--> Hardware tab<br />
--> Device Manager<br />
--> Network Adapters<br />
--> "double click" Realtek ...<br />
--> Advanced tab<br />
--> Wake-On-Lan After Shutdown<br />
--> Enable<br />
<br />
* '''Note''': newer Realtek Windows drivers (tested with ''Realtek 8111/8169 LAN Driver v5.708.1030.2008'', dated 2009/01/22, available from GIGABYTE) may refer to this option slightly differently, like ''Shutdown Wake-On-LAN --> Enable''. It seems that switching it to <tt>Disable</tt> has no effect (you will notice the Link light still turns off upon Windows shutdown). One rather dirty workaround is to boot to Windows and just reset the system (perform an ungraceful restart/shutdown) thus not giving the Windows driver a chance to disable LAN. The Link light will remain on and the LAN adapter will remain accessible after POST - that is until you boot back to Windows and shut it down properly again.<br />
<br />
====Method 3 - Newer Realtek Linux driver====<br />
Any newer driver for these Realtek cards can be found for Linux on the realtek site. (untested but believed to also solve the problem).<br />
<br />
====Method 4 - Enable ''LAN Boot ROM'' in BIOS/CMOS====<br />
It appears that setting ''Integrated Peripherals --> Onboard LAN Boot ROM --> Enabled'' in BIOS/CMOS reactivates the Realtek LAN chip on system boot-up, despite the Windows driver disabling it on OS shutdown.<br />
<br><small>This was tested successfully multiple times with GIGABYTE system board GA-G31M-ES2L with BIOS version F8 released on 2009/02/05. YMMV.</small><br />
<br />
===DLink G604T/DLink G502T DNS issue===<br />
Users with a DLink G604T/DLink G502T router, using DHCP and have firmware v2.00+ (typically users with AUS firmware) may have issues with certain programs not resolving the DNS. One of these programs are unfortunatley pacman. The problem is basically the router in certain situations is not sending the DNS properly to DHCP, which causes programs to try and connect to servers with an IP of 1.0.0.0 and fail with a connection timed out error<br />
<br />
====How to diagnose the problem?====<br />
The best way to diagnose the problem is to use a firefox/konqueror/links/seamonkey and to enable wget for pacman. If this is a fresh install of Arch Linux, then you may want to consider installing links through the live CD.<br />
<br />
Firstly enable wget for pacman (since it gives us info about pacman when its downloading packages)<br />
Open /etc/pacman.conf with your favourite editor and uncomment the following line (remove the # if its there)<br />
<br />
XferCommand=/usr/bin/wget --passive-ftp -c -O %o %u<br />
<br />
While your in pacman.conf, check the default mirror that pacman uses to download packages.<br />
<br />
Now open up the default mirror in an internet browser to see if the mirror actually works. If it does work then do pacman -Syy (otherwise pick another working mirror and set it to the pacman default), if you get something similar to the following (notice the 1.0.0.0)<br />
<nowiki>ftp://mirror.pacific.net.au/linux/archlinux/extra/os/i686/extra.db.tar.gz</nowiki> <br />
<nowiki>=> `/var/lib/pacman/community.db.tar.gz.part'</nowiki><br />
Resolving mirror.pacific.net.au... 1.0.0.0<br />
then you most likely have this problem. The 1.0.0.0 means its unable to resolve the DNS, so we must add it to resolv.conf.<br />
<br />
====How to fix It?====<br />
Basically what we need to do is to manually add the DNS to our /etc/resolv.conf file, The problem is that DHCP automatically deletes and replaces this file on boot, so we need to edit /etc/conf.d/dhcpcd and change the flags to stop DHCP doing this<br />
<br />
When you open up /etc/conf.d/dhcpcd, you should see something close to the following<br />
DHCPCD_ARGS="-t 30 -h $HOSTNAME"<br />
add the -R flag to the arguments, i.e.<br />
DHCPCD_ARGS="-R -t 30 -h $HOSTNAME"<br />
<br />
'''NOTE''': If you are using dhcpcd >=4.0.2 the -R flag has been deprecated, please look here on ([http://wiki.archlinux.org/index.php/Configuring_network#For_DHCP_IP]) section how to use a custom resolv.conf file<br />
<br />
Save and close, now open /etc/resolv.conf. You should see a single namespace (most likely 10.1.1.1), this is the gateway to your router, which we need to connect to in order to get the DNS of your ISP. Paste the IP into your browser and login to your router. Go to the DNS section and you should see an IP in the Preferred DNS Server, copy it and paste it as a namespace ABOVE the current gateway one.<br />
<br />
i.e. a resolv.conf should look something along the lines of<br />
namespace 10.1.1.1<br />
<br />
If my Primary DNS Server is 211.29.132.12 then chance resolv.conf to<br />
namespace 211.29.132.12<br />
namespace 10.1.1.1<br />
<br />
Now restart the network daemon by doing /etc/rc.d/network restart and do pacman -Syy, if it syncs fine with the server then problem solved<br />
<br />
====More about it?====<br />
This is the whirlpool forum (Australian ISP community) which talks about and gives the same solution to the problem<br />
http://forums.whirlpool.net.au/forum-replies-archive.cfm/461625.html<br />
<br />
===Get an ip from the wrong DHCP in linked (by vpn) router cases===<br />
In my case i have a network where two routers are tied together through vpn. One router at my home and one at a completely different place in the world, In some rare cases it might be possible that the router that is connected to me by vpn is giving me an ip address. I don't know a way to prevent that but i do know a way to fix that. On a console as root try this:<br />
dhcpcd -k<br />
dhcpcd<br />
The first line releases your ip and the next line requests a new one. I had to run those 2 comments 3 times till my issue was fixed so don't expect it to work after just one try. If that also fails you might need to disconnect the vpn connection and try it again with the above commands.<br />
<br />
This even works when NetworkManager is installed.</div>Markg85https://wiki.archlinux.org/index.php?title=User:Markg85&diff=80712User:Markg852009-10-27T21:58:54Z<p>Markg85: Replaced content with 'User:Markg85/Suspend_and_resume_guide'</p>
<hr />
<div>User:Markg85/Suspend_and_resume_guide</div>Markg85https://wiki.archlinux.org/index.php?title=User:Markg85/Suspend_and_resume_guide&diff=80709User:Markg85/Suspend and resume guide2009-10-27T21:56:59Z<p>Markg85: Created page with '= Suspend = TO BE FILLED IN = Resume = TO BE FILLED IN = How do i wake on lan, keyboard, mouse etc? = First you need to open your favorite console. Now type: cat /proc/acpi/wa…'</p>
<hr />
<div>= Suspend =<br />
TO BE FILLED IN<br />
<br />
= Resume =<br />
TO BE FILLED IN<br />
<br />
= How do i wake on lan, keyboard, mouse etc? =<br />
First you need to open your favorite console.<br />
Now type:<br />
cat /proc/acpi/wakeup<br />
<br />
which should result in some list like this:<br />
Device S-state Status Sysfs node<br />
P0P2 S4 disabled pci:0000:00:01.0<br />
P0P1 S4 disabled pci:0000:00:1e.0<br />
UAR1 S4 disabled pnp:00:0a<br />
PS2K S4 disabled pnp:00:0c<br />
EUSB S4 disabled pci:0000:00:1d.7<br />
USBE S4 disabled pci:0000:00:1a.7<br />
P0P5 S4 disabled <br />
P0P6 S4 disabled <br />
P0P7 S4 disabled <br />
P0P8 S4 disabled pci:0000:00:1c.4<br />
P0P9 S4 disabled pci:0000:00:1c.5<br />
USB0 S4 disabled pci:0000:00:1d.0<br />
USB1 S4 disabled pci:0000:00:1d.1<br />
USB2 S4 disabled pci:0000:00:1d.2<br />
USB3 S4 disabled <br />
USB4 S4 disabled pci:0000:00:1a.0<br />
USB5 S4 disabled pci:0000:00:1a.1<br />
USB6 S4 disabled pci:0000:00:1a.2<br />
P0P4 S4 disabled pci:0000:00:1c.0<br />
<br />
Now to explain a few of those "Device" names:<br />
USB# is one of your USB ports. All the USB# together should be all the USB ports you have on your pc.<br />
PS2k is the PS2 Keyboard port.<br />
<br />
I don't know the rest.<br />
<br />
Lets say you have a connected USB keyboard and you want be able to wake your pc up by for example pressing the space bar on your keyboard. To do this you need to have one of those USB#. I haven't figured out yet how i can trace one of those back to the actual connected device so i have done this in my case:<br />
echo USB0 > /proc/acpi/wakeup<br />
echo USB1 > /proc/acpi/wakeup<br />
echo USB2 > /proc/acpi/wakeup<br />
echo USB3 > /proc/acpi/wakeup<br />
echo USB4 > /proc/acpi/wakeup<br />
echo USB5 > /proc/acpi/wakeup<br />
echo USB6 > /proc/acpi/wakeup<br />
<br />
If you run the following line again:<br />
cat /proc/acpi/wakeup<br />
<br />
you should see some enabled tags like so:<br />
Device S-state Status Sysfs node<br />
P0P2 S4 disabled pci:0000:00:01.0<br />
P0P1 S4 disabled pci:0000:00:1e.0<br />
UAR1 S4 disabled pnp:00:0a<br />
PS2K S4 disabled pnp:00:0c<br />
EUSB S4 disabled pci:0000:00:1d.7<br />
USBE S4 disabled pci:0000:00:1a.7<br />
P0P5 S4 disabled <br />
P0P6 S4 disabled <br />
P0P7 S4 disabled <br />
P0P8 S4 disabled pci:0000:00:1c.4<br />
P0P9 S4 disabled pci:0000:00:1c.5<br />
USB0 S4 enabled pci:0000:00:1d.0<br />
USB1 S4 enabled pci:0000:00:1d.1<br />
USB2 S4 enabled pci:0000:00:1d.2<br />
USB3 S4 enabled <br />
USB4 S4 enabled pci:0000:00:1a.0<br />
USB5 S4 enabled pci:0000:00:1a.1<br />
USB6 S4 enabled pci:0000:00:1a.2<br />
P0P4 S4 disabled pci:0000:00:1c.0<br />
<br />
And that did it for me. When my pc is in suspension mode i can just press space bar to get it back. Because i enabled all the USB ports to wake me up from suspension (or hibernation) a added side effect is that any connected usb device with buttons can now wake my pc up. My mouse for example.</div>Markg85