https://wiki.archlinux.org/api.php?action=feedcontributions&user=Mau5kito&feedformat=atomArchWiki - User contributions [en]2024-03-19T01:11:53ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=User:Mau5kito&diff=317053User:Mau5kito2014-05-28T18:29:11Z<p>Mau5kito: </p>
<hr />
<div>Personal website: [http://www.brunoparmentier.be www.brunoparmentier.be]<br />
<br />
Wiki: [http://wiki.brunoparmentier.be wiki.brunoparmentier.be]</div>Mau5kitohttps://wiki.archlinux.org/index.php?title=User:Mau5kito&diff=296673User:Mau5kito2014-02-09T13:42:24Z<p>Mau5kito: </p>
<hr />
<div>My website: [http://www.brunoparmentier.be TWOBP]</div>Mau5kitohttps://wiki.archlinux.org/index.php?title=I3&diff=294327I32014-01-25T10:22:42Z<p>Mau5kito: /* Default keybindings */ typo</p>
<hr />
<div>{{DISPLAYTITLE:i3}}<br />
[[Category:Tiling WMs]]<br />
[[Category:Dynamic WMs]]<br />
[[ko:i3]]<br />
[[ru:i3]]<br />
[[zh-CN:i3]]<br />
[http://i3wm.org/ i3] is a dynamic [[Wikipedia:Tiling window manager|tiling window manager]] inspired by [[wmii]] that is primarily targeted at developers and advanced users.<br />
<br />
Clients (windows) are organized in a tree data structure within containers. The tree branches via horizontal or vertical splits, and containers can also be set to tabbed or stacked layouts. Floating windows are available for corner cases that don't mix well with tiling, and remain on a separate layer above the tiled windows.<br />
<br />
== Installation ==<br />
<br />
Install the {{Grp|i3}} [[Pacman#Installing package groups|package group]] from the [[official repositories]], which includes: {{Pkg|i3-wm}}, the window manager; {{Pkg|i3status}}, a package to write a status line to i3bar through [[Wikipedia:Standard streams#Standard output (stdout)|stdout]]; and {{Pkg|i3lock}}, an improved screenlocker.<br />
<br />
Additional packages are available in the [[Arch User Repository]]. Install {{AUR|i3-git}} for the development version.<br />
<br />
Install {{AUR|i3-gnome}} to add [[GNOME]] and X-sessions with {{Grp|i3}} running as the window manager. An Xsession starting just the window manager is included in {{Grp|i3}}.<br />
<br />
== Configuration ==<br />
<br />
Edit your {{ic|~/.xinitrc}} and add:<br />
exec i3<br />
<br />
If you want i3 to log its output (useful for debugging), add this line to {{ic|~/.xinitrc}}:<br />
exec i3 -V >> ~/.i3/i3log 2>&1<br />
<br />
If you use the Nvidia binary driver '''<302.17''' you need to add the {{ic|--force-xinerama}} flag to {{ic|~/.xinitrc}}. A detailed explanation can be found at [http://i3wm.org/docs/multi-monitor.html i3wm.org].<br />
exec i3 --force-xinerama<br />
<br />
If you have trouble with mapping keys (ie ; as semicolon), use {{Pkg|xorg-xev}} or see [[Extra Keyboard Keys]].<br />
$ xev | grep -A2 --line-buffered '^KeyRelease' | sed -n '/keycode /s/^.*keycode \([0-9]*\).* (.*, \(.*\)).*$/\1 \2/p'<br />
<br />
=== Status bar ===<br />
<br />
The internal status bar, i3-''ws''bar, was deprecated and replaced by i3bar in i3 v4.0.<br />
<br />
==== New method: i3bar ====<br />
<br />
Unlike i3-wsbar, which requires dzen2, i3bar does not have any dependencies other than {{Pkg|i3-wm}}. It can be used to view information generated by [[conky]] or i3status. For example (as of version 4.1):<br />
<br />
{{hc|~/.i3/config|<nowiki><br />
bar {<br />
output LVDS1<br />
status_command i3status<br />
position top<br />
mode hide<br />
workspace_buttons yes<br />
tray_output none<br />
<br />
font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1<br />
<br />
colors {<br />
background #000000<br />
statusline #ffffff<br />
<br />
focused_workspace #ffffff #285577<br />
active_workspace #ffffff #333333<br />
inactive_workspace #888888 #222222<br />
urgent_workspace #ffffff #900000<br />
}<br />
}<br />
</nowiki>}}<br />
<br />
For further information see the [http://i3wm.org/docs/userguide.html#_configuring_i3bar Configuring i3bar] section of the official User Guide.<br />
<br />
==== Alternatives to i3status ====<br />
<br />
* [https://github.com/enkore/i3pystatus i3pystatus] - extensible i3status replacement with many modules and very flexible configuration. Multi-threaded and lock-up free. (AUR: {{AUR|i3pystatus-git}})<br />
* [https://github.com/HarveyHunt/i3situation i3situation] – a pure python 3 replacement with features provided by multithreaded plugins.<br />
* [https://github.com/ultrabug/py3status py3status] – an extensible i3status wrapper written in python<br />
* [[dzen]] – often used with [[conky]] to create completely custom status bars<br />
* [http://j4status.j4tools.org/ j4status] - j4status provides a status line using several plugin to retrieve information from your computer. j4status is a part of the [http://www.j4tools.org/ j4tools] - tools set to use with i3.<br />
* [[h2status]] - trivial bash wrapper to i3status that nevertheless allows to conveniently write custom json entries, handle click events and asynchronously update the status bar.<br />
<br />
==== Panel alternatives to status bar ====<br />
<br />
Some users may prefer panels such as those provided by conventional [[Desktop_Environment|Desktop Environments]]. This can be achieved within i3 by launching the panel application of choice during startup.<br />
<br />
For the [[Xfce#Panel|XFCE panel]], add the following line to {{ic|~/.i3/config}}:<br />
exec --no-startup-id xfce4-panel<br />
<br />
{{Note|Panel features that are specific to the [[Desktop_Environment|Desktop Environment]] (e.g., widgets for managing workspaces and sessions) will not work, though the normal i3 functionality will be unaffected.}}<br />
<br />
Disabling i3bar is as simple as commenting out the {{ic|bar{ &#125;}} section of {{ic|~/.i3/config}}.<br />
<br />
==== Iconic fonts in the status bar ====<br />
<br />
There is a patch for i3bar to make it properly support icons, but here we'll see how to take advantage of a couple of very complete iconic font sets in order to get really nice looking monochromatic icons in your status bar. Some ttf iconic font sets that are currently available in the AUR are:<br />
<br />
* {{AUR|ttf-font-awesome}} that has a cheatsheet showing the Unicode point for each glyph here [http://fortawesome.github.io/Font-Awesome/cheatsheet/].<br />
* {{AUR|ttf-font-icons}} provides the Icons font set, a non-overlapping and consistently sized mix of Awesome and Ionicons. This not only avoids the overlapping between Awesome and Ionicons but also some minor overlapping between the usual DejaVu Sans and Awesome. All in all it provides a ready to use solution for your status bar including lots of icons. The cheatsheet is here [https://www.dropbox.com/s/9iysh2i0gadi4ic/icons.pdf].<br />
<br />
Then you can combine these fonts by defining a font fallback sequence in your {{ic|~/.i3/config}}:<br />
<br />
bar {<br />
...<br />
font pango:DejaVu Sans Mono, '''Icons''' 8<br />
...<br />
}<br />
<br />
Notice that you have to first list the comma separated font families and then add only one size specification at the end of the string. Don't set a size for each family (even if it happens to be the same size for every family) and don't try to get the same result using multiple font directives, as the vertical alignments and heights of the different components of the i3bar will be wrong in unexpected ways. The correct pango descriptor syntax is as shown above.<br />
<br />
Finally, you will have to enter the iconic glyphs into the format strings in {{ic|~/.i3status.conf}}. For this, use the unicode numbers given in the cheatsheets linked above. For example, if you're using vim you can type <C-v>uXXXX, where XXXX is the unicode hexadecimal number for the glyph.<br />
<br />
=== Quickly jumping to open window ===<br />
<br />
* [https://github.com/proxypoke/quickswitch-for-i3 quickswitch-for-i3] – A Python utility to quickly change to and locate windows in i3<br />
* [https://github.com/yiuin/i3-wm-scripts i3-wm-scripts] – search for and jump to windows with particular names matching regexp<br />
* [https://github.com/ziberna/i3-py/tree/master/examples#winmenupy winmenupy] launches dmenu with a list of clients, sorted after workspaces. Selecting a client jumps to that window.<br />
<br />
=== i3status ===<br />
<br />
First we need to copy over the default configuration files that we will be working with to our home directory.<br />
<br />
$ cp /etc/i3status.conf ~/.i3status.conf<br />
<br />
{{Tip|The example configuration file uses {{ic|eth0}} and {{ic|wlan0}} as interface names, see [[Network Configuration#Device names]] if they do not match with your system.}}<br />
<br />
==== Temperature status ====<br />
<br />
If you would like to add your CPU temperature to the i3status bar simply add these lines to {{ic|~/.i3status.conf}}:<br />
<br />
{{hc|~/.i3status.conf|2=<br />
order += "cpu_temperature 0"<br />
cpu_temperature 0 {<br />
format = "T: %degrees °C"<br />
max_threshold = 65<br />
path = "/sys/devices/platform/coretemp.0/temp1_input"<br />
}<br />
}}<br />
<br />
If the temperature column complains that it cannot get the temperature value then change the path line to:<br />
<br />
path = "/sys/class/thermal/thermal_zone0/temp"<br />
<br />
=== Volume manager ===<br />
<br />
To enable easy management of your system volume, you can install a volume manager applet such as {{AUR|pa-applet-git}} from the [[AUR]]. This should also allow you to use your keyboards volume up, volume down, and mute keys as well as using the applet directly to manage your volume. Once it is installed add the following line to your {{ic|~/.i3/config}} to auto start the applet:<br />
<br />
exec /usr/bin/pa-applet<br />
<br />
=== Network manager ===<br />
<br />
If you would like to use {{Pkg|network-manager-applet}} to manage your network connections, follow the instructions in [[NetworkManager]].<br />
<br />
Then add the the following line to your {{ic|~/.i3/config}} to automatically start the Network Manager applet in your system tray<br />
<br />
exec /usr/bin/nm-applet<br />
<br />
=== Workspace names ===<br />
<br />
Although it is not required, many people prefer naming frequently used workspaces. First you need to determine which monitor you want the workspace to open to. Simply type {{ic|xrandr}} into a terminal and it will show you the available display ports. Some common ones are LVDS1 for laptops or VGA1, HDMI1, HDMI2, etc for external monitors. If you are using [[Multihead#Xinerama|Xinerama]] instead use the outputs xinerama-0, xinerama-1, etc. Add your workspace names to {{ic|~/.i3/config}} You also need to modify the corresponding lines to switch to your workspaces as well as moving focused containers to those workspaces.<br />
<br />
# Workspace names<br />
workspace "1:Web" output LVDS1<br />
workspace "2:Mail" output LVDS1<br />
workspace "3:Irc" output LVDS1<br />
workspace "4:Shell" output LVDS1<br />
<br />
# switch to workspace<br />
bindsym $mod+1 workspace 1:Web<br />
bindsym $mod+2 workspace 2:Mail<br />
bindsym $mod+3 workspace 3:Irc<br />
bindsym $mod+4 workspace 4:Shell<br />
<br />
# move focused container to workspace<br />
bindsym $mod+Shift+1 move container to workspace 1:Web<br />
bindsym $mod+Shift+2 move container to workspace 2:Mail<br />
bindsym $mod+Shift+3 move container to workspace 3:Irc<br />
bindsym $mod+Shift+4 move container to workspace 4:Shell<br />
<br />
=== Launching programs on specific workspaces ===<br />
<br />
To maximize efficiency you can setup certain programs to automatically launch to a specific workspace. This can be accomplished one of two ways. You could use the {{ic|assign}} command so when you manually launch a program it is directed to a the workspace you assigned. An example would be:<br />
<br />
# Assign URxvt terminals to workspace 2<br />
assign [class="URxvt"] 2<br />
<br />
Or if you have renamed the workspaces like the above examples then you must set the new workspace name instead of the number:<br />
<br />
# Assign URxvt terminals to workspace 4:Shell<br />
assign [class="URxvt"] 4:Shell<br />
<br />
{{Note|To be able to determine the class, title, instance, etc of an open window you can use the tool {{ic|xprop}} by installing the package {{Pkg|xorg-xprop}} from the Extra repository.}}<br />
<br />
Alternatively you can change to your target workspace with {{ic|i3-msg}} then have your frequently used programs start automatically with the {{ic|exec}} command:<br />
<br />
exec --no-startup-id i3-msg 'workspace 1:Web; exec /usr/bin/firefox' <br />
exec --no-startup-id i3-msg 'workspace 2:Mail; exec urxvt -name Mail -e /usr/bin/mutt'<br />
exec --no-startup-id i3-msg 'workspace 3:Irc; exec /usr/bin/urxvt -name irssi -e /usr/bin/irssi'<br />
exec --no-startup-id i3-msg 'workspace 4:Shell; exec /usr/bin/urxvt'<br />
<br />
=== Tabbed or stacked web-browsing ===<br />
<br />
Some web-browsers intentionally do not implement tabs, since managing tabs is considered to be the task of the window manager, not the task of the browser.<br />
<br />
To let i3 manage your tab-less web-browser, in this example for [[uzbl]], add the following line to your {{ic|~/.i3/config}}<br />
<br />
for_window [class="Uzbl-core"] focus child, layout stacking, focus<br />
<br />
This is for stacked web browsing, meaning that the windows will be shown vertically. The advantage over tabbed browsing is that the window-titles are fully visible, even if a lot of browser windows are open.<br />
<br />
If you prefer tabbed browsing, with windows in horizontal direction ('tabs'), use<br />
<br />
for_window [class="Uzbl-core"] focus child, layout tabbed, focus<br />
<br />
=== Desktop wallpaper ===<br />
<br />
To be able to manage the desktop wallpaper, you need a lightweight image viewer like [[Feh]] or [[Nitrogen]]. Install feh with the command {{ic|# pacman -S feh}}. Then you can set your wallpaper with the following command:<br />
<br />
$ feh --bg-scale /path/to/image.file<br />
<br />
To have feh set your image to the Desktop Wallpaper add the following line to your {{ic|~/.i3/config}}<br />
<br />
exec --no-startup-id sh ~/.fehbg<br />
<br />
=== Terminal emulator ===<br />
<br />
By default when you press $mod+Return it launches the i3-sensible-terminal which is a script that invokes a terminal. It attempts to start one of these terminals in the following order: $TERMINAL urxvt rxvt terminator Eterm aterm xterm gnome-terminal roxterm xfce4-terminal. You can force it to launch your terminal of choice by modifying the line {{ic|bindsym $mod+Return exec i3-sensible-terminal}}<br />
<br />
=== Scratchpad ===<br />
<br />
Having a scratchpad to jot down or paste notes quickly is very handy! i3 has a feature that allows you to move a window to a scratchpad workspace. Basically it will be hidden from view until you recall it with the {{ic|scratchpad show}} command. To send a focused window to the scratchpad with $mod+Shift+minus or to recall it with $mod+minus enter these lines into your {{ic|~/.i3/config}}<br />
<br />
# Make the currently focused window a scratchpad<br />
bindsym $mod+Shift+minus move scratchpad<br />
<br />
# Show the first scratchpad window<br />
bindsym $mod+minus scratchpad show<br />
<br />
You can start your favorite editor (ie Gedit, vim, nano, etc) on startup and have it automatically moved to the scratchpad workspace to quickly recall it when needed. The following example when placed in {{ic|~/.i3/config}} shows how you can start the urxvt terminal, have it launch the nano editor, and then move it to the scratchpad:<br />
<br />
# starting a specially named term automatically <br />
exec --no-startup-id urxvt -name scratchpad -e /usr/bin/nano<br />
# move this to scratchpad, if active<br />
for_window [class="URxvt" instance="scratchpad"] move scratchpad<br />
<br />
=== Shutdown, reboot, lock screen ===<br />
As there are no Shutdown, Reboot, or Lock Screen buttons, we can add some hotkey combinations to help us out. First we need to create this script and save it as {{ic|i3exit}}. Remember to make it executable with {{ic|chmod +x}} and to place it somewhere in your $PATH.<br />
<br />
{{bc|<nowiki><br />
#!/bin/sh<br />
lock() {<br />
i3lock<br />
}<br />
<br />
case "$1" in<br />
lock)<br />
lock<br />
;;<br />
logout)<br />
i3-msg exit<br />
;;<br />
suspend)<br />
lock && systemctl suspend<br />
;;<br />
hibernate)<br />
lock && systemctl hibernate<br />
;;<br />
reboot)<br />
systemctl reboot<br />
;;<br />
shutdown)<br />
systemctl poweroff<br />
;;<br />
*)<br />
echo "Usage: $0 {lock|logout|suspend|hibernate|reboot|shutdown}"<br />
exit 2<br />
esac<br />
<br />
exit 0<br />
</nowiki>}}<br />
<br />
Now add the following lines to your {{ic|~/.i3/config}} Once completed you will be presented with a prompt whenever you press {{ic|$mod+pause}}.<br />
<br />
set $mode_system System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown<br />
mode "$mode_system" {<br />
bindsym l exec --no-startup-id i3exit lock, mode "default"<br />
bindsym e exec --no-startup-id i3exit logout, mode "default"<br />
bindsym s exec --no-startup-id i3exit suspend, mode "default"<br />
bindsym h exec --no-startup-id i3exit hibernate, mode "default"<br />
bindsym r exec --no-startup-id i3exit reboot, mode "default"<br />
bindsym Shift+s exec --no-startup-id i3exit shutdown, mode "default" <br />
<br />
# back to normal: Enter or Escape<br />
bindsym Return mode "default"<br />
bindsym Escape mode "default"<br />
}<br />
bindsym $mod+Pause mode "$mode_system"<br />
<br />
=== Screensaver and power management ===<br />
<br />
You can use [[Display_Power_Management_Signaling|DPMS]] to blank your screen or to suspend/poweroff your monitor. Adding the following line to your {{ic|~/.i3/config}} will suspend your monitor after 10 minutes.<br />
<br />
exec --no-startup-id xset dpms 600<br />
<br />
With {{AUR|xss-lock}} you can register a screenlocker for your i3 session. xss-lock subscribes to the systemd-events {{ic|suspend}}, {{ic|hibernate}}, {{ic|lock-session}}, and {{ic|unlock-session}} with appropriate actions (run locker and wait for user to unlock or kill locker). It also reacts to the [[Display Power Management Signaling#xset screen-saver control|X screensaver]] and runs or kills the locker in response to the x-server signals. Start xss-lock in your autostart like this:<br />
xss-lock -- i3lock -i ''background_image'' &<br />
<br />
== Usage ==<br />
<br />
See the [http://i3wm.org/docs official documentation] on this subject for more information: [http://i3wm.org/docs/userguide.html i3 User’s Guide]<br />
<br />
In i3, commands are invoked using a modifier key, which is referred to as $mod. This is the Alt key (Mod1) by default, with the Windows key (Mod4) being a popular alternative.<br />
<br />
=== Default keybindings ===<br />
<br />
(Many thanks for Funtoo Linux team for the excellent wiki (http://www.funtoo.org/I3_Tiling_Window_Manager))<br />
<br />
{| border="1"<br />
! Key !! Command<br />
|-<br />
|$mod + Enter || Open terminal<br />
|-<br />
|$mod + A || Focus Parent<br />
|-<br />
|$mod + S || Stacked Layout<br />
|-<br />
|$mod + W || Tabbed Layout<br />
|-<br />
|$mod + E || Default Layout<br />
|-<br />
|$mod + SpaceBar || Focus tiling/floating<br />
|-<br />
|$mod + D || dmenu<br />
|-<br />
|$mod + H || Split Horizontal<br />
|-<br />
|$mod + V || Split Vertically<br />
|-<br />
|$mod + J || Left<br />
|-<br />
|$mod + K || Down<br />
|-<br />
|$mod + J || Up<br />
|-<br />
|$mod + ; || Right<br />
|-<br />
|$mod + Shift + Q || Kill window<br />
|-<br />
|$mod + Shift + E || Exit i3<br />
|-<br />
|$mod + Shift + C || Reload i3config without restarting<br />
|-<br />
|$mod + Shift + R || Restart i3 (reloads i3config without exiting i3)<br />
|-<br />
|$mod + Shift + J || Move left<br />
|-<br />
|$mod + Shift + K || Move down<br />
|-<br />
|$mod + Shift + L || Move up<br />
|-<br />
|$mod + Shift + : || Move right<br />
|-<br />
|$mod + Shift + SpaceBar || Toggle tiling/floating<br />
|}<br />
<br />
=== Application launcher ===<br />
<br />
i3 currently uses [[dmenu]] as a application launcher, which is bound by default to {{ic|$mod+d}}.<br />
<br />
By default i3-dmenu-desktop is used as a wrapper for dmenu. i3-dmenu-desktop creates a list of all installed applications via their .desktop files. There is a rewrite of this perl script called {{AUR|j4-dmenu-desktop-git}}, which is a near-drop-in replacement for the script shipped with i3, but much faster.<br />
<br />
=== Clipboard (copy & paste issues) ===<br />
<br />
By default, when you close a window, the buffer with the clipboard info will disappear. You have to use a clipboard manager like {{Pkg|clipit}} to avoid that.<br />
<br />
== See also ==<br />
<br />
* [http://i3wm.org/docs/userguide.html i3 User Guide]<br />
* [[Comparison of Tiling Window Managers]]<br />
* [http://i3wm.org Official website]<br />
* [http://code.stapelberg.de/git/i3 Source code]<br />
* [https://github.com/ashinkarov/i3-extras Collection of scripts and patches]<br />
<br />
'''Arch Linux Forums'''<br />
* [https://bbs.archlinux.org/viewtopic.php?id=99064 The i3 thread] - A general discussion about i3<br />
* [https://bbs.archlinux.org/viewtopic.php?id=103369 i3 desktop screenshots and config sharing]</div>Mau5kitohttps://wiki.archlinux.org/index.php?title=Arch_build_system&diff=259207Arch build system2013-05-27T20:35:56Z<p>Mau5kito: /* Set the PACKAGER variable in /etc/makepkg.conf */ Add link to expac package</p>
<hr />
<div>[[Category:About Arch]]<br />
[[Category:Package development]]<br />
[[Category:Package management]]<br />
[[cs:Arch Build System]]<br />
[[da:Arch Build System]]<br />
[[de:Arch Build System]]<br />
[[el:Arch Build System]]<br />
[[es:Arch Build System]]<br />
[[fr:ABS]]<br />
[[it:Arch Build System]]<br />
[[ja:Arch Build System]]<br />
[[ko:Arch Build System]]<br />
[[pl:Arch Build System]]<br />
[[ro:ABS]]<br />
[[ru:Arch Build System]]<br />
[[tr:Arch_derleme_sistemi]]<br />
[[zh-CN:Arch Build System]]<br />
[[zh-TW:Arch Build System]]<br />
{{Article summary start}}<br />
{{Article summary text|The Arch Build System is a ports-like system for building and packaging software from source code. This article includes a general overview of the ABS followed by detailed usage instructions.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Package management overview}}}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|ABS FAQ}}<br />
{{Article summary wiki|Arch Packaging Standards}}<br />
{{Article summary wiki|Creating Packages}}<br />
{{Article summary wiki|Kernel Compilation with ABS}}<br />
{{Article summary end}}<br />
<br />
This article provides an overview of the Arch Build System along with a walkthrough for beginners. It is not a complete reference guide! For a quick and simple introduction to the ABS, see the [[ABS FAQ]]. If you need more information, please reference the man pages.<br />
{{Note|ABS syncs once a day so it may lag behind what is already available in the repositories.}}<br />
== What is the Arch Build System? ==<br />
<br />
The Arch Build System, '''ABS''' for short, is a ''ports-like'' system for building and packaging software from source code. While [[pacman]] is the specialized Arch tool for binary package management (including packages built with the ABS), ABS is a collection of tools for compiling source into installable {{ic|.pkg.tar.xz}} packages.<br />
<br />
=== What is a ports-like system? ===<br />
<br />
''Ports'' is a system used by *BSD to automate the process of building software from source code. The system uses a ''port'' to download, unpack, patch, compile, and install the given software. A ''port'' is merely a small directory on the user's computer, named after the corresponding software to be installed, that contains a few files with the instructions for building and installing the software from source. This makes installing software as simple as typing {{ic|make}} or {{ic|make install clean}} within the port's directory.<br />
<br />
=== ABS is a similar concept ===<br />
<br />
ABS is made up of a directory tree (the ABS tree) residing under {{ic|/var/abs}}. This tree contains many subdirectories, each within a category and each named by their respective package. This tree represents (but does not contain) all ''official Arch software'', retrievable through the SVN system. You may refer to each package-named subdirectory as an 'ABS', much the way one would refer to a 'port'. These ABS (or subdirectories) do not contain the software package nor the source but rather a [[PKGBUILD]] file (and sometimes other files). A PKGBUILD is a simple Bash build script -- a text file containing the compilation and packaging instructions as well as the URL of the appropriate '''source''' tarball to be downloaded. (The most important component of ABS are PKGBUILDs.) By issuing the ABS [[makepkg]] command, the software is first compiled and then ''packaged'' within the build directory before being installed. Now you may use [[pacman]], the Arch Linux package manager, to install, upgrade, and remove your new package.<br />
<br />
=== ABS overview ===<br />
<br />
'ABS' may be used as an umbrella term since it includes and relies on several other components; therefore, though not technically accurate, 'ABS' can refer to the following tools as a complete toolkit:<br />
<br />
; ABS tree: The ABS directory structure; an SVN hierarchy under {{ic|/var/abs/}} on your (local) machine. It contains many subdirectories, named for all available official Arch Linux software from repositories specified in {{ic|/etc/abs.conf}}, but not the packages themselves. The tree is created after installing the {{Pkg|abs}} package with [[pacman]] and subsequently running the {{ic|abs}} script.<br />
<br />
; [[PKGBUILD]]s: A [[Bash]] script that contains the URL of the source code along with the compilation and packaging instructions.<br />
<br />
; [[makepkg]]: ABS shell command tool which reads the PKGBUILDs, automatically downloads and compiles the sources and creates a {{ic|.pkg.tar*}} according to the {{ic|PKGEXT}} array in {{ic|makepkg.conf}}. You may also use makepkg to make your own custom packages from the [[AUR]] or third-party sources. (See the [[Creating Packages]] wiki article.)<br />
<br />
; [[pacman]]: pacman is completely separate, but is necessarily invoked either by makepkg or manually, to install and remove the built packages and for fetching dependencies.<br />
<br />
; [[Arch User Repository|AUR]]: The Arch User Repository is separate from ABS but AUR (unsupported) PKGBUILDs are built using makepkg to compile and package up software. In contrast to the ABS tree on your local machine, the AUR exists as a website interface. It contains many thousands of user-contributed PKGBUILDs for software which is unavailable as an official Arch package. If you need to build a package outside the official Arch tree, chances are it is in the AUR.<br />
<br />
== Why would I want to use ABS? ==<br />
<br />
The Arch Build System is used to:<br />
* Compile or recompile a package, for any reason<br />
* Make and install new packages from source of software for which no packages are yet available (see [[Creating Packages]]) <br />
* Customize existing packages to fit your needs (enabling or disabling options, patching)<br />
* Rebuild your entire system using your compiler flags, "à la FreeBSD" (e.g. with [[pacbuilder]])<br />
* Cleanly build and install your own custom kernel (see [[Kernel Compilation]])<br />
* Get kernel modules working with your custom kernel<br />
* Easily compile and install a newer, older, beta, or development version of an Arch package by editing the version number in the PKGBUILD<br />
<br />
ABS is not necessary to use Arch Linux, but it is useful for automating certain tasks of source compilation.<br />
<br />
== How to use ABS ==<br />
<br />
Building packages using abs consists of these steps:<br />
#Install the {{Pkg|abs}} package with [[pacman]].<br />
#Run {{ic|abs}} as root to create the ABS tree by synchronizing it with the Arch Linux server.<br />
#Copy the build files (usually residing under {{ic|/var/abs/<repo>/<pkgname>}}) to a build directory.<br />
#Navigate to that directory, edit the PKGBUILD (if desired/necessary) and do '''makepkg'''. <br />
#According to instructions in the PKGBUILD, makepkg will download the appropriate source tarball, unpack it, patch if desired, compile according to {{ic|CFLAGS}} specified in {{ic|makepkg.conf}}, and finally compress the built files into a package with the extension {{ic|.pkg.tar.gz}} or {{ic|.pkg.tar.xz}}. <br />
#Installing is as easy as doing {{ic|pacman -U <.pkg.tar.xz file>}}. Package removal is also handled by pacman.<br />
<br />
=== Install tools ===<br />
<br />
To use the ABS, you first need to [[pacman|install]] {{Pkg|abs}} from the [[Official Repositories|official repositories]].<br />
<br />
This will grab the abs-sync scripts, various build scripts, and [[rsync]] (as a dependency, if you do not already have it).<br />
<br />
Before you can actually build anything, however, you will also need basic compiling tools. These are handily collected in the [[Pacman#Installing_package_groups|package group]] {{grp|base-devel}}. This group can be installed with pacman.<br />
<br />
=== /etc/abs.conf ===<br />
<br />
As root, edit {{ic|/etc/abs.conf}} to include your desired repositories.<br />
<br />
Remove the {{ic|!}} in front of the appropriate repositories. For example:<br />
REPOS=(core extra community !testing)<br />
<br />
=== ABS tree ===<br />
<br />
The ABS tree is an SVN directory hierarchy located under {{ic|/var/abs}} and looks like this:<br />
<br />
{{bc|<nowiki><br />
| -- core/<br />
| || -- acl/<br />
| || || -- PKGBUILD<br />
| || -- attr/<br />
| || || -- PKGBUILD<br />
| || -- abs/<br />
| || || -- PKGBUILD<br />
| || -- autoconf/<br />
| || || -- PKGBUILD<br />
| || -- ...<br />
| -- extra/<br />
| || -- acpid/<br />
| || || -- PKGBUILD<br />
| || -- apache/<br />
| || || -- PKGBUILD<br />
| || -- ...<br />
| -- community/<br />
| || -- ...<br />
</nowiki>}}<br />
<br />
The ABS tree has exactly the same structure as the package database:<br />
<br />
* First-level: Reposistory name<br />
* Second-level: Package name directories<br />
* Third level: PKGBUILD (contains information needed to build a package) and other related files (patches, other files needed for building the package)<br />
<br />
The source code for the package is not present in the ABS directory. Instead, the '''PKGBUILD''' file contains a URL that will download the source code when the package is built. So the size of abs tree is quite small.<br />
<br />
==== Download ABS tree ====<br />
As root, run:<br />
# abs<br />
<br />
Your ABS tree is now created under {{ic|/var/abs}}. Note the appropriate branches of the ABS tree now exist and correspond to the ones you specified in {{ic|/etc/abs.conf}}. <br />
<br />
The abs command should be run periodically to keep in sync with the official repositories. Individual ABS package files can also be downloaded with:<br />
<br />
# abs <repository>/<package><br />
This way you do not have to check out the entire abs tree just to build one package.<br />
<br />
=== /etc/makepkg.conf ===<br />
<br />
{{ic|/etc/makepkg.conf}} specifies global environment variables and compiler flags which you may wish to edit if you are using an SMP system, or to specify other desired optimizations. The default settings are for i686 and x86_64 optimizations which will work fine for those architectures on single-CPU systems. (The defaults will work on SMP machines, but will only use one core/CPU when compiling -- see [[makepkg.conf]].)<br />
<br />
==== Set the PACKAGER variable in /etc/makepkg.conf ====<br />
<br />
Setting the PACKAGER variable in {{ic|/etc/makepkg.conf}} is an optional but ''highly recommended'' step. It allows a "flag" to quickly identify which packages have been built and/or installed by YOU, not the official maintainer! This is easily accomplished using {{Pkg|expac}} available from the community repo:<br />
<br />
===== Showing All Packages (including those from AUR) =====<br />
$ grep myname /etc/makepkg.conf<br />
PACKAGER="myname <myemail@myserver.com>"<br />
<br />
$ expac "%n %p" | grep "myname" | column -t<br />
archey3 myname<br />
binutils myname<br />
gcc myname<br />
gcc-libs myname<br />
glibc myname<br />
tar myname<br />
<br />
===== Showing Only Packages Contained in Repos =====<br />
<br />
This example only shows packages contained in the repos defined in {{ic|/etc/pacman.conf}}:<br />
<br />
$ . /etc/makepkg.conf; grep -xvFf <(pacman -Qqm) <(expac "%n\t%p" | grep "$PACKAGER$" | cut -f1)<br />
binutils<br />
gcc<br />
gcc-libs<br />
glibc<br />
tar<br />
<br />
=== Create a build directory ===<br />
<br />
It is recommended to create a build directory where the actual compiling will take place; you should never modify the ABS tree by building within it, as data will be lost (overwritten) on each ABS update. It is good practice to use your home directory, though some Arch users prefer to create a 'local' directory under {{ic|/var/abs/}}, owned by a normal user. <br />
<br />
Create your build directory. e.g.:<br />
<br />
$ mkdir -p $HOME/abs<br />
<br />
Copy the ABS from the tree ({{ic|/var/abs/<repository>/<pkgname>}}) to the build directory.<br />
<br />
=== Build package ===<br />
<br />
In our example, we will build the ''slim'' display manager package.<br />
<br />
Copy the slim ABS from the ABS tree to a build directory:<br />
$ cp -r /var/abs/extra/slim/ ~/abs<br />
<br />
Navigate to the build directory:<br />
$ cd ~/abs/slim<br />
<br />
Modify the PKGBUILD to add or remove support for components, to patch or to change package versions, etc. (optional):<br />
$ nano PKGBUILD<br />
<br />
Run makepkg as normal user (with {{ic|-s}} switch to install with automatic dependency handling):<br />
$ makepkg -s<br />
<br />
{{Note|Before complaining about missing (make) dependencies, remember that the {{Grp|base}} group is assumed to be installed on all Arch Linux systems. The group "base-devel" is assumed to be installed when building with '''makepkg'''. See [[#Install tools]].}}<br />
<br />
Install as root:<br />
# pacman -U slim-1.3.0-2-i686.pkg.tar.xz<br />
<br />
That's it. You have just built slim from source and cleanly installed it to your system with pacman. Package removal is also handled by pacman with {{ic|pacman -R slim}}.<br />
<br />
The ABS method adds a level of convenience and automation, while still maintaining complete transparency and control of the build and installation functions by including them in the PKGBUILD.<br />
<br />
==== fakeroot ====<br />
Essentially, the same steps are being executed in the traditional method (generally including the {{ic|./configure, make, make install}} steps) but the software is installed into a ''fake root'' environment. (A ''fake root'' is simply a subdirectory within the build directory that functions and behaves as the system's root directory. In conjunction with the '''fakeroot''' program, makepkg creates a fake root directory, and installs the compiled binaries and associated files into it, with '''root''' as owner.) The ''fake root'', or subdirectory tree containing the compiled software, is then compressed into an archive with the extension {{ic|.pkg.tar.xz}}, or a ''package''. When invoked, pacman then extracts the package (installs it) into the system's real root directory ({{ic|/}}).</div>Mau5kitohttps://wiki.archlinux.org/index.php?title=User:Mau5kito&diff=254509User:Mau5kito2013-04-18T08:00:59Z<p>Mau5kito: Added personnal website</p>
<hr />
<div>My website: [http://twobp.alwaysdata.net TWOBP]</div>Mau5kitohttps://wiki.archlinux.org/index.php?title=Power_management/Suspend_and_hibernate&diff=244250Power management/Suspend and hibernate2013-01-17T10:14:36Z<p>Mau5kito: missing word</p>
<hr />
<div>[[Category:Power management]]<br />
{{Article summary start}}<br />
{{Article summary text|Describes suspend(sleep-to-ram), hibernate(sleep-to-disk)}}<br />
{{Article summary heading|Related articles}}<br />
{{Article summary wiki|Suspend to RAM}}<br />
{{Article summary wiki|Systemd}}<br />
{{Article summary wiki|pm-utils}}<br />
{{Article summary wiki|Uswsusp}}<br />
{{Article summary wiki|Tuxonice}}<br />
{{Article summary wiki|Suspending to RAM with hibernate-script}}<br />
{{Article summary wiki|Suspending to Disk with hibernate-script}}<br />
{{Article summary end}}<br />
<br />
Manually suspending the operating system, either to memory (standby) or to disk (hibernate) sometimes provides the most efficient way to optimize battery life, depending on the usage pattern of the laptop. While there is relatively straightforward support in the linux kernel to support these operations, typically some adjustments have to be made before initiating these operations (typically due to problematic drivers, modules or hardware). The following tools provide wrappers around the kernel interfaces to suspend/resume<br />
<br />
* Wrappers: Systemd, pm-utils<br />
* Backend: kernel, uswsusp, tuxonice <br />
<br />
=Backend=<br />
<br />
==Kernel==<br />
<br />
===Suspend===<br />
<br />
works-out-of-box<br />
<br />
===Hibernation===<br />
<br />
It needs a swap partiton.<br />
<br />
'''About swap partition size'''<br />
<br />
Even if your swap partition is smaller than RAM, you still have a big chance in hibernating successfully. According to [http://www.mjmwired.net/kernel/Documentation/power/interface.txt kernel documentation]: "''{{ic|/sys/power/image_size}} controls the size of the image created by the suspend-to-disk mechanism [...] which is set to 2/5 of available RAM by default. [...] The suspend-to-disk mechanism will do its best to ensure the image size will not exceed that number.''" You may either decrease it due to a small swap partition or increase it in purpose of possible hibernation speed up.<br />
<br />
'''Add Kernel Parameters'''<br />
<br />
The parameter {{ic|1=resume=SWAP_PARTITION}} has to be passed to the [[Kernel parameters]] (where {{ic|SWAP_PARTITION}} is either your swap device, i.e. {{ic|/dev/sda'''X'''}}, or your swap UUID). Consult [[Kernel parameters]] for more info.<br />
<br />
kernel /boot/vmlinuz-linux ... resume=/dev/sdaX<br />
<br />
If you are using swap file instead of regular swap partition, read [[Swap#Swap file resuming]] for more info.<br />
<br />
kernel /boot/vmlinuz-linux ... resume=/dev/sdaX resume_offset=12345<br />
<br />
You will also need to add the {{ic|resume}} hook to {{ic|mkinitcpio.conf}}:<br />
<br />
{{hc|/etc/mkinitcpio.conf|2=# resume must be placed after ide scsi sata and/or lvm2, but before filesystems<br />
HOOKS="... ide scsi sata lvm2 '''''resume''''' filesystems"}}<br />
<br />
You must rebuild the initrd image for these changes to take effect:<br />
<br />
{{bc|# mkinitcpio -p linux}}<br />
<br />
{{Note|If you use a custom kernel, then you might have to change the value of the {{ic|-p}} option.}}<br />
<br />
==Uswsusp==<br />
<br />
'''uswsusp''' (userspace software suspend) is a set of user space tools used for hibernation (suspend-to-disk) and suspend (suspend-to-RAM or standby) on Linux systems.<br />
<br />
Consulte [[Uswsusp]].<br />
<br />
==TuxOnIce==<br />
<br />
'''TuxOnIce''' , an advanced suspend/hibernate framework which supports suspending to a swap-disk or a regular file with fast LZO-compression.<br />
<br />
Consulte [[TuxOnIce]].<br />
<br />
= Wrappers =<br />
<br />
== systemd ==<br />
<br />
{{bc|<br />
$ systemctl suspend<br />
$ systemctl hibernate<br />
$ systemctl hybrid-sleep<br />
}}<br />
<br />
See [[systemd#ACPI Power Management with systemd]]<br />
<br />
==pm-utils==<br />
<br />
{{bc|<br />
# pm-suspend<br />
# pm-hibernate<br />
# pm-suspend-hybrid<br />
}}<br />
<br />
See [[pm-utils]]</div>Mau5kitohttps://wiki.archlinux.org/index.php?title=Network_configuration&diff=241965Network configuration2012-12-28T14:45:38Z<p>Mau5kito: /* Manually run DHCP Client Daemon */dhcpcd will not work correctly unless run as root</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 />
[[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 />
<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. To set the hostname: <br />
# hostnamectl set-hostname '''myhostname'''<br />
<br />
{{Note|You no longer need to edit {{ic|/etc/hosts}}, {{pkg|nss-myhostname}} 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 />
=== Persistent device names ===<br />
<br />
For motherboards that have integrated NICs, it is important to know which one is considered the primary NIC (e.g. {{ic|eth0}}) and which is considered the secondary NIC (e.g. {{ic|eth1}}). Many configuration issues are caused by users incorrectly configuring the network settings for {{ic|eth0}}, when in fact, they have their Ethernet cable plugged into {{ic|eth1}}.<br />
<br />
[[Udev]] is responsible for which device gets which name. With udev and modular network drivers, the network interface numbering is not persistent across reboots by default, because the drivers are loaded in parallel and, thus, in random order. Configuring your network connection is hard if you do not know if your card will be called {{ic|eth0}} or {{ic|eth1}}. You can fix this using {{ic|ifrename}}. See [[Rename network interfaces]]. It is also possible to manually create udev rules that assign interface names based on the interface's MAC address. See [[Udev#Network device]].<br />
<br />
=== Get current device names ===<br />
<br />
Current NIC names can be found using the {{ic|ip}} tool:<br />
<br />
{{hc|$ ip addr <nowiki>|</nowiki> sed '/^[0-9]/!d;s/: <.*$//'|<br />
1: lo<br />
2: eth1<br />
3: eth0<br />
4: 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 addr show dev eth0|<br />
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP 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/resolve.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 issues.}}<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 />
=====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 />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
ExecStart=/sbin/ip link set dev wlan0 up<br />
ExecStart=/usr/sbin/wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf<br />
ExecStart=/sbin/dhcpcd wlan0<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/conf.d/network}} using your editor of choice. This file will store your interface and static IP address settings.<br />
{{hc|/etc/conf.d/network|<nowiki><br />
interface=wlan0<br />
address=192.168.0.10<br />
netmask=24<br />
broadcast=192.168.0.255<br />
gateway=192.168.0.1<br />
</nowiki>}}<br />
<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 />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
EnvironmentFile=/etc/conf.d/network<br />
ExecStart=/sbin/ip link set dev ${interface} up<br />
ExecStart=/usr/sbin/wpa_supplicant -B -i ${interface} -c /etc/wpa_supplicant.conf # Remove this for wired connections<br />
ExecStart=/sbin/ip addr add ${address}/${netmask} broadcast ${broadcast} dev ${interface}<br />
ExecStart=/sbin/ip route add default via ${gateway}<br />
<br />
ExecStop=/sbin/ip addr flush dev ${interface}<br />
ExecStop=/sbin/ip link set dev ${interface} 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 />
=== 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 />
== 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 issue ===<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 issue: ping uses ICMP 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 />
<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 issue 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 issue ===<br />
<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 />
<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 issue ===<br />
<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 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.</div>Mau5kito