Chrooting to Arch Linux ARM from Arch Linux

Yesterday, after updating my Arch Linux ARM on my raspberry pi 2, I could not no longer log in to the OS.
The culprit was libtirpc-1.0.1-2-armv7h.pkg.tar.xz. After downgrading it to libtirpc-0.3.2-2-armv7h.pkg.tar.xz, I could log in again.
However, to downgrade the package I had to chroot to my microsd card in which Arch Linux ARM is saved, from my Arch Linux.
Chrooting to a machine of different architecture required extra steps.
Here’s how I have done it.

1. Install qemu-user-static and binfmt-support from AUR
yaourt qemu-user-static
yaourt binfmt-support

2. Copy qemu-arm to the sdcard.
cp -p /usr/bin/qemu-arm-static /mnt/usr/bin/

3. Chroot!
chroot /mnt qemu-arm-static /bin/bash

4. Downgrade the package.
qemu-arm-static /usr/bin/pacman -U /var/cache/pacman/pkg/libtirpc-0.3.2-2-armv7h.pkg.tar.xz

Advertisements
Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s