Archive for July 2010

I ripped out the network from booting

[This articles was written in 2010 when archlinux used its own configuration and init system and does not apply today]

I am sick and tired of the long time the network takes to initialise during boot, specially if it a wireless network I want to connect to. Now however I have had enough and I removed the net-profiles from my daemon array in /etc/rc.conf
I am much more satisfied with my system now. The boot time is minimal and it is so easy to simple choose amongst the various profiles I have as the needs requires.

During my travels with my laptop I have had many different kind of connections both wireless and through an ethernet cable. Getting to know the wireless network environment the laptop exists in is easy to do from the command line by using:

$ sudo iwlist eth0 scan

Of course you have to replace eth0 with the correct device for your system. The yielded information is a comprehensive list of all wireless networks and their configuration. Allowing you to create a profile by simply editing one of the templates available from /etc/network.d/examples with the correct information for your system and the wireless network to connect to and save it to /etc/network.d/ . To then connect to the wireless network you use:

$ sudo netcfg name_of_profile

Hopefully it will work but if not the netcfg daemon do print very clear error messages.

Mounting the SDHC flash card

I bought a camera a few days ago. Eagerly wanting to import the images from the SDHC flash card I use with the camera I noticed my laptop came equiped with a flash card reader. It felt a little bit nostalgic as I inserted the flash card in the slot, reminding me to the days of floppies but better, instead of the always magneticly recorded data on the mechanical floppies. Which always seemed to loose data no matter how gentle you treated the disk. I have never had a flash card break.

I have no software to automatically mount newly detected storage media. So it was up to me to somehow figure out what file in /dev the device would be represented by. As I asked for advice on how to do this on the Archlinux IRC channel I got two very nice tips:

First by reading the messages from the message buffer of the kernel right after I inserted the card in the flash reader, using:

$ dmesg | tail

which yielded on the last lines of the buffer the messages,

mmc0: new high speed SDHC card at address bddc
mmcblk0: mmc0:bddc SD04G 3.69 GiB
 mmcblk0: p1

I could get the necessary information of what the kernel was doing. As one can see all was fine, I was a little bit worried because the text printed above the flash reader only says, “SD/MMC – MS/Pro”, so I was not sure it would support the SDHC standard. While the messages from dmesg is very human readable it only hints at what file you should mount in order to access the flash card. A quick search on the interent shows that for some people the file was named mmc0 but that file did not exists on my system so to find out the full name of the file, I used:

$ ls /dev -l | grep brw

which yielded,

brw-rw---- 1 root disk      7,   0 Jul  9 02:55 loop0
brw-rw---- 1 root disk    179,   0 Jul  9 04:53 mmcblk0
brw-rw---- 1 root disk    179,   1 Jul  9 04:53 mmcblk0p1
brw-rw---- 1 root disk      8,   0 Jul  9 02:55 sda
brw-rw---- 1 root disk      8,   1 Jul  9 02:55 sda1
brw-rw---- 1 root disk      8,   2 Jul  9 02:55 sda2
brw-rw---- 1 root disk      8,   3 Jul  9 02:55 sda3
brw-rw---- 1 root disk      8,   4 Jul  9 02:55 sda4
brw-rw---- 1 root optical  11,   0 Jul  9 02:55 sr0

Then simply mounting the file mmcblk0p1 at the location of my choice gave me access to the flash card.