https://wiki.archlinux.org/api.php?action=feedcontributions&user=Ratcheer&feedformat=atomArchWiki - User contributions [en]2024-03-29T12:43:23ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Talk:Dracut&diff=586449Talk:Dracut2019-10-17T18:09:02Z<p>Ratcheer: </p>
<hr />
<div>== Draft ==<br />
<br />
I have written a draft proposal here: https://wiki.archlinux.org/index.php/User:Krathalan<br />
<br />
[[User:Krathalan|Krathalan]] ([[User talk:Krathalan|talk]]) 00:16, 7 October 2019 (UTC)<br />
<br />
''[Moved from [[User talk:Krathalan#dracut draft]]. -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 06:02, 9 October 2019 (UTC)]''<br />
<br />
:This is great: thanks! Apart from changing the comment about it being unsupported, I would consider this good to go. [[User:Jasonwryan|Jasonwryan]] ([[User talk:Jasonwryan|talk]]) 23:32, 6 October 2019 (UTC)<br />
<br />
:The page looks good, I'm working on the dracut and mkinitcpio hooks, you can also suggest users to remove mkinitcpio after installing and testing dracut, since the kernel now depends on initramfs. [[User:Grazzolini|Grazzolini]] ([[User talk:Grazzolini|talk]]) 01:41, 9 October 2019 (UTC)</div>Ratcheerhttps://wiki.archlinux.org/index.php?title=Talk:Dracut&diff=586448Talk:Dracut2019-10-17T18:06:59Z<p>Ratcheer: /* Draft */</p>
<hr />
<div>== Draft ==<br />
<br />
I have written a draft proposal here: https://wiki.archlinux.org/index.php/User:Krathalan<br />
<br />
[[User:Krathalan|Krathalan]] ([[User talk:Krathalan|talk]]) 00:16, 7 October 2019 (UTC)<br />
<br />
''[Moved from [[User talk:Krathalan#dracut draft]]. -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 06:02, 9 October 2019 (UTC)]''<br />
<br />
:This is great: thanks! Apart from changing the comment about it being unsupported, I would consider this good to go. [[User:Jasonwryan|Jasonwryan]] ([[User talk:Jasonwryan|talk]]) 23:32, 6 October 2019 (UTC)<br />
<br />
:The page looks good, I'm working on the dracut and mkinitcpio hooks, you can also suggest users to remove mkinitcpio after installing and testing dracut, since the kernel now depends on initramfs. [[User:Grazzolini|Grazzolini]] ([[User talk:Grazzolini|talk]]) 01:41, 9 October 2019 (UTC)<br />
<br />
:Should something be added about removing/renaming 90-linux.hook after removing mkinitcpio? [[User:Ratcheer|Tim Cuthbertson (ratcheer)]] ([[User talk:Ratcheer|talk]]) 18:06, 17 October 2019 (UTC)</div>Ratcheerhttps://wiki.archlinux.org/index.php?title=Pacman/Rosetta&diff=346731Pacman/Rosetta2014-11-27T16:39:40Z<p>Ratcheer: Added SUSE zypper command to lock a package</p>
<hr />
<div>[[Category:Package management]]<br />
[[es:Pacman Rosetta]]<br />
[[ja:Pacman Rosetta]]<br />
[[sr:Pacman Rosetta]]<br />
[[zh-CN:Pacman Rosetta]]<br />
This page pulls heavily from [http://old-en.opensuse.org/Software_Management_Command_Line_Comparison openSUSE's Software Management Command Line Comparison]. It has been simplified and has added Arch to the comparison, as well as modified the order in which each distribution exists for the benefit of Arch users.<br />
<br />
Users from other Linux distributions can benefit from pacman by using a simple wrapper: [https://github.com/icy/pacapt pacapt]. The script could also be intended for Arch users having to temporarily deal with another distribution.<br />
<br />
[https://github.com/icy/pacapt pacapt] is a pacman shell script implementation for other linux distribution.<br />
<br />
{{Note|<br />
* Some of the tools described here are specific to a certain version of pacman. The -Qk option is new in pacman 4.1.<br />
* The command {{ic|pkgfile}} can be found in the {{Pkg|pkgfile}} package.<br />
}}<br />
{|<br />
| align="center" style="background:#f0f0f0;"|'''<font color="#707070">Action</font>'''<br />
| align="center" style="background:#f0f0f0;"|'''Arch'''<br />
| align="center" style="background:#f0f0f0;"|'''Red Hat/Fedora'''<br />
| align="center" style="background:#f0f0f0;"|'''Debian/Ubuntu'''<br />
| align="center" style="background:#f0f0f0;"|'''SUSE/openSUSE'''<br />
| align="center" style="background:#f0f0f0;"|'''Gentoo'''<br />
|-<br />
| Install a package(s) by name ||pacman -S||yum install ||apt-get install||zypper install zypper in|| emerge [-a]<br />
|- style="background:#e4e4e4"<br />
| Remove a package(s) by name ||pacman -Rc||yum remove/erase ||apt-get remove||zypper remove zypper rm ||emerge -C<br />
|-<br />
| Search for package(s) by searching the expression in name, description, short description. What exact fields are being searched by default varies in each tool. Mostly options bring tools on par. ||pacman -Ss||yum search ||apt-cache search||zypper search zypper se [-s]||emerge -S <br />
|- style="background:#e4e4e4"<br />
| Upgrade Packages - Install packages which have an older version already installed ||pacman -Syu||yum update ||apt-get upgrade||zypper update zypper up||emerge -u world<br />
|-<br />
| Upgrade Packages - Another form of the update command, which can perform more complex updates -- like distribution upgrades. When the usual update command will omit package updates, which include changes in dependencies, this command can perform those updates. ||pacman -Syu||yum distro-sync ||apt-get dist-upgrade||zypper dup||emerge -uDN world<br />
|- style="background:#e4e4e4"<br />
| Reinstall given Package - Will reinstall the given package without dependency hassle. ||pacman -S||yum reinstall||apt-get install --reinstall||zypper install --force||emerge [-a]<br />
|-<br />
| Installs local package file, e.g. app.rpm and uses the installation sources to resolve dependencies ||pacman -U||yum localinstall ||dpkg -i && apt-get install -f||zypper in /path/to/local.rpm||emerge<br />
|- style="background:#e4e4e4"<br />
| Updates package(s) with local packages and uses the installation sources to resolve dependencies ||pacman -U||yum localupdate ||n/a||emerge||<br />
|-<br />
| Use some magic to fix broken dependencies in a system || pacman dep level - testdb, shared lib level - findbrokenpkgs or lddd||package-cleanup --problems||apt-get --fix-broken / aptitude install||zypper verify ||revdep-rebuild<br />
|- style="background:#e4e4e4"<br />
| Only downloads the given package(s) without unpacking or installing them ||pacman -Sw||yumdownloader (found in yum-utils package)||apt-get --download-only / aptitude download|| zypper --download-only ||emerge --fetchonly <br />
|-<br />
| Remove dependencies that are no longer needed, because e.g. the package which needed the dependencies was removed. ||<nowiki>pacman -Qdtq | pacman -Rs -</nowiki>||yum autoremove||apt-get autoremove ||zypper rm -u||emerge --depclean <br />
|- style="background:#e4e4e4"<br />
| Downloads the corresponding source package(s) to the given package name(s) || Use [[ABS]] && makepkg -o ||yumdownloader --source||apt-get source / debcheckout||zypper source-install||emerge --fetchonly<br />
|- style="background:#e4e4e4"<br />
| Remove packages no longer included in any repositories. ||||package-cleanup --orphans||||||<br />
|-<br />
| Install/Remove packages to satisfy build-dependencies. Uses information in the source package. ||automatic||yum-builddep||apt-get build-dep ||zypper si -d||emerge -o <br />
|- style="background:#e4e4e4"<br />
| Add a package lock rule to keep its current state from being changed ||${EDITOR} /etc/pacman.conf<br/>modify IgnorePkg array||yum.conf <--”exclude” option (add/amend)||<nowiki>echo "$PKGNAME hold" | dpkg --set-selections</nowiki>||Put package name in /etc/zypp/locks, or zypper al||/etc/portage/package.mask<br />
|-<br />
| Delete a package lock rule ||remove package from IgnorePkg line in /etc/pacman.conf||yum.conf <--”exclude” option (remove/amend)||<nowiki>echo "$PKGNAME install" | dpkg --set-selections</nowiki> ||Remove package name from /etc/zypp/locks||/etc/portage/package.mask (or package.unmask) <br />
|- style="background:#e4e4e4"<br />
| Show a listing of all lock rules ||cat /etc/pacman.conf||yum.conf (research needed)||/etc/apt/preferences ||View /etc/zypp/locks||cat /etc/portage/package.mask<br />
|-<br />
| Add a checkpoint to the package system for later rollback ||||(unnecessary, done on every transaction)||||n/a ||<br />
|- style="background:#e4e4e4"<br />
| Remove a checkpoint from the system ||N/A||N/A||||n/a ||<br />
|-<br />
| Provide a list of all system checkpoints ||N/A||yum history list||||n/a ||<br />
|- style="background:#e4e4e4"<br />
| Rolls entire packages back to a certain date or checkpoint. ||N/A||yum history rollback||||n/a ||<br />
|-<br />
|- <br />
| Undo a single specified transaction. ||N/A||yum history undo||||n/a||||<br />
|- style="background:#e4e4e4"<br />
| Mark a package previously installed as a dependency as explicitly required. ||pacman -D --asexplicit||||aptitude unmarkauto||||emerge --select <br />
|- <br />
| Install package(s) as dependency / without marking as explicitly required. ||pacman -S --asdeps||||||||emerge -1<br />
| ||||||||||<br />
|-<br />
| ||||||||||<br />
|-<br />
| '''''Package information management''''' ||||||||||<br />
|- style="background:#e4e4e4"<br />
| Get a dump of the whole system information - Prints, Saves or similar the current state of the package management system. Preferred output is text or XML. (Note: Why either-or here? No tool offers the option to choose the output format.) ||(see /var/lib/pacman/local)||(see /var/lib/rpm/Packages)||apt-cache stats||n/a ||emerge --info<br />
|-<br />
| Show all or most information about a package. The tools' verbosity for the default command vary. But with options, the tools are on par with each other. ||pacman -[S<nowiki>|</nowiki>Q]i ||yum list or info ||apt-cache show / apt-cache policy||zypper info zypper if||emerge -S; emerge -pv; eix<br />
|- style="background:#e4e4e4"<br />
| Search for package(s) by searching the expression in name, description, short description. What exact fields are being searched by default varies in each tool. Mostly options bring tools on par. ||pacman -Ss ||yum search ||apt-cache search||zypper search zypper se [-s]||emerge -S <br />
|-<br />
| Lists packages which have an update available. Note: Some provide special commands to limit the output to certain installation sources, others use options. ||pacman -Qu ||yum list updates yum check-update ||apt-get upgrade -> n||zypper list-updates zypper patch-check (just for patches) ||emerge -uDNp world<br />
|- style="background:#e4e4e4"<br />
| Display a list of all packages in all installation sources that are handled by the packages management. Some tools provide options or additional commands to limit the output to a specific installation source. ||pacman -Sl ||yum list available||apt-cache dumpavail apt-cache dump (Cache only) apt-cache pkgnames||zypper packages ||emerge -ep world<br />
|-<br />
| Displays packages which provide the given exp. aka reverse provides. Mainly a shortcut to search a specific field. Other tools might offer this functionality through the search command. ||pkgfile <filename>||yum provides / yum whatprovides ||apt-file search <filename>||zypper what-provides zypper wp|| equery belongs (only installed packages); pfl<br />
|- style="background:#e4e4e4"<br />
| Display packages which require X to be installed, aka show reverse/ dependencies.||pacman -Sii||yum resolvedep ||apt-cache rdepends / aptitude search ~Dpattern||IN PROGRESS || equery depends<br />
|-<br />
| Display packages which conflict with given expression (often package). Search can be used as well to mimic this function.||(none)||repoquery --whatconflicts||aptitude search '~Cpattern'||IN PROGRESS ||<br />
|- style="background:#e4e4e4"<br />
| List all packages which are required for the given package, aka show dependencies. ||pacman -[S<nowiki>|</nowiki>Q]i||yum deplist ||apt-cache depends / apt-cache show||IN PROGRESS || emerge -ep<br />
|-<br />
| List what the current package provides ||||yum provides ||||IN PROGRESS||equery files<br />
|- style="background:#e4e4e4"<br />
| List the files that the package holds. Again, this functionality can be mimicked by other more complex commands. ||pacman -Ql $pkgname <br/>pkgfile -l ||repoquery -l $pkgname ||dpkg-query -L $pkgname ||IN PROGRESS ||equery files<br />
|-<br />
| List all packages that require a particular package ||||repoquery --whatrequires [--recursive]||||||equery depends -a<br />
|- style="background:#e4e4e4"<br />
| Search all packages to find the one which holds the specified file. auto-apt is using this functionality. ||pkgfile -s||yum provides / yum whatprovides ||apt-file search||IN PROGRESS ||equery belongs<br />
|- style="background:#e4e4e4"<br />
| Display all packages that the specified packages obsoletes. ||||yum list obsoletes ||apt-cache show||IN PROGRESS|| <br />
|-<br />
| Verify dependencies of the complete system. Used if installation process was forcefully killed. ||testdb||yum deplist ||apt-get check||n/a || emerge -uDN world<br />
|- style="background:#e4e4e4"<br />
| Generates a list of installed packages || pacman -Q || yum list installed || dpkg --get-selections || zypper ||emerge -ep world<br />
|-<br />
| List packages that are installed but are not available in any installation source (anymore). ||pacman -Qm||yum list extras || deborphan || |zypper se -si | grep 'System Packages'||eix-test-obsolete<br />
|- style="background:#e4e4e4"<br />
| List packages that were recently added to one of the installation sources, i.e. which are new to it. ||(none)||yum list recent ||aptitude search '~N' / aptitude forget-new||n/a||eix-diff<br />
|-<br />
| Show a log of actions taken by the software management. ||cat /var/log/pacman.log ||yum history cat /var/log/yum.log||cat /var/log/dpkg.log||cat /var/log/zypp/history || located in /var/log/portage<br />
|- style="background:#e4e4e4"<br />
| Clean up all local caches. Options might limit what is actually cleaned. Autoclean removes only unneeded, obsolete information. ||pacman -Sc<br/>pacman -Scc ||yum clean all ||apt-get clean / apt-get autoclean / aptitude clean|| zypper clean || eclean distfiles<br />
|-<br />
| Add a local package to the local package cache mostly for debugging purposes. ||cp $pkgname /var/cache/pacman/pkg/||||apt-cache add ||n/a || cp $srcfile /usr/portage/distfiles<br />
|- style="background:#e4e4e4"<br />
| Display the source package to the given package name(s) ||||repoquery -s||apt-cache showsrc ||n/a||<br />
|-<br />
| Generates an output suitable for processing with dotty for the given package(s). ||||||apt-cache dotty ||n/a ||<br />
|- style="background:#e4e4e4"<br />
| Set the priority of the given package to avoid upgrade, force downgrade or to overwrite any default behavior. Can also be used to prefer a package version from a certain installation source. ||${EDITOR} /etc/pacman.conf<br/>Modify HoldPkg and/or IgnorePkg arrays||yum-plugin-priorities and yum-plugin-protect-packages||/etc/apt/preferences, apt-cache policy|| zypper mr -p || ${EDITOR} /etc/portage/package.keywords<br/>Add a line with =category/package-version<br />
|-<br />
| Remove a previously set priority ||||||/etc/apt/preferences ||zypper mr -p || ${EDITOR} /etc/portage/package.keywords<br/>remove offending line<br />
|- style="background:#e4e4e4"<br />
| Show a list of set priorities. ||||||apt-cache policy /etc/apt/preferences ||n/a || cat /etc/portage/package.keywords<br />
|-<br />
| Ignores problems that priorities may trigger. ||||||||n/a ||<br />
|-<br />
| ||||||||||<br />
|-<br />
| ||||||||||<br />
|- style="background:#e4e4e4"<br />
| Installation sources management ||${EDITOR} /etc/pacman.conf||${EDITOR} /etc/yum.repos.d/${REPO}.repo||${EDITOR} /etc/apt/sources.list|| ||layman<br />
|-<br />
| Add an installation source to the system. Some tools provide additional commands for certain sources, others allow all types of source URI for the add command. Again others, like apt and yum force editing a sources list. apt-cdrom is a special command, which offers special options design for CDs/DVDs as source. ||${EDITOR} /etc/pacman.conf||${EDITOR} /etc/yum.repos.d/${REPO}.repo||apt-cdrom add||zypper service-add ||layman, overlays<br />
|- style="background:#e4e4e4"<br />
| Refresh the information about the specified installation source(s) or all installation sources. ||pacman -Sy ||yum clean expire-cache && yum check-update ||apt-get update||zypper refresh zypper ref||layman -f<br />
|-<br />
| Prints a list of all installation sources including important information like URI, alias etc. ||cat /etc/pacman.d/mirrorlist||cat /etc/yum.repos.d/*||||zypper service-list ||layman -l<br />
|- style="background:#e4e4e4"<br />
| Disable an installation source for an operation ||||yum --disablerepo=${REPO}||||||emerge package::repo-to-use<br />
|- <br />
| Download packages from a different version of the distribution than the one installed. ||||yum --releasever=${VERSION} ||apt-get install -t release package/ apt-get install package/release (deps not covered)||||echo "category/package ~amd64" >> /etc/portage/package.keywords && emerge package<br />
|- style="background:#e4e4e4"<br />
| '''''Other commands''''' ||||||||||<br />
|-<br />
| Start a shell to enter multiple commands in one session ||||yum shell ||apt-config shell||zypper shell ||<br />
|-<br />
| ||||||||||<br />
|-<br />
| ||||||||||<br />
|- style="background:#e4e4e4"<br />
| '''''Package Verification'''''||||||||||<br />
|-<br />
| Single package||pacman -Qk[k] <package>||rpm -V <package>||debsums||rpm -V <package>||equery check<br />
|- style="background:#e4e4e4"<br />
| All packages||pacman -Qk[k]||rpm -Va||debsums||rpm -Va||equery check<br />
|-<br />
| ||||||||||<br />
|-<br />
| ||||||||||<br />
|-<br />
| '''''Package Querying'''''||||||||||<br />
|- style="background:#e4e4e4"<br />
| List installed local packages along with version||pacman -Q||rpm -qa||dpkg -l||||emerge -e world<br />
|-<br />
| Display local package information: Name, version, description, etc.||pacman -Qi ||rpm -qi ||dpkg -s||||emerge -pv and emerge -S<br />
|- style="background:#e4e4e4"<br />
| Display remote package information: Name, version, description, etc.||pacman -Si ||yum info ||apt-cache show / aptitude show||||emerge -pv and emerge -S<br />
|- <br />
| Display files provided by local package||pacman -Ql ||rpm -ql||dpkg -L||||equery files<br />
|- style="background:#e4e4e4"<br />
| Display files provided by a remote package||pkgfile -l||repoquery -l||||||pfl<br />
|- <br />
| Query the package which provides FILE ||pacman -Qo ||rpm -qf (installed only) or yum whatprovides (everything) ||dpkg -S/dlocate||||equery belongs<br />
|- style="background:#e4e4e4"<br />
| Query a package supplied on the command line rather than an entry in the package management database||pacman -Qp||rpm -qp||dpkg -I||||<br />
|-<br />
| Show the changelog of a package||pacman -Qc||rpm -q --changelog||apt-get changelog|||||equery changes -f<br />
|- style="background:#e4e4e4"<br />
| Search locally installed package for names or descriptions ||pacman -Qs|| ||aptitude search <nowiki>'~i(~nexpr|~dexpr)'</nowiki>|||||eix -S -I<br />
|-<br />
| List packages not required by any other package||pacman -Qt||package-cleanup --all --leaves||deborphan -anp1||||<br />
|-<br />
| ||||||||||<br />
|-<br />
| '''''Building Packages'''''||||||||||<br />
|- style="background:#e4e4e4"<br />
| Build a package||makepkg -s||rpmbuild -ba (normal) mock (in chroot)||debuild||rpmbuild -ba ||ebuild; quickpkg<br />
|-<br />
| Check for possible packaging issues||namcap||rpmlint ||lintian||||repoman<br />
|- style="background:#e4e4e4"<br />
| List the contents of a package file||pacman -Qpl <file>||rpmls rpm -qpl||dpkg -c||rpm -qpl||<br />
|-<br />
| Extract a package ||tar -Jxvf||<nowiki>rpm2cpio | cpio -vid</nowiki>||<nowiki>ar vx | tar -zxvf data.tar.gz</nowiki>||<nowiki>rpm2cpio | cpio -vid</nowiki>||tar -jxvf<br />
|- style="background:#e4e4e4"<br />
| Query a package supplied on the command line rather than an entry in the package management database||pacman -Qp||rpm -qp||dpkg -I||||<br />
|-<br />
| align="center" style="background:#f0f0f0;"|'''<font color="#707070">Action</font>'''<br />
| align="center" style="background:#f0f0f0;"|'''Arch'''<br />
| align="center" style="background:#f0f0f0;"|'''Red Hat/Fedora'''<br />
| align="center" style="background:#f0f0f0;"|'''Debian/Ubuntu'''<br />
| align="center" style="background:#f0f0f0;"|'''SUSE/openSUSE'''<br />
| align="center" style="background:#f0f0f0;"|'''Gentoo'''<br />
|}</div>Ratcheerhttps://wiki.archlinux.org/index.php?title=Udev&diff=220578Udev2012-08-30T14:27:38Z<p>Ratcheer: Corrected link to udev homepage</p>
<hr />
<div>[[Category:Hardware detection and troubleshooting]]<br />
[[cs:Udev]]<br />
[[es:Udev]]<br />
[[it:Udev]]<br />
[[ru:Udev]]<br />
[[zh-CN:Udev]]<br />
[[zh-TW:Udev]]<br />
{{Lowercase title}}<br />
<br />
{{ic|udev}} replaces the functionality of both {{Ic|hotplug}} and {{Ic|hwdetect}}.<br />
<br />
''"udev is the device manager for the Linux kernel. Primarily, it manages device nodes in {{ic|/dev}}. It is the successor of devfs and hotplug, which means that it handles the {{ic|/dev}} directory and all user space actions when adding/removing devices, including firmware load."'' Source: [[Wikipedia:Udev|Wikipedia article]]<br />
<br />
udev loads kernel modules by utilizing coding parallelism to provide a potential performance advantage versus loading these modules serially. The modules are therefore loaded asynchronously. The inherent disadvantage of this method is that udev does not always load modules in the same order on each boot. If the machine has multiple block devices, this may manifest itself in the form of device nodes changing designations randomly. For example, if the machine has two hard drives, {{ic|/dev/sda}} may randomly become {{ic|/dev/sdb}}. See below for more info on this.<br />
<br />
{{Note|1=Systemd and udev have been merged upstream. Udev will now be part of a package called {{pkg|systemd-tools}}. This package contains several other standalone tools which can be used without systemd. See [http://www.archlinux.org/news/systemd-tools-replaces-udev/ the announcement].}}<br />
<br />
== About udev rules ==<br />
udev rules written by the administrator go in {{ic|/etc/udev/rules.d/}}, their file name has to end with {{ic|.rules}}. The udev rules shipped with various packages are found in {{ic|/usr/lib/udev/rules.d/}}. If there are two files by the same name under {{ic|/usr/lib}} and {{ic|/etc}}, the ones in {{ic|/etc}} take precedence.<br />
<br />
If you want to learn how to write udev rules, see [http://www.reactivated.net/writing_udev_rules.html Writing udev rules].<br />
<br />
To get a list of all of the attributes of a device you can use to write rules, run this command:<br />
# udevadm info -a -n [device name]<br />
<br />
Replace {{ic|[device name]}} with the device present in the system, such as {{ic|/dev/sda}} or {{ic|/dev/ttyUSB0}}.<br />
<br />
udev automatically detects changes to rules files, so changes take effect immediately without requiring udev to be restarted. However, the rules are not re-triggered automatically on already existing devices, so hot-pluggable devices, such as USB devices, will probably have to be reconnected for the new rules to take effect.<br />
<br />
== UDisks ==<br />
Simply [[pacman|install]] the {{pkg|udisks}} package, and all of your media should be automatically mounted in [[GNOME]] and [[KDE]] SC 4.6. There is no need for any additional rules this way. Be aware that udisks2 is a compatibility-breaking rewrite of udisks and is the version currently [http://www.archlinux.org/packages/extra/x86_64/udisks2/ required] by GNOME, whereas XFCE and KDE seem to still [http://www.archlinux.org/packages/extra/x86_64/udisks/ require] udisks.<br />
<br />
As an extra bonus you can remove [[HAL]] if you were only using that for auto mounting purposes.<br />
<br />
=== Automounting UDisks Wrappers ===<br />
A UDisks wrapper has the advantage of being very easy to install and needing no (or minimal) configuration. The wrapper will automatically mount things like CDs and flash drives.<br />
<br />
* [http://ignorantguru.github.com/udevil/ udevil] - {{pkg|udevil}} "''mounts and unmounts removable devices without a password, shows device info, and monitors device changes''". It is written in C and can replace UDisks and includes [http://igurublog.wordpress.com/downloads/script-devmon/ devmon], which can be installed separately from the AUR ({{AUR|devmon}}). It can also selectively automatically start applications or execute commands after mounting, ignore specified devices and volume labels, and unmount removable drives.<br />
* {{AUR|ldm}} - A lightweight daemon that mounts usb drives, cds, dvds or floppys automagically. [https://bbs.archlinux.org/viewtopic.php?id=125918]<br />
* [[udiskie]] - Written in Python. Enables automatic mounting and unmounting by any user.<br />
* {{AUR|udisksevt}} - Written in Haskell. Enables automatic mounting by any user. Designed to be integrated with {{AUR|traydevice}}.<br />
* {{AUR|udisksvm}} - A GUI UDisks wrapper which uses the udisks2 dbus interface. It calls a 'traydvm' script, included in the package. The 'traydvm' GUI utility is a script which displays a systray icon for a plugged-in device, with a right-click menu to perform simple actions on the device. As the automount function can be disabled, this tool should work with other automounting tools, to show system tray icons. It is independent of any file manager.<br />
<br />
* You can easily automount and eject removable devices with the combination of {{pkg|pmount}}, {{pkg|udisks2}} and {{pkg|spacefm}}. Note you have to run spacefm in daemon mode with {{ic|spacefm -d &}} in your startup scripts, {{ic|~/.xinitrc}} or {{ic|~/.xsession}}, to get automounting. You can also mount internal disks by adding them to {{ic|/etc/pmount.allow}}.<br />
<br />
=== UDisks Shell Functions ===<br />
While UDisks includes a simple method of (un)mounting devices via command-line, it can be tiresome to type the commands out each time. These shell functions will generally shorten and ease command-line usage.<br />
<br />
* [https://bbs.archlinux.org/viewtopic.php?id=109307 udisks_functions] - Written for Bash.<br />
* [https://bbs.archlinux.org/viewtopic.php?id=117674 bashmount] - {{AUR|bashmount}} is a menu-driven Bash script with a configuration file that makes it easy to configure and extend.<br />
<br />
==Tips and tricks==<br />
<br />
=== Accessing Firmware Programmers and USB Virtual Comm Devices ===<br />
The following ruleset will allow normal users (within the "users" group) the ability to access the [http://www.ladyada.net/make/usbtinyisp/ USBtinyISP] USB programmer for AVR microcontrollers and a generic (SiLabs [http://www.silabs.com/products/interface/usbtouart CP2102]) USB to UART adapter and the [http://www.atmel.com/tools/AVRDRAGON.aspx?tab=overview Atmel AVR Dragon] programmer. Adjust the permissions accordingly. Verified as of 22-06-2012.<br />
<br />
{{hc|/etc/udev/rules.d/50-embedded_devices.rules|2=<nowiki><br />
# USBtinyISP Programmer rules<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1781", ATTRS{idProduct}=="0c9f", GROUP="users", MODE="0666"<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="0479", GROUP="users", MODE="0666"<br />
# USBasp Programmer rules http://www.fischl.de/usbasp/<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05dc", GROUP="users", MODE="0666"<br />
<br />
# Mdfly.com Generic (SiLabs CP2102) 3.3v/5v USB VComm adapter<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", GROUP="users", MODE="0666"<br />
<br />
#Atmel AVR Dragon (dragon_isp) rules<br />
SUBSYSTEM=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2107", GROUP="users", MODE="0666"<br />
<br />
#Atmel AVR JTAGICEMKII rules<br />
SUBSYSTEM=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2103", GROUP="users", MODE="0666"<br />
<br />
</nowiki>}}<br />
<br />
=== Execute on USB Insert ===<br />
See the [[Execute on USB insert]] article or the [http://igurublog.wordpress.com/downloads/script-devmon/ devmon wrapper script].<br />
<br />
=== Mount drives as a normal user ===<br />
If you want to mount an internal drive in your Desktop Environments as a normal user (without the need to type your superuser password), you just have to create one of the following file in [[PolicyKit]] Local Authority depending on whether you use udisks (KDE, XFCE) or udisks2 (newer GNOME) (if in doubt run a {{ic|pacman -Qi udisks2}} to see). The setting extends the privilege to all members of the 'users' group but you can substitute {{ic|unix-user:USERNAME}} for the group setting for individual privileges. See [[PolicyKit]] for details.<br />
<br />
This example configuration allows any member of the {{ic|users}} group to mount and unmount disks with udisks or udisk2. If it doesn't already exist, create the file {{ic|/etc/polkit-1/localauthority/50-local.d/10-udisks.pkla}} with these contents:<br />
<br />
'''udisks'''<br />
[Local Users]<br />
Identity=unix-group:users<br />
Action=org.freedesktop.udisks.*<br />
ResultAny=yes<br />
ResultInactive=yes<br />
ResultActive=yes<br />
'''udisk2'''<br />
[Local Users]<br />
Identity=unix-group:users<br />
Action=org.freedesktop.udisks2.*<br />
ResultAny=yes<br />
ResultInactive=yes<br />
ResultActive=yes<br />
<br />
====Internal drives only====<br />
'''udisks'''<br />
{{hc|/etc/polkit-1/localauthority/50-local.d/50-filesystem-mount-system-internal.pkla|2=<nowiki><br />
[Mount a system-internal device]<br />
Identity=unix-group:users<br />
Action=org.freedesktop.udisks.filesystem-mount-system-internal<br />
ResultActive=yes<br />
</nowiki>}}<br />
'''udisks2'''<br />
{{hc|/etc/polkit-1/localauthority/50-local.d/50-filesystem-mount-system-internal.pkla|2=<nowiki><br />
[Mount a system-internal device]<br />
Identity=unix-group:users<br />
Action=org.freedesktop.udisks2.filesystem-mount-system<br />
ResultActive=yes <br />
</nowiki>}}<br />
<br />
=== Mark internal SATA-Ports as eSATA-Ports ===<br />
If you connected a eSATA bay or an other eSATA adapter the system will still recognize this disk as an internal SATA drive. Gnome and KDE will ask you for your root password all the time. The following rule will mark the specified SATA-Port as an external eSATA-Port. With that, a normal Gnome user can connect their eSATA drives to that port like a USB drive, without any root password and so on.<br />
<br />
{{hc|/etc/udev/rules.d/10-esata.rules|2=<nowiki><br />
DEVPATH=="/devices/pci0000:00/0000:00:1f.2/host4/*", ENV{UDISKS_SYSTEM_INTERNAL}="0"<br />
</nowiki>}}<br />
<br />
{{Note| The DEVPATH can be found after connection the eSata drive with the following command (replace sdb to your needs):<br />
<br />
# find /sys/devices/ -name sdb<br />
/sys/devices/pci0000:00/0000:00:1f.2/host4/target4:0:0/4:0:0:0/block/sdb<br />
<br />
}}<br />
<br />
=== Setting static device names ===<br />
Because udev loads all modules asynchronously, they are initialized in a different order. This can result in devices randomly switching names. A udev rule can be added to use static device names, but preferably names other than "ethX" and "wlanX".<br />
<br />
For block devices, see [[Persistent block device naming]].<br />
<br />
==== Network device ====<br />
For example, with two network cards, you may notice a switching of designations between {{Ic|eth0}} and {{Ic|eth1}} between reboots.<br />
<br />
One method for network card ordering is to use the udev-sanctioned method of statically-naming each interface. Create the following file to bind the MAC address of each of your cards to a certain interface name:<br />
{{hc|/etc/udev/rules.d/10-network.rules|2=<nowiki><br />
SUBSYSTEM=="net", ATTR{address}=="aa:bb:cc:dd:ee:ff", NAME="net0"<br />
SUBSYSTEM=="net", ATTR{address}=="ff:ee:dd:cc:bb:aa", NAME="wifi0"<br />
</nowiki>}}<br />
<br />
A couple things to note:<br />
* To get the MAC address of each card, use this command: {{Ic|<nowiki>udevadm info -a -p /sys/class/net/<yourdevice> | grep address | tr [A-Z] [a-z]</nowiki>}}<br />
* Make sure to use the lower-case hex values in your udev rules. It doesn't like upper-case.<br />
* When choosing the static names it should be avoided to use "ethX" and "wlanX", because this may lead to race conditions between the kernel und udev during boot. Instead better use interface names that are not used by the kernel as default, e.g. "net0, net1, wifi0, wifi1"<br />
<br />
Don't forget to update your {{ic|/etc/rc.conf}} and other configuration files using the old ethX notation!<br />
<br />
See also [[Rename network interfaces]].<br />
<br />
==== iscsi device ====<br />
Test the output from scsi_id:<br />
/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/sdb<br />
3600601607db11e0013ab5a8e371ce111<br />
<br />
{{hc|/etc/udev/rules.d/75-iscsi.rules|<nowiki><br />
# the iscsi device rules<br />
# this will create an iscsi device for each of the targets<br />
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace /dev/$name", RESULT=="3600601607db11e0013ab5a8e371ce111",<br />
NAME="isda"<br />
</nowiki>}}<br />
<br />
== Troubleshooting ==<br />
=== Blacklisting Modules ===<br />
In rare cases, udev can make mistakes and load the wrong modules. To prevent it from doing this, you can blacklist modules. Once blacklisted, udev will never load that module. See [[blacklisting]]. Not at boot-time ''or'' later on when a hotplug event is received (eg, you plug in your USB flash drive).<br />
<br />
=== udevd hangs at boot ===<br />
After migrating to LDAP or updating an LDAP-backed system udevd can hang at boot at the message "Starting UDev Daemon". This is usually caused by udevd trying to look up a name from LDAP but failing, because the network is not up yet. The solution is to ensure that all system group names are present locally.<br />
<br />
Extract the group names referenced in udev rules and the group names actually present on the system:<br />
<br />
# fgrep -r GROUP /etc/udev/rules.d/ /usr/lib/udev/rules.d | perl -nle '/GROUP\s*=\s*"(.*?)"/ && print $1;' | sort | uniq > udev_groups<br />
# cut -f1 -d: /etc/gshadow /etc/group | sort | uniq > present_groups<br />
<br />
To see the differences, do a side-by-side diff:<br />
<br />
# diff -y present_groups udev_groups<br />
...<br />
network <<br />
nobody <<br />
ntp <<br />
optical optical<br />
power | pcscd<br />
rfkill <<br />
root root<br />
scanner scanner<br />
smmsp <<br />
storage storage<br />
...<br />
<br />
In this case, the pcscd group is for some reason not present in the system. Add the missing groups:<br />
<br />
# groupadd pcscd<br />
<br />
Also, make sure local resources are looked up before resorting to LDAP. {{ic|/etc/nsswitch.conf}} should contain the line<br />
<br />
group: files ldap<br />
<br />
=== Known Problems with Hardware ===<br />
==== BusLogic devices can be broken and will cause a freeze during startup ====<br />
This is a kernel bug and no fix has been provided yet.<br />
<br />
==== Some devices, that should be treated as removable, are not ====<br />
Create a custom udev rule, setting {{ic|UDISKS_SYSTEM_INTERNAL<nowiki>=</nowiki>0}}. For more details, see the manpage of udisks.<br />
<br />
=== Known Problems with Auto-Loading ===<br />
==== CPU frequency modules ====<br />
The current detection method for the various CPU frequency controllers is inadequate, so this has been omitted from the auto-loading process for the time being. To use [[CPU Frequency Scaling]], load the proper module explicitly in your {{Ic|MODULES}} array in {{ic|/etc/rc.conf}}. Further reading: [[rc.conf]].<br />
<br />
==== Sound Problems or Some Modules Not Loaded Automatically ====<br />
Some users have traced this problem to old entries in {{ic|/etc/modprobe.d/sound.conf}}. Try cleaning that file out and trying again.<br />
{{Note|Since {{Ic|udev>&#61;171}}, the OSS emulation modules ({{Ic|snd_seq_oss, snd_pcm_oss, snd_mixer_oss}}) are not automatically loaded by default.}}<br />
<br />
=== Known Problems for Custom Kernel Users ===<br />
==== Udev doesn't start at all ====<br />
Make sure you have a kernel version later than or equal to 2.6.32. Earlier kernels do not have the necessary uevent stuff that udev needs for auto-loading.<br />
<br />
=== IDE CD/DVD-drive support ===<br />
Starting with version 170, udev doesn't support CD-ROM/DVD-ROM drives, which are loaded as traditional IDE drives with the {{Ic|ide_cd_mod}} module and show up as {{ic|/dev/hd*}}. The drive remains usable for tools which access the hardware directly, like cdparanoia, but is invisible for higher userspace programs, like KDE.<br />
<br />
A cause for the loading of the ide_cd_mod module prior to others, like sr_mod, could be e.g. that you have for some reason the module piix loaded with your initramfs. In that case you can just replace it with ata_piix in your {{ic|/etc/mkinitcpio.conf}}.<br />
<br />
=== Optical Drives Have Group ID Set To Disk ===<br />
If the group ID of your optical drive is set to ''disk'' and you want to have it set to ''optical'' you have to create a custom udev rule:<br />
{{hc|/etc/udev/rules.d|2=# permissions for IDE CD devices<br />
SUBSYSTEMS=="ide", KERNEL=="hd[a-z]", ATTR{removable}=="1", ATTRS{media}=="cdrom*", GROUP="optical"<br />
<br />
# permissions for SCSI CD devices<br />
SUBSYSTEMS=="scsi", KERNEL=="s[rg][0-9]*", ATTRS{type}=="5", GROUP="optical"}}<br />
<br />
==See also==<br />
* [https://www.kernel.org/pub/linux/utils/kernel/hotplug/udev/udev.html Udev Homepage]<br />
* [http://www.linux.com/news/hardware/peripherals/180950-udev An Introduction to Udev]<br />
* [http://vger.kernel.org/vger-lists.html#linux-hotplug Udev mailing list information]</div>Ratcheer