Sunday 23 February 2014

BBB: Install Archlinux to eMMC on any OS

With a new BBB with default distro Angstrom:

# Boot on Angstrom SD Image. Keep network cable attached, to get up to date system clock.
# What we will do:
# 1: Unmount and format boot and root partition on MMC, remount
# 2: Copy Archlinux boot and root files to respective folders
# 3: Reboot and set up Archlinux
# Read this for another perspective: http://archlinuxarm.org/platforms/armv7/ti/beaglebone-black
# This procedure created on 23.02.2014

# MMC device is
# /dev/mmcblk1
# Partition 1: boot requires boot flag
# /dev/mmcblk1p1
# Partition 2: root
# /dev/mmcblk1p2

# Unmount all partitions on the MMC
umount /dev/mmcblk1p1
umount /dev/mmcblk1p2

# Make and format filesystem, you may need to re-add partitions as FAT16
mkfs.vfat -F 16 /dev/mmcblk1p1
mkfs.ext4 /dev/mmcblk1p2

wget http://archlinuxarm.org/os/omap/BeagleBone-bootloader.tar.gz
wget http://archlinuxarm.org/os/ArchLinuxARM-am33x-latest.tar.gz

mkdir boot
mount /dev/mmcblk1p1 boot/
tar -xvf BeagleBone-bootloader.tar.gz -C boot/
# Ignore permission isssues, three files in boot now
umount boot

mkdir root
mount /dev/mmcblk1p2 root/
tar -xf ArchLinuxARM-am33x-latest.tar.gz -C root/
# If you get timestamp errors, ignore them. You forgot to keep connection to internet, to set systemclock.
umount root

# Reboot without SD card inserted. Default action is to boot SD card. SSH to IP.

passwd # Enter <rootpass>

# Set hostname
hostnamectl set-hostname kali

# Unsure of available timezones? timedatectl list-timezones
timedatectl set-timezone Europe/Oslo

# Check if correct date time?
date

# Initialize package manager key
pacman-key --init

# Do full upgrade, say Yes where applicable
pacman -Syu
reboot

# Check available MMC space, you should have ~1.1 GiB
df -h

# SSH back in and install your applications, set them up and enjoy
pacman -S vim mlocate screen
updatedb

# Add radio if you want
pacman -S rtl-sdr
pacman -S gnuradio

# Add X if you want
pacman -S xfce4

# Add irssi client if you want
pacman -S irssi

# Add gcc compiler if you want
pacman -S gcc