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:
1# fdisk /dev/sdX
2...
3# mkfs.vfat /dev/sdX1
4# mkfs.ext3 /dev/sdX2
5# mkswap /dev/sdX3
6# mkdir -p /mnt/{b,r}oot
7# mount /dev/sdX2 /mnt/root
8# mount /dev/sdX1 /mnt/boot
Copying and configuring
The following files are copied to the FAT partition:
- all files (except
kernel_emergency.img
) from the following GIT tree: https://github.com/raspberrypi/firmware/tree/master/boot - Modified kernel: http://crux-arm.nu/files/devices/raspberrypi/current/kernel.img
- RAMDisk: http://crux-arm.nu/files/devices/raspberrypi/current/initrd.gz
- Boot configuration file: http://crux-arm.nu/files/devices/raspberrypi/cmdline-ramdisk.txt - please save as
cmdline.txt
- Kernel modules: http://crux-arm.nu/files/devices/raspberrypi/current/modules-3.6.1-raspberrypi_20130305.tar.xz
- CRUX-ARM 2.8 root file system for the Raspberry Pi: http://crux-arm.nu/releases/2.8/crux-arm-rootfs-2.8-hardfp-raspberrypi.tar.xz
After all files are copied the root file system and kernel modules are extracted:
1# tar -pxf /mnt/boot/crux-arm-rootfs-2.8-hardfp-raspberrypi.tar.xz -C /mnt/root
2# 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:
1# vi /mnt/root/etc/fstab
2...#/dev/#REISERFS_ROOT# / reiserfs defaults 0 0
3/dev/mmcblk0p2 / ext3 defaults 0 1
4/dev/mmcblk0p1 /boot vfat defaults 0 2
5...
6#/dev/#XFS_ROOT# / xfs defaults 0 0
7/dev/mmcblk0p3 swap swap defaults 0 0
8...
9
10ESC ZZ
The file cmdline.txt
has to be modified like this:
1# vi /mnt/boot/cmdline.txt
2smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 console=tty0 root=/dev/mmcblk0p2 rootfstype=ext3 rootwait
3
4ESC ZZ
After unmounting the SD card carefully CRUX-ARM 2.8 should be able to boot:
1# cd
2# umount /mnt/{b,r}oot
3# 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:
1# vi /etc/rc.d/net
2...
3start)
4 # loopback
5 /sbin/ip addr add 127.0.0.1/8 dev lo broadcast + scope host
6 /sbin/ip link set lo up
7 # ethernet
8 /sbin/ip link set eth0 up
9 /sbin/dhcpcd eth0
10 ;;
11stop)
12 /usr/bin/killall dhcpcd
13 /sbin/ip route del default
14 /sbin/ip link set eth0 down
15 /sbin/ip link set lo down
16 /sbin/ip addr del 127.0.0.1/8 dev lo
17 ;;
18
19ESC ZZ
After a restart of the network service, a connection should have been established:
1# /etc/rc.d/net restart
2# 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:
1# date --set="3 Apr 2013 19:50:00" # please replace!
2# ports -u
3# echo "Updates: $(ports -d|tail -n+2|wc -l)"
4# prt-get sysup
5...
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:
1# useradd ntp; groupadd ntp
2# 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.:
1# vi /boot/config.txt
2disable_overscan=1
3arm_freq=950
4gpu_mem=16
5core_freq=250
6sdram_freq=450
7
8ESC 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.