Posts tagged ‘arch’

Configuring audio for my Arch desktop

I probably started in the wrong end, by installing a few GStreamer packages:

  1. gstreamer0.10-bad-plugins
  2. gstreamer0.10-ugly-plugins
  3. gstreamer0.10-ffmpeg

It was first after that that I actually configured sound :-)

As always the Arch Wiki contains all the information needed, and more. There’s a page for configuring Alsa. All I did was install alsa-utils, make sure my user was a member of audio and then configure using alsamixer until aplay /usr/share/sounds/alsa/Front_Center.wav played properly. Then I put alsa in the DEAMON list in /etc/rc.conf.

Next I installed and configured PulseAudio. Again there’s an excellent page with instructions for configuring PulseAudio on the wiki. For me that meant first installing pulseaudio and alsa-plugins. Then I used vigr to add my user to pulse-access and pulse-rt. I also created /etc/asound.conf, following the instruction on the wiki it contains the following:

pcm.pulse {
    type pulse
}
ctl.pulse {
    type pulse
}

pcm.!default {
    type pulse
}
ctl.!default {
    type pulse
}

I then double checked that PulseAudio uses HAL to detect the needed modules. Lastly I made it possible for gstreamer to use PulseAudio by installing gstreamer0.10-pulse.

[edited 22/5/2009] Added info on group membership.

Odds and ends for my Arch desktop

After the previous setup steps I found the next task was to add a few odds and ends really were needed before proceeding to other major things, like audio, email, and such. Several of the things I needed are available from AUR so to make things easier I started by adding archlinuxfr to my /etc/pacman.conf:

--- pacman.conf_orig    2009-05-09 18:47:19.825013872 +0100
+++ pacman.conf 2009-04-26 08:22:05.471685249 +0100
@@ -70,6 +70,9 @@
 # Add your preferred servers here, they will be used first
 Include = /etc/pacman.d/mirrorlist

+[archlinuxfr]
+Server = http://repo.archlinux.fr/x86_64
+
 # An example of a custom package repository.  See the pacman manpage for
 # tips on creating your own repositories.
 #[custom]

After that I updated the package listings (pacman -Sy) and installed yaourt (pacman -S yaourt).

After this I could easily install the other packages I need:

  1. nautilus-dropbox
  2. encfs
  3. pam_mount
  4. keysafe
  5. hpodder
  6. twitux

Only pam_mount needed some extra configuration. First I added two lines each to /etc/pam.d/gdm and /etc/pam.d/login:

auth        optional    pam_mount.so
session     optional    pam_mount.so

Then I modified /etc/security/pam_mount.conf.xml to allow users to have their own configs, that’s done by uncommenting the line

<luserconf name=".pam_mount.conf.xml" />

Arch and Haskell, on little snag

Dear lazyweb (Arch users and especially DonS :-) ),

I just used yaourt to update my system and it noticed that haskell-time was available in a new version. After answering a few questions I was greeted with this message:

ghc-pkg: unregistering time-1.1.2.3 would break the following packages: hslogger-1.0.7 MissingH-1.1.0
    ConfigFile-1.0.4 convertible-1.0.1 HDBC-2.1.0 HDBC-sqlite3-2.1.0.0 HSH-1.2.6 (use --force to override)
error: scriptlet failed to execute correctly

Is there already some automated way to deal with this? (How to deal with it manually is fairly obvious to me…)

Setting up my network services on Arch

After having set up X (not sure I really can call just installing it “setting up” though :-) ) and Gnome, which of course included installing and configuring Xmonad, I went on to configure some network-related stuff.

At home I use mDNS to make it easy to connect to the computers we have at home. I added avahi to the list of services to start in /etc/rc.conf and installed nss-mdns. Then I following the instructions on how to configure mDNS on Arch, which resulted in the following changes:

--- /etc/nsswitch.conf_old  2009-05-02 21:17:06.460591935 +0100
+++ /etc/nsswitch.conf  2009-04-25 18:08:39.719853968 +0100
@@ -6,7 +6,7 @@

 publickey: files

-hosts: files dns
+hosts: files mdns_minimal [NOTFOUND=return] dns mdns
 networks: files

 protocols: db files

I also need SSH access to my desktop machine so I installed OpenSSH (openssh). No changes were needed to the configuration but following the instructions I made the following change to /etc/hosts.allow to allow connections at all:

--- /etc/hosts.allow_orig   2009-05-02 21:31:16.243401337 +0100
+++ /etc/hosts.allow    2009-04-28 17:55:57.553603986 +0100
@@ -2,5 +2,6 @@
 # /etc/hosts.allow
 #

+sshd: ALL

 # End of file

Then of course I added sshd to the list of services in /etc/rc.conf.

The last step was setting up NTP, based on suggestions on the Arch Wiki I installed OpenNTP (openntp) rather than the standard NTP package. No changes to the configuration were needed, just adding it to DAEMONS in /etc/rc.conf.

That was it, all the crucial network-related services set up and running at boot.

Arch, Gnome, and shutdown/reboot

I’ll soon continue documenting my experience with installing and configuring my desktop, but first a note on fixing an irritating issue in Gnome 2.26. Soon after installing Gnome I noticed that I couldn’t reboot or shutdown from inside my Gnome session, I had to log out and use GDM’s action menu instead. Rather irritating, but something I could live with until the weekend. It took a while to find the solution so to safe myself time in the future I’ll document it here. It might even help someone else, who knows?

Whenever I tried to reboot or shutdown I saw the following message appear in ~/.xsession-errors:

gnome-session[4134]: WARNING: Unable to list sessions: Rejected send message, 2 matched rules;
type="method_call", sender=":1.50" (uid=1000 pid=4134 comm="gnome-session ")
interface="org.freedesktop.ConsoleKit.Manager" member="GetSessions" error name="(unset)"
requested_reply=0 destination="org.freedesktop.ConsoleKit" (uid=0 pid=2838
comm="/usr/sbin/console-kit-daemon "))

After giving up on finding a solution with Google I turned to #archlinux and was pointed to a forum post. That discussion doesn’t mention the warning message at all, so it wasn’t obvious to me at first that it was the same issue. However, about half-way down the page I found a post by justusjonas that looked relevant. I tried that change, or rather something very similar, and a manual reboot later I could confirm that the change indeed fixed the issue. This is the change I applied:

--- /etc/dbus-1/system.d/ConsoleKit.conf_org    2009-05-02 15:59:40.235077390 +0100
+++ /etc/dbus-1/system.d/ConsoleKit.conf    2009-05-02 16:00:10.108231150 +0100
@@ -32,6 +32,8 @@
     <allow send_interface="org.freedesktop.ConsoleKit.Manager"
            send_member="GetSeats"/>
     <allow send_interface="org.freedesktop.ConsoleKit.Manager"
+           send_member="GetSessions"/>
+    <allow send_interface="org.freedesktop.ConsoleKit.Manager"
            send_member="GetSessionForCookie"/>
     <allow send_interface="org.freedesktop.ConsoleKit.Manager"
            send_member="GetSessionForUnixProcess"/>

More on the move to Arch Linux

After installing a basic Arch system and adding X.org it still isn’t very usable. My desktop of choice is Gnome, so that’s what I installed next, with a few extra packages to make it prettier and more useful.

I found out the hard way a few weeks ago that if you install gnome without gnome-extras then it’s a bad idea to install gdm and configure your system to boot to X. That way you’ll end up in a situation where your desktop doesn’t have an X terminal. I made sure to avoid that situation this time around. After installing gnome,gnome-extras and gdm I noticed that both gdm and policykit created users with uid 120 and 102, respectively. Just like exptected from services they have low uids. What surprised me was that they ended up having gid 1001 and 1002. That looks like bugs to me :-) I decided to fix that up manually myself by editing the group file (using vigr of course) and then searching for all file with the offending gids (using find / -gid 1001 for the first, with obvious changes to find the second).

After configuring gdm I realised I also needed gdm-themes :-) And I also added a few pretty fonts, and removed a few of the unpretty ones:

# pacman -S ttf-ms-fonts ttf-cheapskate artwiz-fonts ttf-bitstream-vera
# pacman -Rns xorg-fonts-75dpi xorg-fonts-100dpi

Then of course I needed to install xmonad:

# pacman -S xmonad-contrib

Co-ercing Gnome to actually use it was interesting though. I followed the instructions for running Xmonad in Jaunty, but that wasn’t enough. I also needed to place a file named xmonad.desktop in /usr/share/applications/ with the following contents (greatly inspired by the metacity.desktop found in the same location):

[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Xmonad
Exec=xmonad
NoDisplay=true
X-GNOME-WMName=Xmonad
X-GNOME-Autostart-Phase=WindowManager
X-GNOME-Provides=windowmanager

After that it was time to install stuff that is useful :-) First off was Thunderbird, which I immidiately had to equip with a few plug-ins of course. When setting up my mail account again I noticed that my Gnome session wasn’t quite the way I wanted—there was no gpg-agent running. After a quick check with the people on arch-general, without receiving any definitive resolution, I wrote my own little hack to address it. Of course I posted it in the thread I had started, but I might as well include it here too:

--- /etc/gdm/Xsession_orig  2009-04-27 17:13:50.346834448 +0100
+++ /etc/gdm/Xsession   2009-04-27 17:16:25.310151728 +0100
@@ -213,6 +213,14 @@
   fi
 fi

+# add seahorse if found
+seahorse="`gdmwhich seahorse-agent`"
+if [ -n "${seahorse}" ] && [ -x "${seahorse}" ]; then
+    command="seahorse-agent --execute $command"
+elif [ -z "${seahorse}" ]; then
+    echo "$0: seahorse not found!"
+fi
+
 # add ssh-agent if found
 sshagent="`gdmwhich ssh-agent`"
 if [ -n "$sshagent" ] && [ -x "$sshagent" ] && [ -z "$SSH_AUTH_SOCK" ]; then

There’s one more tool I can’t live without, parcellite, which is also available pre-built on Arch.

Moving to Arch Linux

<rant>So my irritation with Debian on the desktop reached a critical moment over the last few days. Sid is a good desktop system for most things, but if you are interested in Haskell then you really should prepare yourself for being a little behind on things. If it isn’t GHC that is out of date then it’s some library that hasn’t been rebuilt for the latest version of GHC. If you’re lucky then new packages are uploaded to the NEW queue and it’s only a matter of waiting for the autobuilders to get to them. Of course that doesn’t mean you can get those packages, so not that much luck in the end anyway.</rant>

I decided to move to the only other distro I’ve used seriously since Linux’ move to 2.x kernels, Arch. I remember it as a slightly less polished than Debian, but more up-to-date than even Sid. Also, there is a vibrant group of Haskell hackers working on providing almost all of Hackage in Arch’s native packaging system.

Installing Arch turned out to be a bit of a blast from the past, even when compared to Debian. Luckily the Arch wiki is there to help with the things that are different compared to Debian. I would suggest having a second computer with a browser pointed to Arch’s home pages nearby during the entire install.

For my installation of Debian I had opted to use LVM and I wanted to keep my /home around so I had to follow the steps required to use LVM in Arch. Installation went smooth and the reboot was successful. Now starts the hard work—configuring the system and updating my home folder.

The very first thing I noticed was that vim wasn’t installed by default, only vi was available. Not a big problem, except that my muscle memory resulted in a lot of vim: command not found messages. Clearly I had to install vim just to keep my sanity.

Next thing to do was to install X.org and the video driver I need:

# pacman -S xorg xf86-video-intel

After adding hal to /etc/rc.conf I started it manually and I ran startx as non-root. Wow, it all worked perfect, without creating any configuration file for X first. I double checked and it used the driver I wanted, i.e. it didn’t pick a safe default, like vesa, as its first option. Brilliant.

After following the instructions for changing the keyboard layout in X.org using hal I even had my ‘@’ on the right key. (The most confusing thing was that in X.org the UK keyboard layout is called gb, while in the console setup it’s called uk.)

I’ll post a bit more about the setup and configuration of my system as I progress towards my ideal desktop.

Arch and mkinitrd

A few days ago I ran into some problems after updating my kernel. It was almost certainly due to my own ignorance, however I did solve it and everything was good. Or so I thought. Yesterday I started seeing artefacts on my screen that shouldn’t be there. Squares and lines would appear out of nowhere and disappear as soon as I forced redrawing of the area. Having had problems earlier with frame buffers in Linux I listed the loaded modules. Whooaa! I didn’t spend that much money on my system. I had 133 modules loaded, just a few more than exptected. I received some help on the mailing list.

I turned on the autodetection in /etc/mkinitrd.conf and reduced the ramdisk by more than 50%. When using the --show argument for mkinitrd I noticed that a few extra filesystems were included. There’s a comment that AUTODETECT will limit the included filesystems but it didn’t seem to deliver on that promise. Modifying the list of filesystems does impact what’s included. Then I removed the entire CDROM subsystem, I really don’t need it during boot.

These are the modified lines after the changes:

REMOVE_CDROM=1

AUTODETECT=1

FILESYSTEMS=ext3

The Arch Wiki has an excellent page on initrd of course.

Ubuntu is in the bin!

For the first time in years I don’t have a Ubuntu system installed at home. Over the last few weeks I’ve been playing with ArchLinux and it’s been good so far. I especially enjoy the frequent updates to the software. Ubuntu with its two releases per year has been leaving me less and less satisfied lately. Don’t get me wrong, it’s great at work where I need a system I can rely on. For home, however, I want a totally different system. I want it bleeding edge on top, with a less bloody edge at the bottom. Arch Linux gives me exactly that!

I just tried installing Dapper FT2. I suppose in attempt to see if tracking Ubuntu unstable would be an interesting hobby. The install CD’s expert mode didn’t work at all! I ended up in a cul-de-sac since it apparently doesn’t like non-networked system (yes, I’m still on a dialup!). The non-expert mode worked better, but the system didn’t boot once installed. The kernel didn’t manage to find the proper modules to deal with my SATA drive. A few hours later I had downloaded the kernel sources and had a few failed kernel compiles (some USB-related driver kept resulting in compilation errors). Once the I had a kernel that booted I decided to look at what I had installed. Oh my DOYC, a default Ubuntu system is amazingly bloated. I installed debfoster and started cleaning up. 50% of the packages went out the door… Then I stopped to think about what I was doing. Ubuntu clearly isn’t a system for me anymore. If I need a Debian-based system on my computer I’ll just go for the real thing (Sid of course) instead. My Ubuntu Dapper FT2 CD went in the bin.

Experiencing Arch Linux

I’ve just “finished” installing Arch Linux. (I don’t think I’ll ever be finished for real since Linux is such a dynamic place. However, I’ve installed enough of Arch Linux to be writing this using Epiphany, running on a slick GNOME desktop.)

So far Arch has proven to be a nice, well designed system with a lean feel to it. Being used to Debian (lately Ubuntu) and its extreme attention to detail, Arch does give a more rough impression. It’s a price I think is worth paying, and believe me, it’s not as bad as it sounds. I’ve spent about 2 hours getting the base system, postfix, X.org, and GNOME installed and configured properly. A few small details remain, but I would have to attend to those no matter what distro I choose (getting HAL to refrain from mounting one of the partitions on my USB stick isn’t something that comes pre-configured in any distro I know of :) ).

The only thing left doing now is building proper Arch packages for muttng and keysafe.