Cubieboard 1 Gentoo step ok & Cubiboard 2 doesn't boot with Gentoo

Started by iSgomm, September 18, 2013, 04:49:08 am

Previous topic - Next topic

iSgomm

Hi to everyone,
I open this forum to share all the steps to install the cubieboard2 on Gentoo.
I found this link ( thanks to pluto7777 ) which shows the following step for installing Gentoo on cubieboard1, but when booting from ssd cubieboard2 with the card does not start showing a black screen.

Below are listed the steps, I ask those who had done work on gentoo to share sequence of all correct steps .
Please I need help for all correct step for installing Gentoo on cubieboard2.

Greetings

http://pluto7777.blogspot.it/2013/03/gentoo-installation-for-cubieboardthis.html

Install Gentoo on Cubieboard1 step

su
cd /tmp
wget http://dl.linux-sunxi.org/amery/sunxi-3.0/latest/cubieboard_hwpack.tar.xz
tar -xf cubieboard_hwpack.tar.xz
fdisk -l
dd if=/tmp/bootloader/sunxi-spl.bin of=/dev/mmcblk0 bs=1024 seek=8
dd if=/tmp/bootloader/u-boot.bin of=/dev/mmcblk0 bs=1024 seek=32
fdisk /dev/mmcblk0
(n,p,1,2048,+64M,t,c,a,1)
(n,p,2,default,default)
w
mkfs.vfat /dev/mmcblk0p1
mkfs.ext2 /dev/mmcblk0p2
mkdir /mnt/gentoo
mount /dev/mmcblk0p2 /mnt/gentoo
mkdir /mnt/gentoo/boot
mount /dev/mmcblk0p1 /mnt/gentoo/boot
wget http://distfiles.gentoo.org/releases/arm/autobuilds/current-stage3-armv7a_hardfp/stage3-armv7a_hardfp-20130209.tar.bz2
tar xfpj stage3-armv7a_hardfp-20130209.tar.bz2 -C /mnt/gentoo/
wget http://distfiles.gentoo.org/snapshots/portage-latest.tar.bz2
tar xjf portage-latest.tar.bz2 -C /mnt/gentoo/usr
cp /tmp/kernel/* /mnt/gentoo/boot
cp -r /tmp/rootfs/lib/* /mnt/gentoo/lib
echo -e "/dev/mmcblk0p1 /boot auto noatime 1 2\r\n/dev/mmcblk0p2 / ext2 noatime 0 1" > /mnt/gentoo/etc/fstab
grep root /etc/shadow
copy
nano /mnt/gentoo/etc/shadow
paste
cd /mnt/gentoo/etc/init.d/
ln -s net.lo net.eth0
cd /mnt/gentoo/etc/runlevels/default
ln -s /etc/init.d/sshd sshd
ln -s /etc/init.d/net.eth0 net.eth0
ln -s /etc/init.d/swclock swclock
sed 's/#PermitRootLogin yes/PermitRootLogin yes/g' -i /mnt/gentoo/etc/ssh/sshd_config
cd ~/
umount /dev/mmcblk0p1
umount /dev/mmcblk0p2

boot it up

echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
cp /usr/share/zoneinfo/America/Chicago /etc/localtime
echo "America/Chicago" > /etc/timezone
date -s "18 MAR 2013 18:00"
eselect profile list
eselect profile set 27
nano /etc/portage/make.conf
CFLAGS="-O2 -pipe -march=armv7-a -mtune=cortex-a8 -mfpu=neon -ftree-vectorize -mfloat-abi=hard"
emerge --sync
emerge --update --deep --with-bdeps=y --newuse world
emerge ntp

If the update changes eth0 name
ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules

nedyarrd

I have installed gentoo on my machine and running from sata. Pluto7777 have good guide to install gentoo, but there is some mistakes like:


cd /mnt/gentoo/etc/runlevels/default
ln -s /etc/init.d/sshd sshd
ln -s /etc/init.d/net.eth0 net.eth0
ln -s /etc/init.d/swclock swclock

it should be done in gentoo environment i.e by chrooting to /mnt/gentoo

chroot /mnt/gentoo
rc-update add sshd default
rc-update add net.eth0 default
rc-update add swclock default
exit


ikaruzz

Pluto7777 shows the step for installing Gentoo on cubieboard1. This works!
But you have a cubieboard2 - you should try a newer Kernel for cubieboard2.

I use the latest kernelsources from patwood for my cubieboard2.
Gentoo works without problems on my raspberry pi, cubieboard1 and cubieboard2.

Read this articles
"http://wiki.gentoo.org/wiki/Raspberry_Pi#Compiling_the_kernel";.
"http://wiki.gentoo.org/wiki/Raspberry_Pi_Cross_building"; the part "crossdev "

Crossbuilding a kernel for the cubieboard works similar!
Create a crossdev on your x86-Desktops gentoo-linux!
root # emerge --ask crossdev
root # crossdev -S -v -t armv7a-hardfloat-linux-gnueabi

or if you want to have special version of gcc glibc binutils kernel-headers e.g.:
root # crossdev --g "=4.7.3" --l "=2.15-r3" --b "=2.23.1" --k "=3.9"  -v -t armv7a-hardfloat-linux-gnueabi
install u-boot-tools:
root # emerge dev-embedded/u-boot-tools

Download kernelsources from patwood:
wget https://github.com/patrickhwood/linux-sunxi/archive/pat-sunxi-3.4.43.tar.gz
Unpack it and put e.g. this ".config" (http://pastebin.com/m6ACR202) in the root of the kernelsources.
cd to the kernelsources and:
root # mkdir /tmp/cb2
root # mkdir /tmp/cb2/boot
root # ARCH=arm CROSS_COMPILE=/usr/bin/armv7a-hardfloat-linux-gnueabi- make oldconfig

If you want to change the config:
root # ARCH=arm CROSS_COMPILE=/usr/bin/armv7a-hardfloat-linux-gnueabi- make menuconfig
else:
root # ARCH=arm CROSS_COMPILE=/usr/bin/armv7a-hardfloat-linux-gnueabi- make -j3
root # ARCH=arm CROSS_COMPILE=/usr/bin/armv7a-hardfloat-linux-gnueabi- make modules_install INSTALL_MOD_PATH=/tmp/cb2
root # ARCH=arm CROSS_COMPILE=/usr/bin/armv7a-hardfloat-linux-gnueabi- make uImage
root # cp ./arch/arm/boot/uImage /tmp/cb2


In /tmp/cb2 you will find a working kernel and the modules.

For debugging the boot process read this:
http://linux-sunxi.org/Cubieboard/TTL
You can buy this device here: http://dx.com/p/arduino-pl2303hx-to-usb-ttl-upload-download-wire-black-100cm-199553

The mistakes from Pluto7777 are not critical.
After booting cubieboard attach a keyboard and a monitor to the cubieboard, login via console and fix it.