https://wiki.archlinux.org/api.php?action=feedcontributions&user=Ultraviolet&feedformat=atomArchWiki - User contributions [en]2024-03-29T01:58:56ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=MariaDB&diff=408207MariaDB2015-11-05T09:12:36Z<p>Ultraviolet: /* Add user */ added FLUSH PRIVILEGES so the changes will take effect</p>
<hr />
<div>[[Category:Database management systems]]<br />
[[cs:MySQL]]<br />
[[de:MySQL]]<br />
[[es:MySQL]]<br />
[[fr:MariaDB]]<br />
[[it:MySQL]]<br />
[[ja:MySQL]]<br />
[[ru:MySQL]]<br />
[[sr:MySQL]]<br />
[[tr:MySQL]]<br />
[[zh-CN:MySQL]]<br />
{{Related articles start}}<br />
{{Related|phpMyAdmin}}<br />
{{Related|Adminer}}<br />
{{Related articles end}}<br />
MySQL is a widely spread, multi-threaded, multi-user SQL database. For more information about features, see the [http://www.mysql.com/ official homepage].<br />
<br />
{{Note|MariaDB is now officially Arch Linux's default implementation of MySQL. It is recommended for all users to [[#Upgrade from Oracle MySQL to MariaDB|upgrade]] to MariaDB. Oracle MySQL was dropped to the [[AUR]]. See [https://www.archlinux.org/news/mariadb-replaces-mysql-in-repositories/ the announcement].}}<br />
<br />
== Installation ==<br />
<br />
[https://mariadb.org/ MariaDB] is the [https://www.archlinux.org/news/mariadb-replaces-mysql-in-repositories/ default implementation] of MySQL in Arch Linux, provided with the {{Pkg|mariadb}} package.<br />
<br />
Alternative implementations are:<br />
* {{App|Oracle MySQL|An implementation by Oracle Corporation.|https://www.mysql.com/|{{AUR|mysql}}}}<br />
* {{App|Percona Server|An implementation by Percona LLC.|http://www.percona.com/software/percona-server/|{{Pkg|percona-server}}}}<br />
<br />
{{Tip|<br />
* If the database (in {{ic|/var/lib/mysql}}) resides on a [[Btrfs]] file system, you should consider disabling [[Btrfs#Copy-On-Write_.28CoW.29|Copy-on-Write]] for the directory before creating any database.<br />
* If the database resides on a [[ZFS]] file system, you should consult [[ZFS#Database]] before creating any database.<br />
}}<br />
<br />
Install {{Pkg|mariadb}}, afterwards run the following command '''before starting''' the {{ic|mysqld.service}}:<br />
# mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql<br />
Now the {{ic|mysqld.service}} can be started and/or enabled with [[systemd#Using units|systemd]].<br />
<br />
It is recommended to secure the MySQL installation by running the following command:<br />
# mysql_secure_installation<br />
<br />
To simplify administration, you might want to install a front-end such as {{Pkg|mysql-workbench}} and/or [[Adminer]].<br />
<br />
===Upgrade MariaDB===<br />
You might consider running running the following command after a (major) version upgrade (such as from 5.5 to 10.0, or from 10.0 to 10.1):<br />
# mysql_upgrade -u root -p<br />
<br />
=== Upgrade from Oracle MySQL to MariaDB ===<br />
{{Note|It could be necessary to remove the following files from {{ic|/var/lib/mysql}} : {{ic|ib_logfile0}}, {{ic|ib_logfile1}} and {{ic|aria_log_control}}, before restarting the daemon in the following procedure.}}<br />
<br />
See [https://www.archlinux.org/news/mariadb-replaces-mysql-in-repositories/ the announcement] for the procedure to follow.<br />
<br />
== Configuration ==<br />
Once you have started the MySQL server and added a root account, you may want to change the default configuration.<br />
<br />
To log in as {{ic|root}} on the MySQL server, use the following command:<br />
$ mysql -u root -p<br />
<br />
{{Tip|<br />
While MySQL syntax elements are often written in ALL CAPS for emphasis, they do not need to be typed as such. When entered in lowercase they have the same effect, at least when using MariaDB. The quotes around the user and hostname shown below are also not usually necessary.<br />
}}<br />
<br />
=== Add user ===<br />
Creating a new user takes two steps: create the user; grant privileges. In the below example, the user ''monty'' with ''some_pass'' as password is being created, then granted full permissions to the database ''mydb'': <br />
<br />
{{hc|$ mysql -u root -p|<br />
MariaDB> CREATE USER 'monty'@'localhost' IDENTIFIED BY 'some_pass';<br />
MariaDB> GRANT ALL PRIVILEGES ON mydb.* TO 'monty'@'localhost';<br />
MariaDB> FLUSH PRIVILEGES;<br />
MariaDB> quit}}<br />
<br />
=== Configuration files ===<br />
<br />
''MariaDB'' configuration options are read from the following files in the given order (according to {{ic|mysqld --help --verbose | tail -20}} output):<br />
/etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf<br />
<br />
Depending on the scope of the changes you want to make (system-wide, user-only...), use the corresponding file. See [https://mariadb.com/kb/en/mariadb/documentation/getting-started/starting-and-stopping-mariadb/mysqld-configuration-files-and-groups/ this entry] of the KnowledgeBase for more information.<br />
<br />
=== Grant remote access ===<br />
{{Warning|This is not considered as best practice and may cause security issues. Consider using [[Secure Shell]], [[VNC]] or [[:Category:Virtual Private Network|VPN]], if you want to maintain the MySQL-server outside and/or inside your LAN.}}<br />
If you want to access your MySQL server from other LAN hosts, you have to edit the following lines in {{ic|/etc/mysql/my.cnf}}:<br />
[mysqld]<br />
...<br />
#skip-networking<br />
bind-address = <some ip-address><br />
...<br />
<br />
Grant any MySQL user remote access (example for root):<br />
$ mysql -u root -p<br />
Check current users with remote access privileged:<br />
SELECT User, Host FROM mysql.user WHERE Host <> 'localhost';<br />
Now grant remote access for your user (here root)::<br />
GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.1.%' IDENTIFIED BY 'my_optional_remote_password' WITH GRANT OPTION;<br />
You can change the '%' wildcard to a specific host if you like. The password can be different from user's main password.<br />
<br />
=== Disable remote access ===<br />
The MySQL server is accessible from the network by default. If MySQL is only needed for the localhost, you can improve security by not listening on TCP port 3306. To refuse remote connections, uncomment the following line in {{ic|/etc/mysql/my.cnf}}:<br />
skip-networking<br />
<br />
You will still be able to log in from the localhost.<br />
<br />
=== Enable auto-completion ===<br />
{{Note|Enabling this feature can make the client initialization longer.}}<br />
The MySQL client completion feature is disabled by default. To enable it system-wide edit {{ic|/etc/mysql/my.cnf}}, and replace {{ic|no-auto-rehash}} by {{ic|auto-rehash}}. Completion will be enabled next time you run the MySQL client.<br />
<br />
=== Using UTF-8 ===<br />
In the {{ic|/etc/mysql/my.cnf}} file section under the {{ic|mysqld}} group, add:<br />
<br />
{{bc|<nowiki><br />
[mysqld]<br />
init_connect = 'SET collation_connection = utf8_general_ci,NAMES utf8'<br />
collation_server = utf8_general_ci<br />
character_set_client = utf8<br />
character_set_server = utf8<br />
</nowiki>}}<br />
<br />
=== Using a TMPFS for tmpdir ===<br />
The directory used by MySQL for storing temporary files is named ''tmpdir''. For example, it is used to perform disk based large sorts, as well as for internal and explicit temporary tables.<br />
<br />
Create the directory with appropriate permissions:<br />
# mkdir -pv /var/lib/mysqltmp<br />
# chown mysql:mysql /var/lib/mysqltmp<br />
<br />
Find the id and gid of the {{ic|mysql}} user and group:<br />
$ id mysql<br />
uid=27(mysql) gid=27(mysql) groups=27(mysql)<br />
<br />
Add to your {{ic|/etc/fstab}} file.<br />
tmpfs /var/lib/mysqltmp tmpfs rw,gid=27,uid=27,size=100M,mode=0750,noatime 0 0<br />
<br />
Add to your {{ic|/etc/mysql/my.cnf}} file under the {{ic|mysqld}} group:<br />
tmpdir = /var/lib/mysqltmp<br />
<br />
Then reboot or ( shutdown mysql, mount the tmpdir, start mysql ).<br />
<br />
=== Time zone tables ===<br />
Although time zone tables are created during the installation, they are not automatically populated. They need to be populated if you are planning on using CONVERT_TZ() in SQL queries.<br />
<br />
To populate the time zone tables with all the time zones:<br />
$ mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql<br />
<br />
Optionally, you may populate the table with specific time zone files:<br />
$ mysql_tzinfo_to_sql <timezone_file> <timezone_name> | mysql -u root -p mysql<br />
<br />
== Backup ==<br />
<br />
There are various [https://mariadb.com/kb/en/mariadb/documentation/backing-up-and-restoring/ tools and strategies] to back up your databases.<br />
<br />
If you are using the default InnoDB storage engine, a [https://mariadb.com/kb/en/mariadb/documentation/clients-and-utilities/backup-restore-and-import/mysqldump/#examples suggested] way of backing up all your bases online while provisioning for [https://dev.mysql.com/doc/refman/5.6/en/password-security-user.html point-in-time recovery] (also known as “roll-forward,” when you need to restore an old backup and replay the changes that happened since that backup) is to execute the following command:<br />
<br />
$ mysqldump --single-transaction --flush-logs --master-data=2 --all-databases -u root -p > all_databases.sql<br />
<br />
This will prompt for '''MariaDB's''' root user's password, which was defined during database [[#Configuration]].<br />
<br />
Specifying the password on the command line is [https://dev.mysql.com/doc/refman/5.6/en/password-security-user.html strongly discouraged], as it exposes it to discovery by other users through the use of {{ic|ps aux}} or other techniques. Instead, the aforementioned command will prompt for the specified user's password, concealing it away.<br />
<br />
=== Compression ===<br />
As SQL tables can get pretty large, it is recommended to pipe the output of the aforementioned command in a compression utility like {{Pkg|gzip}}:<br />
$ mysqldump --single-transaction --flush-logs --master-data=2 --all-databases -u root -p | gzip > all_databases.sql.gz<br />
<br />
Decompressing the backup thus created and reloading it in the server is achieved by doing:<br />
$ gunzip all_databases.sql.gz | mysql -u root -p<br />
<br />
This will recreate and repopulate all the databases previously backed up (see [https://stackoverflow.com/questions/23180963/restore-all-mysql-database-from-a-all-database-sql-gz-file#comment35453351_23180977 this] or [http://www.linuxquestions.org/questions/linux-server-73/how-to-restore-mysqldump-all-databases-backup-892922/ this]).<br />
<br />
=== Non-interactive ===<br />
<br />
If you want to setup non-interactive backup script for use in [[cron]] jobs or [[Systemd/cron_functionality|systemd timers]], see [https://dev.mysql.com/doc/refman/5.6/en/option-files.html option files] and [https://stackoverflow.com/a/9293090 this illustration] for ''mysqldump''.<br />
<br />
Basically you should add the following section to the relevant [[#Configuration_files|configuration file]]:<br />
{{bc|<nowiki><br />
[mysqldump]<br />
user=mysqluser<br />
password=secret<br />
</nowiki>}}<br />
<br />
Mentioning a user here is optional, but doing so will free you from having to mention it on the command line.<br />
<br />
==== Example script ====<br />
<br />
The database can be dumped to a file for easy backup. The following shell script will do this for you, creating a {{ic|db_backup.gz}} file in the same directory as the script, containing your database dump:<br />
<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
<br />
THISDIR=$(dirname $(readlink -f "$0"))<br />
<br />
mysqldump --single-transaction --flush-logs --master-data=2 --all-databases \<br />
| gzip > $THISDIR/db_backup.gz<br />
echo 'purge master logs before date_sub(now(), interval 7 day);' | mysql<br />
</nowiki>}}<br />
<br />
See also the official {{ic|mysqldump}} page in the [http://dev.mysql.com/doc/refman/5.6/en/mysqldump.html MySQL] and [https://mariadb.com/kb/en/mariadb/documentation/clients-and-utilities/backup-restore-and-import/mysqldump MariaDB] manuals.<br />
<br />
=== Holland Backup ===<br />
<br />
A python-based software package named [http://hollandbackup.org/ Holland Backup] is available in [[AUR]] to automate all of the backup work. It supports direct mysqldump, LVM snapshots to tar files (mysqllvm), LVM snapshots with mysqldump (mysqldump-lvm), and {{pkg|xtrabackup}} methods to extract the data. The Holland framework supports a multitude of options and is highly configurable to address almost any backup situation.<br />
<br />
The main {{AUR|holland}} and {{AUR|holland-common}} packages provide the core framework; one of the sub-packages ({{AUR|holland-mysqldump}}, {{AUR|holland-mysqllvm}} and/or {{AUR|holland-xtrabackup}} must be installed for full operation. Example configurations for each method are in the {{ic|/usr/share/doc/holland/examples/}} directory and can be copied to {{ic|/etc/holland/backupsets/}}, as well as using the {{ic|holland mk-config}} command to generate a base config for a named provider.<br />
<br />
== Troubleshooting ==<br />
=== MySQL daemon cannot start ===<br />
If MySQL fails to start and there is no entry in the log files, you might want to check the permissions of files in the directories {{ic|/var/lib/mysql}} and {{ic|/var/lib/mysql/mysql}}. If the owner of files in these directories is not {{ic|mysql:mysql}}, you should do the following:<br />
# chown mysql:mysql /var/lib/mysql -R<br />
If you run into permission problems despite having followed the above, ensure that your {{ic|my.cnf}} is copied to {{ic|/etc/}}:<br />
# cp /etc/mysql/my.cnf /etc/my.cnf<br />
Now try and start the daemon.<br />
<br />
If you get these messages in your {{ic|/var/lib/mysql/hostname.err}}:<br />
[ERROR] Can't start server : Bind on unix socket: Permission denied<br />
[ERROR] Do you already have another mysqld server running on socket: /var/run/mysqld/mysqld.sock ?<br />
[ERROR] Aborting<br />
the permissions of {{ic|/var/run/mysqld}} could be the culprit.<br />
# chown mysql:mysql /var/run/mysqld -R<br />
<br />
If you run mysqld and the following error appears:<br />
Fatal error: Can’t open and lock privilege tables: Table ‘mysql.host’ doesn’t exist<br />
Run the following command from the {{ic|/usr}} directory to install the default tables:<br />
# cd /usr<br />
# mysql_install_db --user=mysql --ldata=/var/lib/mysql/<br />
<br />
=== Unable to run mysql_upgrade because MySQL cannot start ===<br />
Try run MySQL in safemode:<br />
# mysqld_safe --datadir=/var/lib/mysql/<br />
And then run:<br />
# mysql_upgrade -u root -p<br />
<br />
=== Reset the root password ===<br />
Stop {{ic|mysqld.service}}. Issue the following command:<br />
# mysqld_safe --skip-grant-tables &<br />
Connect to the mysql server. Issue the following command:<br />
# mysql -u root mysql<br />
Change root password:<br />
mysql> use mysql;<br />
mysql> UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';<br />
mysql> FLUSH PRIVILEGES;<br />
mysql> exit<br />
Start {{ic|mysqld.service}}.<br />
<br />
=== Check and repair all tables ===<br />
Check and auto repair all tables in all databases, [http://dev.mysql.com/doc/refman/5.7/en/mysqlcheck.html see more]:<br />
# mysqlcheck -A --auto-repair -u root -p<br />
<br />
=== Optimize all tables ===<br />
Forcefully optimize all tables, automatically fixing table errors that may come up.<br />
# mysqlcheck -A --auto-repair -f -o -u root -p<br />
<br />
=== OS error 22 when running on ZFS ===<br />
If you are using [[ZFS]] and get the following error:<br />
InnoDB: Operating system error number 22 in a file operation.<br />
You need to disable aio_writes by adding a line to the mysqld-section in /etc/mysql/my.cnf <br />
[mysqld]<br />
...<br />
innodb_use_native_aio = 0<br />
<br />
However, if the post install scripts failed because of the above issue, MySQL/MariaDB might be in an invalid state. To recover from this state, execute the following:<br />
rm -rf /var/lib/mysql/*<br />
mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql<br />
chown -R mysql:mysql /var/lib/mysql &>/dev/null<br />
/usr/bin/systemd-tmpfiles --create mysql.conf<br />
<br />
After which MySQL/MariaDB should be installed correctly.<br />
<br />
=== Cannot login through CLI, but phpmyadmin works well ===<br />
This may happen if you are using a long (>70-75) password.<br />
As for 5.5.36, for some reason, mysql CLI cannot handle that much characters in readline mode.<br />
So, if you are planning to use the recommended password input mode:<br />
$ mysql -u <user> -p<br />
Password:<br />
consider changing the password to smaller one.<br />
<br />
{{Note|You still can log in by specifying the password as an argument to mysql command.<br />
{{Warning|This behavior is considered dangerous, because your password might leak, for example, to the logs. Use it only in case of emergency and do not forget to change password right afterwards.}}<br />
$ mysql -u <user> -p"<some-veryveryveryveryveryveryveryveryveryveryveryveryveryveryvery-long-and-veryveryveryveryveryveryveryveryveryvery-strong-password>"<br />
}}<br />
<br />
===MySQL binary logs are taking up huge disk space===<br />
By default, mysqld creates binary log files in {{ic|/var/lib/mysql}}. This is useful for replication master server or data recovery. But these binary logs can eat up your disk space. If you do not plan to use replication or data recovery features, you may disable binary logging by commenting out these lines in {{ic|/etc/mysql/my.cnf}}:<br />
#log-bin=mysql-bin<br />
#binlog_format=mixed<br />
Alternatively, you can purge some binary logs in {{ic|/var/lib/mysql}} to free up disk space with this command:<br />
#mysql -u root -p"PASSWORD" -e "PURGE BINARY LOGS TO 'mysql-bin.0000xx';"<br />
<br />
== See also ==<br />
<br />
* [https://mariadb.org/ MariaDB Official Website]<br />
* [https://mariadb.com/kb/en/ MariaDB knowledge Base]<br />
* [http://dev.mysql.com/doc/ MySQL documentation ]<br />
* [[LAMP]] - ArchWiki article covering the setup of a LAMP server (Linux Apache MySQL PHP)<br />
* [[PhpMyAdmin]] - ArchWiki article covering the web-based tool to help manage MySQL databases using an Apache/PHP front-end.<br />
* [[PHP]] - ArchWiki article on PHP.<br />
* [http://www.askapache.com/mysql/performance-tuning-mysql.html MySQL Performance Tuning Scripts and Know-How]</div>Ultraviolethttps://wiki.archlinux.org/index.php?title=MariaDB&diff=408206MariaDB2015-11-05T09:11:23Z<p>Ultraviolet: improved example user privileges, they were far too permissive for most things</p>
<hr />
<div>[[Category:Database management systems]]<br />
[[cs:MySQL]]<br />
[[de:MySQL]]<br />
[[es:MySQL]]<br />
[[fr:MariaDB]]<br />
[[it:MySQL]]<br />
[[ja:MySQL]]<br />
[[ru:MySQL]]<br />
[[sr:MySQL]]<br />
[[tr:MySQL]]<br />
[[zh-CN:MySQL]]<br />
{{Related articles start}}<br />
{{Related|phpMyAdmin}}<br />
{{Related|Adminer}}<br />
{{Related articles end}}<br />
MySQL is a widely spread, multi-threaded, multi-user SQL database. For more information about features, see the [http://www.mysql.com/ official homepage].<br />
<br />
{{Note|MariaDB is now officially Arch Linux's default implementation of MySQL. It is recommended for all users to [[#Upgrade from Oracle MySQL to MariaDB|upgrade]] to MariaDB. Oracle MySQL was dropped to the [[AUR]]. See [https://www.archlinux.org/news/mariadb-replaces-mysql-in-repositories/ the announcement].}}<br />
<br />
== Installation ==<br />
<br />
[https://mariadb.org/ MariaDB] is the [https://www.archlinux.org/news/mariadb-replaces-mysql-in-repositories/ default implementation] of MySQL in Arch Linux, provided with the {{Pkg|mariadb}} package.<br />
<br />
Alternative implementations are:<br />
* {{App|Oracle MySQL|An implementation by Oracle Corporation.|https://www.mysql.com/|{{AUR|mysql}}}}<br />
* {{App|Percona Server|An implementation by Percona LLC.|http://www.percona.com/software/percona-server/|{{Pkg|percona-server}}}}<br />
<br />
{{Tip|<br />
* If the database (in {{ic|/var/lib/mysql}}) resides on a [[Btrfs]] file system, you should consider disabling [[Btrfs#Copy-On-Write_.28CoW.29|Copy-on-Write]] for the directory before creating any database.<br />
* If the database resides on a [[ZFS]] file system, you should consult [[ZFS#Database]] before creating any database.<br />
}}<br />
<br />
Install {{Pkg|mariadb}}, afterwards run the following command '''before starting''' the {{ic|mysqld.service}}:<br />
# mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql<br />
Now the {{ic|mysqld.service}} can be started and/or enabled with [[systemd#Using units|systemd]].<br />
<br />
It is recommended to secure the MySQL installation by running the following command:<br />
# mysql_secure_installation<br />
<br />
To simplify administration, you might want to install a front-end such as {{Pkg|mysql-workbench}} and/or [[Adminer]].<br />
<br />
===Upgrade MariaDB===<br />
You might consider running running the following command after a (major) version upgrade (such as from 5.5 to 10.0, or from 10.0 to 10.1):<br />
# mysql_upgrade -u root -p<br />
<br />
=== Upgrade from Oracle MySQL to MariaDB ===<br />
{{Note|It could be necessary to remove the following files from {{ic|/var/lib/mysql}} : {{ic|ib_logfile0}}, {{ic|ib_logfile1}} and {{ic|aria_log_control}}, before restarting the daemon in the following procedure.}}<br />
<br />
See [https://www.archlinux.org/news/mariadb-replaces-mysql-in-repositories/ the announcement] for the procedure to follow.<br />
<br />
== Configuration ==<br />
Once you have started the MySQL server and added a root account, you may want to change the default configuration.<br />
<br />
To log in as {{ic|root}} on the MySQL server, use the following command:<br />
$ mysql -u root -p<br />
<br />
{{Tip|<br />
While MySQL syntax elements are often written in ALL CAPS for emphasis, they do not need to be typed as such. When entered in lowercase they have the same effect, at least when using MariaDB. The quotes around the user and hostname shown below are also not usually necessary.<br />
}}<br />
<br />
=== Add user ===<br />
Creating a new user takes two steps: create the user; grant privileges. In the below example, the user ''monty'' with ''some_pass'' as password is being created, then granted full permissions to the database ''mydb'': <br />
<br />
{{hc|$ mysql -u root -p|<br />
MariaDB> CREATE USER 'monty'@'localhost' IDENTIFIED BY 'some_pass';<br />
MariaDB> GRANT ALL PRIVILEGES ON mydb.* TO 'monty'@'localhost';<br />
MariaDB> quit}}<br />
<br />
=== Configuration files ===<br />
<br />
''MariaDB'' configuration options are read from the following files in the given order (according to {{ic|mysqld --help --verbose | tail -20}} output):<br />
/etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf<br />
<br />
Depending on the scope of the changes you want to make (system-wide, user-only...), use the corresponding file. See [https://mariadb.com/kb/en/mariadb/documentation/getting-started/starting-and-stopping-mariadb/mysqld-configuration-files-and-groups/ this entry] of the KnowledgeBase for more information.<br />
<br />
=== Grant remote access ===<br />
{{Warning|This is not considered as best practice and may cause security issues. Consider using [[Secure Shell]], [[VNC]] or [[:Category:Virtual Private Network|VPN]], if you want to maintain the MySQL-server outside and/or inside your LAN.}}<br />
If you want to access your MySQL server from other LAN hosts, you have to edit the following lines in {{ic|/etc/mysql/my.cnf}}:<br />
[mysqld]<br />
...<br />
#skip-networking<br />
bind-address = <some ip-address><br />
...<br />
<br />
Grant any MySQL user remote access (example for root):<br />
$ mysql -u root -p<br />
Check current users with remote access privileged:<br />
SELECT User, Host FROM mysql.user WHERE Host <> 'localhost';<br />
Now grant remote access for your user (here root)::<br />
GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.1.%' IDENTIFIED BY 'my_optional_remote_password' WITH GRANT OPTION;<br />
You can change the '%' wildcard to a specific host if you like. The password can be different from user's main password.<br />
<br />
=== Disable remote access ===<br />
The MySQL server is accessible from the network by default. If MySQL is only needed for the localhost, you can improve security by not listening on TCP port 3306. To refuse remote connections, uncomment the following line in {{ic|/etc/mysql/my.cnf}}:<br />
skip-networking<br />
<br />
You will still be able to log in from the localhost.<br />
<br />
=== Enable auto-completion ===<br />
{{Note|Enabling this feature can make the client initialization longer.}}<br />
The MySQL client completion feature is disabled by default. To enable it system-wide edit {{ic|/etc/mysql/my.cnf}}, and replace {{ic|no-auto-rehash}} by {{ic|auto-rehash}}. Completion will be enabled next time you run the MySQL client.<br />
<br />
=== Using UTF-8 ===<br />
In the {{ic|/etc/mysql/my.cnf}} file section under the {{ic|mysqld}} group, add:<br />
<br />
{{bc|<nowiki><br />
[mysqld]<br />
init_connect = 'SET collation_connection = utf8_general_ci,NAMES utf8'<br />
collation_server = utf8_general_ci<br />
character_set_client = utf8<br />
character_set_server = utf8<br />
</nowiki>}}<br />
<br />
=== Using a TMPFS for tmpdir ===<br />
The directory used by MySQL for storing temporary files is named ''tmpdir''. For example, it is used to perform disk based large sorts, as well as for internal and explicit temporary tables.<br />
<br />
Create the directory with appropriate permissions:<br />
# mkdir -pv /var/lib/mysqltmp<br />
# chown mysql:mysql /var/lib/mysqltmp<br />
<br />
Find the id and gid of the {{ic|mysql}} user and group:<br />
$ id mysql<br />
uid=27(mysql) gid=27(mysql) groups=27(mysql)<br />
<br />
Add to your {{ic|/etc/fstab}} file.<br />
tmpfs /var/lib/mysqltmp tmpfs rw,gid=27,uid=27,size=100M,mode=0750,noatime 0 0<br />
<br />
Add to your {{ic|/etc/mysql/my.cnf}} file under the {{ic|mysqld}} group:<br />
tmpdir = /var/lib/mysqltmp<br />
<br />
Then reboot or ( shutdown mysql, mount the tmpdir, start mysql ).<br />
<br />
=== Time zone tables ===<br />
Although time zone tables are created during the installation, they are not automatically populated. They need to be populated if you are planning on using CONVERT_TZ() in SQL queries.<br />
<br />
To populate the time zone tables with all the time zones:<br />
$ mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql<br />
<br />
Optionally, you may populate the table with specific time zone files:<br />
$ mysql_tzinfo_to_sql <timezone_file> <timezone_name> | mysql -u root -p mysql<br />
<br />
== Backup ==<br />
<br />
There are various [https://mariadb.com/kb/en/mariadb/documentation/backing-up-and-restoring/ tools and strategies] to back up your databases.<br />
<br />
If you are using the default InnoDB storage engine, a [https://mariadb.com/kb/en/mariadb/documentation/clients-and-utilities/backup-restore-and-import/mysqldump/#examples suggested] way of backing up all your bases online while provisioning for [https://dev.mysql.com/doc/refman/5.6/en/password-security-user.html point-in-time recovery] (also known as “roll-forward,” when you need to restore an old backup and replay the changes that happened since that backup) is to execute the following command:<br />
<br />
$ mysqldump --single-transaction --flush-logs --master-data=2 --all-databases -u root -p > all_databases.sql<br />
<br />
This will prompt for '''MariaDB's''' root user's password, which was defined during database [[#Configuration]].<br />
<br />
Specifying the password on the command line is [https://dev.mysql.com/doc/refman/5.6/en/password-security-user.html strongly discouraged], as it exposes it to discovery by other users through the use of {{ic|ps aux}} or other techniques. Instead, the aforementioned command will prompt for the specified user's password, concealing it away.<br />
<br />
=== Compression ===<br />
As SQL tables can get pretty large, it is recommended to pipe the output of the aforementioned command in a compression utility like {{Pkg|gzip}}:<br />
$ mysqldump --single-transaction --flush-logs --master-data=2 --all-databases -u root -p | gzip > all_databases.sql.gz<br />
<br />
Decompressing the backup thus created and reloading it in the server is achieved by doing:<br />
$ gunzip all_databases.sql.gz | mysql -u root -p<br />
<br />
This will recreate and repopulate all the databases previously backed up (see [https://stackoverflow.com/questions/23180963/restore-all-mysql-database-from-a-all-database-sql-gz-file#comment35453351_23180977 this] or [http://www.linuxquestions.org/questions/linux-server-73/how-to-restore-mysqldump-all-databases-backup-892922/ this]).<br />
<br />
=== Non-interactive ===<br />
<br />
If you want to setup non-interactive backup script for use in [[cron]] jobs or [[Systemd/cron_functionality|systemd timers]], see [https://dev.mysql.com/doc/refman/5.6/en/option-files.html option files] and [https://stackoverflow.com/a/9293090 this illustration] for ''mysqldump''.<br />
<br />
Basically you should add the following section to the relevant [[#Configuration_files|configuration file]]:<br />
{{bc|<nowiki><br />
[mysqldump]<br />
user=mysqluser<br />
password=secret<br />
</nowiki>}}<br />
<br />
Mentioning a user here is optional, but doing so will free you from having to mention it on the command line.<br />
<br />
==== Example script ====<br />
<br />
The database can be dumped to a file for easy backup. The following shell script will do this for you, creating a {{ic|db_backup.gz}} file in the same directory as the script, containing your database dump:<br />
<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
<br />
THISDIR=$(dirname $(readlink -f "$0"))<br />
<br />
mysqldump --single-transaction --flush-logs --master-data=2 --all-databases \<br />
| gzip > $THISDIR/db_backup.gz<br />
echo 'purge master logs before date_sub(now(), interval 7 day);' | mysql<br />
</nowiki>}}<br />
<br />
See also the official {{ic|mysqldump}} page in the [http://dev.mysql.com/doc/refman/5.6/en/mysqldump.html MySQL] and [https://mariadb.com/kb/en/mariadb/documentation/clients-and-utilities/backup-restore-and-import/mysqldump MariaDB] manuals.<br />
<br />
=== Holland Backup ===<br />
<br />
A python-based software package named [http://hollandbackup.org/ Holland Backup] is available in [[AUR]] to automate all of the backup work. It supports direct mysqldump, LVM snapshots to tar files (mysqllvm), LVM snapshots with mysqldump (mysqldump-lvm), and {{pkg|xtrabackup}} methods to extract the data. The Holland framework supports a multitude of options and is highly configurable to address almost any backup situation.<br />
<br />
The main {{AUR|holland}} and {{AUR|holland-common}} packages provide the core framework; one of the sub-packages ({{AUR|holland-mysqldump}}, {{AUR|holland-mysqllvm}} and/or {{AUR|holland-xtrabackup}} must be installed for full operation. Example configurations for each method are in the {{ic|/usr/share/doc/holland/examples/}} directory and can be copied to {{ic|/etc/holland/backupsets/}}, as well as using the {{ic|holland mk-config}} command to generate a base config for a named provider.<br />
<br />
== Troubleshooting ==<br />
=== MySQL daemon cannot start ===<br />
If MySQL fails to start and there is no entry in the log files, you might want to check the permissions of files in the directories {{ic|/var/lib/mysql}} and {{ic|/var/lib/mysql/mysql}}. If the owner of files in these directories is not {{ic|mysql:mysql}}, you should do the following:<br />
# chown mysql:mysql /var/lib/mysql -R<br />
If you run into permission problems despite having followed the above, ensure that your {{ic|my.cnf}} is copied to {{ic|/etc/}}:<br />
# cp /etc/mysql/my.cnf /etc/my.cnf<br />
Now try and start the daemon.<br />
<br />
If you get these messages in your {{ic|/var/lib/mysql/hostname.err}}:<br />
[ERROR] Can't start server : Bind on unix socket: Permission denied<br />
[ERROR] Do you already have another mysqld server running on socket: /var/run/mysqld/mysqld.sock ?<br />
[ERROR] Aborting<br />
the permissions of {{ic|/var/run/mysqld}} could be the culprit.<br />
# chown mysql:mysql /var/run/mysqld -R<br />
<br />
If you run mysqld and the following error appears:<br />
Fatal error: Can’t open and lock privilege tables: Table ‘mysql.host’ doesn’t exist<br />
Run the following command from the {{ic|/usr}} directory to install the default tables:<br />
# cd /usr<br />
# mysql_install_db --user=mysql --ldata=/var/lib/mysql/<br />
<br />
=== Unable to run mysql_upgrade because MySQL cannot start ===<br />
Try run MySQL in safemode:<br />
# mysqld_safe --datadir=/var/lib/mysql/<br />
And then run:<br />
# mysql_upgrade -u root -p<br />
<br />
=== Reset the root password ===<br />
Stop {{ic|mysqld.service}}. Issue the following command:<br />
# mysqld_safe --skip-grant-tables &<br />
Connect to the mysql server. Issue the following command:<br />
# mysql -u root mysql<br />
Change root password:<br />
mysql> use mysql;<br />
mysql> UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';<br />
mysql> FLUSH PRIVILEGES;<br />
mysql> exit<br />
Start {{ic|mysqld.service}}.<br />
<br />
=== Check and repair all tables ===<br />
Check and auto repair all tables in all databases, [http://dev.mysql.com/doc/refman/5.7/en/mysqlcheck.html see more]:<br />
# mysqlcheck -A --auto-repair -u root -p<br />
<br />
=== Optimize all tables ===<br />
Forcefully optimize all tables, automatically fixing table errors that may come up.<br />
# mysqlcheck -A --auto-repair -f -o -u root -p<br />
<br />
=== OS error 22 when running on ZFS ===<br />
If you are using [[ZFS]] and get the following error:<br />
InnoDB: Operating system error number 22 in a file operation.<br />
You need to disable aio_writes by adding a line to the mysqld-section in /etc/mysql/my.cnf <br />
[mysqld]<br />
...<br />
innodb_use_native_aio = 0<br />
<br />
However, if the post install scripts failed because of the above issue, MySQL/MariaDB might be in an invalid state. To recover from this state, execute the following:<br />
rm -rf /var/lib/mysql/*<br />
mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql<br />
chown -R mysql:mysql /var/lib/mysql &>/dev/null<br />
/usr/bin/systemd-tmpfiles --create mysql.conf<br />
<br />
After which MySQL/MariaDB should be installed correctly.<br />
<br />
=== Cannot login through CLI, but phpmyadmin works well ===<br />
This may happen if you are using a long (>70-75) password.<br />
As for 5.5.36, for some reason, mysql CLI cannot handle that much characters in readline mode.<br />
So, if you are planning to use the recommended password input mode:<br />
$ mysql -u <user> -p<br />
Password:<br />
consider changing the password to smaller one.<br />
<br />
{{Note|You still can log in by specifying the password as an argument to mysql command.<br />
{{Warning|This behavior is considered dangerous, because your password might leak, for example, to the logs. Use it only in case of emergency and do not forget to change password right afterwards.}}<br />
$ mysql -u <user> -p"<some-veryveryveryveryveryveryveryveryveryveryveryveryveryveryvery-long-and-veryveryveryveryveryveryveryveryveryvery-strong-password>"<br />
}}<br />
<br />
===MySQL binary logs are taking up huge disk space===<br />
By default, mysqld creates binary log files in {{ic|/var/lib/mysql}}. This is useful for replication master server or data recovery. But these binary logs can eat up your disk space. If you do not plan to use replication or data recovery features, you may disable binary logging by commenting out these lines in {{ic|/etc/mysql/my.cnf}}:<br />
#log-bin=mysql-bin<br />
#binlog_format=mixed<br />
Alternatively, you can purge some binary logs in {{ic|/var/lib/mysql}} to free up disk space with this command:<br />
#mysql -u root -p"PASSWORD" -e "PURGE BINARY LOGS TO 'mysql-bin.0000xx';"<br />
<br />
== See also ==<br />
<br />
* [https://mariadb.org/ MariaDB Official Website]<br />
* [https://mariadb.com/kb/en/ MariaDB knowledge Base]<br />
* [http://dev.mysql.com/doc/ MySQL documentation ]<br />
* [[LAMP]] - ArchWiki article covering the setup of a LAMP server (Linux Apache MySQL PHP)<br />
* [[PhpMyAdmin]] - ArchWiki article covering the web-based tool to help manage MySQL databases using an Apache/PHP front-end.<br />
* [[PHP]] - ArchWiki article on PHP.<br />
* [http://www.askapache.com/mysql/performance-tuning-mysql.html MySQL Performance Tuning Scripts and Know-How]</div>Ultraviolethttps://wiki.archlinux.org/index.php?title=PKGBUILD&diff=381242PKGBUILD2015-07-07T17:57:54Z<p>Ultraviolet: /* arch */ capitalise a in Arch</p>
<hr />
<div>[[Category:Package development]]<br />
[[cs:PKGBUILD]]<br />
[[da:PKGBUILD]]<br />
[[el:PKGBUILD]]<br />
[[es:PKGBUILD]]<br />
[[fa:PKGBUILD]]<br />
[[fr:PKGBUILD]]<br />
[[it:PKGBUILD]]<br />
[[ja:PKGBUILD]]<br />
[[pl:PKGBUILD]]<br />
[[pt:PKGBUILD]]<br />
[[ru:PKGBUILD]]<br />
[[sr:PKGBUILD]]<br />
[[zh-CN:PKGBUILD]]<br />
[[zh-TW:PKGBUILD]]<br />
{{Related articles start}}<br />
{{Related|Arch packaging standards}}<br />
{{Related|Arch Build System}}<br />
{{Related|Creating packages}}<br />
{{Related|:Category:Package development}}<br />
{{Related|Pacman tips}}<br />
{{Related|Arch User Repository}}<br />
{{Related|makepkg}}<br />
{{Related|pacman}}<br />
{{Related articles end}}<br />
<br />
This article discusses variables definable by the maintainer in a PKGBUILD. For information on the PKGBUILD functions and creating packages in general, refer to [[Creating packages]].<br />
<br />
A PKGBUILD is a shell script containing the build information required by [[Arch Linux]] packages.<br />
<br />
Packages in Arch Linux are built using the [[makepkg]] utility. When ''makepkg'' is run, it searches for a {{ic|PKGBUILD}} file in the current directory and follows the instructions therein to either compile or otherwise acquire the files to build a package archive ({{ic|''pkgname''.pkg.tar.xz}}). The resulting package contains binary files and installation instructions, readily installable with [[pacman]].<br />
<br />
Mandatory variables are {{ic|pkgname}}, {{ic|pkgver}}, {{ic|pkgrel}}, and {{ic|arch}}. {{ic|license}} is not strictly necessary to build a package, but is recommended for any PKGBUILDs shared with others, as ''makepkg'' will produce a warning if not present.<br />
<br />
It is a common practice to define the variables in the PKGBUILD in same order as given here. However, this is not mandatory, as long as correct [[Bash]] syntax is used.<br />
<br />
== Package name ==<br />
<br />
=== pkgbase ===<br />
<br />
An optional global directive is available when building a split package. {{ic|pkgbase}} is used to refer to the group of packages in the output of ''makepkg'' and in the naming of source-only tarballs. If not specified, the first element in the {{ic|pkgname}} array is used. The variable is not allowed to begin with a hyphen. All values for split packages default to the global ones given in the PKGBUILD. Everything, except {{ic|makedepends}}, [[#Sources]], and [[#Integrity]] variables can be overridden within each split package's {{ic|package()}} function.<br />
<br />
=== pkgname ===<br />
<br />
The name(s) of the package(s). This should consist of lowercase alphanumerics and any of the following characters: {{ic|@}}, {{ic|.}}, {{ic|_}}, {{ic|+}}, {{ic|-}} (at symbol, dot, underscore, plus, hyphen). Names are not allowed to start with hyphens. For the sake of consistency, {{ic|pkgname}} should match the name of the source tarball of the software: for instance, if the software is in {{ic|foobar-2.5.tar.gz}}, use {{ic|1=pkgname=foobar}}. The name of the directory containing the PKGBUILD should also match the {{ic|pkgname}}.<br />
<br />
Split packages should be defined as an array, e.g. {{ic|1=pkgname=('foo' 'bar')}}.<br />
<br />
== Version ==<br />
<br />
=== pkgver ===<br />
<br />
The version of the package. This should be the same as the version released by the author of the package. It can contain letters, numbers, periods and underscores, but '''not''' a hyphen ({{ic|-}}). If the author of the software uses one, replace it with an underscore ({{ic|_}}). If the {{ic|pkgver}} variable is used later in the PKGBUILD, then the underscore can easily be substituted for a hyphen, e.g. {{ic|1=source=("$pkgname-${pkgver//_/-}.tar.gz")}}.<br />
<br />
{{Note|If upstream uses a timestamp versioning such as {{ic|30102014}}, ensure to use the reversed date, i.e. {{ic|20141030}} ([[Wikipedia:ISO 8601|ISO 8601]] format). Otherwise it will not appear as a newer version.}}<br />
<br />
{{Tip|[[makepkg]] can automatically [http://allanmcrae.com/2013/04/pacman-4-1-released/ update] this variable by defining a {{ic|pkgver()}} function in the PKGBUILD. See [[VCS package guidelines#The pkgver() function]] for details}}<br />
<br />
=== pkgrel ===<br />
<br />
Release number: this value allows users to differentiate between consecutive builds of the same version of a package. As fixes and additional features are added to the PKGBUILD that influence the resulting package, the {{ic|pkgrel}} should be incremented by 1. When a new version of the software is released, this value must be reset to 1.<br />
<br />
=== epoch ===<br />
<br />
{{Warning|{{ic|epoch}} should only be used when absolutely required to do so.}}<br />
<br />
Used to force the package to be seen as newer than any previous version with a lower epoch. This value is required to be a positive integer; the default is 0. It is used when the version numbering scheme of a package changes (or is alphanumeric), breaking normal version comparison logic. For example:<br />
<br />
{{hc|1=<br />
pkgver=5.13<br />
pkgrel=2<br />
epoch=1<br />
|2=<br />
1:5.13-2<br />
}}<br />
<br />
See [https://www.archlinux.org/pacman/pacman.8.html pacman(8)] for more information on version comparisons.<br />
<br />
== Generic ==<br />
<br />
=== pkgdesc ===<br />
<br />
The description of the package. This is recommended to be 80 characters or less and should not include the package name in a self-referencing way, unless the application name differs from the package name. For example, use {{ic|1=pkgdesc="Text editor for X11"}} instead of {{ic|1=pkgdesc="Nedit is a text editor for X11"}}.<br />
<br />
Also it is important to use keywords wisely to increase the chances of appearing in relevant search queries.<br />
<br />
=== arch ===<br />
<br />
An array of architectures that the PKGBUILD is intended to build and work on. Arch officially supports only {{ic|i686}} and {{ic|x86_64}}, but projects like [http://archlinuxarm.org/ Arch Linux ARM] provide support for other architectures such as {{ic|armv5}}, {{ic|armv6}}, {{ic|armv7}}, and {{ic|armv8}}.<br />
<br />
If a package is architecture-independent in its compiled state (shell scripts, fonts, themes, many types of extensions, etc.) then use {{ic|1=arch=('any')}}. Please note that as this is intended for packages that can be built once and used on any architecture, it will cause the package to be labeled {{ic|-any}} as opposed to {{ic|-i686}}, {{ic|-x86_64}}, etc. Do not use this if a package compiles to architecture-specific binary code.<br />
<br />
If a package can be compiled for any architecture, but is architecture-specific once compiled, specify all architectures officially supported by Arch. At present, this means {{ic|1=arch=('i686' 'x86_64')}}.<br />
<br />
The target architecture can be accessed with the variable {{ic|$CARCH}} during a build.<br />
<br />
=== url ===<br />
The URL of the official site of the software being packaged.<br />
<br />
=== license ===<br />
The license under which the software is distributed. The {{pkg|licenses}} package from the [[official repositories]] contains many commonly used licenses, which are installed to {{ic|/usr/share/licenses/common}}. If a package is licensed under one of these licenses, the value should be set to the directory name, e.g. {{ic|1=license=('GPL')}}. If the appropriate license is not included, several things must be done:<br />
<br />
# Add {{ic|custom}} to the {{ic|license}} array. Optionally, you can replace {{ic|custom}} with {{ic|custom:''name of license''}}. Once a license is used in two or more packages in an official repository (including {{ic|[community]}}), it becomes a part of the {{Pkg|licenses}} package.<br />
# Install the license in: {{ic|/usr/share/licenses/''pkgname''/}}, e.g. {{ic|/usr/share/licenses/foobar/LICENSE}}.<br />
# If the license is only found in a website, then you need to separately include it in the package.<br />
<br />
* The [[Wikipedia:BSD License|BSD]], [[Wikipedia:MIT License|MIT]], [[Wikipedia:ZLIB license|zlib/png]] and [[Wikipedia:Python License|Python]] licenses are special cases and could not be included in the {{pkg|licenses}} package. For the sake of the {{ic|license}} array, it is treated as a common license ({{ic|1=license=('BSD')}}, {{ic|1=license=('MIT')}}, {{ic|1=license=('ZLIB')}} and {{ic|1=license=('Python')}}), but technically each one is a custom license, because each one has its own copyright line. Any packages licensed under these four should have its own unique license stored in {{ic|/usr/share/licenses/''pkgname''}}. Some packages may not be covered by a single license. In these cases, multiple entries may be made in the {{ic|license}} array, e.g. {{ic|1=license=('GPL' 'custom:''name of license''')}}.<br />
* (L)GPL has many versions and permutations of those versions. For (L)GPL software, the convention is:<br />
** (L)GPL — (L)GPLv2 or any later version<br />
** (L)GPL2 — (L)GPL2 only<br />
** (L)GPL3 — (L)GPL3 or any later version<br />
* If after researching the issue no license can be determined, [https://projects.archlinux.org/pacman.git/tree/proto/PKGBUILD.proto PKGBUILD.proto] suggests using {{ic|unknown}}. However, upstream should be contacted about the conditions under which the software is (and is not) available.<br />
<br />
{{Tip|Some software authors do not provide separate license file and describe distribution rules in section of common {{ic|ReadMe.txt}}. This information can be extracted to a separate file during {{ic|build()}} with something like {{ic|sed -n '/'''This software'''/,/''' thereof.'''/p' ReadMe.txt > LICENSE}}}}<br />
<br />
=== groups ===<br />
<br />
The [[Pacman#Installing package groups|group]] the package belongs in. For instance, when installing the {{Grp|kdebase}} package, it installs all packages belonging in that group.<br />
<br />
== Dependencies ==<br />
<br />
{{Note|Additional architecture-specific arrays can be used by appending an underscore and the architecture name, e.g. {{ic|1=depends_x86_64=()}}, {{ic|1=optdepends_x86_64=()}}.<br />
}}<br />
<br />
=== depends ===<br />
An array of packages that must be installed before the software can be run. Version restrictions can be specified with comparison operators, e.g. {{ic|1=depends=('foobar>=1.8.0')}}; if multiple restrictions are needed, the dependency can be repeated for each, e.g. {{ic|1=depends=('foobar>=1.8.0' 'foobar<2.0.0')}}. <br />
<br />
Dependencies that are provided by other dependencies do not need to be listed. For instance, if a package ''foo'' depends on both ''bar'' and ''baz'', and the ''bar'' package depends in turn on ''baz'' too, ''baz'' does not need to be included in ''foo'''s {{ic|depends}} array.<br />
<br />
=== optdepends ===<br />
<br />
An array of packages that are not needed for the software to function, but provide additional features. This may imply that not all executables provided by a package will function without the respective optdepends.[https://lists.archlinux.org/pipermail/arch-general/2014-December/038124.html] If the software works on multiple alternative dependencies, all of them can be listed here, instead of the {{ic|depends}} array.<br />
<br />
A short description of the extra functionality each optdepend provides should also be noted:<br />
<br />
optdepends=('cups: printing support'<br />
'sane: scanners support'<br />
'libgphoto2: digital cameras support'<br />
'alsa-lib: sound support'<br />
'giflib: GIF images support'<br />
'libjpeg: JPEG images support'<br />
'libpng: PNG images support')<br />
<br />
=== makedepends ===<br />
An array of packages that are '''only''' required to build the software. The minimum dependency version can be specified in the same format as in the {{ic|depends}} array.<br />
<br />
{{Tip|The following can be used to see if a particular package is either in the {{Grp|base-devel}} group or pulled in by a members of the group:<br />
<br />
$ pacman -Si $(pactree -rl ''package'') 2>/dev/null <nowiki>|</nowiki> grep -q "^Groups *:.*base-devel"<br />
<br />
}}<br />
<br />
{{Note|The group {{Grp|base-devel}} is assumed to be already installed when building with ''makepkg''. Members of this group '''should not''' be included in {{ic|makedepends}} array.}}<br />
<br />
=== checkdepends ===<br />
An array of packages that the software depends on to run its test suite, but are not needed at runtime. Packages in this list follow the same format as {{ic|depends}}. These dependencies are only considered when the [[Creating packages#check()|check()]] function is present and is to be run by makepkg. <br />
<br />
{{Note|The group {{Grp|base-devel}} is assumed to be already installed when building with ''makepkg''. Members of this group '''should not''' be included in {{ic|checkdepends}} array.}}<br />
<br />
== Package relations ==<br />
<br />
{{Note|Additional architecture-specific arrays can be used by appending an underscore and the architecture name, e.g. {{ic|1=provides_x86_64=()}}, {{ic|1=conflicts_x86_64=()}}.}}<br />
<br />
=== provides ===<br />
An array of additional packages that the software provides the features of (or a virtual package such as {{Ic|cron}} or {{Ic|sh}}). Packages providing the same item can be installed side-by-side, unless at least one of them uses a {{ic|conflicts}} array.<br />
<br />
{{Warning|A version that the package provides should be mentioned ({{ic|pkgver}} and perhaps the {{ic|pkgrel}}), if packages needing the software may require one. For instance, a modified ''qt'' package version 3.3.8, named ''qt-foobar'', should use {{ic|1=provides=('qt=3.3.8')}}; using {{ic|1=provides=('qt')}} would cause the dependencies that require a specific version of ''qt'' to fail. Do not add {{ic|pkgname}} to the {{ic|provides}} array, as it is done automatically.}}<br />
<br />
=== conflicts ===<br />
<br />
An array of packages that conflict with, or cause problems with the package, if installed. All these packages and packages providing this item will need to be removed. The version properties of the conflicting packages can also be specified in the same format as the {{ic|depends}} array.<br />
<br />
=== replaces ===<br />
An array of obsolete packages that are replaced by the package, e.g. {{pkg|wireshark-gtk}} uses {{ic|1=replaces=('wireshark')}}. When syncing, ''pacman'' will immediately replace an installed package upon encountering another package with the matching {{ic|replaces}} in the repositories. If providing an alternate version of an already existing package or uploading to the [[AUR]], use the {{ic|conflicts}} and {{ic|provides}} arrays, which are only evaluated when actually installing the conflicting package.<br />
<br />
== Others ==<br />
<br />
=== backup ===<br />
<br />
An array of files that can contain user-made changes and should be preserved during upgrade or removal of a package, primarily intended for configuration files in {{ic|/etc}}.<br />
<br />
Files in this array should use '''relative''' paths without the leading slash ({{ic|/}}) (e.g. {{ic|etc/pacman.conf}}, instead of {{ic|/etc/pacman.conf}}).<br />
<br />
When updating, new version may be saved as {{ic|file.pacnew}} to avoid overwriting a file which already exists and was previously modified by the user. Similarly, when the package is removed, user-modified file will be preserved as {{ic|file.pacsave}} unless the package was removed with the {{ic|pacman -Rn}} command.<br />
<br />
See also [[Pacnew and Pacsave files]].<br />
<br />
=== options ===<br />
This array allows overriding some of the default behavior of ''makepkg'', defined in {{Ic|/etc/makepkg.conf}}. To set an option, include the name in the array. To reverse the default behavior, place an '''{{ic|!}}''' at the front.<br />
<br />
The full list of the available options can be found in [https://www.archlinux.org/pacman/PKGBUILD.5.html PKGBUILD(5)].<br />
<br />
=== install ===<br />
The name of the {{ic|.install}} script to be included in the package. This should be the same as {{ic|pkgname}}. ''pacman'' has the ability to store and execute a package-specific script when it installs, removes or upgrades a package. The script contains the following functions which run at different times:<br />
<br />
* {{ic|pre_install}} — The script is run right before files are extracted. One argument is passed: new package version.<br />
* {{ic|post_install}} — The script is run right after files are extracted. One argument is passed: new package version.<br />
* {{ic|pre_upgrade}} — The script is run right before files are extracted. Two arguments are passed in the following order: new package version, old package version.<br />
* {{ic|post_upgrade}} — The script is run right after files are extracted. Two arguments are passed in the following order: new package version, old package version.<br />
* {{ic|pre_remove}} — The script is run right before files are removed. One argument is passed: old package version.<br />
* {{ic|post_remove}} — The script is run right after files are removed. One argument is passed: old package version.<br />
<br />
Each function is run [[chroot]]ed inside the ''pacman'' install directory. See [https://bbs.archlinux.org/viewtopic.php?pid=913891 this thread].<br />
<br />
{{Tip|A prototype {{ic|.install}} is provided at [https://projects.archlinux.org/pacman.git/plain/proto/proto.install /usr/share/pacman/proto.install].}}<br />
<br />
=== changelog ===<br />
<br />
The name of the package changelog. To view changelogs for installed packages (that have this file):<br />
<br />
$ pacman -Qc ''pkgname''<br />
<br />
{{Tip|A prototype changelog file is provided at {{ic|/usr/share/pacman/ChangeLog.proto}}}}<br />
<br />
== Sources ==<br />
<br />
=== source ===<br />
<br />
{{Note|Additional architecture-specific arrays can be added by appending an underscore and the architecture name, e.g. {{ic|1=source_x86_64=()}}. There must be a corresponding integrity array with checksums, e.g. {{ic|1=sha256sums_x86_64=()}}.}}<br />
<br />
An array of files needed to build the package. It must contain the location of the software source, which in most cases is a full HTTP or FTP URL. The previously set variables {{ic|pkgname}} and {{ic|pkgver}} can be used effectively here (e.g. {{ic|<nowiki>source=("https://example.com/$pkgname-$pkgver.tar.gz")</nowiki>}}).<br />
<br />
Files can also be supplied directly in the location of the {{ic|PKGBUILD}} and added to this array. These paths are resolved relative to the directory of the {{ic|PKGBUILD}}. Before the actual build process is started, all of the files referenced in this array will be downloaded or checked for existence, and ''makepkg'' will not proceed, if any are missing.<br />
<br />
{{Note|''.install'' files should not be included.}}<br />
<br />
{{Tip|An alternative source name for the downloaded file can be specified with the syntax {{ic|1=source=(<nowiki>'</nowiki>''filename''::''fileuri''<nowiki>'</nowiki>)}}:<br />
<br />
{{bc|<nowiki>source=("project_name::hg+https://googlefontdirectory.googlecode.com/hg/")</nowiki>}}}}<br />
<br />
=== noextract ===<br />
<br />
An array of files listed under {{ic|source}}, which should not be extracted from their archive format by ''makepkg''. This can be used with archives that cannot be handled by {{ic|/usr/bin/bsdtar}} or those that need to be installed as-is. If an alternative unarchiving tool is used (e.g. {{Pkg|lrzip}}), it should be added in the {{ic|makedepends}} array and the first line of the [[Creating packages#prepare()|prepare()]] function should extract the source archive manually; for example:<br />
<br />
prepare() {<br />
lrzip -d ''source''.tar.lrz<br />
}<br />
<br />
Note that while the {{ic|source}} array accepts URLs, {{ic|noextract}} is '''just''' the file name portion:<br />
<br />
<nowiki>source=("http://foo.org/bar/foobar.tar.xz")</nowiki><br />
noextract=('foobar.tar.xz')<br />
<br />
To extract ''nothing'', you can do something like this (taken from [https://projects.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/firefox-i18n#n123 firefox-i18n's PKGBUILD]):<br />
<br />
noextract=("${source[@]%%::*}")<br />
<br />
== Integrity ==<br />
<br />
{{Style|Too detailed about collisions without explaining why they are relevant here.|section=Integrity variables details}}<br />
<br />
The values for these variables can be auto-generated by [[makepkg]]'s {{ic|-g}} option, then commonly appended with {{ic|makepkg -g >> PKGBUILD}}. The {{ic|updpkgsums}} command is able to update the variables wherever they are in the PKGBUILD. Both tools will use the variable that is already set in the PKGBUILD, or fall back to {{ic|md5sums}} if none is set.<br />
<br />
The file integrity checks to use can be set up with the {{ic|INTEGRITY_CHECK}} option in {{ic|/etc/makepkg.conf}}. See [https://www.archlinux.org/pacman/makepkg.conf.5.html makepkg.conf(5)].<br />
<br />
For reference:<br />
<br />
*''Collision vulnerability'' means generation of a series of different fixed-width strings, where any two end up having identical hashes.<br />
*''Preimage vulnerability'' means generation of a string or a file that matches a specific, predetermined hash.<br />
<br />
{| class="wikitable"<br />
! Algorithm !! Collision vulnerability !! Preimage vulnerability<br />
|-<br />
| MD5 || Severely broken. || Theoretical.<br />
|-<br />
| SHA-1 || Theoretical. || Not found.<br />
|-<br />
| SHA-2 || Not found. || Not found.<br />
|}<br />
<br />
=== md5sums ===<br />
An array of 128-bit MD5 checksums of the files listed in the {{ic|source}} array.<br />
<br />
{{Note|<br />
*A [[Wikipedia:MD5|collision]] can be found in 2<sup>18</sup> <nowiki>=</nowiki> 2.6 × 10<sup>5</sup> operations or less than a second on a regular computer.<br />
*An unpractical, theoretical preimage vulnerability is estimated at 2<sup>123.4</sup> ≈ 1.4 × 10<sup>37</sup>, instead of the intended 2<sup>128</sup> ≈ 3.4 × 10<sup>38</sup>.<br />
}}<br />
<br />
=== sha1sums ===<br />
An array of 160-bit SHA-1 checksums of the files listed in the {{ic|source}} array.<br />
<br />
{{Note|<br />
*A [[Wikipedia:SHA-1|theoretical collision]] is estimated at 2<sup>61</sup> ≈ 2.3 × 10<sup>18</sup> operations on average, instead of the intended ≈ 1.2 × 2<sup>160 / 2</sup> <nowiki>=</nowiki> 1.2 × 2<sup>80</sup> ≈ 1.5 × 10<sup>24</sup>.<br />
*While no known preimage vulnerabilities exist, SHA-1 is being phased out in use of SSL certificates in at least Microsoft, Google and Mozilla by 2017.<br />
}}<br />
<br />
=== sha256sums ===<br />
An array of SHA-2 checksums with digest size of 256. This is an alternative to {{ic|md5sums}} and {{ic|sha1sums}} and has no [[Wikipedia:SHA-2|known vulnerabilities]]. Once all files in the {{ic|source}} array are available, a SHA-2 hash of each file will be automatically generated and compared with the values of this array in the same order.<br />
<br />
=== sha224sums, sha384sums, sha512sums ===<br />
An array of SHA-2 checksums with digest sizes 224, 384, and 512 bits, respectively. These are less common alternatives to {{ic|sha256sums}}.<br />
<br />
=== validpgpkeys ===<br />
An array of PGP fingerprints. If used, ''makepkg'' will only accept signatures from the keys listed here and will ignore the trust values from the keyring. If the source file was signed with a subkey, ''makepkg'' will still use the primary key for comparison.<br />
<br />
Only full fingerprints are accepted. They must be uppercase and must not contain whitespace characters.<br />
<br />
{{note|You can use {{ic|gpg --list-keys --fingerprint <KEYID>}} to find out the fingerprint of the appropriate key.}}<br />
<br />
== See also ==<br />
*[https://www.archlinux.org/pacman/PKGBUILD.5.html PKGBUILD(5) Manual Page]<br />
*[http://ix.io/66p Example PKGBUILD file]</div>Ultraviolethttps://wiki.archlinux.org/index.php?title=PKGBUILD&diff=381238PKGBUILD2015-07-07T17:52:36Z<p>Ultraviolet: /* arch */ clarified meaning of "any", added mention of arm project</p>
<hr />
<div>[[Category:Package development]]<br />
[[cs:PKGBUILD]]<br />
[[da:PKGBUILD]]<br />
[[el:PKGBUILD]]<br />
[[es:PKGBUILD]]<br />
[[fa:PKGBUILD]]<br />
[[fr:PKGBUILD]]<br />
[[it:PKGBUILD]]<br />
[[ja:PKGBUILD]]<br />
[[pl:PKGBUILD]]<br />
[[pt:PKGBUILD]]<br />
[[ru:PKGBUILD]]<br />
[[sr:PKGBUILD]]<br />
[[zh-CN:PKGBUILD]]<br />
[[zh-TW:PKGBUILD]]<br />
{{Related articles start}}<br />
{{Related|Arch packaging standards}}<br />
{{Related|Arch Build System}}<br />
{{Related|Creating packages}}<br />
{{Related|:Category:Package development}}<br />
{{Related|Pacman tips}}<br />
{{Related|Arch User Repository}}<br />
{{Related|makepkg}}<br />
{{Related|pacman}}<br />
{{Related articles end}}<br />
<br />
This article discusses variables definable by the maintainer in a PKGBUILD. For information on the PKGBUILD functions and creating packages in general, refer to [[Creating packages]].<br />
<br />
A PKGBUILD is a shell script containing the build information required by [[Arch Linux]] packages.<br />
<br />
Packages in Arch Linux are built using the [[makepkg]] utility. When ''makepkg'' is run, it searches for a {{ic|PKGBUILD}} file in the current directory and follows the instructions therein to either compile or otherwise acquire the files to build a package archive ({{ic|''pkgname''.pkg.tar.xz}}). The resulting package contains binary files and installation instructions, readily installable with [[pacman]].<br />
<br />
Mandatory variables are {{ic|pkgname}}, {{ic|pkgver}}, {{ic|pkgrel}}, and {{ic|arch}}. {{ic|license}} is not strictly necessary to build a package, but is recommended for any PKGBUILDs shared with others, as ''makepkg'' will produce a warning if not present.<br />
<br />
It is a common practice to define the variables in the PKGBUILD in same order as given here. However, this is not mandatory, as long as correct [[Bash]] syntax is used.<br />
<br />
== Package name ==<br />
<br />
=== pkgbase ===<br />
<br />
An optional global directive is available when building a split package. {{ic|pkgbase}} is used to refer to the group of packages in the output of ''makepkg'' and in the naming of source-only tarballs. If not specified, the first element in the {{ic|pkgname}} array is used. The variable is not allowed to begin with a hyphen. All values for split packages default to the global ones given in the PKGBUILD. Everything, except {{ic|makedepends}}, [[#Sources]], and [[#Integrity]] variables can be overridden within each split package's {{ic|package()}} function.<br />
<br />
=== pkgname ===<br />
<br />
The name(s) of the package(s). This should consist of lowercase alphanumerics and any of the following characters: {{ic|@}}, {{ic|.}}, {{ic|_}}, {{ic|+}}, {{ic|-}} (at symbol, dot, underscore, plus, hyphen). Names are not allowed to start with hyphens. For the sake of consistency, {{ic|pkgname}} should match the name of the source tarball of the software: for instance, if the software is in {{ic|foobar-2.5.tar.gz}}, use {{ic|1=pkgname=foobar}}. The name of the directory containing the PKGBUILD should also match the {{ic|pkgname}}.<br />
<br />
Split packages should be defined as an array, e.g. {{ic|1=pkgname=('foo' 'bar')}}.<br />
<br />
== Version ==<br />
<br />
=== pkgver ===<br />
<br />
The version of the package. This should be the same as the version released by the author of the package. It can contain letters, numbers, periods and underscores, but '''not''' a hyphen ({{ic|-}}). If the author of the software uses one, replace it with an underscore ({{ic|_}}). If the {{ic|pkgver}} variable is used later in the PKGBUILD, then the underscore can easily be substituted for a hyphen, e.g. {{ic|1=source=("$pkgname-${pkgver//_/-}.tar.gz")}}.<br />
<br />
{{Note|If upstream uses a timestamp versioning such as {{ic|30102014}}, ensure to use the reversed date, i.e. {{ic|20141030}} ([[Wikipedia:ISO 8601|ISO 8601]] format). Otherwise it will not appear as a newer version.}}<br />
<br />
{{Tip|[[makepkg]] can automatically [http://allanmcrae.com/2013/04/pacman-4-1-released/ update] this variable by defining a {{ic|pkgver()}} function in the PKGBUILD. See [[VCS package guidelines#The pkgver() function]] for details}}<br />
<br />
=== pkgrel ===<br />
<br />
Release number: this value allows users to differentiate between consecutive builds of the same version of a package. As fixes and additional features are added to the PKGBUILD that influence the resulting package, the {{ic|pkgrel}} should be incremented by 1. When a new version of the software is released, this value must be reset to 1.<br />
<br />
=== epoch ===<br />
<br />
{{Warning|{{ic|epoch}} should only be used when absolutely required to do so.}}<br />
<br />
Used to force the package to be seen as newer than any previous version with a lower epoch. This value is required to be a positive integer; the default is 0. It is used when the version numbering scheme of a package changes (or is alphanumeric), breaking normal version comparison logic. For example:<br />
<br />
{{hc|1=<br />
pkgver=5.13<br />
pkgrel=2<br />
epoch=1<br />
|2=<br />
1:5.13-2<br />
}}<br />
<br />
See [https://www.archlinux.org/pacman/pacman.8.html pacman(8)] for more information on version comparisons.<br />
<br />
== Generic ==<br />
<br />
=== pkgdesc ===<br />
<br />
The description of the package. This is recommended to be 80 characters or less and should not include the package name in a self-referencing way, unless the application name differs from the package name. For example, use {{ic|1=pkgdesc="Text editor for X11"}} instead of {{ic|1=pkgdesc="Nedit is a text editor for X11"}}.<br />
<br />
Also it is important to use keywords wisely to increase the chances of appearing in relevant search queries.<br />
<br />
=== arch ===<br />
<br />
An array of architectures that the PKGBUILD is intended to build and work on. Arch officially supports only {{ic|i686}} and {{ic|x86_64}}, but projects like [http://archlinuxarm.org/ Arch Linux ARM] provide support for other architectures such as {{ic|armv5}}, {{ic|armv6}}, {{ic|armv7}}, and {{ic|armv8}}.<br />
<br />
If a package is architecture-independent in its compiled state (shell scripts, fonts, themes, many types of extensions, etc.) then use {{ic|1=arch=('any')}}. Please note that as this is intended for packages that can be built once and used on any architecture, it will cause the package to be labeled {{ic|-any}} as opposed to {{ic|-i686}}, {{ic|-x86_64}}, etc. Do not use this if a package compiles to architecture-specific binary code.<br />
<br />
If a package can be compiled for any architecture, but is architecture-specific once compiled, specify all architectures officially supported by arch. At present, this means {{ic|1=arch=('i686' 'x86_64')}}.<br />
<br />
The target architecture can be accessed with the variable {{ic|$CARCH}} during a build.<br />
<br />
=== url ===<br />
The URL of the official site of the software being packaged.<br />
<br />
=== license ===<br />
The license under which the software is distributed. The {{pkg|licenses}} package from the [[official repositories]] contains many commonly used licenses, which are installed to {{ic|/usr/share/licenses/common}}. If a package is licensed under one of these licenses, the value should be set to the directory name, e.g. {{ic|1=license=('GPL')}}. If the appropriate license is not included, several things must be done:<br />
<br />
# Add {{ic|custom}} to the {{ic|license}} array. Optionally, you can replace {{ic|custom}} with {{ic|custom:''name of license''}}. Once a license is used in two or more packages in an official repository (including {{ic|[community]}}), it becomes a part of the {{Pkg|licenses}} package.<br />
# Install the license in: {{ic|/usr/share/licenses/''pkgname''/}}, e.g. {{ic|/usr/share/licenses/foobar/LICENSE}}.<br />
# If the license is only found in a website, then you need to separately include it in the package.<br />
<br />
* The [[Wikipedia:BSD License|BSD]], [[Wikipedia:MIT License|MIT]], [[Wikipedia:ZLIB license|zlib/png]] and [[Wikipedia:Python License|Python]] licenses are special cases and could not be included in the {{pkg|licenses}} package. For the sake of the {{ic|license}} array, it is treated as a common license ({{ic|1=license=('BSD')}}, {{ic|1=license=('MIT')}}, {{ic|1=license=('ZLIB')}} and {{ic|1=license=('Python')}}), but technically each one is a custom license, because each one has its own copyright line. Any packages licensed under these four should have its own unique license stored in {{ic|/usr/share/licenses/''pkgname''}}. Some packages may not be covered by a single license. In these cases, multiple entries may be made in the {{ic|license}} array, e.g. {{ic|1=license=('GPL' 'custom:''name of license''')}}.<br />
* (L)GPL has many versions and permutations of those versions. For (L)GPL software, the convention is:<br />
** (L)GPL — (L)GPLv2 or any later version<br />
** (L)GPL2 — (L)GPL2 only<br />
** (L)GPL3 — (L)GPL3 or any later version<br />
* If after researching the issue no license can be determined, [https://projects.archlinux.org/pacman.git/tree/proto/PKGBUILD.proto PKGBUILD.proto] suggests using {{ic|unknown}}. However, upstream should be contacted about the conditions under which the software is (and is not) available.<br />
<br />
{{Tip|Some software authors do not provide separate license file and describe distribution rules in section of common {{ic|ReadMe.txt}}. This information can be extracted to a separate file during {{ic|build()}} with something like {{ic|sed -n '/'''This software'''/,/''' thereof.'''/p' ReadMe.txt > LICENSE}}}}<br />
<br />
=== groups ===<br />
<br />
The [[Pacman#Installing package groups|group]] the package belongs in. For instance, when installing the {{Grp|kdebase}} package, it installs all packages belonging in that group.<br />
<br />
== Dependencies ==<br />
<br />
{{Note|Additional architecture-specific arrays can be used by appending an underscore and the architecture name, e.g. {{ic|1=depends_x86_64=()}}, {{ic|1=optdepends_x86_64=()}}.<br />
}}<br />
<br />
=== depends ===<br />
An array of packages that must be installed before the software can be run. Version restrictions can be specified with comparison operators, e.g. {{ic|1=depends=('foobar>=1.8.0')}}; if multiple restrictions are needed, the dependency can be repeated for each, e.g. {{ic|1=depends=('foobar>=1.8.0' 'foobar<2.0.0')}}. <br />
<br />
Dependencies that are provided by other dependencies do not need to be listed. For instance, if a package ''foo'' depends on both ''bar'' and ''baz'', and the ''bar'' package depends in turn on ''baz'' too, ''baz'' does not need to be included in ''foo'''s {{ic|depends}} array.<br />
<br />
=== optdepends ===<br />
<br />
An array of packages that are not needed for the software to function, but provide additional features. This may imply that not all executables provided by a package will function without the respective optdepends.[https://lists.archlinux.org/pipermail/arch-general/2014-December/038124.html] If the software works on multiple alternative dependencies, all of them can be listed here, instead of the {{ic|depends}} array.<br />
<br />
A short description of the extra functionality each optdepend provides should also be noted:<br />
<br />
optdepends=('cups: printing support'<br />
'sane: scanners support'<br />
'libgphoto2: digital cameras support'<br />
'alsa-lib: sound support'<br />
'giflib: GIF images support'<br />
'libjpeg: JPEG images support'<br />
'libpng: PNG images support')<br />
<br />
=== makedepends ===<br />
An array of packages that are '''only''' required to build the software. The minimum dependency version can be specified in the same format as in the {{ic|depends}} array.<br />
<br />
{{Tip|The following can be used to see if a particular package is either in the {{Grp|base-devel}} group or pulled in by a members of the group:<br />
<br />
$ pacman -Si $(pactree -rl ''package'') 2>/dev/null <nowiki>|</nowiki> grep -q "^Groups *:.*base-devel"<br />
<br />
}}<br />
<br />
{{Note|The group {{Grp|base-devel}} is assumed to be already installed when building with ''makepkg''. Members of this group '''should not''' be included in {{ic|makedepends}} array.}}<br />
<br />
=== checkdepends ===<br />
An array of packages that the software depends on to run its test suite, but are not needed at runtime. Packages in this list follow the same format as {{ic|depends}}. These dependencies are only considered when the [[Creating packages#check()|check()]] function is present and is to be run by makepkg. <br />
<br />
{{Note|The group {{Grp|base-devel}} is assumed to be already installed when building with ''makepkg''. Members of this group '''should not''' be included in {{ic|checkdepends}} array.}}<br />
<br />
== Package relations ==<br />
<br />
{{Note|Additional architecture-specific arrays can be used by appending an underscore and the architecture name, e.g. {{ic|1=provides_x86_64=()}}, {{ic|1=conflicts_x86_64=()}}.}}<br />
<br />
=== provides ===<br />
An array of additional packages that the software provides the features of (or a virtual package such as {{Ic|cron}} or {{Ic|sh}}). Packages providing the same item can be installed side-by-side, unless at least one of them uses a {{ic|conflicts}} array.<br />
<br />
{{Warning|A version that the package provides should be mentioned ({{ic|pkgver}} and perhaps the {{ic|pkgrel}}), if packages needing the software may require one. For instance, a modified ''qt'' package version 3.3.8, named ''qt-foobar'', should use {{ic|1=provides=('qt=3.3.8')}}; using {{ic|1=provides=('qt')}} would cause the dependencies that require a specific version of ''qt'' to fail. Do not add {{ic|pkgname}} to the {{ic|provides}} array, as it is done automatically.}}<br />
<br />
=== conflicts ===<br />
<br />
An array of packages that conflict with, or cause problems with the package, if installed. All these packages and packages providing this item will need to be removed. The version properties of the conflicting packages can also be specified in the same format as the {{ic|depends}} array.<br />
<br />
=== replaces ===<br />
An array of obsolete packages that are replaced by the package, e.g. {{pkg|wireshark-gtk}} uses {{ic|1=replaces=('wireshark')}}. When syncing, ''pacman'' will immediately replace an installed package upon encountering another package with the matching {{ic|replaces}} in the repositories. If providing an alternate version of an already existing package or uploading to the [[AUR]], use the {{ic|conflicts}} and {{ic|provides}} arrays, which are only evaluated when actually installing the conflicting package.<br />
<br />
== Others ==<br />
<br />
=== backup ===<br />
<br />
An array of files that can contain user-made changes and should be preserved during upgrade or removal of a package, primarily intended for configuration files in {{ic|/etc}}.<br />
<br />
Files in this array should use '''relative''' paths without the leading slash ({{ic|/}}) (e.g. {{ic|etc/pacman.conf}}, instead of {{ic|/etc/pacman.conf}}).<br />
<br />
When updating, new version may be saved as {{ic|file.pacnew}} to avoid overwriting a file which already exists and was previously modified by the user. Similarly, when the package is removed, user-modified file will be preserved as {{ic|file.pacsave}} unless the package was removed with the {{ic|pacman -Rn}} command.<br />
<br />
See also [[Pacnew and Pacsave files]].<br />
<br />
=== options ===<br />
This array allows overriding some of the default behavior of ''makepkg'', defined in {{Ic|/etc/makepkg.conf}}. To set an option, include the name in the array. To reverse the default behavior, place an '''{{ic|!}}''' at the front.<br />
<br />
The full list of the available options can be found in [https://www.archlinux.org/pacman/PKGBUILD.5.html PKGBUILD(5)].<br />
<br />
=== install ===<br />
The name of the {{ic|.install}} script to be included in the package. This should be the same as {{ic|pkgname}}. ''pacman'' has the ability to store and execute a package-specific script when it installs, removes or upgrades a package. The script contains the following functions which run at different times:<br />
<br />
* {{ic|pre_install}} — The script is run right before files are extracted. One argument is passed: new package version.<br />
* {{ic|post_install}} — The script is run right after files are extracted. One argument is passed: new package version.<br />
* {{ic|pre_upgrade}} — The script is run right before files are extracted. Two arguments are passed in the following order: new package version, old package version.<br />
* {{ic|post_upgrade}} — The script is run right after files are extracted. Two arguments are passed in the following order: new package version, old package version.<br />
* {{ic|pre_remove}} — The script is run right before files are removed. One argument is passed: old package version.<br />
* {{ic|post_remove}} — The script is run right after files are removed. One argument is passed: old package version.<br />
<br />
Each function is run [[chroot]]ed inside the ''pacman'' install directory. See [https://bbs.archlinux.org/viewtopic.php?pid=913891 this thread].<br />
<br />
{{Tip|A prototype {{ic|.install}} is provided at [https://projects.archlinux.org/pacman.git/plain/proto/proto.install /usr/share/pacman/proto.install].}}<br />
<br />
=== changelog ===<br />
<br />
The name of the package changelog. To view changelogs for installed packages (that have this file):<br />
<br />
$ pacman -Qc ''pkgname''<br />
<br />
{{Tip|A prototype changelog file is provided at {{ic|/usr/share/pacman/ChangeLog.proto}}}}<br />
<br />
== Sources ==<br />
<br />
=== source ===<br />
<br />
{{Note|Additional architecture-specific arrays can be added by appending an underscore and the architecture name, e.g. {{ic|1=source_x86_64=()}}. There must be a corresponding integrity array with checksums, e.g. {{ic|1=sha256sums_x86_64=()}}.}}<br />
<br />
An array of files needed to build the package. It must contain the location of the software source, which in most cases is a full HTTP or FTP URL. The previously set variables {{ic|pkgname}} and {{ic|pkgver}} can be used effectively here (e.g. {{ic|<nowiki>source=("https://example.com/$pkgname-$pkgver.tar.gz")</nowiki>}}).<br />
<br />
Files can also be supplied directly in the location of the {{ic|PKGBUILD}} and added to this array. These paths are resolved relative to the directory of the {{ic|PKGBUILD}}. Before the actual build process is started, all of the files referenced in this array will be downloaded or checked for existence, and ''makepkg'' will not proceed, if any are missing.<br />
<br />
{{Note|''.install'' files should not be included.}}<br />
<br />
{{Tip|An alternative source name for the downloaded file can be specified with the syntax {{ic|1=source=(<nowiki>'</nowiki>''filename''::''fileuri''<nowiki>'</nowiki>)}}:<br />
<br />
{{bc|<nowiki>source=("project_name::hg+https://googlefontdirectory.googlecode.com/hg/")</nowiki>}}}}<br />
<br />
=== noextract ===<br />
<br />
An array of files listed under {{ic|source}}, which should not be extracted from their archive format by ''makepkg''. This can be used with archives that cannot be handled by {{ic|/usr/bin/bsdtar}} or those that need to be installed as-is. If an alternative unarchiving tool is used (e.g. {{Pkg|lrzip}}), it should be added in the {{ic|makedepends}} array and the first line of the [[Creating packages#prepare()|prepare()]] function should extract the source archive manually; for example:<br />
<br />
prepare() {<br />
lrzip -d ''source''.tar.lrz<br />
}<br />
<br />
Note that while the {{ic|source}} array accepts URLs, {{ic|noextract}} is '''just''' the file name portion:<br />
<br />
<nowiki>source=("http://foo.org/bar/foobar.tar.xz")</nowiki><br />
noextract=('foobar.tar.xz')<br />
<br />
To extract ''nothing'', you can do something like this (taken from [https://projects.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/firefox-i18n#n123 firefox-i18n's PKGBUILD]):<br />
<br />
noextract=("${source[@]%%::*}")<br />
<br />
== Integrity ==<br />
<br />
{{Style|Too detailed about collisions without explaining why they are relevant here.|section=Integrity variables details}}<br />
<br />
The values for these variables can be auto-generated by [[makepkg]]'s {{ic|-g}} option, then commonly appended with {{ic|makepkg -g >> PKGBUILD}}. The {{ic|updpkgsums}} command is able to update the variables wherever they are in the PKGBUILD. Both tools will use the variable that is already set in the PKGBUILD, or fall back to {{ic|md5sums}} if none is set.<br />
<br />
The file integrity checks to use can be set up with the {{ic|INTEGRITY_CHECK}} option in {{ic|/etc/makepkg.conf}}. See [https://www.archlinux.org/pacman/makepkg.conf.5.html makepkg.conf(5)].<br />
<br />
For reference:<br />
<br />
*''Collision vulnerability'' means generation of a series of different fixed-width strings, where any two end up having identical hashes.<br />
*''Preimage vulnerability'' means generation of a string or a file that matches a specific, predetermined hash.<br />
<br />
{| class="wikitable"<br />
! Algorithm !! Collision vulnerability !! Preimage vulnerability<br />
|-<br />
| MD5 || Severely broken. || Theoretical.<br />
|-<br />
| SHA-1 || Theoretical. || Not found.<br />
|-<br />
| SHA-2 || Not found. || Not found.<br />
|}<br />
<br />
=== md5sums ===<br />
An array of 128-bit MD5 checksums of the files listed in the {{ic|source}} array.<br />
<br />
{{Note|<br />
*A [[Wikipedia:MD5|collision]] can be found in 2<sup>18</sup> <nowiki>=</nowiki> 2.6 × 10<sup>5</sup> operations or less than a second on a regular computer.<br />
*An unpractical, theoretical preimage vulnerability is estimated at 2<sup>123.4</sup> ≈ 1.4 × 10<sup>37</sup>, instead of the intended 2<sup>128</sup> ≈ 3.4 × 10<sup>38</sup>.<br />
}}<br />
<br />
=== sha1sums ===<br />
An array of 160-bit SHA-1 checksums of the files listed in the {{ic|source}} array.<br />
<br />
{{Note|<br />
*A [[Wikipedia:SHA-1|theoretical collision]] is estimated at 2<sup>61</sup> ≈ 2.3 × 10<sup>18</sup> operations on average, instead of the intended ≈ 1.2 × 2<sup>160 / 2</sup> <nowiki>=</nowiki> 1.2 × 2<sup>80</sup> ≈ 1.5 × 10<sup>24</sup>.<br />
*While no known preimage vulnerabilities exist, SHA-1 is being phased out in use of SSL certificates in at least Microsoft, Google and Mozilla by 2017.<br />
}}<br />
<br />
=== sha256sums ===<br />
An array of SHA-2 checksums with digest size of 256. This is an alternative to {{ic|md5sums}} and {{ic|sha1sums}} and has no [[Wikipedia:SHA-2|known vulnerabilities]]. Once all files in the {{ic|source}} array are available, a SHA-2 hash of each file will be automatically generated and compared with the values of this array in the same order.<br />
<br />
=== sha224sums, sha384sums, sha512sums ===<br />
An array of SHA-2 checksums with digest sizes 224, 384, and 512 bits, respectively. These are less common alternatives to {{ic|sha256sums}}.<br />
<br />
=== validpgpkeys ===<br />
An array of PGP fingerprints. If used, ''makepkg'' will only accept signatures from the keys listed here and will ignore the trust values from the keyring. If the source file was signed with a subkey, ''makepkg'' will still use the primary key for comparison.<br />
<br />
Only full fingerprints are accepted. They must be uppercase and must not contain whitespace characters.<br />
<br />
{{note|You can use {{ic|gpg --list-keys --fingerprint <KEYID>}} to find out the fingerprint of the appropriate key.}}<br />
<br />
== See also ==<br />
*[https://www.archlinux.org/pacman/PKGBUILD.5.html PKGBUILD(5) Manual Page]<br />
*[http://ix.io/66p Example PKGBUILD file]</div>Ultraviolethttps://wiki.archlinux.org/index.php?title=Tablet_PC&diff=381107Tablet PC2015-07-05T22:33:44Z<p>Ultraviolet: /* Automatic rotation */ added mention of aur package for iio-sensor-proxy</p>
<hr />
<div>[[Category:Mobile devices]]<br />
Here are some hints for getting Arch Linux working on your tablet PC. These instructions contain information for getting the stylus, stylus rotation, and screen rotation to work properly on a tablet PC.<br />
<br />
== Stylus ==<br />
<br />
First [[install]] {{Pkg|xf86-input-wacom}}.<br />
<br />
Then add the following lines to the '''ServerLayout''' section of the [[Xorg]] configuration file {{ic|/etc/X11/xorg.conf}}:<br />
<br />
InputDevice "stylus" "SendCoreEvents"<br />
InputDevice "eraser" "SendCoreEvents"<br />
InputDevice "cursor" "SendCoreEvents"<br />
<br />
As well as the following sections:<br />
<br />
Section "InputDevice"<br />
Identifier "stylus"<br />
Driver "wacom"<br />
Option "Device" "/dev/ttyS0"<br />
Option "Type" "stylus"<br />
Option "ForceDevice" "ISDV4"<br />
Option "Button2" "3"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "eraser"<br />
Driver "wacom"<br />
Option "Device" "/dev/ttyS0"<br />
Option "Type" "eraser"<br />
Option "ForceDevice" "ISDV4"<br />
Option "Button2" "3"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "cursor"<br />
Driver "wacom"<br />
Option "Device" "/dev/ttyS0"<br />
Option "Type" "cursor"<br />
Option "ForceDevice" "ISDV4"<br />
EndSection<br />
<br />
== Rotation ==<br />
<br />
Unless you are running a very old Xserver, rotation capabilities (xrandr) should already be on by default. If not, you can enable xrandr by adding the following option to the '''Screen''' section of the xorg.conf file.<br />
<br />
Option "RandRRotation" "on"<br />
<br />
Save the file and restart the xserver for changes to take effect.<br />
<br />
=== XFCE: Stylus and screen rotation ===<br />
<br />
The following script will rotate the display 90 degrees clockwise every time it is executed. It will also rotate the wacom pointer so the stylus will still work.<br />
<br />
{{hc|rotate.sh|<br />
#!/bin/bash<br />
<br />
case $(xfconf-query -c pointers -p /Wacom_ISDv4_90_Pen_stylus/Properties/Wacom_Rotation) in<br />
2) # Currently top is rotated left, we should set it normal (0°)<br />
xrandr -o 0<br />
xfconf-query -c pointers -p /Wacom_ISDv4_90_Pen_stylus/Properties/Wacom_Rotation -s 0<br />
xfconf-query -c xsettings -p /Xft/RGBA -s rgb<br />
;;<br />
0) # Screen is not rotated, we should rotate it right (90°)<br />
xrandr -o 3<br />
xfconf-query -c pointers -p /Wacom_ISDv4_90_Pen_stylus/Properties/Wacom_Rotation -s 1<br />
xfconf-query -c xsettings -p /Xft/RGBA -s vbgr<br />
;;<br />
1) # Top of screen is rotated right, we should invert it (180°)<br />
xrandr -o 2<br />
xfconf-query -c pointers -p /Wacom_ISDv4_90_Pen_stylus/Properties/Wacom_Rotation -s 3<br />
xfconf-query -c xsettings -p /Xft/RGBA -s bgr<br />
;;<br />
3) # Screen is inverted, we should rotate it left (270°)<br />
xrandr -o 1<br />
xfconf-query -c pointers -p /Wacom_ISDv4_90_Pen_stylus/Properties/Wacom_Rotation -s 2<br />
xfconf-query -c xsettings -p /Xft/RGBA -s vrgb<br />
;;<br />
*)<br />
echo "Unknown result from 'xfconf-query -c pointers -p /Wacom_ISDv4_90_Pen_stylus/Properties/Wacom_Rotation'" >&2<br />
exit 1<br />
;;<br />
esac<br />
}}<br />
<br />
Save the file and make it executable ({{ic|chmod +x rotate.sh}}). You can create a link to it on your desktop or panel, or link it to a keyboard shortcut or special button on your tablet.<br />
<br />
=== Touchscreen rotation ===<br />
<br />
[https://github.com/yourealwaysbe/grox Grox] is a simple script for rotating a touchscreen absolutely or by relative increments. It only uses xrandr to query the current state, rather than XFCE specific features.<br />
<br />
== Automatic rotation ==<br />
<br />
=== With a script ===<br />
<br />
The following python script was developed to automatic rotate the screen and the touchscreen. Furthermore, it disable the touchpad for inverted, right, and left orientation, and supports automatic detection of accelerometers, touchscreens and touchpad devices.<br />
<br />
It works for devices with an accelerometer communicating through the industrial i/o subsystem {{ic|/sys/bus/iio/devices/iio:deviceX}}, where X is the number of the device. Usually, it is necessary to change the following parameters dpath, devicename and touchpad.<br />
<br />
See [https://gist.githubusercontent.com/ei-grad/4d9d23b1463a99d24a8d/raw/rotate.py rotate.py].<br />
<br />
=== With systemd ===<br />
<br />
See [https://github.com/hadess/iio-sensor-proxy iio-sensor-proxy]. {{AUR|iio-sensor-proxy-git}} is available in the AUR.<br />
<br />
== Tips and tricks ==<br />
<br />
=== CellWriter ===<br />
<br />
[http://risujin.org/cellwriter/ CellWriter] is a grid-entry natural handwriting input panel. As you write characters into the cells, your writing is instantly recognized at the character level. {{Pkg|cellwriter}} is available in community repository.<br />
<br />
=== Easystroke ===<br />
<br />
[http://easystroke.sourceforge.net/ Easystroke] is a gesture recognition application, recognizing gestures by a variety of input devices, to include pen stylus, mouse, and touch. Gestures can be used to launch programs, enter text, emulate buttons and keys, and scroll. Easystroke is available in the AUR: {{AUR|easystroke-git}}.<br />
<br />
==== Launch CellWriter under pen ====<br />
<br />
One useful application of Easystroke is to use it to launch CellWriter right below your mouse pointer.<br />
<br />
{{Style|Script dump, in-code comments}}<br />
<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
# Original author: mr_deimos (ubuntuforums.org). February 14, 2010<br />
# Many bugs fixed and improvements made by Ben Wong. October 20, 2010<br />
<br />
# This script toggles the cellwriter letter recognizer window.<br />
# If a cellwriter window is visible, it will be hidden.<br />
# If cellwriter is not already running, this will create a new process.<br />
# If coordinates are specified, the window pops up at those coordinates. <br />
# If coordinates are not specified, the window is toggled, but not moved.<br />
<br />
# Implementation Note: this script is trickier than it should be<br />
# because cellwriter does two stupid things. First, it has no<br />
# --get-state option, so we can't tell if it is hidden or not. Second,<br />
# both the notification area applet and the actual program window have<br />
# the same window name in X, which means we can't simply use xwininfo<br />
# to find out if it is showing or not. <br />
#<br />
# (Of course, we wouldn't have to be doing this crazy script at all,<br />
# if cellwriter had a --toggle-window option to toggle showing the<br />
# keyboard, but that's another rant...)<br />
#<br />
# To work around the problem, we'll assume that if the window we got<br />
# information about from xwininfo is smaller than 100 pixels wide, it<br />
# must be an icon in the notification area. This may be the wrong<br />
# assumption, but, oh well...<br />
<br />
if [[ "$1" == "-v" || "$1" == "--verbose" ]]; then<br />
verbose=echo<br />
shift<br />
else<br />
verbose=:<br />
fi<br />
<br />
if [[ "$1" && -z "$2" || "$1" == "-h" || "$1" == "--help" ]] ; then <br />
cat >&2 <<EOF<br />
$(basename $0): Toggle showing the cellwriter window, optionally moving it."<br />
<br />
Usage: $(basename $0) [x y]"<br />
Where x and y are the desired position of the cellwriter window."<br />
If x and y are omitted, the window is not moved."<br />
EOF<br />
exit 1<br />
fi<br />
<br />
if [[ "$1" && "$2" ]]; then<br />
x=$[$1-20] # Offset slightly so cursor will be in window <br />
y=$[$2-30]<br />
[ $x -lt 0 ] && x=0 # Minimum value is zero<br />
[ $y -lt 0 ] && y=0<br />
fi<br />
<br />
if ! xwininfo -root >/dev/null; then<br />
echo "$(basename $0): Error: Could not connect to your X server." >&2<br />
exit 1<br />
fi<br />
<br />
# Try to obtain CellWriter's window id.<br />
# We can't use "xwininfo -name" b/c that might find the notification icon. <br />
OLDIFS="$IFS"<br />
IFS=$'\n'<br />
for line in $(xwininfo -root -tree | grep CellWriter); do<br />
line=0x${line#*0x} # Just to get rid of white space before 0x.<br />
$verbose -en "Checking: $line\t"<br />
if [[ $line =~ (0x[A-Fa-f0-9]+).*\)\ *([0-9]+)x([0-9]+) ]]; then<br />
id=${BASH_REMATCH[1]}<br />
width=${BASH_REMATCH[2]}<br />
height=${BASH_REMATCH[3]}<br />
if [[ $width -gt 100 ]]; then<br />
$verbose "looks good."<br />
CW_WIN_ID=$id<br />
break;<br />
else<br />
$verbose "too small, ignoring."<br />
fi<br />
else<br />
echo "BUG: The xwininfo regular expression in $0 is broken." >&2<br />
fi<br />
done<br />
IFS="$OLDIFS"<br />
<br />
#Check if Cellwriter's window is visible<br />
if [ "$CW_WIN_ID" ] ; then<br />
CW_MAP_STATE=`xwininfo -id "$CW_WIN_ID"|grep "Map State"|cut -f 2 -d :`<br />
else<br />
$verbose "Can't find cellwriter window, checking for a running process..."<br />
if ! pgrep -x cellwriter >& /dev/null; then<br />
$verbose "No cellwriter process running, starting a new one."<br />
if [[ "$x" && "$y" ]]; then<br />
cellwriter --show-window --window-x=$x --window-y=$y &<br />
else<br />
cellwriter --show-window &<br />
fi<br />
exit 0<br />
else<br />
$verbose "Found a process, so the window has not been created yet."<br />
$verbose "Pretending the window is UnMapped."<br />
CW_MAP_STATE=IsUnMapped<br />
fi<br />
fi<br />
<br />
$verbose "Map state: $CW_MAP_STATE"<br />
<br />
case "$CW_MAP_STATE" in<br />
<br />
*IsViewable*) # Window is currently visible.<br />
$verbose "hiding window"<br />
cellwriter --hide-window &<br />
;;<br />
<br />
*IsUnMapped*) # Window is currently hidden or non-existent.<br />
if [[ "$x" && "$y" && "$CW_WIN_ID" ]]; then<br />
$verbose "moving window to $x $y"<br />
xdotool windowmove $CW_WIN_ID $x $y<br />
fi<br />
$verbose "showing window"<br />
cellwriter --show-window & # In bg in case cw is not already running<br />
;;<br />
<br />
*) # This will never happen...<br />
echo "BUG: cellwriter is neither viewable nor unmapped" >&2<br />
echo "BUG: ...which means this script, $0, is buggy." >&2<br />
exit 1<br />
;;<br />
esac<br />
<br />
exit 0<br />
</nowiki>}}<br />
<br />
Save the script as '''cellwriter.sh''' in either {{ic|/usr/local/bin/}} or {{ic|$HOME/bin}}, and give it executable rights:<br />
<br />
chmod +x cellwriter.sh<br />
<br />
Then create a gesture in Easystroke tied to the following command:<br />
<br />
cellwriter.sh $EASYSTROKE_X1 $EASYSTROKE_Y1<br />
<br />
When you launch it (using the gesture you created) it will open right under your pen.<br />
<br />
{{Note|This script requires the xdotool package, which is not installed by default.}}<br />
<br />
==== Gestures for theaAlphabet ====<br />
<br />
You can also use Easystroke to make gestures for the entire alphabet, replacing much of the need for CellWriter. To avoid having to make seperate gestures for the uppercase-letters, you can use the following [http://wwww.ubuntuforums.org/showthread.php?t=837032&page=5#49 script] to activate the shift key.<br />
<br />
{{bc|<br />
#!/bin/bash<br />
if [ -f /tmp/shift ]<br />
then<br />
xte "keydown Shift_L" "key $1" "keyup Shift_L"<br />
rm -f /tmp/shift<br />
else<br />
xte "key $1"<br />
fi<br />
}}<br />
<br />
Save the script as '''keypress.sh''' in either {{ic|/usr/local/bin/}} or {{ic|$HOME/bin}}, and give it executable rights:<br />
<br />
chmod +x keypress.sh<br />
<br />
Then create a gesture in Easystroke tied to the following command:<br />
<br />
touch /tmp/shift<br />
<br />
This will activate the shift key. To activate the letter keys, tie your gestures to the following command:<br />
<br />
keypress.sh $LETTER<br />
<br />
Replace $LETTER with the letter in the alphabet in question.<br />
<br />
So when you want to enter an upper-case letter, use your gesture for the shift key followed by the letter. If you want a lower-case letter, simply use your gesture for the letter.<br />
<br />
{{Note|This script requires the xautomation package, which is not installed by default.}}<br />
<br />
=== Xournal ===<br />
<br />
[http://xournal.sourceforge.net/ Xournal] is an application for notetaking, sketching, and keeping a journal using a stylus. Xournal aims to provide superior graphical quality (subpixel resolution) and overall functionality. Xournal can be installed from the '''extra''' repository.<br />
<br />
You can also extend the functionality of Xournal with patches, to enable such things as autosaving documents and inserting images. See [http://sourceforge.net/tracker/?group_id=163434&atid=827735 SourceForge] for links to all the available patches. To apply a patch, download the PKGBUILD for Xournal from the [[ABS]], and reference the article [[Patching in ABS]].<br />
<br />
=== Disable gksu grab mode ===<br />
<br />
{{Warning|This will make it possible for other X applications to listen to keyboard input events, thus making it impossible to shield from malicious applications which may be running, such as keyloggers, etc.}}<br />
<br />
If you are using gksu/gksudo, you can authenticate with the stylus to enter the password by disabling grab mode. In a terminal, run the following command:<br />
<br />
$ gksu-properties<br />
<br />
Change the '''Grab Mode''' to ''disable''.<br />
<br />
=== Gnome-screensaver ===<br />
<br />
To unlock your gnome-screensaver using Cellwriter to enter your password, first start Gconf-editor:<br />
<br />
$ gconf-editor<br />
<br />
Under '''/apps/gnome-screensaver''', set '''embedded_keyboard_command''' to ''cellwriter --xid --keyboard-only'', and check the '''embedded_keyboard_enabled''' checkbox.<br />
<br />
Alternatively, instead of using the graphical registry editor, you can simply paste these into your command-line:<br />
<br />
$ gconftool-2 --set /apps/gnome-screensaver/embedded_keyboard_command "cellwriter --xid --keyboard-only" --type string<br />
$ gconftool-2 --set /apps/gnome-screensaver/embedded_keyboard_enabled true --type boolean<br />
<br />
If you are administrating a multi-user system and would like to set the system-wide default, you can do so like so,<br />
<br />
# gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --set /apps/gnome-screensaver/embedded_keyboard_command "cellwriter --xid --keyboard-only" --type string<br />
# gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --set /apps/gnome-screensaver/embedded_keyboard_enabled true --type boolean<br />
<br />
=== GDM ===<br />
<br />
You can also use CellWriter with GDM. First open '''/etc/gdm/Init/Default''' as root with a text editor. Then near the bottom of the file, add the lines in '''bold''' as shown<br />
<br />
fi<br />
'''cellwriter --keyboard-only &'''<br />
exit 0<br />
<br />
You can add '''--window-x''' and '''--window-y''' to adjust the position of CellWriter accordingly. For example:<br />
cellwriter --keyboard-only --window-x=512 --window-y=768 &<br />
<br />
{{Note|You can only use CellWriter with a Plain style GDM.}}<br />
<br />
To start a fully fledged CellWriter instance within the user session, you might want to terminate the instance started with the keyboard-only switch within the gdm context. Add something like<br />
<br />
killall cellwriter<br />
<br />
to you newly created file /etc/gdm/PostLogin/Default .<br />
<br />
{{Note|This works in a single-user setup, if you have a multi-user setup, you might want to develop and post your more elaborate solution.}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Wacom Drivers ===<br />
<br />
These commands are useful in troubleshooting:<br />
<br />
wacdump -f tpc /dev/ttyS0<br />
xidump -l<br />
xidump -u stylus<br />
<br />
If xidump shows that your tablet's max resolution is the same as screen resolution, then your wacom driver has rescaled your wacom coordinates to the X server's resolution. To fix this, try recompiling you linuxwacom driver with:<br />
<br />
./configure --disable-quirk-tablet-rescale<br />
<br />
=== Screen Rotation ===<br />
<br />
Some video drivers do not support rotation. To check if your driver supports rotation, check the output of '''xrandr''' for the list orientations:<br />
<br />
normal left inverted right<br />
<br />
{{Note|The following driver(s) are known not to support rotation: fglrx}}</div>Ultraviolethttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_Helix&diff=327317Lenovo ThinkPad Helix2014-07-28T00:47:24Z<p>Ultraviolet: </p>
<hr />
<div>[[Category:Lenovo]]<br />
{| class="wikitable"<br />
|+ Hardware Information<br />
! Form Factor <br />
| Tablet/Ultrabook Convertible (detachable keyboard dock)<br />
|-<br />
! Display <br />
| 11.6" 1920x1080 LCD with Capacitive and Pen Digitisers<br />
|-<br />
! CPU <br />
| 3rd Generation (Ivy Bridge) Core i5-3427U or i7-3667U<br />
|-<br />
! RAM <br />
| 4GiB (i5) or 8GiB (i7) DDR3L RAM (dependent upon CPU)<br />
|-<br />
! Storage <br />
| 128/160/256GB mSATA SSD<br />
|-<br />
! WiFi <br />
| Intel Centrino Advanced-N 6205S mPCI WLAN<br />
|-<br />
! Bluetooth <br />
| Broadcom BCM20702 Bluetooth 4.0 (USB connected)<br />
|-<br />
! Camera <br />
| 5MP Rear and 2MP Front (also USB)<br />
|}<br />
<br />
== Installation ==<br />
<br />
{{Note|As this model includes no physical recovery media, it's highly recommended to create a Windows reinstallation flash drive just in case using the recovery media creation tool included with your preinstalled Windows system.}}<br />
<br />
Due to the fact that there is no optical drive, you need to [[USB Installation Media|install Arch from USB stick]].<br />
<br />
The Arch install media will happily boot under UEFI, so it is recommended to disable legacy boot in the system setup utility. If legacy boot is needed for some reason, it does work fine as well.<br />
<br />
Booting using [[Gummiboot]] works perfectly. Again, if legacy boot is needed, [[GRUB]] is perfectly functional as well.<br />
<br />
== Hardware Configuration ==<br />
<br />
To fully support all hardware in X, one needs to ensure that the following driver packages are installed: <br />
<br />
*{{Pkg|xf86-input-synaptics}} (for the clickpad)<br />
*{{Pkg|xf86-input-wacom}} (for the digitisers)<br />
*{{Pkg|xf86-video-intel}} (for the GPU)<br />
<br />
Nearly everything works fine with no special configuration. The sensors (accelerometer, gyroscope, magnetometer, ambient light sensor) don't seem to be recognised yet.<br />
<br />
=== Bluetooth ===<br />
<br />
If the Broadcom USB device isn't showing up, you likely need to turn it on with {{ic|echo 1 > /sys/devices/platform/thinkpad_acpi/rfkill/rfkill0/state}}<br />
<br />
=== Digitisers ===<br />
<br />
The pen digitiser should be recognised by the wacom driver out of the box. The capacitive (touch) digitiser works with the same driver, but is not recognised as compatible by default. To fix this, add Atmel to the first MatchProduct entry in the wacom driver configuration file:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/50-wacom.conf|<br />
Section "InputClass"<br />
Identifier "Wacom class"<br />
MatchProduct "Wacom&#124;WACOM&#124;Hanwang&#124;PTK-540WL&#124;Atmel"<br />
MatchDevicePath "/dev/input/event*"<br />
Driver "wacom"<br />
EndSection<br />
}}<br />
<br />
Everything should work after a reboot.<br />
<br />
If you find yourself frustrated by the capacitive digitiser while trying to use the pen, you may have interest in the {{AUR|thinkpad-helix-utils}} package. It contains a script, {{ic|helix-toggle-touch}}, which will toggle the capacitive digitiser on and off with a simple command.<br />
<br />
=== Screen Rotation ===<br />
<br />
If you have both digitisers configured through the xf86-input-wacom driver, they will automatically rotate with the display and you can use a simple command like {{ic|xrandr --output eDP1 --rotate left}} to rotate the screen with ease.<br />
<br />
If you want to use the bezel buttons (or some other hotkey) to cycle through orientations (or toggle between two specific ones), {{ic|helix-rotate}}, also from from {{AUR|thinkpad-helix-utils}}, provides an easy-to-bind command that may serve your needs well.<br />
<br />
There is also [https://launchpad.net/magick-rotation/ Magick Rotation], which is supposed to automatically rotate the screen based on input events, but it only seems to respond to docking/undocking the tablet.<br />
<br />
== BIOS/Firmware Updates ==<br />
<br />
Helpfully, Lenovo now provides [http://support.lenovo.com/en_US/downloads/detail.page?DocID=DS034628 bootable ISO images] for the purpose of installing BIOS updates. While it is not stated on their site, these bootable images also include updated firmware for the keyboard dock MPU. It is uncertain as to whether the USB hub firmware is also updated via this utility.<br />
<br />
{{Note|While the update utility states that all expansion units should be disconnected, it is only referring to external (USB and DisplayPort) devices. Ensure that the tablet is in the dock and connected only to AC power and the utility boot media before starting the process.}}<br />
<br />
If you do not have access to a USB optical drive and writable media, the information on [http://www.thinkwiki.org/wiki/BIOS_Upgrade/X_Series ThinkWiki] is extremely helpful.</div>Ultraviolethttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_Helix&diff=327314Lenovo ThinkPad Helix2014-07-28T00:38:09Z<p>Ultraviolet: added basic info on bios updating, to be amended</p>
<hr />
<div>[[Category:Lenovo]]<br />
{| class="wikitable"<br />
|+ Hardware Information<br />
! Form Factor <br />
| Tablet/Ultrabook Convertible (detachable keyboard dock)<br />
|-<br />
! Display <br />
| 11.6" 1920x1080 LCD with Capacitive and Pen Digitisers<br />
|-<br />
! CPU <br />
| 3rd Generation (Ivy Bridge) Core i5-3427U or i7-3667U<br />
|-<br />
! RAM <br />
| 4GiB (i5) or 8GiB (i7) DDR3L RAM (dependent upon CPU)<br />
|-<br />
! Storage <br />
| 128/160/256GB mSATA SSD<br />
|-<br />
! WiFi <br />
| Intel Centrino Advanced-N 6205S mPCI WLAN<br />
|-<br />
! Bluetooth <br />
| Broadcom BCM20702 Bluetooth 4.0 (USB connected)<br />
|-<br />
! Camera <br />
| 5MP Rear and 2MP Front (also USB)<br />
|}<br />
<br />
== Installation ==<br />
<br />
{{Note|As this model includes no physical recovery media, it's highly recommended to create a Windows reinstallation flash drive just in case using the recovery media creation tool included with your preinstalled Windows system.}}<br />
<br />
Due to the fact that there is no optical drive, you need to [[USB Installation Media|install Arch from USB stick]].<br />
<br />
The Arch install media will happily boot under UEFI, so it is recommended to disable legacy boot in the system setup utility. If legacy boot is needed for some reason, it does work fine as well.<br />
<br />
Booting using [[Gummiboot]] works perfectly. Again, if legacy boot is needed, [[GRUB]] is perfectly functional as well.<br />
<br />
== Hardware Configuration ==<br />
<br />
To fully support all hardware in X, one needs to ensure that the following driver packages are installed: <br />
<br />
*{{Pkg|xf86-input-synaptics}} (for the clickpad)<br />
*{{Pkg|xf86-input-wacom}} (for the digitisers)<br />
*{{Pkg|xf86-video-intel}} (for the GPU)<br />
<br />
Nearly everything works fine with no special configuration. The sensors (accelerometer, gyroscope, magnetometer, ambient light sensor) don't seem to be recognised yet.<br />
<br />
=== Bluetooth ===<br />
<br />
If the Broadcom USB device isn't showing up, you likely need to turn it on with {{ic|echo 1 > /sys/devices/platform/thinkpad_acpi/rfkill/rfkill0/state}}<br />
<br />
=== Digitisers ===<br />
<br />
The pen digitiser should be recognised by the wacom driver out of the box. The capacitive (touch) digitiser works with the same driver, but is not recognised as compatible by default. To fix this, add Atmel to the first MatchProduct entry in the wacom driver configuration file:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/50-wacom.conf|<br />
Section "InputClass"<br />
Identifier "Wacom class"<br />
MatchProduct "Wacom&#124;WACOM&#124;Hanwang&#124;PTK-540WL&#124;Atmel"<br />
MatchDevicePath "/dev/input/event*"<br />
Driver "wacom"<br />
EndSection<br />
}}<br />
<br />
Everything should work after a reboot.<br />
<br />
If you find yourself frustrated by the capacitive digitiser while trying to use the pen, you may have interest in the {{AUR|thinkpad-helix-utils}} package. It contains a script, {{ic|helix-toggle-touch}}, which will toggle the capacitive digitiser on and off with a simple command.<br />
<br />
=== Screen Rotation ===<br />
<br />
If you have both digitisers configured through the xf86-input-wacom driver, they will automatically rotate with the display and you can use a simple command like {{ic|xrandr --output eDP1 --rotate left}} to rotate the screen with ease.<br />
<br />
If you want to use the bezel buttons (or some other hotkey) to cycle through orientations (or toggle between two specific ones), {{ic|helix-rotate}}, also from from {{AUR|thinkpad-helix-utils}}, provides an easy-to-bind command that may serve your needs well.<br />
<br />
There is also [https://launchpad.net/magick-rotation/ Magick Rotation], which is supposed to automatically rotate the screen based on input events, but it only seems to respond to docking/undocking the tablet.<br />
<br />
== BIOS/Firmware Updates ==<br />
<br />
Helpfully, Lenovo now provides [http://support.lenovo.com/en_US/downloads/detail.page?DocID=DS034628 bootable ISO images] for the purpose of installing BIOS updates. While it is not stated on their site, these bootable images also include updated firmware for the keyboard dock MPU. It is uncertain as to whether the USB hub firmware is also updated via this utility.</div>Ultraviolethttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_Helix&diff=323013Lenovo ThinkPad Helix2014-07-04T00:10:53Z<p>Ultraviolet: </p>
<hr />
<div>[[Category:Lenovo]]<br />
{| class="wikitable"<br />
|+ Hardware Information<br />
! Form Factor <br />
| Tablet/Ultrabook Convertible (detachable keyboard dock)<br />
|-<br />
! Display <br />
| 11.6" 1920x1080 LCD with Capacitive and Pen Digitisers<br />
|-<br />
! CPU <br />
| 3rd Generation (Ivy Bridge) Core i5-3427U or i7-3667U<br />
|-<br />
! RAM <br />
| 4GiB (i5) or 8GiB (i7) DDR3L RAM (dependent upon CPU)<br />
|-<br />
! Storage <br />
| 128/160/256GB mSATA SSD<br />
|-<br />
! WiFi <br />
| Intel Centrino Advanced-N 6205S mPCI WLAN<br />
|-<br />
! Bluetooth <br />
| Broadcom BCM20702 Bluetooth 4.0 (USB connected)<br />
|-<br />
! Camera <br />
| 5MP Rear and 2MP Front (also USB)<br />
|}<br />
<br />
== Installation ==<br />
<br />
{{Note|As this model includes no physical recovery media, it's highly recommended to create a Windows reinstallation flash drive just in case using the recovery media creation tool included with your preinstalled Windows system.}}<br />
<br />
Due to the fact that there is no optical drive, you need to [[USB Installation Media|install Arch from USB stick]].<br />
<br />
The Arch install media will happily boot under UEFI, so it is recommended to disable legacy boot in the system setup utility. If legacy boot is needed for some reason, it does work fine as well.<br />
<br />
Booting using [[Gummiboot]] works perfectly. Again, if legacy boot is needed, [[GRUB]] is perfectly functional as well.<br />
<br />
== Hardware Configuration ==<br />
<br />
To fully support all hardware in X, one needs to ensure that the following driver packages are installed: <br />
<br />
*{{Pkg|xf86-input-synaptics}} (for the clickpad)<br />
*{{Pkg|xf86-input-wacom}} (for the digitisers)<br />
*{{Pkg|xf86-video-intel}} (for the GPU)<br />
<br />
Nearly everything works fine with no special configuration. The sensors (accelerometer, gyroscope, magnetometer, ambient light sensor) don't seem to be recognised yet.<br />
<br />
=== Bluetooth ===<br />
<br />
If the Broadcom USB device isn't showing up, you likely need to turn it on with {{ic|echo 1 > /sys/devices/platform/thinkpad_acpi/rfkill/rfkill0/state}}<br />
<br />
=== Digitisers ===<br />
<br />
The pen digitiser should be recognised by the wacom driver out of the box. The capacitive (touch) digitiser works with the same driver, but is not recognised as compatible by default. To fix this, add Atmel to the first MatchProduct entry in the wacom driver configuration file:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/50-wacom.conf|<br />
Section "InputClass"<br />
Identifier "Wacom class"<br />
MatchProduct "Wacom&#124;WACOM&#124;Hanwang&#124;PTK-540WL&#124;Atmel"<br />
MatchDevicePath "/dev/input/event*"<br />
Driver "wacom"<br />
EndSection<br />
}}<br />
<br />
Everything should work after a reboot.<br />
<br />
If you find yourself frustrated by the capacitive digitiser while trying to use the pen, you may have interest in the {{AUR|thinkpad-helix-utils}} package. It contains a script, {{ic|helix-toggle-touch}}, which will toggle the capacitive digitiser on and off with a simple command.<br />
<br />
=== Screen Rotation ===<br />
<br />
If you have both digitisers configured through the xf86-input-wacom driver, they will automatically rotate with the display and you can use a simple command like {{ic|xrandr --output eDP1 --rotate left}} to rotate the screen with ease.<br />
<br />
If you want to use the bezel buttons (or some other hotkey) to cycle through orientations (or toggle between two specific ones), {{ic|helix-rotate}}, also from from {{AUR|thinkpad-helix-utils}}, provides an easy-to-bind command that may serve your needs well.<br />
<br />
There is also [https://launchpad.net/magick-rotation/ Magick Rotation], which is supposed to automatically rotate the screen based on input events, but it only seems to respond to docking/undocking the tablet.</div>Ultraviolethttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_Helix&diff=323009Lenovo ThinkPad Helix2014-07-04T00:04:52Z<p>Ultraviolet: </p>
<hr />
<div>[[Category:Lenovo]]<br />
{| class="wikitable"<br />
|+ Hardware Information<br />
! Form Factor <br />
| Tablet/Ultrabook Convertible (detachable keyboard dock)<br />
|-<br />
! Display <br />
| 11.6" 1920x1080 LCD with Capacitive and Pen Digitisers<br />
|-<br />
! CPU <br />
| 3rd Generation (Ivy Bridge) Core i5-3427U or i7-3667U<br />
|-<br />
! RAM <br />
| 4GiB (i5) or 8GiB (i7) DDR3L RAM (dependent upon CPU)<br />
|-<br />
! Storage <br />
| 128/160/256GB mSATA SSD<br />
|-<br />
! WiFi <br />
| Intel Centrino Advanced-N 6205S mPCI WLAN<br />
|-<br />
! Bluetooth <br />
| Broadcom BCM20702 Bluetooth 4.0 (USB connected)<br />
|-<br />
! Camera <br />
| 5MP Rear and 2MP Front (also USB)<br />
|}<br />
<br />
== Installation ==<br />
<br />
{{Note|As this model includes no physical recovery media, it's highly recommended to create a Windows reinstallation flash drive just in case using the recovery media creation tool included with your preinstalled Windows system.}}<br />
<br />
Due to the fact that there is no optical drive, you need to [[USB Installation Media|install Arch from USB stick]].<br />
<br />
The Arch install media will happily boot under UEFI, so it is recommended to disable legacy boot in the system setup utility. If legacy boot is needed for some reason, it does work fine as well.<br />
<br />
Booting using [[Gummiboot]] works perfectly. Again, if legacy boot is needed, [[GRUB]] is perfectly functional as well.<br />
<br />
== Hardware Configuration ==<br />
<br />
To fully support all hardware in X, one needs to ensure that the following driver packages are installed: <br />
<br />
*{{Pkg|xf86-input-synaptics}} (for the clickpad)<br />
*{{Pkg|xf86-input-wacom}} (for the digitisers)<br />
*{{Pkg|xf86-video-intel}} (for the GPU)<br />
<br />
Nearly everything works fine with no special configuration. The sensors (accelerometer, gyroscope, magnetometer, ambient light sensor) don't seem to be recognised yet.<br />
<br />
=== Bluetooth ===<br />
<br />
If the Broadcom USB device isn't showing up, you likely need to turn it on with {{ic|echo 1 > /sys/devices/platform/thinkpad_acpi/rfkill/rfkill0/state}}<br />
<br />
=== Digitisers ===<br />
<br />
The pen digitiser should be recognised by the wacom driver out of the box. The capacitive (touch) digitiser works with the same driver, but is not recognised as compatible by default. To fix this, add Atmel to the first MatchProduct entry in the wacom driver configuration file:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/50-wacom.conf|<br />
Section "InputClass"<br />
Identifier "Wacom class"<br />
MatchProduct "Wacom&#124;WACOM&#124;Hanwang&#124;PTK-540WL&#124;Atmel"<br />
MatchDevicePath "/dev/input/event*"<br />
Driver "wacom"<br />
EndSection<br />
}}<br />
<br />
Everything should work after a reboot.<br />
<br />
If you find yourself frustrated by the capacitive digitiser while trying to use the pen, you may have interest in the {{AUR|thinkpad-helix-utils}} package. It contains a script, {{ic|helix-toggle-touch}}, which will toggle the capacitive digitiser on and off with a simple command.<br />
<br />
=== Screen Rotation ===<br />
<br />
If you have both digitisers configured through the xf86-input-wacom driver, they will automatically rotate with the display and you can use a simple command like {{ic|xrandr --output eDP1 --rotate left}} to rotate the screen with ease.<br />
<br />
There is also [https://launchpad.net/magick-rotation/ Magick Rotation], which is supposed to automatically rotate the screen based on input events, but it only seems to respond to docking/undocking the tablet.</div>Ultraviolethttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_Helix&diff=322656Lenovo ThinkPad Helix2014-07-02T03:00:11Z<p>Ultraviolet: </p>
<hr />
<div>[[Category:Lenovo]]<br />
{| class="wikitable"<br />
|+ Hardware Information<br />
! Form Factor <br />
| Tablet/Ultrabook Convertible (detachable keyboard dock)<br />
|-<br />
! Display <br />
| 11.6" 1920x1080 LCD with Capacitive and Pen Digitisers<br />
|-<br />
! CPU <br />
| 3rd Generation (Ivy Bridge) Core i5-3427U or i7-3667U<br />
|-<br />
! RAM <br />
| 4GiB (i5) or 8GiB (i7) DDR3L RAM (dependent upon CPU)<br />
|-<br />
! Storage <br />
| 128/160/256GB mSATA SSD<br />
|-<br />
! WiFi <br />
| Intel Centrino Advanced-N 6205S mPCI WLAN<br />
|-<br />
! Bluetooth <br />
| Broadcom BCM20702 Bluetooth 4.0 (USB connected)<br />
|-<br />
! Camera <br />
| 5MP Rear and 2MP Front (also USB)<br />
|}<br />
<br />
== Installation ==<br />
<br />
{{Note|As this model includes no physical recovery media, it's highly recommended to create a Windows reinstallation flash drive just in case using the recovery media creation tool included with your preinstalled Windows system.}}<br />
<br />
Due to the fact that there is no optical drive, you need to [[USB Installation Media|install Arch from USB stick]].<br />
<br />
The Arch install media will happily boot under UEFI, so it is recommended to disable legacy boot in the system setup utility. If legacy boot is needed for some reason, it does work fine as well.<br />
<br />
Booting using [[Gummiboot]] works perfectly. Again, if legacy boot is needed, [[GRUB]] is perfectly functional as well.<br />
<br />
== Hardware Configuration ==<br />
<br />
To fully support all hardware in X, one needs to ensure that the following driver packages are installed: <br />
<br />
*{{Pkg|xf86-input-synaptics}} (for the clickpad)<br />
*{{Pkg|xf86-input-wacom}} (for the digitisers)<br />
*{{Pkg|xf86-video-intel}} (for the GPU)<br />
<br />
Nearly everything works fine with no special configuration. The sensors (accelerometer, gyroscope, magnetometer, ambient light sensor) don't seem to be recognised yet.<br />
<br />
=== Digitisers ===<br />
<br />
The pen digitiser should be recognised by the wacom driver out of the box. The capacitive (touch) digitiser works with the same driver, but is not recognised as compatible by default. To fix this, add Atmel to the first MatchProduct entry in the wacom driver configuration file:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/50-wacom.conf|<br />
Section "InputClass"<br />
Identifier "Wacom class"<br />
MatchProduct "Wacom&#124;WACOM&#124;Hanwang&#124;PTK-540WL&#124;Atmel"<br />
MatchDevicePath "/dev/input/event*"<br />
Driver "wacom"<br />
EndSection<br />
}}<br />
<br />
Everything should work after a reboot.<br />
<br />
If you find yourself frustrated by the capacitive digitiser while trying to use the pen, you may have interest in the {{AUR|thinkpad-helix-utils}} package. It contains a script, {{ic|helix-toggle-touch}}, which will toggle the capacitive digitiser on and off with a simple command.<br />
<br />
=== Screen Rotation ===<br />
<br />
If you have both digitisers configured through the xf86-input-wacom driver, they will automatically rotate with the display and you can use a simple command like {{ic|xrandr --output eDP1 --rotate left}} to rotate the screen with ease.<br />
<br />
There is also [https://launchpad.net/magick-rotation/ Magick Rotation], which is supposed to automatically rotate the screen based on input events, but it only seems to respond to docking/undocking the tablet.<br />
<br />
=== Bluetooth ===<br />
<br />
If the Broadcom USB device isn't showing up, you likely need to turn it on with {{ic|echo 1 > /sys/devices/platform/thinkpad_acpi/rfkill/rfkill0/state}}</div>Ultraviolethttps://wiki.archlinux.org/index.php?title=Lenovo_Thinkpad_Helix&diff=322655Lenovo Thinkpad Helix2014-07-02T02:57:47Z<p>Ultraviolet: Ultraviolet moved page Lenovo Thinkpad Helix to Lenovo ThinkPad Helix: i care about capitalisation</p>
<hr />
<div>#REDIRECT [[Lenovo ThinkPad Helix]]</div>Ultraviolethttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_Helix&diff=322654Lenovo ThinkPad Helix2014-07-02T02:57:47Z<p>Ultraviolet: Ultraviolet moved page Lenovo Thinkpad Helix to Lenovo ThinkPad Helix: i care about capitalisation</p>
<hr />
<div>[[Category:Lenovo]]<br />
{| class="wikitable"<br />
|+ Hardware Information<br />
! Form Factor <br />
| Tablet/Ultrabook Convertible (detachable keyboard dock)<br />
|-<br />
! Display <br />
| 11.6" 1920x1080 LCD with Capacitive and Pen Digitisers<br />
|-<br />
! CPU <br />
| 3rd Generation (Ivy Bridge) Core i5-3427U or i7-3667U<br />
|-<br />
! RAM <br />
| 4GiB (i5) or 8GiB (i7) DDR3L RAM (dependent upon CPU)<br />
|-<br />
! Storage <br />
| 128/160/256GB mSATA SSD<br />
|-<br />
! WiFi <br />
| Intel Centrino Advanced-N 6205S mPCI WLAN<br />
|-<br />
! Bluetooth <br />
| Broadcom BCM20702 Bluetooth 4.0 (USB connected)<br />
|-<br />
! Camera <br />
| 5MP Rear and 2MP Front (also USB)<br />
|}<br />
<br />
== Installation ==<br />
<br />
{{Note|As this model includes no physical recovery media, it's highly recommended to create a Windows reinstallation flash drive just in case using the recovery media creation tool included with your preinstalled Windows system.}}<br />
<br />
Due to the fact that there is no optical drive, you need to [[USB Installation Media|install Arch from USB stick]].<br />
<br />
The Arch install media will happily boot under UEFI, so it is recommended to disable legacy boot in the system setup utility. If legacy boot is needed for some reason, it does work fine as well.<br />
<br />
Booting using [[Gummiboot]] works perfectly. Again, if legacy boot is needed, GRUB-BIOS is perfectly functional as well.<br />
<br />
== Hardware Configuration ==<br />
<br />
To fully support all hardware in X, one needs to ensure that the following driver packages are installed: <br />
<br />
*{{Pkg|xf86-input-synaptics}} (for the clickpad)<br />
*{{Pkg|xf86-input-wacom}} (for the digitisers)<br />
*{{Pkg|xf86-video-intel}} (for the GPU)<br />
<br />
Nearly everything works fine with no special configuration. The sensors (accelerometer, gyroscope, magnetometer, ambient light sensor) don't seem to be recognised yet.<br />
<br />
=== Digitisers ===<br />
<br />
The pen digitiser should be recognised by the wacom driver out of the box. The capacitive (touch) digitiser works with the same driver, but is not recognised as compatible by default. To fix this, add Atmel to the first MatchProduct entry in the wacom driver configuration file:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/50-wacom.conf|<br />
Section "InputClass"<br />
Identifier "Wacom class"<br />
MatchProduct "Wacom&#124;WACOM&#124;Hanwang&#124;PTK-540WL&#124;Atmel"<br />
MatchDevicePath "/dev/input/event*"<br />
Driver "wacom"<br />
EndSection<br />
}}<br />
<br />
Everything should work after a reboot.<br />
<br />
If you find yourself frustrated by the capacitive digitiser while trying to use the pen, you may have interest in the {{AUR|thinkpad-helix-utils}} package. It contains a script, {{ic|helix-toggle-touch}}, which will toggle the capacitive digitiser on and off with a simple command.<br />
<br />
=== Screen Rotation ===<br />
<br />
If you have both digitisers configured through the xf86-input-wacom driver, they will automatically rotate with the display and you can use a simple command like {{ic|xrandr --output eDP1 --rotate left}} to rotate the screen with ease.<br />
<br />
There is also [https://launchpad.net/magick-rotation/ Magick Rotation], which is supposed to automatically rotate the screen based on input events, but it only seems to respond to docking/undocking the tablet.<br />
<br />
=== Bluetooth ===<br />
<br />
If the Broadcom USB device isn't showing up, you likely need to turn it on with {{ic|echo 1 > /sys/devices/platform/thinkpad_acpi/rfkill/rfkill0/state}}</div>Ultraviolethttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_Helix&diff=322653Lenovo ThinkPad Helix2014-07-02T02:57:02Z<p>Ultraviolet: significant rewrite/update, i recently got this machine</p>
<hr />
<div>[[Category:Lenovo]]<br />
{| class="wikitable"<br />
|+ Hardware Information<br />
! Form Factor <br />
| Tablet/Ultrabook Convertible (detachable keyboard dock)<br />
|-<br />
! Display <br />
| 11.6" 1920x1080 LCD with Capacitive and Pen Digitisers<br />
|-<br />
! CPU <br />
| 3rd Generation (Ivy Bridge) Core i5-3427U or i7-3667U<br />
|-<br />
! RAM <br />
| 4GiB (i5) or 8GiB (i7) DDR3L RAM (dependent upon CPU)<br />
|-<br />
! Storage <br />
| 128/160/256GB mSATA SSD<br />
|-<br />
! WiFi <br />
| Intel Centrino Advanced-N 6205S mPCI WLAN<br />
|-<br />
! Bluetooth <br />
| Broadcom BCM20702 Bluetooth 4.0 (USB connected)<br />
|-<br />
! Camera <br />
| 5MP Rear and 2MP Front (also USB)<br />
|}<br />
<br />
== Installation ==<br />
<br />
{{Note|As this model includes no physical recovery media, it's highly recommended to create a Windows reinstallation flash drive just in case using the recovery media creation tool included with your preinstalled Windows system.}}<br />
<br />
Due to the fact that there is no optical drive, you need to [[USB Installation Media|install Arch from USB stick]].<br />
<br />
The Arch install media will happily boot under UEFI, so it is recommended to disable legacy boot in the system setup utility. If legacy boot is needed for some reason, it does work fine as well.<br />
<br />
Booting using [[Gummiboot]] works perfectly. Again, if legacy boot is needed, GRUB-BIOS is perfectly functional as well.<br />
<br />
== Hardware Configuration ==<br />
<br />
To fully support all hardware in X, one needs to ensure that the following driver packages are installed: <br />
<br />
*{{Pkg|xf86-input-synaptics}} (for the clickpad)<br />
*{{Pkg|xf86-input-wacom}} (for the digitisers)<br />
*{{Pkg|xf86-video-intel}} (for the GPU)<br />
<br />
Nearly everything works fine with no special configuration. The sensors (accelerometer, gyroscope, magnetometer, ambient light sensor) don't seem to be recognised yet.<br />
<br />
=== Digitisers ===<br />
<br />
The pen digitiser should be recognised by the wacom driver out of the box. The capacitive (touch) digitiser works with the same driver, but is not recognised as compatible by default. To fix this, add Atmel to the first MatchProduct entry in the wacom driver configuration file:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/50-wacom.conf|<br />
Section "InputClass"<br />
Identifier "Wacom class"<br />
MatchProduct "Wacom&#124;WACOM&#124;Hanwang&#124;PTK-540WL&#124;Atmel"<br />
MatchDevicePath "/dev/input/event*"<br />
Driver "wacom"<br />
EndSection<br />
}}<br />
<br />
Everything should work after a reboot.<br />
<br />
If you find yourself frustrated by the capacitive digitiser while trying to use the pen, you may have interest in the {{AUR|thinkpad-helix-utils}} package. It contains a script, {{ic|helix-toggle-touch}}, which will toggle the capacitive digitiser on and off with a simple command.<br />
<br />
=== Screen Rotation ===<br />
<br />
If you have both digitisers configured through the xf86-input-wacom driver, they will automatically rotate with the display and you can use a simple command like {{ic|xrandr --output eDP1 --rotate left}} to rotate the screen with ease.<br />
<br />
There is also [https://launchpad.net/magick-rotation/ Magick Rotation], which is supposed to automatically rotate the screen based on input events, but it only seems to respond to docking/undocking the tablet.<br />
<br />
=== Bluetooth ===<br />
<br />
If the Broadcom USB device isn't showing up, you likely need to turn it on with {{ic|echo 1 > /sys/devices/platform/thinkpad_acpi/rfkill/rfkill0/state}}</div>Ultraviolethttps://wiki.archlinux.org/index.php?title=Unofficial_user_repositories/Repo-ck&diff=271408Unofficial user repositories/Repo-ck2013-08-17T04:20:24Z<p>Ultraviolet: /* How to Determine Which CPU Optimized Package Set to Select */</p>
<hr />
<div>[[Category:Kernel]]<br />
{{Article summary start}}<br />
{{Article summary text|<br />
Article details setup and usage of an unofficial Arch Linux repo containing generic and CPU-optimized kernel and support packages containing the ck1 patchset featuring the Brain Fuck Scheduler by Con Kolivas.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Linux-ck}} - Main article.<br />
{{Article summary wiki|Linux-ck/Changelog}} - Linux-ck Changelog.<br />
{{Article summary link|Repo Statistics|http://repo-ck.com/stats.pdf}} - Popularity of packages, # of downloads, etc.<br />
{{Article summary end}}<br />
<br />
== Details ==<br />
The repo contains generic packages as well as CPU-specific packages for the linux-ck family. It also contains packages for {{AUR|chromium-scroll-pixels}} for each arch.<br />
<br />
{| class="wikitable" align="center"<br />
|-<br />
! CPU Type !! Package !! Details<br />
|-<br />
| rowspan="1" bgcolor=#e3f7e6| '''<span style="color: #409044;">Generic</span>'''<br />
| ''chromium-scroll-pixels'' || Current stable version of chromium browser patched to maintain the --scroll-pixel functionality allowing users to set the speed of their wheel mouse's scrolling functions.<br />
|-<br />
|}<br />
<br />
Many ARCH users are familiar with the concept of a generic kernel package. The official ARCH kernel is available in two flavors (either i686 or x86_64) which are ''generic'' packages in that i686 will work with ''any'' compatible x86 CPU and x86_64 will work with ''any'' compatible x86_64 CPU. Users have a choice between the corresponding generic linux-ck packages or CPU-specific and optimized linux-ck packages:<br />
<br />
{| class="wikitable" align="center"<br />
|-<br />
! CPU Type !! Group Alias !! Details<br />
|-<br />
| rowspan="1" bgcolor=#e3f7e6| '''<span style="color: #409044;">Generic</span>'''<br />
| ''ck-generic'' || Compiled with generic optimizations suitable for ''any'' compatible CPU just like the official ARCH linux package. This is true for both Intel and AMD processors.<br />
|-<br />
| rowspan="8" bgcolor=#e3ecf7| '''<span style="color: #2a6dc8;">Intel</span>'''<br />
| ''ck-atom'' || Intel Atom platform specific optimizations. Intel Atom CPUs have an in-order pipelining architecture and thus can benefit from accordingly optimized code.<br />
|- <br />
| ''ck-core2'' || Intel Core 2-family including Dual and Quads (Core 2/Newer Xeon/Mobile Celeron based on Core2).<br />
|- <br />
| ''ck-nehalem'' || Intel 1st Generation Core i3/i5/i7-family specific optimizations.<br />
|- <br />
| ''ck-sandybridge'' || Intel 2nd Generation Core i3/i5/i7-family specific optimizations.<br />
|- <br />
| ''ck-ivybridge'' || Intel 3rd Generation Core i3/i5/i7-family specific optimizations.<br />
|- <br />
| ''ck-haswell'' || Intel 4th Generation Core i3/i5/i7-family specific optimizations.<br />
|- <br />
| ''ck-p4'' || Intel Pentium-4 specific optimizations (P4/P4-based Celeron/Pentium-4 M/Older Xeon).<br />
|- <br />
| ''ck-pentm'' || Intel Pentium-M specific optimizations (Pentium-M notebook chips/not Pentium-4 M).<br />
|- <br />
| rowspan="6" bgcolor=#f7e3e3| '''<span style="color: #e62c2c;">AMD</span>'''<br />
| ''ck-kx'' || AMD K7/K8-family specific optimizations.<br />
|- <br />
| ''ck-k10'' || AMD K10-family specific optimizations including: 61xx Eight-Core Magny-Cours, Athlon X2 7x50, Phenom X3/X4/II, Athlon II X2/X3/X4, or Turion II-family processor.<br />
|- <br />
| ''ck-barcelona'' || CPUs based on AMD Family 10h cores with x86-64 instruction set support.<br />
|-<br />
|''ck-bobcat''|| CPUs based on AMD Family 14h cores with x86-64 instruction set support.<br />
|-<br />
|''ck-bulldozer''|| CPUs based on AMD Family 15h cores with x86-64 instruction set support.<br />
|-<br />
| ''ck-piledriver'' || CPUs based on AMD Family 15h cores with x86-64 instruction set support.<br />
|- <br />
|}<br />
<br />
CPU-specific optimization are invoked at compilation by selecting the corresponding option under '''Processor type and features>Processor family''' or by setting-up the .config file accordingly. These changes setup make specific gcc options including the $CFLAGS. <br />
<br />
{{Note|Repo packages include the BFQ I/O Scheduler compiled as a module. Read the [[#How_to_Enable_the_BFQ_I.2FO_Scheduler|section]] below for instructions to load it and enable it should you wish to do so.}}<br />
<br />
== Setup ==<br />
1) Add the following to {{ic|/etc/pacman.conf}} (I placed my entry at the bottom of the file):<br />
<br />
[repo-ck]<br />
Server = http://repo-ck.com/$arch<br />
<br />
To sign graysky's key, do the following:<br />
# pacman-key -r 5EE46C4C<br />
# pacman-key --lsign-key 5EE46C4C<br />
<br />
2) Refresh via <br />
# pacman -Syy<br />
<br />
That's it. To see the contents of the repo, just search as such:<br />
<br />
$ pacman -Sl repo-ck<br />
<br />
== Installation Examples ==<br />
Use the '''ck-X''' group and select the desired packages for installation. There are 6 groups corresponding to the 13 package sets: '''ck-generic, ck-atom, ck-core2, ck-nehalem, ck-sandybridge, ck-ivybridge, ck-haswell, ck-p4, ck-pentm, ck-kx, ck-k10, ck-barcelona, ck-bulldozer, ck-piledriver'''<br />
<br />
{{bc|1=# pacman -S ck-generic<br />
:: There are 7 members in group ck-generic:<br />
:: Repository repo-ck<br />
1) broadcom-wl-ck 2) linux-ck 3) linux-ck-headers 4) nvidia-304xx-ck 5) nvidia-ck<br />
6) virtualbox-ck-guest-modules 7) virtualbox-ck-host-modules<br />
<br />
Enter a selection (default=all):}}<br />
<br />
Alternatively, simply direct pacman to install the packages directly:<br />
# pacman -S linux-ck linux-ck-headers<br />
<br />
== How to Determine Which CPU Optimized Package Set to Select ==<br />
Users unsure which package set to use can always install the '''ck-generic''' group which will drive any compatible CPU. For those wanting CPU-specific optimized packages, run the following command (assuming that base-devel is installed):<br />
<br />
$ gcc -c -Q -march=native --help=target | grep march<br />
<br />
The resulting value is what gcc would use as the march CFLAG. Refer to the table below for a mapping of this value to the correct group.<br />
<br />
{| class="wikitable" align="center"<br />
|-<br />
! Brand !! Group !! March<br />
|-<br />
| rowspan="8" bgcolor=#e3ecf7| '''<span style="color: #2a6dc8;">Intel</span>'''<br />
| ''ck-atom'' || atom<br />
|- <br />
| ''ck-core2'' || core2<br />
|- <br />
| ''ck-nehalem'' || corei7<br />
|- <br />
| ''ck-sandybridge'' || corei7-avx<br />
|- <br />
| ''ck-ivybridge'' || core-avx-i<br />
|- <br />
| ''ck-haswell'' || core-avx2<br />
|- <br />
| ''ck-p4'' || pentium4, nocona<br />
|- <br />
| ''ck-pentm'' || pentm, pentium-m<br />
|- <br />
| rowspan="6" bgcolor=#f7e3e3| '''<span style="color: #e62c2c;">AMD</span>'''<br />
| ''ck-kx'' || athlon, athlon-4, athlon-tbird, athlon-mp, athlon-xp, k8-sse3<br />
|- <br />
| ''ck-k10'' || amdfam10<br />
|- <br />
| ''ck-barcelona'' || barcelona<br />
|-<br />
|''ck-bobcat''|| btver1<br />
|-<br />
|''ck-bulldozer''|| bdver1<br />
|-<br />
| ''ck-piledriver'' || bdver2<br />
|- <br />
|}<br />
<br />
{{Note|Users are encouraged to add additional entries to this table based on their experience.}}<br />
<br />
Additional links can be used to help determine which package set to select:<br />
<br />
*http://en.gentoo-wiki.com/wiki/Safe_Cflags/Intel<br />
*http://en.gentoo-wiki.com/wiki/Safe_Cflags/AMD<br />
*http://www.linuxforge.net/docs/linux/linux-gcc.php <br />
*http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html<br />
<br />
== How Much Faster Are the CPU Optimized Packages ==<br />
The answer is not ''that'' much faster. Extensive testing comparing the effect of gcc compile options on resulting binaries have been conducted by others with varying result from no change to rather significant speed ups.<br />
<br />
*[http://www.phoronix.com/scan.php?page=home phoronix labs]<br />
*[https://bbs.archlinux.org/viewtopic.php?id=154333 Kernel patch for more CPU families offers measurable speed increases].<br />
<br />
Readers are encouraged to add to this list.<br />
<br />
== How to Enable the BFQ I/O Scheduler ==<br />
Since release 3.0.4-2, the BFQ patchset is applied to the package by default. Users must enable the BFQ scheduler to use it; it is dormant by default.<br />
<br />
=== Globally (for all devices) ===<br />
<br />
Add {{ic|1=elevator=bfq}} to boot loader [[Kernel parameters]].<br />
{{Note|Users building the PKG from the AUR have an option in the PKGBUILD itself to globally use the BFQ as the default I/O scheduler.}}<br />
<br />
=== Selectively (for only specified devices) ===<br />
<br />
Direct the kernel to use it on a device-by-device basis. For example, to enable it for {{ic|/dev/sda}} simply:<br />
# echo bfq > /sys/block/sda/queue/scheduler<br />
<br />
To confirm, simply ''cat'' the same file:<br />
# cat /sys/block/sda/queue/scheduler<br />
noop deadline cfq [bfq] <br />
<br />
Setting this way will not survive a reboot. To make the change automatically at the next system boot, create the following tmpfile where "X" is the letter for the SSD device.<br />
<br />
{{hc| /etc/tmpfiles.d/set_IO_scheduler.conf |<nowiki><br />
w /sys/block/sdX/queue/scheduler - - - - noop<br />
</nowiki>}}<br />
<br />
== Package Trivia/Repo Statistics ==<br />
*Various package sets are compiled via a Bash wrapper script for makepkg. The script is publicly accessible at graysky's [https://github.com/graysky2/repo-ck github] repo.<br />
*Repo [http://repo-ck.com/stats.pdf statistics] are available (popularity of packages, which CPU is most popular, # of downloads, etc.).<br />
{{Note|The statistics are not updated daily but do give a snapshot of the data.}}<br />
<br />
== Troubleshooting ==<br />
=== Forum Support ===<br />
Please use [https://bbs.archlinux.org/viewtopic.php?id=111715 this discussion thread] to voice comments, questions, suggestions, requests, etc. Note from graysky, "I can add other CPU-specific builds upon request. I just wanna be sure people will actually use them if I take the time to compile them."</div>Ultraviolethttps://wiki.archlinux.org/index.php?title=Unofficial_user_repositories/Repo-ck&diff=252243Unofficial user repositories/Repo-ck2013-03-29T05:16:52Z<p>Ultraviolet: /* How to Determine Which CPU Optimized Package Set to Select */</p>
<hr />
<div>[[Category:Kernel]]<br />
{{Article summary start}}<br />
{{Article summary text|<br />
Article details setup and usage of an unofficial Arch Linux repo containing generic and CPU-optimized kernel and support packages containing the ck1 patchset featuring the Brain Fuck Scheduler by Con Kolivas.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Linux-ck}} - Main article.<br />
{{Article summary wiki|Linux-ck/Changelog}} - Linux-ck Changelog.<br />
{{Article summary wiki|http://repo-ck.com/stats.pdf Repo Statistics}} - Popularity of packages, # of downloads, etc.<br />
{{Article summary end}}<br />
<br />
== Details ==<br />
The repo contains generic packages as well as CPU-specific packages for the linux-ck family. It also contains packages for {{AUR|chromium-scroll-pixels}} for each arch.<br />
<br />
{| class="wikitable" align="center"<br />
|-<br />
! CPU Type !! Package !! Details<br />
|-<br />
| rowspan="1" bgcolor=#e3f7e6| '''<span style="color: #409044;">Generic</span>'''<br />
| ''chromium-scroll-pixels'' || Current stable version of chromium browser patched to maintain the --scroll-pixel functionality allowing users to set the speed of their wheel mouse's scrolling functions.<br />
|-<br />
|}<br />
<br />
Many ARCH users are familiar with the concept of a generic kernel package. The official ARCH kernel is available in two flavors (either i686 or x86_64) which are ''generic'' packages in that i686 will work with ''any'' compatible x86 CPU and x86_64 will work with ''any'' compatible x86_64 CPU. Users have a choice between the corresponding generic linux-ck packages or CPU-specific and optimized linux-ck packages:<br />
<br />
{| class="wikitable" align="center"<br />
|-<br />
! CPU Type !! Group Alias !! Details<br />
|-<br />
| rowspan="1" bgcolor=#e3f7e6| '''<span style="color: #409044;">Generic</span>'''<br />
| ''ck-generic'' || Compiled with generic optimizations suitable for ''any'' compatible CPU just like the official ARCH linux package. This is true for both Intel and AMD processors.<br />
|-<br />
| rowspan="7" bgcolor=#e3ecf7| '''<span style="color: #2a6dc8;">Intel</span>'''<br />
| ''ck-atom'' || Intel Atom platform specific optimizations. Intel Atom CPUs have an in-order pipelining architecture and thus can benefit from accordingly optimized code.<br />
|- <br />
| ''ck-core2'' || Intel Core 2-family including Dual and Quads (Core 2/Newer Xeon/Mobile Celeron based on Core2).<br />
|- <br />
| ''ck-nehalem'' || Intel 1st Generation Core i3/i5/i7-family specific optimizations.<br />
|- <br />
| ''ck-sandybridge'' || Intel 2nd Generation Core i3/i5/i7-family specific optimizations.<br />
|- <br />
| ''ck-ivybridge'' || Intel 3rd Generation Core i3/i5/i7-family specific optimizations.<br />
|- <br />
| ''ck-p4'' || Intel Pentium-4 specific optimizations (P4/P4-based Celeron/Pentium-4 M/Older Xeon).<br />
|- <br />
| ''ck-pentm'' || Intel Pentium-M specific optimizations (Pentium-M notebook chips/not Pentium-4 M).<br />
|- <br />
| rowspan="6" bgcolor=#f7e3e3| '''<span style="color: #e62c2c;">AMD</span>'''<br />
| ''ck-kx'' || AMD K7/K8-family specific optimizations.<br />
|- <br />
| ''ck-k10'' || AMD K10-family specific optimizations including: 61xx Eight-Core Magny-Cours, Athlon X2 7x50,P henom X3/X4/II, Athlon II X2/X3/X4, or Turion II-family processor.<br />
|- <br />
| ''ck-barcelona'' || CPUs based on AMD Family 10h cores with x86-64 instruction set support.<br />
|-<br />
|''ck-bobcat''|| CPUs based on AMD Family 14h cores with x86-64 instruction set support.<br />
|-<br />
|''ck-bulldozer''|| CPUs based on AMD Family 15h cores with x86-64 instruction set support.<br />
|-<br />
| ''ck-piledriver'' || CPUs based on AMD Family 15h cores with x86-64 instruction set support.<br />
|- <br />
|}<br />
<br />
CPU-specific optimization are invoked at compilation by selecting the corresponding option under '''Processor type and features>Processor family''' or by setting-up the .config file accordingly. These changes setup make specific gcc options including the $CFLAGS. <br />
<br />
{{Note|Repo packages include the BFQ I/O Scheduler compiled as a module. Read the [[#How_to_Enable_the_BFQ_I.2FO_Scheduler|section]] below for instructions to load it and enable it should you wish to do so.}}<br />
<br />
== Setup ==<br />
1) Add the following to {{ic|/etc/pacman.conf}} (I placed my entry at the bottom of the file):<br />
<br />
[repo-ck]<br />
SigLevel = PackageRequired<br />
Server = http://repo-ck.com/$arch<br />
<br />
To sign graysky's key, do the following:<br />
# pacman-key -r 5EE46C4C<br />
# pacman-key --lsign-key 5EE46C4C<br />
<br />
2) Refresh via <br />
# pacman -Syy<br />
<br />
That's it. To see the contents of the repo, just search as such:<br />
<br />
$ pacman -Sl repo-ck<br />
<br />
== Installation Examples ==<br />
Use the '''ck-X''' group and select the desired packages for installation. There are 6 groups corresponding to the 13 package sets: '''ck-generic, ck-atom, ck-core2, ck-nehalem, ck-sandybridge, ck-ivybridge, ck-p4, ck-pentm, ck-kx, ck-k10, ck-barcelona, ck-bulldozer, ck-piledriver'''<br />
<br />
{{bc|1=# pacman -S ck-generic<br />
:: There are 7 members in group ck-generic:<br />
:: Repository repo-ck<br />
1) broadcom-wl-ck 2) linux-ck 3) linux-ck-headers 4) nvidia-304xx-ck 5) nvidia-ck<br />
6) virtualbox-ck-guest-modules 7) virtualbox-ck-host-modules<br />
<br />
Enter a selection (default=all):}}<br />
<br />
Alternatively, simply direct pacman to install the packages directly:<br />
# pacman -S linux-ck linux-ck-headers<br />
<br />
== How to Determine Which CPU Optimized Package Set to Select ==<br />
Users unsure which package set to use can always install the '''ck-generic''' group which will drive any compatible CPU. For those wanting CPU-specific optimized packages, run the following command (assuming that base-devel is installed):<br />
<br />
$ gcc -c -Q -march=native --help=target | grep march<br />
<br />
The resulting value is what gcc would use as the march CFLAG. Refer to the table below for a mapping of this value to the correct group.<br />
<br />
{| class="wikitable" align="center"<br />
|-<br />
! Brand !! Group !! March<br />
|-<br />
| rowspan="7" bgcolor=#e3ecf7| '''<span style="color: #2a6dc8;">Intel</span>'''<br />
| ''ck-atom'' || atom<br />
|- <br />
| ''ck-core2'' || core2<br />
|- <br />
| ''ck-nehalem'' || corei7<br />
|- <br />
| ''ck-sandybridge'' || corei7-avx<br />
|- <br />
| ''ck-ivybridge'' || core-avx-i<br />
|- <br />
| ''ck-p4'' || pentium4, nocona<br />
|- <br />
| ''ck-pentm'' || pentm<br />
|- <br />
| rowspan="6" bgcolor=#f7e3e3| '''<span style="color: #e62c2c;">AMD</span>'''<br />
| ''ck-kx'' || athlon, athlon-4, athlon-tbird, athlon-mp, athlon-xp, k8-sse3<br />
|- <br />
| ''ck-k10'' || amdfam10<br />
|- <br />
| ''ck-barcelona'' || barcelona<br />
|-<br />
|''ck-bobcat''|| btver1<br />
|-<br />
|''ck-bulldozer''|| bdver1<br />
|-<br />
| ''ck-piledriver'' || bdver2<br />
|- <br />
|}<br />
<br />
{{Note|Users are encouraged to add additional entries to this table based on their experience.}}<br />
<br />
Additional links can be used to help determine which package set to select:<br />
<br />
*http://en.gentoo-wiki.com/wiki/Safe_Cflags/Intel<br />
*http://en.gentoo-wiki.com/wiki/Safe_Cflags/AMD<br />
*http://www.linuxforge.net/docs/linux/linux-gcc.php <br />
*http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html<br />
<br />
== How Much Faster Are the CPU Optimized Packages ==<br />
The answer is not ''that'' much faster. Extensive testing comparing the effect of gcc compile options on resulting binaries have been conducted by others with varying result from no change to rather significant speed ups.<br />
<br />
*[http://www.phoronix.com/scan.php?page=home phoronix labs]<br />
*[https://bbs.archlinux.org/viewtopic.php?id=154333 Kernel patch for more CPU families offers measurable speed increases].<br />
<br />
Readers are encouraged to add to this list.<br />
<br />
== How to Enable the BFQ I/O Scheduler ==<br />
Since release 3.0.4-2, the BFQ patchset is applied to the package by default. Users must enable the BFQ scheduler to use it; it is dormant by default.<br />
<br />
=== Globally (for all devices) ===<br />
<br />
Add {{ic|1=elevator=bfq}} to boot loader [[Kernel parameters]].<br />
{{Note|Users building the PKG from the AUR have an option in the PKGBUILD itself to globally use the BFQ as the default I/O scheduler.}}<br />
<br />
=== Selectively (for only specified devices) ===<br />
<br />
Direct the kernel to use it on a device-by-device basis. For example, to enable it for {{ic|/dev/sda}} simply:<br />
# echo bfq > /sys/block/sda/queue/scheduler<br />
<br />
To confirm, simply ''cat'' the same file:<br />
# cat /sys/block/sda/queue/scheduler<br />
noop deadline cfq [bfq] <br />
<br />
Setting this way will not survive a reboot. To make the change automatically at the next system boot, create the following tmpfile where "X" is the letter for the SSD device.<br />
<br />
{{hc| /etc/tmpfiles.d/set_IO_scheduler.conf |<nowiki><br />
w /sys/block/sdX/queue/scheduler - - - - noop<br />
</nowiki>}}<br />
<br />
== Package Trivia/Repo Statistics ==<br />
*Various package sets are compiled via a Bash wrapper script for makepkg. The script is publicly accessible at graysky's [https://github.com/graysky2/repo-ck github] repo.<br />
*Repo [http://repo-ck.com/stats.pdf statistics] are available (popularity of packages, which CPU is most popular, # of downloads, etc.).<br />
{{Note|The statistics are not updated daily but do give a snapshot of the data.}}<br />
<br />
== Troubleshooting ==<br />
=== Forum Support ===<br />
Please use [https://bbs.archlinux.org/viewtopic.php?id=111715 this discussion thread] to voice comments, questions, suggestions, requests, etc. Note from graysky, "I can add other CPU-specific builds upon request. I just wanna be sure people will actually use them if I take the time to compile them."</div>Ultraviolethttps://wiki.archlinux.org/index.php?title=Unofficial_user_repositories/Repo-ck&diff=252242Unofficial user repositories/Repo-ck2013-03-29T05:16:19Z<p>Ultraviolet: </p>
<hr />
<div>[[Category:Kernel]]<br />
{{Article summary start}}<br />
{{Article summary text|<br />
Article details setup and usage of an unofficial Arch Linux repo containing generic and CPU-optimized kernel and support packages containing the ck1 patchset featuring the Brain Fuck Scheduler by Con Kolivas.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Linux-ck}} - Main article.<br />
{{Article summary wiki|Linux-ck/Changelog}} - Linux-ck Changelog.<br />
{{Article summary wiki|http://repo-ck.com/stats.pdf Repo Statistics}} - Popularity of packages, # of downloads, etc.<br />
{{Article summary end}}<br />
<br />
== Details ==<br />
The repo contains generic packages as well as CPU-specific packages for the linux-ck family. It also contains packages for {{AUR|chromium-scroll-pixels}} for each arch.<br />
<br />
{| class="wikitable" align="center"<br />
|-<br />
! CPU Type !! Package !! Details<br />
|-<br />
| rowspan="1" bgcolor=#e3f7e6| '''<span style="color: #409044;">Generic</span>'''<br />
| ''chromium-scroll-pixels'' || Current stable version of chromium browser patched to maintain the --scroll-pixel functionality allowing users to set the speed of their wheel mouse's scrolling functions.<br />
|-<br />
|}<br />
<br />
Many ARCH users are familiar with the concept of a generic kernel package. The official ARCH kernel is available in two flavors (either i686 or x86_64) which are ''generic'' packages in that i686 will work with ''any'' compatible x86 CPU and x86_64 will work with ''any'' compatible x86_64 CPU. Users have a choice between the corresponding generic linux-ck packages or CPU-specific and optimized linux-ck packages:<br />
<br />
{| class="wikitable" align="center"<br />
|-<br />
! CPU Type !! Group Alias !! Details<br />
|-<br />
| rowspan="1" bgcolor=#e3f7e6| '''<span style="color: #409044;">Generic</span>'''<br />
| ''ck-generic'' || Compiled with generic optimizations suitable for ''any'' compatible CPU just like the official ARCH linux package. This is true for both Intel and AMD processors.<br />
|-<br />
| rowspan="7" bgcolor=#e3ecf7| '''<span style="color: #2a6dc8;">Intel</span>'''<br />
| ''ck-atom'' || Intel Atom platform specific optimizations. Intel Atom CPUs have an in-order pipelining architecture and thus can benefit from accordingly optimized code.<br />
|- <br />
| ''ck-core2'' || Intel Core 2-family including Dual and Quads (Core 2/Newer Xeon/Mobile Celeron based on Core2).<br />
|- <br />
| ''ck-nehalem'' || Intel 1st Generation Core i3/i5/i7-family specific optimizations.<br />
|- <br />
| ''ck-sandybridge'' || Intel 2nd Generation Core i3/i5/i7-family specific optimizations.<br />
|- <br />
| ''ck-ivybridge'' || Intel 3rd Generation Core i3/i5/i7-family specific optimizations.<br />
|- <br />
| ''ck-p4'' || Intel Pentium-4 specific optimizations (P4/P4-based Celeron/Pentium-4 M/Older Xeon).<br />
|- <br />
| ''ck-pentm'' || Intel Pentium-M specific optimizations (Pentium-M notebook chips/not Pentium-4 M).<br />
|- <br />
| rowspan="6" bgcolor=#f7e3e3| '''<span style="color: #e62c2c;">AMD</span>'''<br />
| ''ck-kx'' || AMD K7/K8-family specific optimizations.<br />
|- <br />
| ''ck-k10'' || AMD K10-family specific optimizations including: 61xx Eight-Core Magny-Cours, Athlon X2 7x50,P henom X3/X4/II, Athlon II X2/X3/X4, or Turion II-family processor.<br />
|- <br />
| ''ck-barcelona'' || CPUs based on AMD Family 10h cores with x86-64 instruction set support.<br />
|-<br />
|''ck-bobcat''|| CPUs based on AMD Family 14h cores with x86-64 instruction set support.<br />
|-<br />
|''ck-bulldozer''|| CPUs based on AMD Family 15h cores with x86-64 instruction set support.<br />
|-<br />
| ''ck-piledriver'' || CPUs based on AMD Family 15h cores with x86-64 instruction set support.<br />
|- <br />
|}<br />
<br />
CPU-specific optimization are invoked at compilation by selecting the corresponding option under '''Processor type and features>Processor family''' or by setting-up the .config file accordingly. These changes setup make specific gcc options including the $CFLAGS. <br />
<br />
{{Note|Repo packages include the BFQ I/O Scheduler compiled as a module. Read the [[#How_to_Enable_the_BFQ_I.2FO_Scheduler|section]] below for instructions to load it and enable it should you wish to do so.}}<br />
<br />
== Setup ==<br />
1) Add the following to {{ic|/etc/pacman.conf}} (I placed my entry at the bottom of the file):<br />
<br />
[repo-ck]<br />
SigLevel = PackageRequired<br />
Server = http://repo-ck.com/$arch<br />
<br />
To sign graysky's key, do the following:<br />
# pacman-key -r 5EE46C4C<br />
# pacman-key --lsign-key 5EE46C4C<br />
<br />
2) Refresh via <br />
# pacman -Syy<br />
<br />
That's it. To see the contents of the repo, just search as such:<br />
<br />
$ pacman -Sl repo-ck<br />
<br />
== Installation Examples ==<br />
Use the '''ck-X''' group and select the desired packages for installation. There are 6 groups corresponding to the 13 package sets: '''ck-generic, ck-atom, ck-core2, ck-nehalem, ck-sandybridge, ck-ivybridge, ck-p4, ck-pentm, ck-kx, ck-k10, ck-barcelona, ck-bulldozer, ck-piledriver'''<br />
<br />
{{bc|1=# pacman -S ck-generic<br />
:: There are 7 members in group ck-generic:<br />
:: Repository repo-ck<br />
1) broadcom-wl-ck 2) linux-ck 3) linux-ck-headers 4) nvidia-304xx-ck 5) nvidia-ck<br />
6) virtualbox-ck-guest-modules 7) virtualbox-ck-host-modules<br />
<br />
Enter a selection (default=all):}}<br />
<br />
Alternatively, simply direct pacman to install the packages directly:<br />
# pacman -S linux-ck linux-ck-headers<br />
<br />
== How to Determine Which CPU Optimized Package Set to Select ==<br />
Users unsure which package set to use can always install the '''ck-generic''' group which will drive any compatible CPU. For those wanting CPU-specific optimized packages, run the following command (assuming that base-devel is installed):<br />
<br />
$ gcc -c -Q -march=native --help=target | grep march<br />
<br />
The resulting value is what gcc would use as the march CFLAG. Refer to the table below for a mapping of this value to the correct group.<br />
<br />
{| class="wikitable" align="center"<br />
|-<br />
! Brand !! Group !! March<br />
|-<br />
| rowspan="7" bgcolor=#e3ecf7| '''<span style="color: #2a6dc8;">Intel</span>'''<br />
| ''ck-atom'' || atom<br />
|- <br />
| ''ck-core2'' || core2<br />
|- <br />
| ''ck-nehalem'' || corei7<br />
|- <br />
| ''ck-sandybridge'' || corei7-avx<br />
|- <br />
| ''ck-ivybridge'' || core-avx-i<br />
|- <br />
| ''ck-p4'' || pentium4<br />
|- <br />
| ''ck-pentm'' || pentm<br />
|- <br />
| rowspan="6" bgcolor=#f7e3e3| '''<span style="color: #e62c2c;">AMD</span>'''<br />
| ''ck-kx'' || athlon, athlon-4, athlon-tbird, athlon-mp, athlon-xp, k8-sse3<br />
|- <br />
| ''ck-k10'' || amdfam10<br />
|- <br />
| ''ck-barcelona'' || barcelona<br />
|-<br />
|''ck-bobcat''|| btver1<br />
|-<br />
|''ck-bulldozer''|| bdver1<br />
|-<br />
| ''ck-piledriver'' || bdver2<br />
|- <br />
|}<br />
<br />
{{Note|Users are encouraged to add additional entries to this table based on their experience.}}<br />
<br />
Additional links can be used to help determine which package set to select:<br />
<br />
*http://en.gentoo-wiki.com/wiki/Safe_Cflags/Intel<br />
*http://en.gentoo-wiki.com/wiki/Safe_Cflags/AMD<br />
*http://www.linuxforge.net/docs/linux/linux-gcc.php <br />
*http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html<br />
<br />
== How Much Faster Are the CPU Optimized Packages ==<br />
The answer is not ''that'' much faster. Extensive testing comparing the effect of gcc compile options on resulting binaries have been conducted by others with varying result from no change to rather significant speed ups.<br />
<br />
*[http://www.phoronix.com/scan.php?page=home phoronix labs]<br />
*[https://bbs.archlinux.org/viewtopic.php?id=154333 Kernel patch for more CPU families offers measurable speed increases].<br />
<br />
Readers are encouraged to add to this list.<br />
<br />
== How to Enable the BFQ I/O Scheduler ==<br />
Since release 3.0.4-2, the BFQ patchset is applied to the package by default. Users must enable the BFQ scheduler to use it; it is dormant by default.<br />
<br />
=== Globally (for all devices) ===<br />
<br />
Add {{ic|1=elevator=bfq}} to boot loader [[Kernel parameters]].<br />
{{Note|Users building the PKG from the AUR have an option in the PKGBUILD itself to globally use the BFQ as the default I/O scheduler.}}<br />
<br />
=== Selectively (for only specified devices) ===<br />
<br />
Direct the kernel to use it on a device-by-device basis. For example, to enable it for {{ic|/dev/sda}} simply:<br />
# echo bfq > /sys/block/sda/queue/scheduler<br />
<br />
To confirm, simply ''cat'' the same file:<br />
# cat /sys/block/sda/queue/scheduler<br />
noop deadline cfq [bfq] <br />
<br />
Setting this way will not survive a reboot. To make the change automatically at the next system boot, create the following tmpfile where "X" is the letter for the SSD device.<br />
<br />
{{hc| /etc/tmpfiles.d/set_IO_scheduler.conf |<nowiki><br />
w /sys/block/sdX/queue/scheduler - - - - noop<br />
</nowiki>}}<br />
<br />
== Package Trivia/Repo Statistics ==<br />
*Various package sets are compiled via a Bash wrapper script for makepkg. The script is publicly accessible at graysky's [https://github.com/graysky2/repo-ck github] repo.<br />
*Repo [http://repo-ck.com/stats.pdf statistics] are available (popularity of packages, which CPU is most popular, # of downloads, etc.).<br />
{{Note|The statistics are not updated daily but do give a snapshot of the data.}}<br />
<br />
== Troubleshooting ==<br />
=== Forum Support ===<br />
Please use [https://bbs.archlinux.org/viewtopic.php?id=111715 this discussion thread] to voice comments, questions, suggestions, requests, etc. Note from graysky, "I can add other CPU-specific builds upon request. I just wanna be sure people will actually use them if I take the time to compile them."</div>Ultraviolethttps://wiki.archlinux.org/index.php?title=Fprint&diff=224620Fprint2012-09-22T17:48:10Z<p>Ultraviolet: /* Installation */</p>
<hr />
<div>[[Category:Input devices]]<br />
[[bg:Fprint]]<br />
[[fa:Fprint]]<br />
{{out of date|Fprint is now in Extra repository, names of some commands are changed.}}<br />
From [http://reactivated.net/fprint/wiki/Pam_fprint Pam fprint - fprint project]:<br />
<br />
:''pam_fprint is a simple PAM module which uses libfprint's fingerprint processing and verification functionality for authentication. In other words, instead of seeing a password prompt, you're asked to scan your fingerprint.''<br />
<br />
The idea is to use the built-in fingerprint reader in some notebooks for login using PAM. This article will also explain how to use regular password for backup login method (solely fingerprint scanner is not recommended due to numerous reasons).<br />
<br />
== Prerequisites ==<br />
<br />
First, make sure you have one of the supported finger scanners. You can check if your device is supported by checking [http://www.thinkwiki.org/wiki/Integrated_Fingerprint_Reader this] list of supported devices. To check which one you have, type<br />
# lsusb<br />
<br />
You need to install '''pam''' and the '''fprint''' group.<br />
# pacman -S pam fprint<br />
<br />
== Installation ==<br />
<br />
Some dependencies:<br />
# pacman -S libusb imagemagick<br />
<br />
Once you made sure your reader is supported, you are good to go.<br />
<br />
== Configuration ==<br />
<br />
=== Permissions ===<br />
<br />
By default, only root has access to the device. You can create a signature from sudo, but then you can only use it for root user. The following solution from the Ubuntu forums may work for some people.<br />
<br />
1. If the group plugdev doesn't exist, create it<br />
# groupadd plugdev<br />
<br />
2. Add yourself to the group<br />
# gpasswd -a USER plugdev<br />
<br />
3. Allow USB access<br />
# chgrp -R plugdev /dev/bus/usb/<br />
<br />
=== Login configuration ===<br />
<br />
Modify the auth section of /etc/pam.d/login to this<br />
auth required pam_env.so<br />
auth sufficient pam_fprintd.so<br />
auth sufficient pam_unix.so try_first_pass likeauth nullok<br />
auth required pam_deny.so<br />
<br />
This tries to use fingerprint login first, and if if fails or if it finds no fingerprint signatures in the give user's home directory, it proceeds to password login.<br />
<br />
You can also modify other files in /etc/pam.d/ using the same method, for example /etc/pam.d/gdm for GNOME's fingerprint login or /etc/pam.d/polkit-1 for GNOME PolicyKit Authentication.<br />
<br />
=== Create fingeprint signature ===<br />
<br />
Now you should be able to run the program under a normal user. To see the usage, run<br />
$ pam_fprint_enroll --help<br />
Chose one of the fingers and run <br />
$ pam_fprint_enroll -f #<br />
You will be asked to scan the given finger 3 times. After that, the signature is created in your home directory.<br />
<br />
== Setup fingerprint-gui ==<br />
<br />
An alternate fingerprint reader gui.<br />
This works with libfprint-unstable which has support for the new Upeksonly readers, such as,<br />
the new Thinkpad W510 T510 T410 T420 Upeksonly reader with USB ID 147e:2016<br />
<br />
http://www.thinkwiki.org/wiki/Integrated_Fingerprint_Reader<br />
<br />
http://www.n-view.net/Appliance/fingerprint/<br />
<br />
Install a dependency:<br />
$ pacman -S libfakekey<br />
<br />
Install fingerprint-gui from AUR<br />
$ yaourt -S fingerprint-gui<br />
<br />
Please make sure your user is a member of "plugdev" and "scanner" group if you use UPEK non-free library. You may also have to log out and back in for these changes to take effect.<br />
# gpasswd -a USER plugdev<br />
# gpasswd -a USER scanner<br />
<br />
fingerprint-polkit-agent conflicts with files in /etc/xdg/autostart that must<br />
be removed:<br />
"polkit-gnome-authentication-agent-1.desktop" and<br />
"polkit-kde-authentication-agent-1.desktop".<br />
<br />
Edit your PAM configuration<br />
(e.g., /etc/pam.d/{login,su,sudo,gdm}).<br />
<br />
Change the auth section to read<br />
<br />
auth required pam_env.so<br />
auth sufficient pam_fingerprint-gui.so<br />
auth sufficient pam_unix.so try_first_pass likeauth nullok<br />
auth required pam_deny.so<br />
<br />
Add this to your ~/.bashrc file if you get an error saying that it can't connect to X desktop.<br />
xhost + &><br />
<br />
Now run fingerprint-gui and register fingerprints for the current user. You will need to run fingerprint-gui and register fingerprints as all users you want to use the fingerprint reader, i.e. as root to use it for "su" login.</div>Ultraviolethttps://wiki.archlinux.org/index.php?title=Dynamic_DNS&diff=213423Dynamic DNS2012-07-17T23:07:24Z<p>Ultraviolet: Updated to reflect improvements in script/pkgbuild.</p>
<hr />
<div>[[Category:Domain Name System]]<br />
{{Article summary start|Summary}}<br />
{{Article summary text|Setting up Dynamic DNS for Homeservers}}<br />
{{Article summary end}}<br />
<br />
'''DDNS, Dynamic DNS or DynDNS''' is a service which offers operators of homeservers the possibility to have an URL which does not change when the provider changes the servers public IP-Address.<br />
<br />
==Router or Server?==<br />
Most (home) routers offer connecting to different DDNS Services. But the offered lists are limited to serveal services which are most likely not free. If the Router supports a free service, or you are willing to pay or donate for a service, you should do this, it is faster and more reliable.<br />
In that case, there is no need to use a softwareside solution.<br />
<br />
{{Warning|You should definetly set up NAT on your router or a firewall on your PC and do everything to secure your network and computers.}}<br />
<br />
==Setting up DDNS==<br />
===Service===<br />
[http://FreeDNS.afraid.org FreeDNS.afraid.org] is a free Service which is easy and uncomplicated to set up.<br><br />
<br />
===Software===<br />
After signing up there, install {{AUR|afraid-dyndns-uv}}, available in the [[Arch User Repository]]. It updates the IP.<br />
<br />
===Configuration===<br />
After building and installing the package, configuration of {{ic|/usr/bin/afraid-dyndns-uv}} (which is a perl script) is necessary.<br />
<br />
Locate the Lines<br />
{{bc|1=<br />
$afraid = "http://freedns.afraid.org/api/?action=getdyndns&sha=%s&style=xml";<br />
$CACHEDIR = "/var/cache/afraid-dyndns/IP"; # set cache directory<br />
$HASH = "<your_hash>"; # account hash for authentication<br />
}}<br />
Get the Hashcode:<br />
*Visit [http://freedns.afraid.org/api/ http://freedns.afraid.org/api/] and log in.<br />
*Copy the shasum from the URL which points to the XML or ASCII API<br />
*Replace "<your_hash>" in {{ic|/usr/bin/afraid-dyndns-uv}} with the shasum from the url<br />
<br />
===Automatic Update===<br />
The last step is to add this line to your crontab:<br />
{{bc|*,5 * * * * afraid-dyndns-uv}}<br />
It will update the IP every 5 Minutes.</div>Ultraviolet