Latest Entries »

Since I’m suspecting the problems I have been experiencing booting ArchLinux on a WYSE S30 are related to the bootloader, I have created two bootable USB sticks with ArchLinux on it. One with a legacy GRUB, and the other with LILO. Both are available in AUR.

My original bootable USB stick was made on an 1 GB stick, which is rather small for the purpose. Therefore I’ve dd’d the content of the stick to a 4 GB stick, deleted and re-created the partition, and ran resize2fs on it.

After arch-chrooting (available in the arch-install-scripts package) into the partition, I’ve added the archlinux-fr repository to the pacman configuration and installed yaourt, so I can install stuff from AUR.

Installing grub-legacy appeared to go fine, but, the fact my host system is x86_64 caused a minor problem. The stage 1.5 and stage2 files got installed in /usr/lib/grub/x86_64-unknown in stead of /usr/lib/grub/i386-pc. After adding a symlink, the grub-install script works fine.

After that, I’ve dd’ed the content of the 4 GB stick to an 8 GB one. I have not adjusted the partitions, causing the following issue, and hence the -P ignore while installing LILP

sh-4.2# lilo -C /boot/lilo.conf -b /dev/sde1 -P ignore
Warning: Ignoring entry 'boot'
Warning: /dev/sde1 is not on the first disk
Warning: Device 0x0840: Inconsistent partition table, 1st entry
  CHS address in PT:  1:18:21  -->  LBA (8700)
  LBA address in PT:  2048  -->  CHS (0:33:3)
Warning: The partition table is *NOT* being adjusted.
Added Arch  +  *
Added Arch-wyse  +
4 warnings were issued.

The result, leading to two more-or-less bootable USB sticks. There are just little modification required, depending on how the BIOS of the WYSE S30 will identify the sticks to the bootloader. I am also suspecting this BIOS is what is causing the issues with GRUB2 and SYSLINUX.

Anyhow, the WYSE S30 is at Stack, so I cannot test any of these assumptions yet. Just working a little ahead, doing some preparations. What can I say? I do useful things while procrastinating… one trés importante exam coming up. I really need to pass that Discrete Structures exam, and then I can start my master’s project. And I must admit, it feels a little strange, thinking about it. Thinking about doing research, writing a paper. I mean… things are getting serious now, but, more then that. Thinking about people actually being interested in what I am going to do. The idea of what I am about to do is important. I mean… thinking it really matters…. it’s just weird you know.

Looking inside my laptop, I noticed:

An empty slow with wires

An empty slot with wires

I noticed an empty slow with two wires. I believe those are inteded to install a 3G module. There is a SIM slot behind the battery. Looking at my laptop’s (HP EliteBook 8530w) data sheet, the appropiate 3G module is an HP un2400. It’s available on ebay for US $13.58 + $2.89 shipping. According to google that’s about € 12. For that price i’d say it’s worth a try.

Looking at the datasheets of my other laptop’s (HP EliteBook 8570w) data sheet, the matching 3G Module is HP un2430. This is also available on ebay, but it’s a little more pricy: US $ 53.99 + $2.99 shipping. For that price, I say no thanks!

I mean, I don’t need it at all, but it would be a nice toy to play with. So, I wonder, would the cheaper un2400 also work in the new laptop? According to this thread on the hp forums it might be blocked by the BIOS. Damn, that would be a nasty trick to make people buy the expensive 3G card. I mean, what the fuck? The thing performs the exact same task, why it is 4 times as expensive?

So… I might buy that thing some time, and test it in both laptops. Who knows… but I will also be looking for an optical drive to use in the “upgrade bay” of my 8570w. I mean… a laptop without an optical drive feels kinda incomplete.

As I have mentioned before, my HP EliteBook 8530w has been experiencing overheating problems, which I expected to be related to dust. Undusting this laptop went easier then anticipated.

Step 1: Remove the keyboard screws, located at the bottom

Remove Keyboard Screws

Remove Keyboard Screws

Step 2: Unlock the keyboard locks, located at the top of the keyboard, between esc and f1, f4 and f5, f8 and f9, f12 and scroll lock/

Keyboard locked

Keyboard locked

Keyboard unlocked

Keyboard unlocked

Step 3: Remove the keyboard

Remove the keyboard

Remove the keyboard

The keyboard looks a little dusty on the back, however, the fan doesn’t look as dusty as expected. Appearances are deceiving.

Step 4: Remove the fan

Thick layer of dust

Thick layer of dust

As you see, there is a thick layer of dust at the air outlet of the fan, even though the fan blades are just a tiny bit dusty.

Dust

Dust

Now that thick layer of dust is removed, put everything together again in reverse order ;)

Now…. I am running the laptop at full speed (2.8 GHz in stead of 800 MHz) and make it compile stuff, to see if the overheating problem is solved.

Since I’ve been running ArchLinux I have been experiencing certain problems. When I try to log out from XFCE4, the system appears to hang. Then, I should switch to another tty, and switch back. Then the logout window is displayed, however, the background is scrambled.

I am also experiencing trouble taking screenshots. Also now, when I run xfce4-screenshooter, it hangs until I switch to another tty and back. This makes me think the problem is related to grabbing the content of the screen.

It seems, with the particular graphics chip that is in my new laptop, a new acceleration method called “glamor”

https://wiki.archlinux.org/index.php/ATI#Glamor:

Since xf86-video-ati driver-1:7.2.0-1, glamor is automaticaly enabled with radeonsi drivers (Southern Island and superior GFX cards)

My graphics chip turns out to be such a “Southern Island” chip. From my /var/log/Xorg.0.log

[  3682.989] (--) RADEON(0): Chipset: "VERDE" (ChipID = 0x682d)

It says “VERDE”, which is, according to theRadeon Feature Matrixa Southern Island chip. The “marketing name” however, seems to be different, as the chip inside my laptop is called “FirePro M4000”. Whatever it’s called, it’s causing me trouble.

The Wiki page is even mentioning how to enable this “glamor” thing on older cards, but I wish to disable it. Looking at the man page of “radeon”, it reveals an option, “AccelMethod”, which can be either “EXA” or “glamor”.

Creating a /etc/X11/xorg.conf.d/20-radeon.conf file with

Section "Device"
    Identifier "Radeon"
    Driver "radeon"
    Option "AccelMethod" "EXA"
EndSection

solves the problem. I can now log out without having to switch to a different tty, and take screenshots. Also, the problem of the missing/blank icons in my system tray has been resolved by this.

The WYSE S30 is a thin client. It’s CPU is an AMD Geode GX500. (It identifies itself as National Semiconductor). It’s based on an CPU design by Cyrix. Anyhow, the default kernel doesn’t boot on this CPU. I’ve tried to run the installation image on this machine. In this situation, the kernel gives a message about an unknown CPU manufacturer and says the system might be unstable. After this, the system hangs. The bootable ArchLinux installation I’ve just created, it gets stuck in a reboot loop.

I have tried to compile a kernel optimised for this specific CPU, but I still get inside this reboot loop. I am wondering if the problem is caused by the bootloader. As said, I’ve been using SYSLINUX. In stead I’ve tried GRUB2, but that doesn’t even display the menu. Seeing these symptoms, it appears there are some more incompatibilities about this particular device.

Looking at the CPU, from what I’ve read, it’s basically an 686-class CPU with some AMD extentions such as 3dnow! However, it is lacking one i686 instruction. However, as I’ve created a custom kernel, that should not be the problem. Therefore I am blaming the bootloader now. So… I might have to look at some alternative boot loaders. But…. not today…. been working at this for hours. It’s enough for today.

To install a new ArchLinux installation from an existing installation, one would generally use the method described on their wiki. https://wiki.archlinux.org/index.php/Install_from_Existing_Linux#Method_1:_Using_the_Bootstrap_Image

However, I am running an x86_64 installation, and I would like to create an i686 bootable USB stick. My first idea was to replace the x86_64 bootstrap image by the i686 bootstrap image. However, the resulting USB stick turned out to be x86_64. So, that’s not quite what I was looking for.

In order to create an i686 installation from an existing x86_64, one needs to adjust the /tmp/root.i686/etc/pacman.conf file ( or /tmp/root.x86_64/etc/pacman.conf for that matter) and change the Architecture line.

Architecture = auto

into

Architecture = i686

then run the pacstrap command as described on the wiki.

After pacstrap is finished, chroot into the installed system, and install the bootloader. I’m using syslinux for this.

sh-4.2# arch-chroot /mnt
sh-4.2# pacman -S syslinux
error: failed to prepare transaction (package architecture is not valid)
:: package syslinux-6.02-4-i686 does not have a valid architecture

The “Architecture” must also be set in the target installation. In the “base” installation, nano is the available editor. Run nano /etc/pacman.conf and modify the file, then we can install syslinux.

sh-4.2# pacman -S syslinux
resolving dependencies...
looking for inter-conflicts...

Packages (1): syslinux-6.02-4

Total Download Size:    1.09 MiB
Total Installed Size:   3.24 MiB

:: Proceed with installation? [Y/n] 
:: Retrieving packages ...

etc. etc. the installation continues normally.

Installing the bootloader can take a few minutes. Be patient.

sh-4.2# syslinux-install_update -i -a -m
Syslinux BIOS install successful
Boot Flag Set - /dev/sdc1
Installed MBR (/usr/lib/syslinux/bios/mbr.bin) to /dev/sdc

Now, we need a little configuration. We still have to create an fstab, and configure the bootloader. Since we’re going to boot from USB, I will be using UUID’s to identify the right volume.

[root@8570w andre]# blkid /dev/sdc1
/dev/sdc1: UUID="a7d9a26e-abb3-461b-aacd-1ae4fe96f2e4" TYPE="ext2" PARTUUID="b71a2cfb-01" 

/etc/fstab becomes

UUID=a7d9a26e-abb3-461b-aacd-1ae4fe96f2e4	/         	ext2      	rw,relatime,data=ordered	0 1

in /boot/syslinux/syslinux.cfg, set the right root device, so it looks like

    MENU LABEL Arch Linux
    LINUX ../vmlinuz-linux
    APPEND root=UUID=a7d9a26e-abb3-461b-aacd-1ae4fe96f2e4 rw
    INITRD ../initramfs-linux.img

I have tried to boot the resulting stick in qemu-system-i386, which fails, but it boots on real hardware. (To test this, I have enabled CSM temporary on my laptop)

Now, we are this far, we can start the second phase of the project.

Yaourt

Yaourt is a wrapper for the pacman package manager, which allows installing from the Arch User Repository, AUR. It also supports installing from a normal user, and then prompts for a password to install through su or sudo. Yaourt is not available in the standard repositories. However, it’s available in the ArchLinux France repository:
Adding the archlinuxfr repository and install yaourt.

Network

In order to have a dynamic network configuration, for example, to easily connect to a WiFi, NetworkManager is a convenient tool.

[andre@8570w ~]$ yaourt -S openntpd networkmanager dnsmasq bluez network-manager-applet gnome-keyring
[root@8570w andre]# systemctl enable NetworkManager 
[root@8570w andre]# systemctl enable NetworkManager-wait-online

Network was previously configures to use DHCP on the ethernet connection, disable this to prevent conflicts:

[root@8570w andre]# systemctl disable dhcpcd@enp0s25

In order to start openntpd once the connection has been established, look here.

NFS

Installing NFS support and enabling the daemons:

[andre@8570w ~]$ yaourt -S nfs-utils
[root@8570w andre]# systemctl enable rpc-statd
[root@8570w andre]# systemctl enable rpc-gssd

NFS3 vs NFS4

On the old laptop, I was running NFS3 as NFS4 gave me some problems. There was a detail I’ve overlooked. Back then, I was like, I’ll come back to this issue later, and never looked into it again. The difference between mounting NFS3 and NFS4 is the fact NFS3 required the full path on the server, while NFS4 requires a relative path to the NFS root. Therefore the corresponding lines in the fstab are

NFS3:

192.168.178.49:/srv/nfs4/1000   /mnt/1000   nfs defaults,user,noauto 0 0

NFS4:

192.168.178.49:/1000   /mnt/1000   nfs4 defaults,user,noauto 0 0

Mounting from thunar

In order to mount removable media, for example, an SD card, “USB stick” or external hard disk through Thunar, we need the gvfs

[andre@8570w ~]$ yaourt -S gvfs

Before I installed gvfs, I had my user mountable NFS mounts from my fstab listed in Thunar, after installing they were gone. To get them back, add x-gvfs-show to the mount options in fstab

192.168.178.49:/1000   /mnt/1000   nfs4 defaults,user,noauto,x-gvfs-show 0 0

Touchpad

This laptop has a huge touchpad. By default it was set to “two finger scrolling”. Really annoying. This is not a Mac for God’s sake! After a day, I’m getting RSI pains. No good… but fortunately, this is just a configuration option, and can be set to normal edge scrolling.

woohoo --- i can use edge scrolling

Localisation

At first, I didn’t configure a language. Just running in English was fine, but what I didn’t realise is that this meant I was running in “C”, meaning it wasn’t using UTF-8 encoding, which prevented me from listening to Russian music, as their file names contain non-ASCII characters.

[andre@8570w ~]$ echo $LANG
C

Before setting any locale, it has to be generated. Uncomment the desired locales in /etc/locale-gen and run locale-gen

[root@8570w andre]# locale-gen

So, I am going to configure a global setting of UK English with UTF-8,

[root@8570w andre]#  localectl set-locale LANG=en_GB.UTF-8

and set my own profile to Dutch by adding the following to ~/.bashrc

export LANG=nl_NL.UTF-8

So… I am a little very frustrated at gitosis. But first things first…

Yesterday I’ve been finishing the configuration on my new laptop. Installing some software and such. I will post a report on that later. This afternoon, I’ve been backupping my old laptop. I took an imagine of the Windows partition, and made a tarball of the linux root file system. Earlier I’ve already made a backup of the home partition.

So, I can start opening the old laptop, and remove all the dust from it. When that’s done, it will be completely reinstalled. Actually, I was thinking about just putting a copy of the root file system from my new laptop on the old one, and then just make two required modifications: setting the hostname and creating a new fstab (as it’s UUID based)

But that’s not what my frustrations are about. This afternoon, I wanted to work on my OAuth WordPress plugin. Still a few things to be done before it can be released. Well… in order to work on my source I need to access the git. I am using gitosis to manage access to my repository. Therefore I need to add the SSH public key from my new laptop into it’s access control list. Since all my computers are in the gitosis system, I logged into my raspberry pi server, and attempted to add the said key.

[andre@rpi-server keydir]$ git push
Counting objects: 5, done.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 338 bytes | 0 bytes/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: WARNING:gitosis.ssh:Unsafe SSH username in keyfile: 'andre@8570w.pub'
To gitosis@blaatschaap.be:gitosis-admin.git
   345de48..f110208  master -> master

Unsafe SSH username, and the key is not added. What the fuck. I started googling, and it suggested the “username” gitosis complains about is the past part of the keyfile. (This is just an arbitrary string, a comment, to identify the key to a user looking at the string, and it not used by the machine.)

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCbkYGFFpgrYZKy2eJIdSIebvuqaBhW96owRD7WT5MgwUXVtv76NeTJHgoZbUM7/zex+DV4tZwxkTZMQ8yXUmmqdrjYdHSlkxekcE7uvX0Xul0sRywm/Qfbdlu/DQeuTorhY5zb/Zx6TNXR+zw5KKlTPbnTEIXDwqh9kpenQR0auWL24/UQjoC9hTZavxY3cQlMEABGyfyTx7xnxQFZZGZ7h5x+OOWraXY6eYw2eHV53M+eSEIqFJz3LTD4tSl4svWNHTMz7EEfKpO5FmGjwJKIz8RYQiutCmz4bfziIbZvGYJGnUl/u/UlgtdkxaMjvPkZCmnWB+nqtLre2RFKQOWz andre@8570w

But even changing that to, for example andre@hpnew.blaatschaap.be or whatever I tried. (Trying a FQDN formatted hostname as last attempt) Everything I tried, it kept complaining. As last resort I simply disabled the checking for the name. This is done in /usr/share/pyshared/gitosis/ssh.py
I have replaced

def isSafeUsername(user):
    match = _ACCEPTABLE_USER_RE.match(user)
    return (match is not None)

by

def isSafeUsername(user):
    return (True)

So, my key would be accepted regardless this “username”. But really, I’ve tried anything… I don’t get it.

Well… looking at what _ACCEPTABLE_USER_RE.match(user) is:

_ACCEPTABLE_USER_RE = re.compile(r'^[a-zA-Z][a-zA-Z0-9_.-]*(@[a-zA-Z][a-zA-Z0-9.-]*)?$')

I am not familiar with python, but, it looks like a regluar expression saying the hostname should start with a letter, which was not the case for my hostname. But, I’ve tried many variants, including plenty that should just pass this little test. So… I don’t get the problem, and I’ve been pulling my hair out. Well… I just disabled the silly little test and got access to my reposiroty.

The crazy thing is, I’ve not only added my laptop, but also another ssh account at my server, which I use for development, right in the shell, which got accepted without a complaint. Really…. what the fuck.

Update: ran this test, and expected, hpnew.blaatschaap.be is accepted just fine by this test.

andre@blaatschaap:~$ cat test.py 
import re

_ACCEPTABLE_USER_RE = re.compile(r'^[a-zA-Z][a-zA-Z0-9_.-]*(@[a-zA-Z][a-zA-Z0-9.-]*)?$')

def isSafeUsername(user):
    match = _ACCEPTABLE_USER_RE.match(user)
    return (match is not None)


if isSafeUsername("andre@blaatschaap.be"):
    print "ok"
else:
    print "nak"

if isSafeUsername("andre@hpnew.blaatschaap.be"):
    print "ok"
else:
    print "nak"

if isSafeUsername("andre@8570w"):
    print "ok"
else:
    print "nak"

andre@blaatschaap:~$ python test.py 
ok
ok
nak

Therefore I wonder, is this “username” it complains about something else? Encoded in the base64 string? I thought that was the key only….

Well, last post I’ve discussed the problems I’ve encountered while trying to boot the ArchLinux installation CD in UEFI mode. As mentioned, it booted fine in legacy (BIOS) mode. Anyhow, let’s have a look at the installation procedure on an UEFI/GPT system.

IMG_1324Since the hard disk was previously partitioned using the MBR partition scheme and booting in legacy (BIOS) mode, we need to start from scratch. This includes creating the UEFI system partition.

When we start the GPT version of fdisk, gdisk, it will give a message about the fact the hard disk is currently using  the MBR partitioning scheme, and converting could possibly be destructive. We are going to repartition the whole disk, so it’s a destructive operation anyways.

So, we create an empty parition table, with the o command, just the way we would do in fdisk, we create a new partition with the n command. Here we notice a little difference, we can enter a number between 1 and 128 here. We’ll proceed with creating a 512 MB partition, and enter HEX code EF00 for EFI BOOT PARTITION.

Since the new laptop got 8 GB of RAM, the size of the Swap partition will be 16 GB. This is the next partition I’m going to create. I will enter 8200 for Linux Swap Parition.

The next two partitions will be the root file system and the home partition, 50 and 200 GB. I have kept left an amount of unpartitioned disk space for potential use with other operating systems. gdisk defaults to code 8300, which is ext2/3/4, so I don’t need to change this. All the same as with fdisk.

Next, will be formatting the partitions. However, attempting to format the partitions immediately after closing gdisk will result in an in-use error message. Re-reading the partition table doesn’t make a difference, a REBOOT is required to proceed. After rebooting, formatting works like a charm. The UEFI BOOT partition MUST be formatted FAT32. The other partitions will be formatted ext4, and the swap partition will have to be initialised with mkswap.

# mkfs.vfat -F32 /dev/sda1
# mkfs.ext4 /dev/sda3
# mkfs.ext4 /dev/sda4
# mkswap /dev/sda2

After formatting the partitions, we can mount them and start the ArchLinux installation process.

# swapon /dev/sda2
# mount /dev/sda3 /mnt
# mkdir /mnt/home
# mount /dev/sda4 /mnt/home
# mkdir -p /mnt/boot/efi
# mount /dev/sda1 /mnt/boot/efi
# pacstrap base /mnt
# genfstab -U -p /mnt >> /mnt/etc/fstab
# arch-chroot /mnt
# ln -s /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime
# mkinitcpio -p linux

So far, the installation procedure itself, has been pretty standard. The next step, setting up the boot loader, has caused me some problems. And this is the step that differentiates UEFI from BIOS booting, the boot process.

First of all, the EFI variables must be mounted. Please note the grub-install is executed inside the arch-chroot.

# mount -t efivarfs efivarfs /sys/firmware/efi/efivars
# pacman -S grub efibootmgr
# grub-install –target=x86_64-efi –efi-directory=/boot/efi –bootloader-id=grub

However, this resulted in an error message show_boot_order() "no such file or directory". The result is the system doesn’t boot automatically, but when I choose to browse the file system, I can load GRUB2 and boot correctly.

Next, I’ve tried to install Gummiboot, and “chainload” GRUB2. This works fine. However, gummiboot assumes the EFI boot partition to be mounted at /boot.

# pacman -S gummiboot
# gummiboot –path=/boot/efi

Now, setting it up to chainload GRUB, in /boot/efi/loader/entries/grub.conf:

title GRUB
efi /EFI/grub/grubx64.efi

And in /boot/efi/loader/loader.conf

default grub

makes the system bootable.

UEFI boot

As I am about to install my new laptop, I am considering using UEFI. The laptop supports UEFI but came with legacy booting enabled as default option. Whether this is the university setting or the factory default I’m not sure, since my father’s HP laptop got UEFI enables as default option.

I haven’t been working with UEFI systems before. Well, I’ve installed Ubuntu on my father’s laptop, on an external (USB) hard disk, so he could dual boot Windows and Linux. And that’s one of the advantages of UEFI. No boot manager is required. This is built in into UEFI.

My new laptop, the HP EliteBook 8570w has three options, legacy boot, uefi hybrid (both legacy and uefi / with csm), and native uefi (without csm).

I have selected the compatible mode. Now, as I try to boot from the ArchLinux installation CD. I am still using my external (USB) optical drive, since the laptop was delivered without internal optical drive. Well… so I boot from the CD, a menu shows, where I can choose between booting Arch, an UEFI shell (version 1 and 2) and to return to the firmware.

So, I select to boot Arch. The screen goes black. The USB optical drive appears to be reading slowly, but nothing happens. When I reboot, the uefi firmware does not detect the USB optical drive. Something is not going right. ArchLinux boot media are a hybrid case. The ISO contains both SYSLINUX and UEFI booting, but can also be dd’d to an USB flash medium. I believe this is the reason why I have had experienced booting ArchLinux installation media on my EliteBook 8530w. I have made an UEFI bootable USB flash drive according to the instructions on the ArchWiki.Using this I can boot normally. This appears to confirm my hypothesis the hybrid boot medium confuses the HP firmware.

So, creating partitions. Since I am using GPT, I will use gdisk in stead of fdisk. Creating partitions will be similar to fdisk. Partitions have numbers from 1 to 128. There are no concepts like extended and logical partitions. They’re a dirty hack of the MBR partitioning scheme anyways. I am still overthinking how I need to partition this system. This is the first time I am working an UEFI based system and GPT style partitioning. I still haven’t decided what boot loader I will be using, either SYSLINUX or GRUB2.