install archlinux [raspberrypi]

if you do not care about the latest version of archlinux:
simply download the image and burn it onto a sdcard
http://downloads.raspberrypi.org/arch/images/arch-2014-06-22/ArchLinuxARM-2014.06-rpi.img.zip

if you care about the latest version of archlinux:
based on:
https://www.raspberrypi.org/forums/viewtopic.php?f=53&t=88905
http://archlinuxarm.org/platforms/armv6/raspberry-pi

install raspbian on a sdcard and boot it:
sudo nano /boot/cmdline.txt
add at the beginning of the file:
loop.max_part=15
expand image to full sd-card:
sudo raspi-config
reboot:
sudo reboot
after reboot install:
sudo apt-get install bsdtar zip unzip dosfstools parted -y
create root password:
sudo passwd
now run as root:
su
cd
touch create_image.sh
chmod +x ./create_image.sh
nano create_image.sh

copy and paste the folling code in to nano:

#!/bin/bash

# Packages required
# dosfstools parted
# Can be run on any Linux system
# loop.max_part=15 must be in kernel cmdline (cmdline.txt for rpi)
# then reboot

echo "creating image to fit on 2Gb card"
dd if=/dev/zero of=arch-rpi.img bs=1M count=1850

echo "Partitioning"
fdisk arch-rpi.img <<EOF
o
n
p
1

+100M

t
c
n
p
2


w
EOF

sleep 5

losetup -f arch-rpi.img
sleep 5

echo "Formatting vfat"
mkfs.vfat /dev/loop0p1
sleep 5
mkdir boot
echo "Mounting boot"
mount /dev/loop0p1 boot
echo "Installing"

echo "Formatting ext4"
mkfs.ext4 /dev/loop0p2
sleep 5
mkdir root
echo "Mounting root"
mount /dev/loop0p2 root

wget http://archlinuxarm.org/os/ArchLinuxARM-rpi-latest.tar.gz
echo "Installing"
bsdtar -xpf ArchLinuxARM-rpi-latest.tar.gz -C root
sync
mv root/boot/* boot
sync
umount boot root
losetup -d /dev/loop0p1
losetup -d /dev/loop0p1
losetup -d /dev/loop0
echo "All complete, image arch-rpi.img created, compressing...."
zip -9 arch-rpi.img.zip arch-rpi.img

run the bash file as root user(took over 30 minutes for me on pi model B):
./create_image.sh

remove help files:
rm arch-rpi.img
rm -r boot
rm -r root
rm -r ArchLinuxARM-rpi-latest.tar.gz

remove root password:
sudo passwd -l root

on your pc connect with root account to raspbian and go to /root/
and copy arch-rpi.img.zip from pi to your computer.

unzip the arch-rpi.img.zip on your computer and write it onto a sdcard

plug the sdcard into your pi, start it and login with ssh:
user: alarm
password: alarm

if you like to install gnupg:
su
pw:root
cd
pacman -S gnupg

Advertisements

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