CRUX-ARM 2.8 on Raspberry Pi

Meanwhile there are plenty of operating systems available for the Raspberry Pi – including an ARM version of the source-based Linux distro CRUX.

So if you like handcrafting or think Raspbian is “too mainstream“, you can have a lot of fun with a SD card with at least 1 GB of memory and a pot of coffee. 😉

Partitions and mounting

The following partitions have to be created on the SD card:

  • 1.Partition, later /dev/mmcblk0p1 – /boot, VFAT, at least 100 MB
  • 2.Partition, later /dev/mmcblk0p2 – /, ext3, at least 512 MB
  • 3.Partition, later /dev/mmcblk0p3 – swap, ideally 100-512 MB

It’s senseful to do this under Linux because archives have to be extracted on the SD card afterwards:

# fdisk /dev/sdX
...
# mkfs.vfat /dev/sdX1
# mkfs.ext3 /dev/sdX2
# mkswap /dev/sdX3
# mkdir -p /mnt/{b,r}oot
# mount /dev/sdX2 /mnt/root
# mount /dev/sdX1 /mnt/boot

Copying and configuring

The following files are copied to the FAT partition:

After all files are copied the root file system and kernel modules are extracted:

# tar -pxf /mnt/boot/crux-arm-rootfs-2.8-hardfp-raspberrypi.tar.xz -C /mnt/root
# tar -pxf /mnt/boot/modules-3.6.1-raspberrypi_20130305.tar.xz -C /mnt/root

Some lines of the file /etc/fstab are modified afterwards:

# vi /mnt/root/etc/fstab
...#/dev/#REISERFS_ROOT#  /         reiserfs  defaults               0      0
/dev/mmcblk0p2    /         ext3      defaults               0      1
/dev/mmcblk0p1          /boot   vfat    defaults        0       2
...
#/dev/#XFS_ROOT#       /         xfs       defaults               0      0
/dev/mmcblk0p3           swap      swap      defaults               0      0
...

ESC ZZ

The file cmdline.txt has to be modified like this:

# vi /mnt/boot/cmdline.txt
smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 console=tty0 root=/dev/mmcblk0p2 rootfstype=ext3 rootwait

ESC ZZ

After unmounting the SD card carefully CRUX-ARM 2.8 should be able to boot:

# cd
# umount /mnt/{b,r}oot
# eject /dev/sdX

😉

Network configuration

The network configuration needs to be modified. By default, a static IP (192.168.1.100/24) is used which might not always be the best setting – e.g. if you’re using DHCP:

# vi /etc/rc.d/net
...
start)
        # loopback
        /sbin/ip addr add 127.0.0.1/8 dev lo broadcast + scope host
        /sbin/ip link set lo up
        # ethernet
        /sbin/ip link set eth0 up
        /sbin/dhcpcd eth0
        ;;
stop)
        /usr/bin/killall dhcpcd
        /sbin/ip route del default
        /sbin/ip link set eth0 down
        /sbin/ip link set lo down
        /sbin/ip addr del 127.0.0.1/8 dev lo
        ;;

ESC ZZ

After a restart of the network service, a connection should have been established:

# /etc/rc.d/net restart
# ping google.de

If not, have a deeper look at the error messages:

Updates

A couple of updates have been published after the creation of the CRUX-ARM 2.8 Raspberry Pi image – you should install them. It’s important that your date/time is set correctly to avoid that builds are canceled with an error message:

# date --set="3 Apr 2013 19:50:00"     # please replace!
# ports -u
# echo "Updates: $(ports -d|tail -n+2|wc -l)"
# prt-get sysup
...

Please be patient. The Raspberry Pi has to compile all updates – and this takes some time because of the used CPU. 😉

Tools

Some essentials tools like GNU screen, elinks and ntp are missing in the minimal image of CRUX-ARM 2.8:

# useradd ntp; groupadd ntp
# prt-get depinst screen ntp elinks python

Please be patient – the tiny machine isn’t very fast and takes some time for compiling the source codes.

Tweaks

If you wan’t to, you can “tune” your Raspberry Pi by tuning the CPU, disabling overscan, etc.:

# vi /boot/config.txt
disable_overscan=1
arm_freq=950
gpu_mem=16
core_freq=250
sdram_freq=450

ESC ZZ

These settings are consistent as far as possible with the Raspbian “High” settings. The CPU is overclocked at 950 Mhz, Core uses a frequeny of 250 Mhz and the memory runs at 450 Mhz. Overscan is disabled and 16 MB are reserved for the GPU – ideal if you wan’t to use the Raspberry Pi as server.

Sharing is caring

Leave a Reply