CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors

Supported Devices


OVH Sys ARM server

Ryuo


Introduction

OVH Sys ARM virtual server based on Armada 375 development board.

CPU Information

processor : 0
model name : ARMv7 Processor rev 1 (v7l)
BogoMIPS : 50.00
Features : half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpd32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x4
CPU part : 0xc09
CPU revision : 1
Hardware : Marvell Armada 375 (Device Tree)

boot.log

Installation

# Enlarge the tmpfs root partition
mount -o remount,size=1g /

# Install some stuff we need to install CRUX
apt update
apt install -y xz-utils

# Partition the disk; SWAP / BOOT / ROOT partitions
sgdisk -Z /dev/sda
sgdisk -n 1:0:+2G -t 1:8200 -n 2:0:+32M -t 2:8300 -n 3:0:0 -t 3:8300 /dev/sda

# Format the partitions; note that BOOT partition needs to have 64 bit and metadata checksum features turned off
mkswap /dev/sda1
mkfs.ext4 -F -O ^64bit /dev/sda2
mkfs.ext4 -F /dev/sda3

# Mount the partitions
swapon /dev/sda1
mount /dev/sda3 /mnt
mkdir -p /mnt/boot
mount /dev/sda2 /mnt/boot

# Unpack the rootfs tarball
wget http://resources.crux-arm.nu/releases/3.4/crux-arm-rootfs-3.4.tar.xz
tar -x -f crux-arm-rootfs-3.4.tar.xz -C /mnt
rm crux-arm-rootfs-3.4.tar.xz

# Mount the pseudo filesystems
mount -t devtmpfs none /mnt/dev
mount -t devpts none /mnt/dev/pts
mount -t sysfs none /mnt/sys
mount -t proc none /mnt/proc

# Configure fstab
cat > /mnt/etc/fstab << 'EOF'
# /etc/fstab: static file system information
#
# <file system>        <dir>     <type>    <options>                        <dump> <pass>

/dev/sda1              swap      swap      defaults                         0      0
/dev/sda2              /boot     ext4      defaults                         0      2
/dev/sda3              /         ext4      defaults                         0      1

# the following entries are required for proper system operation
devpts                 /dev/pts  devpts    noexec,nosuid,gid=tty,mode=0620  0      0
shm                    /dev/shm  tmpfs     defaults                         0      0

# End of file
EOF

# Setup networking (replace as needed)
cat > /mnt/etc/rc.d/net << 'EOF'
#!/bin/sh
#
# /etc/rc.d/net: start/stop network interface
#

DEV=eth0

IP4=#IP4 ADDRESS#
IP4_GW=#IP4 GATEWAY#

IP6=#IP6 ADDRESS#
IP6_GW=#IP6 GATEWAY#

case $1 in
    start)
        ip link set dev ${DEV} up
        ip -4 address add dev ${DEV} ${IP4}/32
        ip -4 route add dev ${DEV} ${IP4_GW}
        ip -4 route add default via ${IP4_GW}
        ip -6 address add dev ${DEV} ${IP6}/128
        ip -6 route add dev ${DEV} ${IP6_GW}
        ip -6 route add default via ${IP6_GW}
        ;;
    stop)
        ip -6 route delete default via ${IP6_GW}
        ip -6 route delete dev ${DEV} ${IP6_GW}
        ip -6 address delete dev ${DEV} ${IP6}/128
        ip -4 route delete default via ${IP4_GW}
        ip -4 route delete dev ${DEV} ${IP4_GW}
        ip -4 address delete dev ${DEV} ${IP4}/32
        ip link set dev ${DEV} down
        ;;
    restart)
        $0 stop
        $0 start
        ;;
    *)
        echo "Usage: $0 [start|stop|restart]"
        ;;
esac

# End of file
EOF

# Disable IPv6 autoconfiguration
cat > /mnt/etc/sysctl.conf << 'EOF'
#
# /etc/sysctl.conf: configuration for system variables, see sysctl.conf(5)
#

net.ipv6.conf.all.accept_ra=0
net.ipv6.conf.all.autoconf=0

# End of file
EOF

# Setup hosts (replace as needed)
cat > /mnt/etc/hosts << 'EOF'
#
# /etc/hosts: static lookup table for host names
#

# IPv4
127.0.0.1   localhost #HOSTNAME#

# IPv6
::1         ip6-localhost ip6-loopback #HOSTNAME#
fe00::0	    ip6-localnet
ff00::0	    ip6-mcastprefix
ff02::1	    ip6-allnodes
ff02::2	    ip6-allrouters
ff02::3	    ip6-allhosts

# End of file
EOF

# Setup DNS (replace as needed)
cat > /mnt/etc/resolv.conf << 'EOF'
nameserver #NAMESERVER#
EOF

# Setup hostname (replace as needed)
sed -i -e '/HOSTNAME=/cHOSTNAME=#HOSTNAME#' /mnt/etc/rc.conf

# Setup timezone (replace as needed)
sed -i -e '/TIMEZONE=/cTIMEZONE=#TIMEZONE#' /mnt/etc/rc.conf

# Enable ssh service
sed -i -e 's;\(SERVICES\)=(\(.*\));\1=(\2 sshd);' /mnt/etc/rc.conf

# Allow root to login over SSH via password authentication (change after first boot)
sed -i -e '/#PermitRootLogin/cPermitRootLogin yes' /mnt/etc/ssh/sshd_config

# Generate locales (replace as needed)
chroot /mnt localedef -i #LOCALE# -f #ENCODING# #LOCALE#.#ENCODING#

# Setup root password
chroot /mnt passwd root

# Create and install kernel package
wget http://last.public.ovh.hdaas.snap.mirrors.ovh.net/debian/pool/main/l/linux-source-4.9.124-armada375/linux-image-4.9.124-armada375_4.9.124-1_armhf.deb
wget http://last.public.ovh.hdaas.snap.mirrors.ovh.net/debian/pool/main/l/linux-source-4.9.124-armada375/linux-headers-4.9.124-armada375_4.9.124-1_armhf.deb
ar x linux-image-4.9.124-armada375_4.9.124-1_armhf.deb data.tar.xz
tar -x -f data.tar.xz ./lib ./boot ./usr/lib
ln -s uImage-4.9.124-armada375 boot/uImage
ar x linux-headers-4.9.124-armada375_4.9.124-1_armhf.deb data.tar.xz
tar -x -f data.tar.xz ./usr/src
tar -c lib boot usr | gzip > /mnt/kernel-armada375#4.9.124-1.pkg.tar.gz
chroot /mnt pkgadd /kernel-armada375#4.9.124-1.pkg.tar.gz
rm -rf linux-image-4.9.124-armada375_4.9.124-1_armhf.deb linux-headers-4.9.124-armada375_4.9.124-1_armhf.deb data.tar.xz lib boot usr /mnt/kernel-armada375#4.9.124-1.pkg.tar.gz

# Setup uboot
fw_setenv localargs 'console=ttyS0,115200 root=/dev/sda3 rw'
fw_setenv localcmd 'ide reset; ext4load ide 0:2 $kernel_addr_r /uImage; setenv bootargs $localargs; bootm $kernel_addr_r'

# Unmount everything
umount -R /mnt
swapoff /dev/sda1