Difference between revisions of "Tegra Ubuntu Installation"

From eLinux.org
Jump to: navigation, search
m (moved Installation Detail to Tegra Ubuntu Installation: original page name was not specific to the content)
(Add category)
Line 181: Line 181:
               mount_block_root(root_device_name, root_mountflags);
               mount_block_root(root_device_name, root_mountflags);

Latest revision as of 01:30, 28 October 2011

Here should be all steps to install Ubuntu from Scratch on Nvidia Harmony Dev Board

From Ianr and Guilhem:

Build linux kernel zImage for Tegra

git clone git://nv-tegra.nvidia.com/linux-2.6.git
cd linux-2.6
git checkout tegra-9.12.7

You need to use the latest gnu arm codesourcery toolchain : http://www.codesourcery.com/sgpp/lite/arm/portal/subscription?@template=lite

To configure your kernel use arch/arm/configs/tegra_harmony_gnu_linux_defconfig

make ARCH=arm CROSS_COMPILE=arm-none-eabi- tegra_harmony_gnu_linux_defconfig

Build your zImage

make ARCH=arm CROSS_COMPILE=arm-none-eabi- -j2

Onboard ethernet works with kernels 9.12.4 onwards If you want you can enable additional USB network adapters (e.g. I use CONFIG_USB_NET_AX8817X )

Download Android SDK from nVidia

Copy the recently-built zImage into the android_tegra_250_5421622 directory

Connect mini-USB on Tegra to host PC

Create new files:

linux_fastboot_nand.cfg and nvflash script hacked_nvflash_crt_1gb.sh Note: It seem that odmdata value can be used to tweak settings (ex: memory adding 0x30 will rise memory to 650MB)

Boot into ForceRecovery mode Execute the new script

sh hacked_nvflash_crt_1gb.sh

[actually the zImage is not used at this point, so it doesn't matter what kernel you use]

Monitor on board should display:

"Entering NvFlash recovery mode / Nv3p Server"

"Starting Fastboot USB download protocol"

It is now waiting for a fastboot protocol connection over USB, so you need the fastboot host application

Build x86 version of fastboot

mkdir fastboot_x86
cd fastboot_x86
git clone git://nv-tegra.nvidia.com/android/platform/build.git build
git clone git://nv-tegra.nvidia.com/android/platform/external/svox.git external/svox
git clone git://nv-tegra.nvidia.com/android/platform/external/zlib.git external/zlib
git clone git://nv-tegra.nvidia.com/android/platform/system/core.git system/core
cd system/core
git checkout tegra-9.12.5   <<< gets correct Tegra version of fastboot host source
cd ../..
make -f build/core/main.mk fastboot

note: you may need to comment out $(error stop) to avoid java/javac version test Once completed use the binary located into out/host/linux-x86/bin/fastboot

sudo fastboot -i 0x955 -p sda1 flash:raw boot zImage

Note it is the zImage that gets used, the other one is just a dummy

[updated: may need to be root to run fastboot]


The linux bootargs come from the fastboot which will need to be hacked if you want to pass anything more complex. The sda1 is a special case in the fastboot code.

Root FS is ext3 USB stick or ext3 USB HDD that appears as sda1

Build / Install Karmic RootFS

You will need at least 1GB SD card or Hard Drive If you need more detailed information on building Karmic root FS you can follow Robert Nelson's instructions on: http://www.elinux.org/BeagleBoardUbuntu Install rootstock:

sudo apt-get install rootstock

Execute rootstock to create your own rootfs

sudo rootstock --fqdn nvidia-tegra --login ubuntu --password ubuntu --imagesize 2G --dist karmic --serial ttyS0

Upon Completion, you should have: armel-rootfs-<date>.tgz -> Root file System

Create a partition ext2 or ext3 on your SD card or Hard Drive

mkdir -p ./tmp
sudo mount /dev/sdX1 ./tmp
sudo tar xfp armel-rootfs-*.tgz -C ./tmp
cd ./tmp
sudo umount ./tmp

Rootfs files to tweak


add to /etc/network/interfaces

auto usb0
iface usb0 inet dhcp
Boot Fixup

Edit /etc/fstab Note change the "ext3" to "ext2" if you formated your device in ext2 Add/Edit /etc/e2fsck.conf

sudo gedit ./tmp/etc/e2fsck.conf


# Superblock last mount time is in the future (PR_0_FUTURE_SB_LAST_MOUNT).
0x000031 = {
   preen_ok = true
   preen_nomessage = true

# Superblock last write time is in the future (PR_0_FUTURE_SB_LAST_WRITE).
0x000032 = {
   preen_ok = true
   preen_nomessage = true
Update Sources

Add karmic updates to /etc/apt/sources.list

deb http://ports.ubuntu.com/ubuntu-ports karmic-updates main universe

Finally sync and umount your drive

Disable Network Manager
sudo bash -c "echo exit > etc/default/NetworkManager"

Your ready to run minimal Ubuntu on your dev board

Install ubuntu-desktop to get full desktop

sudo apt-get install  ubuntu-desktop

Note: - The lights come on with kernel 9.12.7 - No wireless driver yet ar6000 need to be built

- No HW Acceleration - Boot from sd

diff -Nurp -X nodiff.txt linux-2.6-9.12.7-jre2/init/do_mounts.c linux-2.6-9.12.7-jre3/init/do_mounts.c
--- linux-2.6-9.12.7-jre2/init/do_mounts.c    2010-03-26 23:03:43.487720890 -0400
+++ linux-2.6-9.12.7-jre3/init/do_mounts.c    2010-03-30 02:40:55.919278197 -0400
@@ -383,6 +383,7 @@ void __init prepare_namespace(void)

     if (saved_root_name[0]) {
         root_device_name = saved_root_name;
+        root_device_name = "/dev/mmcblk0p1";
         if (!strncmp(root_device_name, "mtd", 3) ||
             !strncmp(root_device_name, "ubi", 3)) {
             mount_block_root(root_device_name, root_mountflags);