Инструменты пользователя

Инструменты сайта


wiki:usomiq-ubuntu

Это старая версия документа!


uSomIQ Ubuntu и Debian

На этой странице описано как установить Ubuntu и Debian на модуль uSomIQ.

За основу взяты инструкции от Robert Nelson, доступные здесь:
http://www.eewiki.net/display/linuxonarm/BeagleBone

Основные ссылки

GCC Toolchain

wget -c https://launchpad.net/linaro-toolchain-binaries/trunk/2013.07/+download/gcc-linaro-arm-linux-gnueabihf-4.8-2013.07-1_linux.tar.xz
tar xJf gcc-linaro-arm-linux-gnueabihf-4.8-2013.07-1_linux.tar.xz
export CC=`pwd`/gcc-linaro-arm-linux-gnueabihf-4.8-2013.07-1_linux/bin/arm-linux-gnueabihf-

Bootloader

Das U-Boot – the Universal Boot Loader [http://www.denx.de/wiki/U-Boot]

Загрузить U-Boot

Загрузите U-Boot с помощью git:

git clone git://git.denx.de/u-boot.git
cd u-boot/
git checkout v2013.07 -b tmp

U-Boot патчи

Добавьте поддержку uSomIQ в u-boot

wget http://www.mentorel.com/downloads/usomiq/patches/add-usomiq-to-uboot.patch
patch -p1 < add-usomiq-to-uboot.patch

Компиляция U-Boot

make ARCH=arm CROSS_COMPILE=${CC} distclean
make ARCH=arm CROSS_COMPILE=${CC} am335x_evm_config
make ARCH=arm CROSS_COMPILE=${CC}

Ядро Linux

git clone git://github.com/RobertCNelson/linux-dev.git
cd linux-dev/
git checkout origin/am33x-v3.2 -b tmp

Добавьте поддержку uSomIQ в ядре

wget http://www.mentorel.ru/downloads/usomiq/patches/add-usomiq-to-nelson-scripts.patch
patch -p1 < add-usomiq-to-nelson-scripts.patch

Сборка ядра:

./build_kernel.sh

Файл ядра zImage и модули будут в директории «deploy».

Пресобранные бинарники

Пресобранные бинарники находятся здесь, но лучше собрать самые актуальные вручную

http://www.mentorel.com/downloads/usomiq/boot/beaglebone-compatible/

Файловая система

Debian 7.0.0 (Wheezy) Root File System

This file system is very small and can be installed to the NAND flash on uSomIQ. It is not that small like Angstrom minimal distribution (~20M), but will require around 75M on the flash. However it is a real Debian system with apt-get utility installed.

Default User: debian Password: temppwd

Root User: root Root Password: root

wget -c https://rcn-ee.net/deb/minfs/wheezy/debian-7.1-minimal-armhf-2013-08-25.tar.xz

verify the image with:

md5sum debian-7.1-minimal-armhf-2013-08-25.tar.xz
63e68e96b21cefeae9e4ecbf0568fd26  debian-7.1-minimal-armhf-2013-08-25.tar.xz

Extract Image:

tar xJf debian-7.1-minimal-armhf-2013-08-25.tar.xz

Now you have a directory with the archived (tar) file system itself and a file with user names/passwords.

Ubuntu 13.04 (Raring) Root File System

Default User: ubuntu Password: temppwd

wget -c https://rcn-ee.net/deb/minfs/raring/ubuntu-13.04-minimal-armhf-2013-08-25.tar.xz

verify the image with:

md5sum ubuntu-13.04-minimal-armhf-2013-08-25.tar.xz
4bbf7944d43ba5f4fbb5a86232b57d58  ubuntu-13.04-minimal-armhf-2013-08-25.tar.xz

Extract Image:

tar xJf ubuntu-13.04-minimal-armhf-2013-08-25.tar.xz

Now you have a directory with the archived (tar) file system itself and a file with user names/passwords.

Root File System for NAND

A Root File System around 64Mb in size, for flash applications.

Debian 7 (small flash)

User Password
debian temppwd
root root

Download:

wget -c https://rcn-ee.net/deb/barefs/wheezy/debian-7.1-bare-armhf-2013-08-25.tar.xz

Verify:

md5sum debian-7.1-bare-armhf-2013-08-25.tar.xz
276f2b77c1de379e5923f1f97b1f7853 debian-7.1-bare-armhf-2013-08-25.tar.xz

Extract:

tar xJf debian-7.1-bare-armhf-2013-08-25.tar.xz

Установка Ubuntu/Debian

На SD карту

Подготовка карты microSD

Для этих инструкций предположим, что SD карта видна в системе как /dev/sdc. Узнать имя устройства можно командой «sudo fdisk \-l»

export DISK=/dev/mmcblk0

Очистим microSD:

sudo dd if=/dev/zero of=${DISK} bs=1024 count=1024
sudo parted --script ${DISK} mklabel msdos

Установка загрузочного раздела:

sudo fdisk ${DISK} << __EOF__
n
p
1

+64M
t
e
p
w
__EOF__

Установим флаг «BOOT»

sudo parted --script ${DISK} set 1 boot on

Форматируем загрузочный раздел как vfat:

sudo mkfs.vfat -F 16 ${DISK}1 -n boot

Создадим раздел для файловой системы:

sudo fdisk ${DISK} << __EOF__
n
p
2


w
__EOF__

Отформатируем rootfs как ext4:

sudo mkfs.ext4 ${DISK}2 -L rootfs

Монтирование карты

На большинстве операционных систем монтирование происходит автоматически

sudo mkdir -p /media/boot/
sudo mkdir -p /media/rootfs/

sudo mount ${DISK}1 /media/boot/
sudo mount ${DISK}2 /media/rootfs/

Запись загрузчика

Скопируйте MLO/u-boot.img на загрузочный раздел

sudo cp -v ./u-boot/MLO /media/boot/
sudo cp -v ./u-boot/u-boot.img /media/boot/

uEnv.txt based bootscript

Requires: u-boot v2013.04

Create «uEnv.txt» boot script: (nano uEnv.txt)

#optargs=
mmcroot=/dev/mmcblk0p2 ro
mmcrootfstype=ext4 rootwait fixrtc
 
#To boot old v3.2.x based kernel enable: (BeagleBone/uSomIQ only)
uenvcmd=run loaduimage; run mmc_classic_boot
   
#To boot new v3.8.x based device tree:
#uenvcmd=run loaduimage; run loadfdt; run mmcargs; bootz ${loadaddr} - ${fdtaddr}

Copy uEnv.txt to the boot partition:

sudo cp -v ./uEnv.txt /media/boot/

Запись ядра и файловой системы

После исполнения скрипта build_kernel.sh появится следующее сообщение:

-----------------------------
Script Complete
eewiki.net: [user@localhost:~$ export kernel_version=3.X.Y-Z]
-----------------------------

Скопируйте в командную строку сообщение «export kernel_version=3.X.Y-Z» «как есть» и выполните:

export kernel_version=3.X.Y-Z

Скопируйте файл ядра zImage на второй раздел в директорию /boot:

sudo cp -v ./linux-dev/deploy/${kernel_version}.zImage /media/rootfs/boot/zImage

Запишите файловую систему:

sudo tar xfvp ./*-*-minimal-arm*-*/arm*-rootfs-*.tar -C /media/rootfs/

Запишите модули ядра:

sudo tar xfv ./linux-dev/deploy/${kernel_version}-modules.tar.gz -C /media/rootfs/

Исправьте /etc/fstab:

sudo nano /media/rootfs/etc/fstab

добавьте строки:

/dev/mmcblk0p2   /           auto   errors=remount-ro   0   1
/dev/mmcblk0p1   /boot/uboot auto   defaults            0   0

Включение сети

sudo nano /media/rootfs/etc/network/interfaces

добавьте строки:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

Включение логина по консоли

Debian:

sudo nano /media/rootfs/etc/inittab

добавьте в конец файла:

T0:23:respawn:/sbin/getty -L ttyO0 115200 vt102

Ubuntu:

sudo nano /media/rootfs/etc/init/serial.conf

добавьте в конец файла:

start on stopped rc RUNLEVEL=[2345]
stop on runlevel [!2345]

respawn
exec /sbin/getty 115200 ttyO0

Правильно извлеките microSD карту:

sync
sudo umount /media/boot
sudo umount /media/rootfs

Установка Debian на NAND

Here you will learn how install Debian to a UBIFS partition on a uSomIQ system on module.

1) Install Ubuntu or Debian to a SD card as described in the previous step

2) Download and extract a small Debian file system as described root_file_system_for_nand

You will have an archive debian-7.1-bare-armhf-2013-08-25.tar after extracting. Place this archive to the SD card with OS installed in the previous step.

3) Boot the board with the SD card to u-boot and issue the following commands:

nand erase.chip
mmc rescan
fatload mmc 0 0x81600000 MLO
nand write 0x81600000 0 20000
nand write 0x81600000 20000 20000
nand write 0x81600000 40000 20000

Load the u-boot image u-boot.img to NAND. Note that we use the actual size of the u-boot.img file in Hex. If your file has a different size then update this number

fatload mmc 0 0x81600000 u-boot.img
nand write 0x81600000 80000 57d74 # <- this is the actual size of the u-boot.img file in Hex

Load the kernel image zImage to NAND. Note that we use the actual size of the zImage file in Hex. If your file has a different size then update this number

run loaduimage
nand write ${loadaddr} 280000 2B08f8 # <- this is the actual size of the zImage file in Hex

4) Boot farther to OS

5) Prepare a UBIFS partition

For more information visit: http://processors.wiki.ti.com/index.php/UBIFS_Support

Preparing NAND partition

ubiformat /dev/mtd7 -s 2048 -O 2048
ubiattach /dev/ubi_ctrl -m 7 -O 2048
ubimkvol /dev/ubi0 -s 235MiB -N rootfs
mount -t ubifs ubi0:rootfs /mnt

6) Install the file system to the UBIFS-partiotion

cd /mnt
tar xf <path to image>/debian-7.1-bare-armhf-2013-08-25.tar
sync

7) Enable the Serial login

Edit the file /mnt/etc/inittab as described for the SD card installation.

8) Enable Network

Edit the file /mnt/etc/network/interfaces as described for the SD card installation.

9) Remove the SD card and reboot the board

FAQ

CircuitCo LCD3 Backlight

Turn on Backlight:

i2cset -f -y 1 0x24 0x07 0x09
i2cset -f -y 1 0x24 0x08 0x60

CircuitCo LCD3/LCD7 TouchScreen

Add to /etc/modules:

fbcon
ti_tscadc
wiki/usomiq-ubuntu.1405353488.txt.gz · Последнее изменение: 2014/07/14 19:58 — maxx