https://wiki.archlinux.org/api.php?action=feedcontributions&user=JackH79&feedformat=atomArchWiki - User contributions [en]2024-03-29T14:33:23ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Fsniper&diff=200877Fsniper2012-05-09T15:36:20Z<p>JackH79: </p>
<hr />
<div>[[Category:Applications]]<br />
[[Category:File Managers]]<br />
Fsniper is a directory monitor that can be used to execute predefined actions on files that enter the monitored directory. This can, for example, be used to monitor your downloads folder and sort downloaded files automatically into your file system.<br />
<br />
Unlike cron jobs or bash scripts, fsniper uses [[Wikipedia:inotify|inotify]] to monitor file changes. This enable it to react immediately and efficiently to changes of the file system.<br />
<br />
== Installation ==<br />
[https://aur.archlinux.org/packages.php?ID=16677 Fsniper] is available from the [[AUR]].<br />
<br />
== Configuration ==<br />
<br />
Fsniper comes with a self-explanatory example.conf that can be copied to {{Ic|~/.config/fsniper/config}} for modification and personalisation.<br />
watch {<br />
# watch the ~/drop directory for new files<br />
~/drop {<br />
# matches any mimetype beginning with image/<br />
image/* {<br />
# %% is replaced with the filename of the new file<br />
handler = echo found an image: %%<br />
}<br />
# matches any file ending with .extension<br />
*.extension {<br />
# the filename is added to the end of the handler line if %% is not present<br />
handler = echo glob handler 1: <br />
# the second handler will be run if the first exits with a return code of 1<br />
handler = echo glob handler 2: %%<br />
}<br />
# run handlers on files that match this regex<br />
/.*regex.*/ {<br />
handler = echo regex handler<br />
}<br />
# generic handler to catch files that nothing else did<br />
* {<br />
handler = mv %% ~/downloads/<br />
}<br />
}<br />
}<br />
<br />
Once configured, fsniper can be started by typing<br />
$ fsniper --daemon<br />
<br />
== Daemonizing ==<br />
<br />
Fsniper can also be started automatically at [[Arch Boot Process|boot]] time as an rc.d [[daemon]] by placing the following script as {{Ic|/etc/rc.d/fsniper}}:<br />
<br />
(Replace <your-user-name> with your user name(s))<br />
daemon_name=fsniper<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
USERS=( '<your-user-name>' )<br />
for USER in ${USERS[@]}<br />
do<br />
PID=$(pidof -o %PPID /usr/bin/fsniper)<br />
case "$1" in<br />
start)<br />
stat_busy "Starting $daemon_name"<br />
[ -z "$PID" ] && su -c "/usr/bin/fsniper --daemon" $USER<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
add_daemon fsniper<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Stopping $daemon_name"<br />
[ ! -z "$PID" ] && kill $PID > /dev/null<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon fsniper<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 1<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
esac<br />
done<br />
exit 0<br />
<br />
The daemon can then be started by typing<br />
# rc.d start fsniper<br />
<br />
or by placing fsniper in the daemons section of your [[rc.conf|{{Ic|/etc/rc.conf}}]].</div>JackH79https://wiki.archlinux.org/index.php?title=Fsniper&diff=200876Fsniper2012-05-09T15:27:09Z<p>JackH79: </p>
<hr />
<div>[[Category:Applications]]<br />
[[Category:File Managers]]<br />
Fsniper is a directory monitor that can be used to execute predefined actions on files that enter the monitored directory. This can, for example, be used to monitor your downloads folder and sort downloaded automatically into your file system.<br />
Unlike cron jobs or bash scripts, fsniper uses [[Wikipedia:inotify|inotify]] to monitor file changes, which enable it to react immediately and efficiently to changes of the file system.<br />
<br />
== Installation ==<br />
[https://aur.archlinux.org/packages.php?ID=16677 Fsniper] is available from the [[AUR]].<br />
<br />
== Configuration ==<br />
<br />
Fsniper comes with a self-explanatory example.conf that can be copied to ~/.config/fsniper/config for modification.<br />
watch {<br />
<br />
# watch the ~/drop directory for new files<br />
~/drop {<br />
# matches any mimetype beginning with image/<br />
image/* {<br />
# %% is replaced with the filename of the new file<br />
handler = echo found an image: %%<br />
}<br />
# matches any file ending with .extension<br />
*.extension {<br />
# the filename is added to the end of the handler line if %% is not present<br />
handler = echo glob handler 1: <br />
# the second handler will be run if the first exits with a return code of 1<br />
handler = echo glob handler 2: %%<br />
}<br />
# run handlers on files that match this regex<br />
/.*regex.*/ {<br />
handler = echo regex handler<br />
}<br />
# generic handler to catch files that nothing else did<br />
* {<br />
handler = mv %% ~/downloads/<br />
}<br />
}<br />
}<br />
<br />
Once configured, fsniper can be started by typing<br />
$ fsniper --daemon<br />
<br />
== Daemonizing ==<br />
<br />
Fsniper can be run as an rc.d [[daemon]] by placing the following script as /etc/rc.d/fsniper (replace <your-user-name> with your user name(s)):<br />
daemon_name=fsniper<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
USERS=( '<your-user-name>' )<br />
for USER in ${USERS[@]}<br />
do<br />
PID=$(pidof -o %PPID /usr/bin/fsniper)<br />
case "$1" in<br />
start)<br />
stat_busy "Starting $daemon_name"<br />
[ -z "$PID" ] && su -c "/usr/bin/fsniper --daemon" $USER<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
add_daemon fsniper<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Stopping $daemon_name"<br />
[ ! -z "$PID" ] && kill $PID > /dev/null<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon fsniper<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 1<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
esac<br />
done<br />
exit 0<br />
<br />
The daemon can then be started by typing<br />
# rc.d start fsniper<br />
<br />
or by placing fsniper in the daemons section of your [[rc.conf|/etc/rc.conf]].</div>JackH79https://wiki.archlinux.org/index.php?title=Fsniper&diff=200875Fsniper2012-05-09T15:26:28Z<p>JackH79: </p>
<hr />
<div>[[Category:Applications]]<br />
[[Category:File Managers]]<br />
Fsniper is a directory monitor that can be used to execute predefined actions on files that enter the monitored directory. This can, for example, be used to monitor your downloads folder and sort downloaded automatically into your file system.<br />
Unlike cron jobs or bash scripts, fsniper uses [[Wikipedia:inotify]] to monitor file changes, which enable it to react immediately and efficiently to changes of the file system.<br />
<br />
== Installation ==<br />
[https://aur.archlinux.org/packages.php?ID=16677 Fsniper] is available from the [[AUR]].<br />
<br />
== Configuration ==<br />
<br />
Fsniper comes with a self-explanatory example.conf that can be copied to ~/.config/fsniper/config for modification.<br />
watch {<br />
<br />
# watch the ~/drop directory for new files<br />
~/drop {<br />
# matches any mimetype beginning with image/<br />
image/* {<br />
# %% is replaced with the filename of the new file<br />
handler = echo found an image: %%<br />
}<br />
# matches any file ending with .extension<br />
*.extension {<br />
# the filename is added to the end of the handler line if %% is not present<br />
handler = echo glob handler 1: <br />
# the second handler will be run if the first exits with a return code of 1<br />
handler = echo glob handler 2: %%<br />
}<br />
# run handlers on files that match this regex<br />
/.*regex.*/ {<br />
handler = echo regex handler<br />
}<br />
# generic handler to catch files that nothing else did<br />
* {<br />
handler = mv %% ~/downloads/<br />
}<br />
}<br />
}<br />
<br />
Once configured, fsniper can be started by typing<br />
$ fsniper --daemon<br />
<br />
== Daemonizing ==<br />
<br />
Fsniper can be run as an rc.d [[daemon]] by placing the following script as /etc/rc.d/fsniper (replace <your-user-name> with your user name(s)):<br />
daemon_name=fsniper<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
USERS=( '<your-user-name>' )<br />
for USER in ${USERS[@]}<br />
do<br />
PID=$(pidof -o %PPID /usr/bin/fsniper)<br />
case "$1" in<br />
start)<br />
stat_busy "Starting $daemon_name"<br />
[ -z "$PID" ] && su -c "/usr/bin/fsniper --daemon" $USER<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
add_daemon fsniper<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Stopping $daemon_name"<br />
[ ! -z "$PID" ] && kill $PID > /dev/null<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon fsniper<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 1<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
esac<br />
done<br />
exit 0<br />
<br />
The daemon can then be started by typing<br />
# rc.d start fsniper<br />
<br />
or by placing fsniper in the daemons section of your [[rc.conf|/etc/rc.conf]].</div>JackH79https://wiki.archlinux.org/index.php?title=Fsniper&diff=200874Fsniper2012-05-09T15:18:38Z<p>JackH79: /* Daemonizing */</p>
<hr />
<div>[[Applications:File Managers]]<br />
Fsniper is a directory monitor that can be used to execute predefined actions on files that enter the monitored directory. Unlike cron jobs or bash scripts, fsniper uses inotify to monitor file changes, which enables it to react immediately to changes of the file system.<br />
<br />
== Installation ==<br />
[https://aur.archlinux.org/packages.php?ID=16677 Fsniper] is available from the [[AUR]].<br />
<br />
== Configuration ==<br />
<br />
Fsniper comes with a self-explanatory example.conf that can be copied to ~/.config/fsniper/config for modification.<br />
watch {<br />
<br />
# watch the ~/drop directory for new files<br />
~/drop {<br />
# matches any mimetype beginning with image/<br />
image/* {<br />
# %% is replaced with the filename of the new file<br />
handler = echo found an image: %%<br />
}<br />
# matches any file ending with .extension<br />
*.extension {<br />
# the filename is added to the end of the handler line if %% is not present<br />
handler = echo glob handler 1: <br />
# the second handler will be run if the first exits with a return code of 1<br />
handler = echo glob handler 2: %%<br />
}<br />
# run handlers on files that match this regex<br />
/.*regex.*/ {<br />
handler = echo regex handler<br />
}<br />
# generic handler to catch files that nothing else did<br />
* {<br />
handler = mv %% ~/downloads/<br />
}<br />
}<br />
}<br />
<br />
Once configured, fsniper can be started by typing<br />
$ fsniper --daemon<br />
<br />
== Daemonizing ==<br />
<br />
Fsniper can be run as an rc.d [[daemon]] by placing the following script as /etc/rc.d/fsniper (replace <your-user-name> with your user name(s)):<br />
daemon_name=fsniper<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
USERS=( '<your-user-name>' )<br />
for USER in ${USERS[@]}<br />
do<br />
PID=$(pidof -o %PPID /usr/bin/fsniper)<br />
case "$1" in<br />
start)<br />
stat_busy "Starting $daemon_name"<br />
[ -z "$PID" ] && su -c "/usr/bin/fsniper --daemon" $USER<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
add_daemon fsniper<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Stopping $daemon_name"<br />
[ ! -z "$PID" ] && kill $PID > /dev/null<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon fsniper<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 1<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
esac<br />
done<br />
exit 0<br />
<br />
The daemon can then be started by typing<br />
# rc.d start fsniper<br />
<br />
or by placing fsniper in the daemons section of your [[rc.conf|/etc/rc.conf]].</div>JackH79https://wiki.archlinux.org/index.php?title=Fsniper&diff=200873Fsniper2012-05-09T15:15:13Z<p>JackH79: /* Installation */</p>
<hr />
<div>[[Applications:File Managers]]<br />
Fsniper is a directory monitor that can be used to execute predefined actions on files that enter the monitored directory. Unlike cron jobs or bash scripts, fsniper uses inotify to monitor file changes, which enables it to react immediately to changes of the file system.<br />
<br />
== Installation ==<br />
[https://aur.archlinux.org/packages.php?ID=16677 Fsniper] is available from the [[AUR]].<br />
<br />
== Configuration ==<br />
<br />
Fsniper comes with a self-explanatory example.conf that can be copied to ~/.config/fsniper/config for modification.<br />
watch {<br />
<br />
# watch the ~/drop directory for new files<br />
~/drop {<br />
# matches any mimetype beginning with image/<br />
image/* {<br />
# %% is replaced with the filename of the new file<br />
handler = echo found an image: %%<br />
}<br />
# matches any file ending with .extension<br />
*.extension {<br />
# the filename is added to the end of the handler line if %% is not present<br />
handler = echo glob handler 1: <br />
# the second handler will be run if the first exits with a return code of 1<br />
handler = echo glob handler 2: %%<br />
}<br />
# run handlers on files that match this regex<br />
/.*regex.*/ {<br />
handler = echo regex handler<br />
}<br />
# generic handler to catch files that nothing else did<br />
* {<br />
handler = mv %% ~/downloads/<br />
}<br />
}<br />
}<br />
<br />
Once configured, fsniper can be started by typing<br />
$ fsniper --daemon<br />
<br />
== Daemonizing ==<br />
<br />
Fsniper can be run as an rc.d daemon by placing the following script as /etc/rc.d/fsniper (replace <your-user-name> with your user name(s)):<br />
daemon_name=fsniper<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
USERS=( '<your-user-name>' )<br />
for USER in ${USERS[@]}<br />
do<br />
PID=$(pidof -o %PPID /usr/bin/fsniper)<br />
case "$1" in<br />
start)<br />
stat_busy "Starting $daemon_name"<br />
[ -z "$PID" ] && su -c "/usr/bin/fsniper --daemon" $USER<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
add_daemon fsniper<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Stopping $daemon_name"<br />
[ ! -z "$PID" ] && kill $PID > /dev/null<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon fsniper<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 1<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
esac<br />
done<br />
exit 0<br />
<br />
The daemon can the be started by typing<br />
# rc.d start fsniper<br />
<br />
or by placing fsniper in the daemons section of your /etc/rc.conf</div>JackH79https://wiki.archlinux.org/index.php?title=Fsniper&diff=200830Fsniper2012-05-09T07:37:46Z<p>JackH79: Created page with "Applications:File Managers Fsniper is a directory monitor that can be used to execute predefined actions on files that enter the monitored directory. Unlike cron jobs or b..."</p>
<hr />
<div>[[Applications:File Managers]]<br />
Fsniper is a directory monitor that can be used to execute predefined actions on files that enter the monitored directory. Unlike cron jobs or bash scripts, fsniper uses inotify to monitor file changes, which enables it to react immediately to changes of the file system.<br />
<br />
== Installation ==<br />
[[Fsniper]] is available from the [[AUR]].<br />
<br />
== Configuration ==<br />
<br />
Fsniper comes with a self-explanatory example.conf that can be copied to ~/.config/fsniper/config for modification.<br />
watch {<br />
<br />
# watch the ~/drop directory for new files<br />
~/drop {<br />
# matches any mimetype beginning with image/<br />
image/* {<br />
# %% is replaced with the filename of the new file<br />
handler = echo found an image: %%<br />
}<br />
# matches any file ending with .extension<br />
*.extension {<br />
# the filename is added to the end of the handler line if %% is not present<br />
handler = echo glob handler 1: <br />
# the second handler will be run if the first exits with a return code of 1<br />
handler = echo glob handler 2: %%<br />
}<br />
# run handlers on files that match this regex<br />
/.*regex.*/ {<br />
handler = echo regex handler<br />
}<br />
# generic handler to catch files that nothing else did<br />
* {<br />
handler = mv %% ~/downloads/<br />
}<br />
}<br />
}<br />
<br />
Once configured, fsniper can be started by typing<br />
$ fsniper --daemon<br />
<br />
== Daemonizing ==<br />
<br />
Fsniper can be run as an rc.d daemon by placing the following script as /etc/rc.d/fsniper (replace <your-user-name> with your user name(s)):<br />
daemon_name=fsniper<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
USERS=( '<your-user-name>' )<br />
for USER in ${USERS[@]}<br />
do<br />
PID=$(pidof -o %PPID /usr/bin/fsniper)<br />
case "$1" in<br />
start)<br />
stat_busy "Starting $daemon_name"<br />
[ -z "$PID" ] && su -c "/usr/bin/fsniper --daemon" $USER<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
add_daemon fsniper<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Stopping $daemon_name"<br />
[ ! -z "$PID" ] && kill $PID > /dev/null<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon fsniper<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 1<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
esac<br />
done<br />
exit 0<br />
<br />
The daemon can the be started by typing<br />
# rc.d start fsniper<br />
<br />
or by placing fsniper in the daemons section of your /etc/rc.conf</div>JackH79https://wiki.archlinux.org/index.php?title=Mac&diff=172290Mac2011-12-04T07:30:03Z<p>JackH79: /* Installation */</p>
<hr />
<div>[[Category:Apple (English)]]<br />
{{i18n|MacBook}}<br />
[[fr:MacBook]]<br />
{{out of date|reason=kernel26}}<br />
{{Article summary start}}<br />
{{Article summary text|Details the installation and configuration of Arch Linux on Apple's MacBook and MacBook Pro lines of notebooks.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Official Arch Linux Install Guide}}<br />
{{Article summary wiki|Beginners Guide}}<br />
{{Article summary wiki|General Recommendations}}<br />
{{Article summary end}}<br />
<br />
Installing Arch Linux on a MacBook is quite similar to installing it on any other computer. However, due to the specific hardware configuration on a MacBook, there are a few deviations and special considerations which warrant a separate guide. For more background information, please see the [[Official Arch Linux Install Guide]], [[Beginners Guide]], [[Beginners Guide Appendix]], and [[Post Installation Tips]]. This guide should also work for the MacBook Pros 5 series, and apply to both the 32 and 64 bits versions. If you have a Macbook5,2 (Polycarbonate, Non-Unibody) and are having additional issues, please see [[Macbook5,2]] for additional help.<br />
<br />
== Overview ==<br />
<br />
Specifically, the procedure for installing Arch Linux on a MacBook is:<br />
<br />
# '''[[#Installation of Mac OS X and Firmware Update | Install Mac OS X]]''': Regardless of the desired end-configuration, it helps to start from a clean install of OS X.<br />
# '''[[#Installation of Mac OS X and Firmware Update | Firmware Update]]''': This should help reduce errors and provide newer features for the hardware.<br />
# '''[[#Partition | Partition]]''': This step either resizes or deletes the OS X partition and creates partitions for Arch Linux.<br />
# '''[[#Installation | Install Arch Linux]]''': The actual installation procedure.<br />
# '''[[#Post-Install Configuration | Post-Install Configuration]]''': MacBook specific configuration.<br />
<br />
{{ Tip | rEFIt is a popular bootloader for EFI-firmware computers (including Macs). It can be installed at any time during the installation. For instructions, please see [[MacBook#rEFIt|rEFIt]]. }}<br />
<br />
==Installation of Mac OS X and Firmware Update==<br />
<br />
[http://www.apple.com Apple] already has excellent instructions for installing Mac OS X. Follow their instructions. Finally, once OS X is installed, go to:<br />
<br />
Apple Menu --> Software Update<br />
<br />
And update all software. Once this has run, you will need to reboot your computer. Do this, and then run '''Software Update''' again to check to make sure that all updates have been installed.<br />
<br />
{{Note | Sometimes '''Software Update''' may not pick up all the firmware updates available for your computer. However, you can try to search this upgrades directly into the Apple's Support site.}}<br />
<br />
If you are not going to have Mac OS X installed, make backups of these files:<br />
<br />
/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS/AppleUSBVideoSupport<br />
<br />
You will need this file later for iSight functionality.<br />
<br />
<pre>/Library/ColorSync/Profiles/Displays/<FILES HERE></pre><br />
<br />
You will need the file(s) here for adjusting the [[#Color_Profile | color profile]].<br />
<br />
==Partition==<br />
<br />
The next step in the installation is to re-partition the hard drive. If Mac OS X was installed using the typical procedure, then your drive should have a GPT format and the following two partitions:<br />
<br />
* '''EFI partition''': a 200 MB partition at the beginning of the disk.It is often read as '''msdos''' or '''FAT''' by some partitioning tools and usually labeled ''#1''<br />
* '''Mac OS X partition''': the ''(HFS+)'' partition that should take up all of the remaining disk space. Usually labeled ''#2''.<br />
<br />
How to partition depends on how many operating systems you want install. The following options will be proposed here:<br />
<br />
* [[#Arch Linux Only | Arch Linux Only]] for single boot.<br />
* [[#Mac OS X with Arch Linux | Mac OS X with Arch Linux]] for dual boot.<br />
<br />
If you do not know which option to pick, we recommend the dual boot so you can still return to Mac OS X whenever you want.<br />
<br />
===Arch Linux Only===<br />
<br />
This situation is the easiest to deal with. Mostly, partitioning is the same as any other hardware that Arch Linux can be installed on. The only special consideration is the MacBook firmware boot sound. To ensure that this sound is off: '''mute''' the volume in Mac OS X before continuing further. The MacBook firmware relies on the value in Mac OS X, if available. Note that if you choose to get rid of the OS X partition, there is no easy way to update your machines firmware unless you use an external drive to load OS X.<br />
<br />
Then partition with '''parted'''. The simplest way is to change the partition table to '''msdos''' and then partition as normal. If you decide to use the GPT format, GRUB will not be able to recognize the partitioning scheme.<br />
<br />
{{Note | to partition with '''parted''', just boot the Arch Linux core install disk and run '''parted''' from the root account before using the install program.}}<br />
<br />
Once you have finished this part, please move on to [[#Installation | Installation]] section.<br />
<br />
===Mac OS X with Arch Linux===<br />
<br />
The easiest way to partition your hard drive, so that Mac OS X and Arch Linux will co-exist, is to use partitioning tools in Mac OS X and then finish with Arch Linux tools.<br />
<br />
{{Warning | It is highly recommended that this only be attempted after a clean install of Mac OS X. Using these methods on a pre-existing system may have undesired results.}}<br />
<br />
'''Procedure''':<br />
* In Mac OS X, run '''Disk Utility''' (located in /Applications/Utilities)<br />
<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''partition''' tab on the right.<br />
<br />
* Select the volume to be resized in the '''volume scheme.'''<br />
<br />
* Decide how much space you wish to have for your Mac OS X partition, and how much for Arch Linux. Remember that a typical installation of Mac OS X requires around 15-20 GiB, depending on the number of software applications and files.<br />
<br />
* Finally, type the new (smaller) size for the MacOS partition in the size box and click '''apply'''. This will create a new partition out of the empty space.<br />
<br />
{{Note | if you wish to have a shared partition between Mac OS X and Arch Linux, then additional steps will need to happen here. Please see [[#Shared Partition|Shared Partition]].}}<br />
<br />
* If the above completed successfully, then you can continue. If not, then you may need to fix your partitions from within Mac OS X first.<br />
<br />
* Boot the Arch install CD by holding down the alt key during Boot. <br />
<br />
* Now run '''parted'''<br />
# parted<br />
<br />
* Delete the empty space partition and partition the space as you would for any other installation. Note that MBR is limited to 4 primary partitions (including the efi partition). That leaves 2 primary partitions for arch. One strategy is to have a system and home partition, and use a swap file (I have not tried to use logical partitions). Another is to dedicate one partition to a shared partition (see below).<br />
<br />
* At this point, if you are dual booting, you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press Y.<br />
# reboot<br />
<br />
* Done! Please continue to [[MacBook#Installation | installation]]<br />
<br />
===Mac OS X, Windows XP, & Arch Linux Triple boot===<br />
<br />
This may not work for everyone but it has been successfully tested on a Macbook from late 2009.<br />
<br />
The easiest way to partition your hard drive, so that all these operating systems can co-exist, is to use disk utility in Mac OS X, use the formatter on windows XP install CP, and then finish with Arch Linux tools.<br />
<br />
{{Warning | It is highly recommended that this only be attempted after a clean install of Mac OS X. Using these methods on a pre-existing system may have undesired results. At least back your stuff up with timemachine or clonezilla before you begin.}}<br />
<br />
'''Procedure''':<br />
* In Mac OS X, run '''Disk Utility''' (located in /Applications/Utilities)<br />
<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''partition''' tab on the right.<br />
<br />
* Select the volume to be resized in the '''volume scheme.'''<br />
<br />
* Decide how much space you wish to have for your Mac OS X partition, how much fo XP, and how much for Arch Linux. Remember that a typical installation of Mac OS X requires around 15-20 GiB, and XP about the same, depending on the number of software applications and files. Something like OSX 200Gb, XP 25Gb, Arch 25Gb should be fine.<br />
<br />
* Put your decisions into action by pressing the + button and adding the new partitions, Label them as you like and make sure that your XP partition is the last one on the disk and is formatted for FAT32. It is probably best to have Arch formatted in HFS format as to not confuse you later, it will be reformatted anyway.<br />
<br />
So in linux terms your partitions will be something like:<br><br />
<br><br />
<br>sda (disk)<br />
<br>sda1 (Mac boot partition - you cannot see this one in OSX)<br />
<br>sda2 (OSX install in HFS+)<br />
<br>sda3 (Arch install temporarly in HFS)<br />
<br>sda4 (XP install in FAT32)<br />
<br />
* Finally, click '''apply'''. This will create a new partition out of the empty space.<br />
<br />
{{Note | Using this method you may not be able to have a shared partition between Mac OS X and Arch Linux, this is because the mac will only allow for 4 active partitions. You will however be able to mount a HFS partition in Arch for one workaround. There are other workarounds possible also.}}<br />
<br />
* If the above completed successfully, you can continue. If not, then you may need to fix your partitions from within Mac OS X first.<br />
<br />
* You will not be needing boot camp this way, the program rEFIt is much more flexible (though not as flexible as Grub). Download and install rEFIt [[http://refit.sourceforge.net/]]<br />
<br />
* Go into a terminal in OS X and perform the following, this will enable the rEFIt boot manager. <br />
<pre><br />
cd /efi/refit<br />
./enable.sh<br />
</pre><br />
<br />
* Reboot to check the rEFIt is working, it should appear on boot. When it comes up go to the rEFIt partition manager and agree to the changes.<br />
<br />
* Put your XP install CD and boot it with rEFIt - You may have to reboot a few times until it is recognized by the boot loader. Install XP and once it is installed use the OSX install CD to get your drivers running nicely in XP.<br />
** Note: when installing XP make sure you select your XP partition and format it again inside the XP installer. If you do not reformat it will not work.<br />
<br />
* Boot the Arch install CD, log in as root and run /arch/setup<br />
<br />
* Follow the install as normal but note that you will have to tell that arch installer to mount sda3 as the root partition and format it as ext3, there will not be a /boot or swap partition so ignore those warnings.<br />
<br />
* At this point, if you are dual booting, you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press Y.<br />
# reboot<br />
<br />
* Done! Please continue to [[MacBook#Installation | installation]]<br />
<br />
==Booting Directly from GRUB==<br />
It is possible to boot directly from GRUB2 in efi mode without using refit. These instructions are known to work on a Macbook 7,1. It is advisable to host GRUB on either a fat32 or HFS+ partition, but ext2 or ext3 may also work. GRUB's appleloader command does not currently work with the 7,1, but support can be added with the patch available [https://savannah.gnu.org/bugs/index.php?33185 here].<br />
<br />
After the GRUB install is in the desired location, the firmware needs to be instructed to boot from that location. This can be done from either an existing OS X install or an OS X install disk. The following command assumes that the GRUB install is in /efi/grub on an existing OS X partition:<br />
sudo bless --folder /efi/grub --file /efi/grub/grub.efi<br />
===Compilation===<br />
Some models may need EFI_ARCH set to i386.<br />
bzr branch --revision -2 bzr://bzr.savannah.gnu.org/grub/trunk/grub grub<br />
cd grub<br />
./autogen.sh<br />
patch -p1 < appleloader_macbook_7_1.patch<br />
export EFI_ARCH=x86_64<br />
./configure --with-platform=efi --target=${EFI_ARCH} --program-prefix=""<br />
make<br />
cd grub-core<br />
../grub-mkimage -O ${EFI_ARCH}-efi -d . -o grub.efi -p "" part_gpt part_msdos ntfs ntfscomp hfsplus fat ext2 normal chain boot configfile linux multiboot<br />
cp grub.efi *.mod *.lst yourinstalllocation<br />
<br />
===Example grub.cfg===<br />
Note that there may be a better method for loading Windows.<br />
<pre><br />
set debug=video<br />
insmod efi_gop<br />
<br />
menuentry "Arch Linux EFI" {<br />
set root=(hd0,3)<br />
#search --set -f /boot/vmlinuz26-efi-physical<br />
#loadbios /boot/vbtrace_bios.bin /boot/int10.bin<br />
linux /boot/vmlinuz26-efi-physical root=/dev/sda3 reboot=pci resume=/dev/sda3 resume_offset=151552<br />
initrd /boot/kernel26-efi-physical.img<br />
}<br />
<br />
menuentry "MacOSX" {<br />
set root=(hd0,2)<br />
# Search the root device for Mac OS X's loader.<br />
#search --set -f /usr/standalone/i386/boot.efi<br />
# Load the loader.<br />
chainloader /usr/standalone/i386/boot.efi<br />
}<br />
<br />
menuentry "Windows 7" {<br />
appleloader HD<br />
}<br />
<br />
menuentry "Boot from CD" {<br />
appleloader CD<br />
}<br />
<br />
menuentry "Boot from USB" {<br />
appleloader USB<br />
}<br />
</pre><br />
<br />
==Installation==<br />
{{ Note | This section is only required if you want to have Mac OS X installed along with Arch Linux. If not, follow the steps in the official install guide, then skip to [[MacBook#Post-Install Configuration | post install]].}}<br />
<br />
* Boot from the Arch Linux install CD.<br />
{{Note | Some MacBook users report strange keyboard output such as long delays and character doubling. To fix this problem, boot with following options.}}<br />
{{Note | As of 4/30/2011, Macbook 7,1 models will not boot with the normal iso, but the latest [https://wiki.archlinux.org/index.php/Archboot archboot] iso should work.}}<br />
boot: arch noapic irqpoll acpi=force<br />
<br />
* Log in as '''root'''<br />
<br />
* Run the Arch installer:<br />
<br />
/arch/setup<br />
<br />
* Proceed through the installation as described in the [[Official Arch Linux Install Guide]] '''except''' in the following areas:<br />
** In the [[Official Arch Linux Install Guide#Prepare Hard Drive | prepare hard drive]] stage do only the [[Official Arch Linux Install Guide#Manually configure block devices, filesystems and mountpoints | set filesystem mountpoints]] step, taking care to assign the correct partitions.<br />
** In the [[Official Arch Linux Install Guide#Install Bootloader | install boot loader]] stage, edit the menu.lst file and add '''reboot=pci''' to the end of the '''kernel''' lines, for example: <pre style="margin: .5em 0; padding: .5em 1em">kernel /vmlinuz26 root=/dev/sda5 ro reboot=pci</pre> This will allow your MacBook to reboot correctly from Arch.<br />
** Also in the [[Official Arch Linux Install Guide#Install Bootloader | install boot loader]] stage, install GRUB on whatever partition that {{Codeline|/boot}} is on. {{Warning | Do not install GRUB onto ''/dev/sda'' !!! Doing so is likely to lead to an unstable post-environment.}}<br />
** In the [[Official Arch Linux Install Guide#Configure System | configure system]] stage, edit /etc/mkinitcpio.conf and add the '''usbinput''' hook to the '''HOOKS''' line somewhere after the '''autodetect''' hook. This will load the drivers for your keyboard in case you need to use it before Arch boots (e.g. entering a [[LUKS]] password or using the troubleshooting shell).<br />
<br />
* When the install process is complete, reboot your computer.<br />
# reboot<br />
<br />
* Hold down the eject key as your MacBook starts, this should eject the Arch Linux install disk.<br />
<br />
=== Additional steps for Arch Linux only install===<br />
{{ Note | Do this after you tested that your setup is working. This procedure has been tested on a MacBook 4,1 with an msdos partition table. It may not work on newer versions. Please update if it works for you.}}<br />
* In order for Linux to boot up straight away, you will have to tell the firmware that your /boot partition is bootable, or you will always have to hold down the option (alt) key whenever you want to start up your computer.<br />
* In order to do this you will need '''a)''' The original Mac OS X install disk, and '''b)''' a [http://refit.sourceforge.net/doc/c1s5_burning.html rEFIt live CD] ('''no''' rEFIt installation is reqired)<br />
* Boot the rEFIt live CD (hold down the option (alt) key during boot and then choose the rEFIt option)<br />
* Move the cursor down to the partition tool (the small hard drive with the pie chart) and enter<br />
** Ignore any messages, exit the application and reboot with your Mac OS X installation disk in your drive.<br />
* Boot into it (you may need to hold the option (alt) key during boot again to access it)<br />
** Acknowledge the language prompt, open the terminal (found under the Utilities menu in the menu bar), and type:<br />
# diskutil list<br />
** Find the device name of your /boot partition (this is your root (/) partition, if you don't have it separate). The format should be /dev/disk0sX, where X is a number from 1 to infinity<br />
** Then type (replace X with the appropriate number):<br />
# bless --device /dev/disk0sX --setBoot --legacy --verbose<br />
* Remove the installation disk and restart your computer<br />
* After a few seconds of grey screen, your boot loader screen should appear automatically.<br />
<br />
==Post-Install Configuration==<br />
<br />
=== Xorg ===<br />
<br />
Install and configure Xorg by following the [[Xorg]] article.<br />
<br />
==== Video ====<br />
<br />
Different MacBook models have different graphic cards.<br />
<br />
To see which graphics card you have type:<br />
<br />
$ lspci | grep VGA<br />
<br />
* If it returns a string containing '''intel''' you only need the '''xf86-video-intel''' driver. You can install it by typing<br />
<br />
# pacman -S xf86-video-intel<br />
<br />
* if it returns '''nVidia''', read [[NVIDIA]].<br />
<br />
* otherwise if it returns '''ATI''' or '''AMD''', read [[ATI]].<br />
<br />
===== NVIDIA note =====<br />
<br />
{{ Tip | MBP 6.2 - With the proprietary [[NVIDIA]] drivers, support for [https://wiki.archlinux.org/index.php/NVIDIA#Enabling_Pure_Video_HD_.28VDPAU.2FVAAPI.29 Pure Video HD] is available for hardware video decoding. }}<br />
<br />
For MacBooks with NVIDIA graphics, for the backlight to work properly you may need the [http://aur.archlinux.org/packages.php?ID=25467 nvidia-bl] package found in the [[AUR]].<br />
<br />
===== Macbook 6.2+ - EFI =====<br />
<br />
As of 4/30/2011, the proprietary nvidia driver is not known to work under X with this model in efi mode. The nouveau driver should work out of the box, but dri should be installed from the [http://aur.archlinux.org/packages/mesa-git/PKGBUILD mesa-git] package.<br />
<br />
==== Touchpad ====<br />
<br />
The touchpad should have basic functionality by default. A true multitouch driver which behaves very similarly to native OSX can be installed from the AUR: [http://aur.archlinux.org/packages.php?ID=46339 xf86-input-multitouch-git]. It supports 1, 2 and 3 finger gestures, including differentiation between horizontal and vertical 3 finger swipe. Additional details are available at [http://bitmath.org/code/multitouch/ the driver's project page].<br />
<br />
xf86-input-multitouch-git does not support any sort of configuration without editing the driver's source. Some users are also experiencing issues with false clicks from palm touches. There is now a much more configurable fork available as [http://aur.archlinux.org/packages.php?ID=48505 xf86-input-mtrack-git]. Configuration options are documented in the [https://github.com/BlueDragonX/xf86-input-mtrack readme].<br />
<br />
The following mtrack options work well on a Macbook 7,1:<br />
<br />
Option "Thumbsize" "50"<br />
Option "ScrollDistance" "100"<br />
<br />
Probably you need also to add:<br />
<br />
MatchDevicePath "/dev/input/event10"<br />
<br />
'''Special Note About Older Macbook Models (confirmed on MacBook 2,1):''' On older Macbook models (pre-multitouch), the touchpad will not function properly until you install the xf86-input-synaptics package. Please see [[Touchpad Synaptics]] for more information on installing and configuring this package.<br />
<br />
==== Keyboard ====<br />
<br />
MacBook keyboard works by default. For swaping fn keys with Fx keys see [[Apple Keyboard]].<br />
<br />
To enable it you can map with right application like '''xbindkeys''' or through DE preferences; but another very good way, that we recommend, is to install [http://aur.archlinux.org/packages.php?ID=14833 pommed] from the [[AUR]].<br />
<br />
Edit the '''/etc/pommed.conf''' according to your hardware on MacBook, building<br />
it from '''/etc/pommed.conf.mac''' or '''/etc/pommed.conf.ppc''' example files.<br />
<br />
Note that you can also run it without a configuration file, the defaults may work for you. Then<br />
<br />
Put '''pommed''' at the end in your '''DAEMONS''' array in your '''/etc/rc.conf'''<br />
<br />
finally reboot your pc.<br />
<br />
{{ Tip | if you are using Gnome or KDE you can easily configure ''3rd level functionality'', ''multimedia key'', etc. in Keyboard Preferences.}}<br />
<br />
{{ Note | see the [[Xorg input hotplugging]] page for other configuration information.}}<br />
<br />
<br />
<br />
===== NVIDIA note =====<br />
<br />
If the brightness does not function correctly through pommed, make sure you have installed the [http://aur.archlinux.org/packages.php?ID=25467 nvidia-bl] package and insert<br />
<br />
find . -name "*" -exec sed -i 's/mbp_backlight/nvidia_backlight/' '{}' \;<br />
<br />
into the second line of the pommed PKGBUILD build() function and remake the package. From [https://bbs.archlinux.org/viewtopic.php?id=105091 this forum post].<br />
<br />
Another possible solution is to modify the pommed PKGBUILD build():<br />
<br />
find . -name "*" -exec sed -i 's/nvidia_backlight/apple_backlight/' '{}' \;<br />
<br />
=== Wifi ===<br />
{{ Tip | MBP 6.2: since kernel 2.6.32.35-1 this works out of the box }}<br />
<br />
Different MacBook models have different wireless cards.<br />
<br />
You can easily check what card do your MacBook have by:<br />
<br />
# lspci | grep Network<br />
<br />
* if you have an Atheros all should works-out-of-the-box.<br />
<br />
* instead if you have a Broadcom follow the [[Broadcom BCM4312]] page.<br />
<br />
* 5.0 and 6.0 generation MacBooks may have a BCM43xx, follow the instructions for the broadcom-wl driver on the [[Broadcom wireless]] page. The interfaces can swap during reboot so its best to define them in a udev rule (instructions on the [[Broadcom wireless]] page).<br />
<br />
* 8.1 generation MacBooks have BCM4331, for which support is not present in either Linux (3.0 and 3.1) or the proprietary drivers by Broadcom. There is however preliminary support for it in Linux 3.2. To run the drivers on earlier kernels, you will need to use [http://wireless.kernel.org/en/users/Download compat-wireless]<br />
<br />
''Note'': if your connection frequently drops, you may have to turn off wifi power management. If you are running [[pm-utils]], you may override wireless power management by creating an executable file /etc/pm/wireless with the lines <pre>#!/bin/sh<br />
/sbin/iwconfig wlan0 power off</pre><br />
<br />
=== Power management ===<br />
<br />
==== Laptop-mode-tools ====<br />
<br />
Because the MacBook is obviously a laptop, you may wish to control its power management features using something like [[Laptop Mode Tools]].<br />
<br />
However, Laptop Mode Tools is known to disable the keyboard in console mode after being idle for a few seconds (does not happen when using X). If this happens to you set <br />
<br />
CONTROL_USB_AUTOSUSPEND=0<br />
<br />
in {{Filename|/etc/laptop-mode/conf.d/usb-autosuspend.conf}}. See this [https://bbs.archlinux.org/viewtopic.php?pid=984831 forum thread] for the original workaround.<br />
<br />
==== Suspend to RAM (kernel suspend) ====<br />
<br />
Suspend (the kernel suspend) should work out of the box (I had a problem in which the machine would "suspend immediately after resume" in certain conditions when suspending by closing the lid. This was solved by de-selecting the option "event_when_closed_battery" in gconf-editor &rarr; gnome-power-manager &rarr; actions).<br />
<br />
For a macbook2,1 (bought in 2007) s2ram works using <br />
s2ram -f -a 3 <br />
To make it work with kde4 you have to create a file named "config" into /etc/pm/config.d containing<br />
SLEEP_MODULE="uswsusp"<br />
S2RAM_OPTS="-f -a 3"<br />
<br />
For a MacBook Pro 3,1 (bought in 2008), the following command should work, both in X and in a console:<br />
s2ram -f -a 1<br />
<br />
Note: If you use pm-utils suspending lead (at least for me) disk freeze. Try changing /etc/pm/config.d/module to<br />
SLEEP_MODULE=tuxonice<br />
<br />
For a macbook5.5, s2ram may work using (be sure to run it in X)<br />
s2ram -f -p -m<br />
<br />
==== Suspend to disk (hibernate) ====<br />
<br />
Hibernate should work if you have a swap partition. If you opted for a swap file because of the MBR limitation to 4 primary partitions, you can still get hibernate functionality by following these instructions (this is mostly taken from http://ubuntuforums.org/showthread.php?t=1042946):<br />
<br />
* Create a swapfile (here 2G = bs*count):<br />
sudo dd if=/dev/zero of=/swapfile bs=1024 count=2M<br />
It is recommended, but not necessary, to create the swapfile on a newly created partition, so that fragmentation is minimum.<br />
# chmod 600 swapfile <br />
# mkswap swapfile <br />
mkswap: swapfile: warning: don't erase bootbits sectors<br />
on whole disk. Use -f to force.<br />
Setting up swapspace version 1, size = 2097148 KiB<br />
no label, UUID=6bf46166-4f9e-433a-aac1-91cb3f5cf8ba<br />
# <br />
Note that we will not use this UUID later.<br />
* Add the swapfile in fstab:<br />
/swapfile none swap sw 0 0<br />
* Determine the UUID of partition on which the swapfile is (/sbin/blkid is provided by util-linux-ng)<br />
# blkid -g<br />
# blkid<br />
/dev/sda4: UUID="388014d3-1d18-4ca0-980e-ef2f9fdebde4" TYPE="ext3" <br />
388014d3-1d18-4ca0-980e-ef2f9fdebde4 is the number we are looking for.<br />
* Determine the physical offset of the swapfile:<br />
$ sudo filefrag -v /swapfile | head<br />
Filesystem type is: ef53<br />
Filesystem cylinder groups is approximately 132<br />
File size of /swapfile is 2147483648 (524288 blocks, blocksize 4096)<br />
ext logical physical expected length flags<br />
0 0 24576 12 merged<br />
1 12 24589 24587 1024 merged<br />
2 1036 25615 25612 1024 merged<br />
3 2060 26640 26638 1024 merged<br />
4 3084 27665 27663 1024 merged<br />
5 4108 28690 28688 1024 merged<br />
$ <br />
Here, 24576 is the number we want.<br />
* Edit /boot/grub/menu.lst and add:<br />
resume=/dev/disk/by-uuid/388014d3-1d18-4ca0-980e-ef2f9fdebde4 resume_offset=24576<br />
to your kernel stanza options (or use the kopt method as in the post). Note that the "resume=UUID=" actually did not work for me. I had to use the /dev/disk/by-uuid syntax.<br />
* Nothing to do with update-grub nor mkinitcpio.<br />
* Reboot once<br />
* Try to hibernate<br />
<br />
=== Sound ===<br />
{{ Tip | MBP 5.5: since kernel 2.6.32 this works out of the box - just unmute the front speakers and store the sound level }}<br />
<br />
First of all follow [[ALSA]] wiki page, then if something does not work correctly, continue reading this part.<br />
<br />
Edit your '''/etc/modprobe.d/50-sound.conf''' or '''/etc/modprobe.d/modprobe.conf''' appending this line:<br />
<br />
options snd_hda_intel model=intel-mac-auto<br />
<br />
This should automatically specify the codec in your MacBook. Alternatively, for MacBookPro5,X, you can use:<br />
<br />
options snd_hda_intel model=mb5<br />
<br />
(note that the jack output is controlled with "HP").<br />
<br />
If you have an iMac8,1, you should instead use<br />
<br />
options snd-hda-intel model=mbp3 position_fix=2<br />
<br />
{{ Note | you can try to specify other options, agree with in your hardware. All other possible settings are listed in Kernel Documentation, avaible online:<br />
<br />
* [http://www.kernel.org/doc/Documentation/sound/alsa/ALSA-Configuration.txt ALSA-Configuration.txt]<br />
* [http://www.kernel.org/doc/Documentation/sound/alsa/HD-Audio.txt HD-Audio.txt]<br />
* [http://www.kernel.org/doc/Documentation/sound/alsa/HD-Audio-Models.txt HD-Audio-Models.txt].}}<br />
<br />
Then, reboot.<br />
<br />
=== Bluetooth ===<br />
<br />
{{Note|Bluetooth should work out-of-the box. The hid2hci utility is used by default since bluez 4.91}}<br />
<br />
See the article on [[Bluetooth]] to install and configure all software needed.<br />
<br />
Then if Bluetooth does not work out-of-the-box, you should edit your '''/etc/conf.d/bluetooth''' to enable '''hid2hci''' by uncommenting related line as follows:<br />
<br />
HID2HCI_ENABLE="true"<br />
<br />
Then restart your bluetooth daemon or simply reboot your pc.<br />
<br />
{{ Tip | for advanced bluetooth information see [[Bluetooth]] page.}}<br />
<br />
=== iSight ===<br />
<br />
{{ Tip | MBP 6.2+ (Kernel ~2.6.37+) iSight works out of the box without the need to use firmware from OS X. }}<br />
<br />
{{ Note | linux kernel from 2.6.26 includes the '''Linux UVC driver''' natively. You will not need to download the driver sources manually unless you want to test a newer version or help with development. iSight should work using the instructions below for these kernel versions and up.}}<br />
<br />
iSight webcams require the Apple's proprietary firmware that cannot be redistributed because proprietary. Then we must extract it from MacOS and load it Arch.<br />
<br />
You will need to install [http://aur.archlinux.org/packages.php?ID=23525 isight-firmware-tools] from the [[AUR]] to extract the firmware. The AUR package also includes a udev rule and ELF binary that are necessary, even once you have extracted the firmware file into /lib/firmware/isight.fw, for the file to be loaded every time you boot your computer (namely /etc/udev/rules.d/isight.rules which uses /usr/lib/udev/ift-load).<br />
<br />
Instructions:<br />
<br />
First you need to get the firmware out of a particular file located on your OS X install. It is located in '''/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS/AppleUSBVideoSupport'''.<br />
<br />
<br />
{{ Tip | The AppleUSBVideoSupport file from a Mac OSX 10.6 (Snow Leopard) installation may not work properly. If possible, use the file from OSX 10.5 or before. }}<br />
<br />
To mount the MacOSX drive if multi-booting:<br />
<br />
# sudo mkdir /media/MacOSX<br />
# sudo mount -t hfsplus /dev/sda2 /media/MacOSX<br />
<br />
Then, install [http://aur.archlinux.org/packages.php?ID=23525 isight-firmware-tools] from the [[AUR]].<br />
<br />
Locate the AppleUSBVideoSupport file in the OSX directory listed above, either copy it over to your arch system (I was able to get this file from an iMac so any OSX installation will do, not one specific to your system) or if multi-booting mount the OSX drive and navigate to the directory. Now in that directory you can go ahead and extract the driver<br />
<br />
# ift-extract --apple-driver AppleUSBVideoSupport<br />
<br />
When it is done, check that the firmware has been found:<br />
<br />
# ls /lib/firmware/isight.fw<br />
<br />
Once that is done, you need to completely SHUTDOWN your Mac and start it back up again (because this clears the hardware state of the camera).<br />
<br />
{{ Tip | to save very much time in the future, you just need to place the '''isight.fw''' file you saved in '''/lib/firmware/''' and then shutdown and reboot as instructed above.}}<br />
<br />
Finally you can load the '''uvcvideo''' module or add it at the end of MODULES() array into your '''/etc/rc.conf''' if you want it to load at boot.<br />
<br />
# modprobe uvcvideo<br />
<br />
Everything should now work. You can use many applications to test the camera:<br />
<br />
* MPlayer<br />
<br />
# mplayer tv:// -tv driver=v4l2:width=320:height=240:device=/dev/video0 -fps 30<br />
<br />
* Cheese<br />
* Skype<br />
* Ekiga<br />
<br />
A simple solution to take snapshots is:<br />
<br />
# mplayer tv:// -vf screenshot<br />
<br />
and the pressing the s key to take a snapshot. Files are of the format shot\d\d\d\d.png and are reported in the standard output.<br />
<br />
=== Temperature Sensors ===<br />
<br />
For reading temperature just install and configure '''lm_sensors'''.<br />
See [[Lm sensors]] page.<br />
<br />
=== Color Profile ===<br />
<br />
We can use color profiles from Mac OS.<br />
<br />
First, install [http://aur.archlinux.org/packages.php?ID=10969 xcalib] from the [[AUR]].<br />
<br />
Second copy pre-saved color profiles placed in '''/Library/ColorSync/Profiles/Displays/''' on Mac OS partition to '''~/colorprofiles/''' for example.<br />
<br />
There are color profile files agree with in MacBook models; select the right one:<br />
<br />
* '''Color LCD-4271800.icc''' for MacBook Pro with CoreDuo CPU<br />
* '''Color LCD-4271880.icc''' for MacBook with Core2Duo<br />
* '''Color LCD-4271780.icc''' for MacBook (not Pro) based on CoreDuo or Core2Duo.<br />
<br />
{{ Tip | also Mac OS allows to save current color profile from '''Displays -> Color''' section of the '''Mac OS System Preferences''', in this case file is saved to '''/Users/<username>/Library/ColorSync/Profiles'''.}}<br />
<br />
Finally you can activate it by running<br />
<br />
# xcalib ~/colorprofile.icc<br />
<br />
{{ Warning | previous command set the color profile only for the current session; this mean that you must run it every time you login in your system. For automating it you can execute the command by '''Autostart Application''', concording with your DE (or add the command to your login manager's initialization script, e.g. /etc/gdm/Init/Default).}}<br />
<br />
{{ Note | see '''xcalib''' man pages for further information.}}<br />
<br />
=== Apple Remote ===<br />
<br />
First, to correctly install and configure the '''lirc''' software that control IR see [[Lirc]] wiki.<br />
<br />
Then make LIRC use '''/dev/usb/hiddev0''' (or '''/dev/hiddev0''') by editing '''/etc/conf.d/lircd'''. Here is how mine look:<br />
<br />
#<br />
# Parameters for lirc daemon<br />
#<br />
LIRC_DEVICE="/dev/usb/hiddev0"<br />
LIRC_DRIVER="macmini"<br />
LIRC_EXTRAOPTS=""<br />
LIRC_CONFIGFILE="/etc/lirc/lircd.conf"<br />
<br />
<br />
Use '''irrecord''' (available when installing lirc) to create a configuration file matching your remote control signals (alternatively, you can try to use the lircd.conf below):<br />
<br />
sudo irrecord -d /dev/usb/hiddev0 -H macmini output_conf_file<br />
<br />
Start '''lircd''' and use '''irw''' to check if it works.<br />
<br />
Example of an '''/etc/lirc/lircd.conf''':<br />
<br />
begin remote<br />
<br />
name lircd.conf.macbook<br />
bits 8<br />
eps 30<br />
aeps 100<br />
<br />
one 0 0<br />
zero 0 0<br />
pre_data_bits 24<br />
pre_data 0x87EEFD<br />
gap 211994<br />
toggle_bit_mask 0x87EEFD01<br />
<br />
begin codes<br />
Repeat 0x01<br />
Menu 0x03<br />
Play 0x05<br />
Prev 0x09<br />
Next 0x06<br />
Up 0x0A<br />
Down 0x0C<br />
end codes<br />
<br />
end remote<br />
<br />
===HFS Partition Sharing===<br />
<br />
First, we have to list our partitions. Use<br />
<br />
fdisk -l /dev/sda<br />
<br />
example output:<br />
<br />
# fdisk -l /dev/sda<br />
Device Boot Start End Blocks Id Type<br />
/dev/sda1 1 26 204819 ee GPT<br />
/dev/sda2 26 13602 109051903+ af Unknown<br />
/dev/sda3 * 13602 14478 7031250 83 Linux<br />
/dev/sda4 14478 14594 932832+ 82 Linux swap / Solaris<br />
<br />
As we see, the "Unknown" partition is our OS X partition, which is located in <code>/dev/sda2</code>.<br />
<br />
Create a "mac" folder in /media:<br />
<br />
sudo mkdir /media/mac<br />
<br />
Add at the end of ''/etc/fstab'' this line:<br />
<br />
/dev/sda2 /media/mac hfsplus auto,user,rw,exec 0 0<br />
<br />
Mount it :<br />
<br />
mount /media/mac<br />
<br />
and check it:<br />
<br />
ls /media/mac<br />
<br />
===HFS+ Partitions===<br />
<br />
HFS+ partitions, now the default in Mac OS X, are not fully supported by Linux and are mounted as read-only by default. In order to write to an HFS+ partition, it is necessary to disable journaling. This can be accomplished using Mac OS X Disk Utility. Refer to this [http://support.apple.com/kb/ht2355 Apple support page] for more information.<br />
<br />
===Home Sharing===<br />
<br />
'''''UID Synchronization'''''<br />
<br />
====In OS X====<br />
<br />
{{Note | it is strongly recommended that UID/GID manipulation be done immediately after a new user account is created, in OS X as well as in Arch Linux. If you installed OS X from scratch, then this operation is guaranteed to work after logging into your account for the first time.}}<br />
<br />
=====Step 1: Change UID and GID(s)=====<br />
<br />
'''''Pre-Leopard'''''<br />
<br />
# Open '''NetInfo Manager''' located in the ''/Applications/Utilities'' folder.<br />
<br />
# If not done for you already, enable access to user account transactions by clicking on the closed lock at the bottom of the window, and entering your account password, or root password if you have created a root account.<br />
<br />
# Navigate to ''/users/<new user name>'' where <new user name> is the name of the account that will have read/write access to the folder that will be shared with the primary user in Arch.<br />
<br />
# Change the '''UID''' value to 1000 (the value used by default for first user created in Arch).<br />
<br />
# Also change the '''GID''' value to 1000 (the value used by default for user account creation in Arch).<br />
<br />
# Navigate to ''/groups/<new user name>'', automatically saving the changes you have made so far.<br />
<br />
{{Note | if you get an error message that the transaction is not allowed, log out and log back in.}}<br />
<br />
'''''Leopard'''''<br />
<br />
In Leopard, the '''NetInfo Manager''' application is not present. A different set of steps is required for UID synchronization:<br />
<br />
# Open '''System Preferences'''.<br />
<br />
# Click on '''Accounts'''.<br />
<br />
# Unlock the pane if not already done so.<br />
<br />
# Right-click on the desired user and select '''Advanced Options'''.<br />
<br />
# Write down the value of the '''User ID''' field, you will need it later on. Change both the UID and GID to match the UID and GID of the account wished to be shared with in Arch (1000 by default for the first user created in Arch).<br />
<br />
=====Step 2: Change "Home" Permissions=====<br />
<br />
# Open up '''Terminal''' in the ''/Applications/Utilities'' folder.<br />
<br />
# Enter the following command to reclaim the permission settings of your home folder, replacing <your user name>, <your user group> and <your old UID> with the user name whose UID and GID values you just changed, the group name whose GID value you just changed and the old UID number, respectively.<br />
<br />
sudo find /User/<your user name> -user <your old UID> -exec chown <your user name>:<your user group> {} \;<br />
<br />
====In Arch====<br />
<br />
To synchronize your UID in Arch Linux, you are advised to perform this operation ''while creating a new user account''.<br />
It is therefore recommended that you do this as soon as you install Arch Linux.<br />
<br />
Now you must substitute Arch's home with Mac OS's home, by modify entries of the famous ''/etc/fstab'' file.<br />
<br />
=== Avoid long EFI wait before GRUB ===<br />
If your Macbook spends 30 seconds with "white screen" before GRUB shows, try booting from your Mac OS X install DVD, select language, then click Utilities->Terminal, and enter<br />
<pre><br />
# bless --device /dev/disk0s1 --setBoot --legacy<br />
</pre><br />
(given that if your GRUB is on sda1, /dev/disk0s2 if it is on sda2, etc). Via https://bbs.archlinux.org/viewtopic.php?pid=833215 <br />
<br />
=== Mute startup chime ===<br />
If you forgot to mute before installing, you can still mute again if you have a Mac OS X Install disk. Boot from it, select language, then click Utilities->Terminal, and enter<br />
<pre><br />
# /usr/sbin/nvram SystemAudioVolume=%01<br />
</pre><br />
(or whatever volume you want).<br />
<br />
==rEFIt==<br />
<br />
{{Note | this is not a requirement. It only gives you a menu to choose between OS X and Arch Linux upon every boot.}}<br />
<br />
For more see, [http://refit.sourceforge.net/myths/ refit myths].<br />
<br />
In OS X, download the ".dmg" from -> [http://refit.sourceforge.net/ Refit Homepage] and install it.<br />
<br />
{{Note | if you have already partitioned your hard disk in preparation for the Arch installation, rEFIt may not be enabled by default. You will have to run the "enable.sh" script installed in /efi/refit/.}}<br />
<br />
Open up '''Terminal''' and enter:<br />
<br />
cd /efi/refit; ./enable.sh<br />
<br />
===Problems with rEFIt===<br />
<br />
If you experience problems after the install of Arch or rEFIt, especially is the right OS is not showing up to boot to or if it dumps you at a GRUB prompt stuck like the following:<br />
<pre><br />
GRUB>_<br />
</pre><br />
<br />
Then have a look at this link:<br />
<br />
http://mac.linux.be/content/problems-refit-and-grub-after-installation<br />
<br />
It can give you a basic idea on how to boot off the Arch live cd, mount the problem Arch install, chroot, use gptsync, and reinstall GRUB. This is probably for more advanced users who can translate the commands from a debian system to an Arch system and also apply it to the partitions on their machine. Be careful not to install GRUB in the wrong spot.<br />
<br />
If you need a copy of gptsync you can wget it from here:<br />
http://packages.debian.org/sid/gptsync<br />
or try these, for 64 bit:<br />
<pre><br />
wget http://ftp.us.debian.org/debian/pool/main/r/refit/gptsync_0.14-2_amd64.deb<br />
</pre><br />
<br />
and for i386:<br />
<pre><br />
wget http://ftp.us.debian.org/debian/pool/main/r/refit/gptsync_0.14-2_i386.deb<br />
</pre><br />
<br />
since they are .deb packages you will need the program deb2targz<br />
<br />
pacman -S deb2targz<br />
<br />
== See also ==<br />
<br />
* http://www.netsoc.tcd.ie/~theorie/interblag/2010/01/30/installing-arch-linux-on-a-mac-pro/<br />
* http://allanmcrae.com/2010/04/installing-arch-on-a-macbook-pro-5-5/<br />
* http://linux-junky.blogspot.com/2011/08/triple-boot-archlinux-windows-7-and-mac.html<br />
<br />
=== Kernel patches for the MacBook Air (4,2) ===<br />
<br />
Currently (Linux 3.0.7) there are some bugs in the Linux kernel tree of Linus, that I (telmich) have fixed with patches from different sources:<br />
<br />
* Resolution 1280x800 instead of 1440x900<br />
* Trackpad not working correctly/being detected as Synaptics<br />
* FN-Key + F1..F12 not working (i.e. fn does not modify anything)<br />
* Incorrect FN-Key + F5-F12 mapping (Multimedia Keys)<br />
* Hanging network applications / brcmsmac driver<br />
<br />
You can get the source with patches at http://git.schottelius.org/?p=foreign/linux-macbook-air;a=summary<br />
The following branches are available:<br />
<br />
# keith-jiri: Graphics patches from Keith Packard, FN-Key patches from Jiri Kosina<br />
# keith-jiri-brcmsmac: As above + patch for hanging network drivers<br />
# jiri-kbdmapping: The FN-Key patches and mapping patches<br />
# keith-jiri-kbdmapping: Like 1) + Fix for Multimedia Keys<br />
# keith-jiri-kbdmapping-brcmsmac: Combination of the branches above ('''use this one, if unsure''')<br />
<br />
You build your kernel easily with the Archlinux kernel config:<br />
<br />
<pre><br />
# Clone and checkout correct branch before!<br />
cd linux-macbook-air<br />
<br />
# Use current config as base<br />
zcat /proc/config.gz > .config<br />
<br />
# Build new kernel<br />
# Will ask some CONFIG_* options that had not been in your Kernel<br />
make -j5<br />
</pre></div>JackH79https://wiki.archlinux.org/index.php?title=HAL&diff=84920HAL2009-11-24T09:15:05Z<p>JackH79: /* USB sticks and drives do not automount correctly */</p>
<hr />
<div>[[Category: Hardware detection and troubleshooting (English)]]<br />
[[Category:Daemons and system services (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{Article summary start| Summary}}<br />
{{Article summary text|Information on installing, configurating and troubleshooting HAL.}}<br />
{{Article summary heading|Languages}}<br />
{{i18n_entry|English|HAL}}<br />
{{i18n_entry|Español|HAL (Español)}}<br />
{{i18n_entry|简体中文|HAL (简体中文)}}<br />
{{i18n_entry|Français|HAL_(Français)}}<br />
{{i18n_entry|Italiano|HAL (Italiano)}}<br />
{{i18n_entry|Polish|HAL_(Polski)}}<br />
{{i18n_entry|Русский|HAL_(Русский)}}<br />
{{i18n_entry|Türkçe|HAL (Türkçe)}}<br />
{{Article summary end}}<br />
'''HAL''' (Hardware Abstraction Layer) is a daemon that allows desktop applications to readily access hardware information so that they can locate and use such hardware regardless of bus or device type. In this way a desktop GUI can present all resources to its user in a seamless and uniform manner.<br />
<br />
==Overview==<br />
There are a number of factors involved in 'hotplugging' and HAL is only one of them. When a new device is added, e.g. a USB drive is plugged in, the following occurs (roughly):<br />
* The kernel becomes aware of a new device and registers it in {{Filename|/sys}}.<br />
* [[Udev]] creates a device node (e.g. {{Filename|/dev/sdb1}}), and loads the drivers/modules needed.<br />
* The HAL daemon is notified by [[D-Bus]] and adds the device and what it can find out about it to its database.<br />
* The addition of the new device is broadcast by HAL over D-Bus to whatever programs are subscribing, e.g. Thunar, which shows it as an icon in the shortcuts side panel, or Metacity/Nautilus which will add an icon to the desktop.<br />
* Another program listening may be a volume manager, such as thunar-volman or [[autofs | AutoFS]], configured to automatically create mount points and mount certain types of drives, start Rhythmbox whenever an iPod is connected, etc.<br />
<br />
HAL does not detect the hardware (kernel), manage the devices or the drivers (udev) or automount drives (volume managers). As a '''h'''ardware '''a'''bstraction '''l'''ayer, its role is more akin to a communications center, providing your applications with a clean interface to the devices. Problems with hot-plugged devices not being properly detected, usable, or mounted should be investigated, knowing that it is a long chain and there are more components involved (see 'Troubleshooting').<br />
<br />
===About volumes mount points===<br />
HAL mounts your volumes under {{Filename|/media/''some_folder''}}. To determine what ''some_folder'' should be it uses the '''label''' of a volume or, if the volume does not have a label, it uses the volume's '''type''' (eventually followed by a number if the directory already exists), for example: {{Filename|/media/disk}}, {{Filename|/media/disk-1}} ...<br />
<br />
To give a label to a partition you can use '''GParted''' (available in extra) or its KDE equivalent '''PartitionManager''' (available in [[AUR]]).<br />
<br />
Also keep in mind these three common problems that stop HAL from mounting a device:<br />
*the directory {{Filename|/media/''label_of_your_volume''}} must ''not'' exist, it will be dynamically created and destroyed by HAL<br />
*the device must ''not'' be listed in fstab, otherwise HAL will refuse to mount it<br />
*you must have the right to mount the device, see [[#Permission Denied|Permission Denied]] for more details<br />
<br />
If for some reason you ''cannot'' give a label to your partition you can give a fake label to HAL, you will need two things to do so:<br />
* '''$device_uuid''', the uuid of the device ({{Codeline|ls -l /dev/disk/by-uuid/}} may help you for that)<br />
* '''$device_name''', the fake label you chose<br />
<br />
Place this into {{Filename|/etc/hal/fdi/policy/20-'''$device_name'''.fdi}} without forgetting to replace '''$device_uuid''' and '''$device_name''' by their values.<br />
{{File|name=/etc/hal/fdi/policy/20-$device_name.fdi|content=<nowiki><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<deviceinfo version="0.2"><br />
<device><br />
<match key="volume.uuid" string="</nowiki>'''$device_uuid'''<nowiki>"><br />
<merge key="volume.label" type="string"></nowiki>'''$device_name'''<nowiki></merge><br />
</match><br />
</device><br />
</deviceinfo><br />
</nowiki>}}<br />
<br />
==Install and configure HAL==<br />
<br />
===Step 1: Install===<br />
The HAL daemon requires the presence of the D-Bus daemon, so we need to make sure both are installed. <br />
# pacman -S hal dbus<br />
<br />
Edit {{Filename|/etc/rc.conf}} as root with your favorite editor and add '''dbus''' & '''hal''' to the DAEMONS array, for example:<br />
DAEMONS=(syslog-ng '''dbus hal''' network netfs ...)<br />
The DBus and HAL daemons will now load at boot time. While HAL would load dbus automatically if it was not already running it would not unload it properly at shutdown. Therefore to avoid any complications it is best to load DBus before HAL through your daemons array.<br />
<br />
NOTE: Some people have reported problems with this setup. If you also experience problems also you should try loading '''hal''' first followed by '''dbus'''.<br />
<br />
Or, you could start HAL manually by issuing the following command as root:<br />
# /etc/rc.d/hal start<br />
<br />
For D-Bus and HAL to be of any practical use, local user accounts should be members of the following [[groups]]: '''optical''' and '''storage'''. To achieve this, open a terminal and type the following commands as root:<br />
# gpasswd -a ''username'' optical<br />
# gpasswd -a ''username'' storage<br />
Replace ''username'' with your actual username (e.g. johndoe).<br />
<br />
For those group changes to take effect, you have to completely logout and login again.<br />
<br />
===Step 2: Configure===<br />
Your programs communicate with HAL controlled devices through a D-Bus interface. A number of [http://people.freedesktop.org/~david/hal-spec/hal-spec.html#interfaces interfaces] are defined, each associated with a number of methods: The storage device interface, for example, has the methods 'eject' and 'close tray' (for optical drives). In order to 'mount' a partition on a USB key, you need access to the relevant D-Bus interface ('volume' in this case). <br />
<br />
The configuration file {{Filename|/etc/dbus-1/system.d/hal.conf}} specifies HAL-specific privileges, i.e. which users have access to which interfaces. These are defined as exceptions to the overall restrictions imposed on using D-Bus interfaces, specified in {{Filename|/etc/dbus-1/system.conf}}. In short, you will need to see that {{Filename|hal.conf}} grants your user the right to access specific DBUS/HAL interfaces, because the D-Bus default is not to let you access them.<br />
<br />
The default {{Filename|hal.conf}} will contain a number of policies denying and allowing access, amongst them this default (the later of two defaults and therefore seemingly the deciding one):<br />
{{File|name=/etc/dbus-1/system.d/hal.conf|content=<nowiki><br />
<!-- Default policy for the exported interfaces --><br />
<policy context="default"><br />
<deny send_interface="org.freedesktop.Hal.Device.SystemPowerManagement"/><br />
<deny send_interface="org.freedesktop.Hal.Device.VideoAdapterPM"/><br />
<deny send_interface="org.freedesktop.Hal.Device.LaptopPanel"/><br />
<deny send_interface="org.freedesktop.Hal.Device.Volume"/><br />
<deny send_interface="org.freedesktop.Hal.Device.Volume.Crypto"/><br />
</policy><br />
</nowiki>}}<br />
<br />
In short, users are by default denied access to interfaces like Volume which has methods such as mount and unmount. This is overruled by policies allowing users of the groups 'power' and 'storage' to access their respective devices:<br />
{{File|name=/etc/dbus-1/system.d/hal.conf|content=<nowiki><br />
<policy group="power"><br />
<allow send_interface="org.freedesktop.Hal.Device.SystemPowerManagement"/><br />
<allow send_interface="org.freedesktop.Hal.Device.LaptopPanel"/><br />
</policy><br />
<br />
<policy group="storage"><br />
<allow send_interface="org.freedesktop.Hal.Device.Volume"/><br />
<allow send_interface="org.freedesktop.Hal.Device.Volume.Crypto"/><br />
</policy><br />
</nowiki>}}<br />
<br />
That is why you will want to add your user to those [[groups]], thus reducing the number of customized configuration files.<br />
<br />
====Device specific policies====<br />
<br />
=====NTFS write access=====<br />
Upon [[NTFS Write Support|installing ntfs-3g]], a HAL policy file will be created at /usr/share/hal/fdi/policy/10osvendor. This will use ntfs-3g for all NTFS volumes. Simply restart HAL, and NTFS volumes should be writeable.<br />
<br />
=====Enable the noatime mount option for removable devices=====<br />
This will speed up file operations and also reduce wear on flash memory devices like USB sticks or SD cards.<br />
{{File|name=/etc/hal/fdi/policy/20-noatime-removable.fdi|content=<nowiki><br />
<device> <br />
<match key="block.is_volume" bool="true"><br />
<match key="@block.storage_device:storage.hotpluggable" bool="true"><br />
<merge key="volume.policy.mount_option.noatime" type="bool">true</merge><br />
</match><br />
<match key="@block.storage_device:storage.removable" bool="true"><br />
<merge key="volume.policy.mount_option.noatime" type="bool">true</merge><br />
</match><br />
</match><br />
</device><br />
</nowiki>}}<br />
<br />
=====Disable Automount on login=====<br />
You may want to disable automounting of ntfs(/or other filesystem) partitions on login.<br />
<br />
{{File|name=/etc/hal/fdi/policy/20-disable-automount.fdi|content=<nowiki><br />
<device><br />
<match key="storage.hotpluggable" bool="false"><br />
<match key="storage.removable" bool="false"><br />
<merge key="storage.automount_enabled_hint" type="bool">false</merge><br />
</match><br />
</match><br />
</device><br />
</nowiki>}}<br />
<br />
===Step 3: Start or re-start HAL===<br />
For your changes to take effect you need to (re)start HAL:<br />
# /etc/rc.d/hal restart<br />
<br />
==Troubleshooting==<br />
{{Note|for your changes to take effect you need to restart HAL with {{Codeline|/etc/rc.d/hal restart}} !}}<br />
<br />
===Mounting fails===<br />
<br />
====IsCallerPrivileged failed====<br />
If you get a message "IsCallerPriviliged failed" and are not using KDM or GDM, use ck-launch-session (part of the '''consolekit''' package) to start your DE/WM.<br />
<br />
For example with startx/KDE, this was originally in {{Filename|~/.xinitrc}}:<br />
exec startkde<br />
The new version:<br />
exec ck-launch-session startkde<br />
<br />
====Cannot mount internal drives from Gnome====<br />
If you cannot mount your internal drives in Gnome (by clicking on them in Nautilus), open Authorizations under System -> Preferences, then navigate to org.freedesktop.hal.storage. Select Mount file systems from internal drives, click on Edit, and change Active Console to Yes.<br />
<br />
====Permission Denied====<br />
{{Note|1=An alternative approach for solving this issue is presented in [http://bbs.archlinux.org/viewtopic.php?id=65070 I won the struggle against hal and policykit]. It also helps to correct issues with powerdown and shutdown of the system.}}<br />
<br />
If you just upgraded to hal-0.5.11-7 and suddenly mounting a device stopped working for non-root users with one of these errors:<br />
* "PermissionDeniedByPolicy mount-removable no"<br />
* "PermissionDeniedByPolicy mount-removable-extra-options no"<br />
* "org.freedesktop.hal.storage.mount-removable no <-- (action, result)"<br />
* "org.freedesktop.hal.storage.mount-removable-extra-options no <-- (action, result)"<br />
you can fix the situation by editing {{Filename|/etc/PolicyKit/PolicyKit.conf}} and paste the following into the <config> section:<br />
{{File|name=/etc/PolicyKit/PolicyKit.conf|content=<nowiki><br />
<match user="</nowiki>'''$USER'''<nowiki>"><br />
<!-- replace with your login or delete the line if you want to allow all users to manipulate devices (keep security issues in mind though) --><br />
<match action="org.freedesktop.hal.storage.*"><br />
<return result="yes"/><br />
</match><br />
<match action="hal-storage-mount-fixed-extra-options"><br />
<!-- for internal devices mounted with extra options like a wished mount point --><br />
<return result="yes" /><br />
</match><br />
<match action="hal-storage-mount-removable-extra-options"><br />
<!-- for external devices mounted with extra options like a wished mount point --><br />
<return result="yes" /><br />
</match><br />
</match> <!-- do not forget to delete this line if you deleted the first one --><br />
</nowiki>}}<br />
Restart dbus and hal. If you used KDE you will have to restart KDE as well (the device notifier will not get it otherwise and will stop responding altogether). This was taken from Gullible Jones' "So long, Arch" thread as a hotfix for exactly this type of breakage and is probably not the best fix (especially for machines with a large number of users), but it works.<br />
<br />
{{Note|make sure you type your user name like this {{Codeline|<match user<nowiki>=</nowiki>"myuser">}} and NOT like {{Codeline|<match user<nowiki>=</nowiki>"$myuser">}}.}}<br />
<br />
=====Alternate Fixes=====<br />
* Allowing everything (not recommended because of security constraints):<br />
<match user="yourusername"><br />
<return result="yes"/><br />
</match><br />
<br />
* If you start your window manager from .xinitrc, see suggestion 2 entries up under [[HAL:IsCallerPrivileged failed]]<br />
<br />
* You could also:<br />
{{File|name=/etc/PolicyKit/PolicyKit.conf|content=<nowiki><br />
<config version="0.1"><br />
<define_admin_auth user="USER"/><br />
</config><br />
</nowiki>}}<br />
Where USER is your username<br />
<br />
This gives the user specified admin authority which is the same hal authority level used by the hal and root users:<br />
{{File|name=~.xinitrc|content=<nowiki><br />
exec ck-launch-session window-manager<br />
</nowiki>}}<br />
<br />
===Auto-mounting fails===<br />
<br />
====Inserted CD/DVD does not get recognized by HAL====<br />
If inserted CDs/DVDs are not recognized by HAL (no icon on the desktop or notification), check {{Filename|/etc/fstab}} and remove the lines for the optical drives.<br />
<br />
If that does not work, it may be because your device is not "checked" for automount by HAL. I am not sure why but you may have a file under {{Filename|/etc/hal/fdi/information/media-check-disable-storage_model_'''$YOUR_DEVICE'''.fdi}} which should have a content similar to:<br />
{{File|name=/etc/hal/fdi/information/media-check-disable-storage_model_'''$YOUR_DEVICE'''.fdi|content=<nowiki><br />
<deviceinfo version="0.2"><br />
<device><br />
<match key="info.udi" string="/org/freedesktop/Hal/devices/storage_model_DV$<br />
<merge key="storage.media_check_enabled" type="bool">false</merge><br />
</match><br />
</device><br />
</deviceinfo><br />
</nowiki>}}<br />
If the key is set to false (it was in my case), all you have to do is to change the value of the key to true.<br />
<br />
====USB sticks and drives do not automount correctly====<br />
This sub-section is sourced from [http://bbs.archlinux.org/viewtopic.php?pid=248224 this forum page].<br />
<br />
If you are experiencing problems with automounting USB sticks and/or drives, but do not have problems with mounting CDs or DVDs, and if you are able to manually mount the USB device in question, then you should create the file "preferences.fdi" in the folder {{Filename|/etc/hal/fdi/policy}} and paste the following line into the file<br />
{{File|name=/etc/hal/fdi/policy/preferences.fdi|content=<nowiki><br />
<merge key="volume.ignore" type="bool">false</merge><br />
</nowiki>}}<br />
<br />
Also, if you have GParted installed, you might need to delete {{Filename|/usr/share/hal/fdi/policy/gparted-disable-automount.fdi}} as mentioned at the end of [http://bbs.archlinux.org/viewtopic.php?pid=310284].<br />
<br />
Also you should remove from {{Filename|/etc/fstab}} lines, corresponding to usb devices which should be mounted by hal automatically.<br />
<br />
If this still doesn't work, follow the guidelines in [http://wiki.archlinux.org/index.php/Udev#Tips_.26_Tricks].<br />
<br />
===Removing USB flash causes improper unmount===<br />
If you remove your USB flash without previously unmounting it, automatic unmount by HAL may work improperly.<br />
<br />
You may find that corresponding records from {{Filename|/media/.hal-mtab}} is not deleted, and in nautilus device list (and also on GNOME desktop) remains link to an empty folder, where the device was previously mounted. <br />
<br />
This may be corrected by unmounting flash drive with "lazy" parameter. To do so, you should do some tweaking:<br />
<br />
1) Create an executable script {{Filename|/usr/lib/hal/hal-unmount.sh}} with access rights 755 and the following content<br />
{{File|name=/usr/lib/hal/hal-unmount.sh|content=<nowiki><br />
#!/bin/sh <br />
# sanity check. DEVNAME should start with a / <br />
[ "$DEVNAME" != "${DEVNAME#/}" ] || exit 0<br />
# Lazily unmount drives which are removed, but still mounted <br />
if [ "$ACTION" = remove ] ; then<br />
if [ -x /usr/bin/pumount ] ; then<br />
/usr/bin/pumount -l "$DEVNAME";<br />
else<br />
/bin/umount -l "$DEVNAME";<br />
fi<br />
fi<br />
exit 0<br />
</nowiki>}}<br />
<br />
2) Then you should tell HAL to run this script when you remove your usb stick. To do so, you should add to {{Filename|/etc/udev/rules.d/90-hal.rules}} the following line:<br />
{{File|name=/etc/udev/rules.d/90-hal.rules|content=<nowiki><br />
SUBSYSTEM=="block", ACTION=="remove", RUN+="/usr/lib/hal/hal-unmount.sh"<br />
</nowiki>}}<br />
<br />
3) Execute<br />
# /etc/rc.d/hal restart<br />
<br />
===NTFS issues===<br />
<br />
====The last resort====<br />
{{Warning|This should only be used as a last resort 'hack' if HAL is unable to properly recognize and mount (rw) ntfs drives.}}<br />
<br />
If the above policy does not work (make sure you restarted hal) you can force HAL (and all your other programs) to use the ntfs-3g driver instead of the standard ntfs driver. As root create a symbolic link from mount.ntfs to mount.ntfs-3g:<br />
# ln -s /sbin/mount.ntfs-3g /sbin/mount.ntfs<br />
<br />
Possible issues using this method:<br />
* if mount is called with the "-i" option it does not work<br />
* possible issues with the kernel ntfs module<br />
<br />
====Locale issues====<br />
{{Note|this should not happen anymore with ntfs-3g 2009.1.1 and newer.}}<br />
<br />
You may have problem with filenames containing non-latin characters. This happens because your mounthelper is not parsing the policies and locale option correctly. There is a workaround for this:<br />
<br />
* Remove this symlink: {{Codeline|rm /sbin/mount.ntfs-3g}}<br />
<br />
* Replace it with a new bash script containing:<br />
{{File|name=/sbin/mount.ntfs-3g|content=<nowiki><br />
#!/bin/bash<br />
/bin/ntfs-3g $1 "$2" -o locale=</nowiki>'''en_US.UTF-8'''<nowiki>,$4 # put your own locale here<br />
</nowiki>}}<br />
<br />
* Make it executable: {{Codeline|chmod +x /sbin/mount.ntfs-3g}}<br />
<br />
* Add a line to the pacman configuration file:<br />
{{File|name=/etc/pacman.conf|content=<nowiki><br />
...<br />
NoUpgrade = sbin/mount.ntfs-3g<br />
...<br />
</nowiki>}}<br />
<br />
==External links==<br />
*[http://people.freedesktop.org/~david/hal-spec/hal-spec.html HAL 0.5.10 specifications]<br />
:A comprehensive HAL specification and introduction<br />
<br />
*[http://dventurin.blogspot.com/2007/04/udev-hal-dbus.html Dam's blog]<br />
:An attempt to clarify the division of labor among the kernel, udev, D-Bus and HAL with links to HOWTOs and FAQs on each<br />
<br />
*[http://people.freedesktop.org/~david/talks/dynamic-device-handling-OLS-2006.pdf Dynamic Device Handling (pdf)]<br />
:A presentation of device handling</div>JackH79