Note : here is the previous version of this page, for Debian Jessie
Note : instead of the following steps of cross-deboostrap, Debian Stretch can also be installed via this installer and an HDMI display and an USB keyboard.
My little ARM board from Olimex :
A20-OLinuXino-LIME2 Rev C. (no NAND, no eMMC) CPU: Allwinner A20 dual core CORTEX-A7 RAM: 1 Go, eth 1 Gb/s
Olimex provides nice ready-to-use Debian images for this board. They even provides howtos for rebuilding these images. But for various reasons I ended up installing instead a pristine Debian Jessie (8.6) on it. Even if this board is supported by Debian, the installation wasn't so easy, since I didn't manage to get the HDMI output to work with Jessie. After reading the Debian wiki, this was rather expected, and not a big issue for my use of this board (lightweight server). But a blind installation is another story : I lack any suitable serial cable (such as this one), and my attempt at a remote Debian install over ssh failed miserably (bad preseed.cfg
?). In case it might help others, here comes the steps I finally followed for this installation, now updated to Debian Stretch (9.6).
The steps worked for me, but as usual with this kind of tutorial, your mileage may vary. Since we'll install to a micro-SD card (and hence reformat it!), any data on this card will be lost, so be sure to have backups before proceeding. Now, the good news : if something goes wrong it's quite easy to put this SD card on another machine and restore what you want on it (official image, previous backup, etc).
apt-get install binfmt-support qemu-user-static
/boot
(about 100Mb), the other for /
(all the remaining space). For instance, here's what fdisk /dev/mmcblk0
tells me after this step:Device Boot Start End Sectors Size Id Type /dev/mmcblk0p1 * 2048 239615 237568 116M 83 Linux /dev/mmcblk0p2 239616 15523839 15284224 7,3G 83 Linux
partprobe /dev/mmcblk0 # cf. the 'parted' package mkfs.ext3 /dev/mmcblk0p1 mkfs.ext4 /dev/mmcblk0p2
/mnt
and hence /mnt/boot
:mount /dev/mmcblk0p2 /mnt mkdir /mnt/boot mount /dev/mmcblk0p1 /mnt/boot
MIRROR=http://ftp.fr.debian.org/debian/ debootstrap --arch=armhf --foreign stretch /mnt $MIRROR
export DEBIAN_FRONTEND=noninteractive export DEBCONF_NONINTERACTIVE_SEEN=true export LC_ALL=C cp /usr/bin/qemu-arm-static /mnt/usr/bin chroot /mnt /debootstrap/debootstrap --second-stage chroot /mnt dpkg --configure -a
chroot /mnt apt install -y ssh flash-kernel u-boot-tools u-boot-sunxi
chroot /mnt passwd ##your olimex's root password nano /mnt/etc/hostname ##your olimex's hostname mkdir /mnt/root/.ssh nano /mnt/root/.ssh/authorized_keys ##some ssh public key allowed to log as root
/mnt/etc/network/interfaces
with something like:auto eth0 allow-hotplug eth0 iface eth0 inet dhcp iface eth0 inet6 auto
/mnt/etc/fstab
:/dev/mmcblk0p2 / ext4 defaults 0 1 /dev/mmcblk0p1 /boot ext3 defaults 0 2 proc /proc proc defaults 0 0
mknod /mnt/dev/mmcblk0 b 179 0 mknod /mnt/dev/mmcblk0p1 b 179 1 mknod /mnt/dev/mmcblk0p2 b 179 2
flash-kernel
tool, and add a console=tty1
to the kernel command-line:echo "Olimex A20-OLinuXino-LIME2" > /mnt/etc/flash-kernel/machine sed -i -e "s/quiet/quiet console=tty1/" /mnt/etc/default/flash-kernel
u-boot
loader:dd if=/mnt/usr/lib/u-boot/A20-OLinuXino-Lime2/u-boot-sunxi-with-spl.bin of=/dev/mmcblk0 bs=1k seek=8
boot
directory:chroot /mnt apt-get install -y linux-image-armmp
/mnt/boot/boot.scr
and /mnt/boot/dtb
. If not, you can try manually a chroot /mnt flash-kernel
./mnt/boot
and /mnt
, eject your SD-card from the host machine.ssh root@192.168.X.Y
.