Preparing SD Card for Ubuntu Image

Hello All,

I am using beagle board xm hardware shipped with Angstorm Linux demo image.

Downloaded the ubuntu kernel source from https://github.com/RobertCNelson/stable-kernel and followed the steps to build.
After the kernel build , in which path should we need to look for the rootfs filesystem…

With 4gb sd card made the partition for FAT32 (boot - 120 MB) and ext3 file system(rootfs ~3 GB ).

Could anyone please share the steps to modify the existing uboot environment to boot the ubuntu image from SD Card ?

Thanks,

Kana

Just run "./tools/install_kernel.sh" it'll detect that version of
Angstrom and correctly place the files in the correct location..

Regards,

One thing... Angstrom uses uImage's... so make sure you enable:

https://github.com/RobertCNelson/stable-kernel/blob/master/system.sh.sample#L34

in system.sh

Regards,

I tried the script install_kernel.sh , it copied the files uImage , zImage , dtbs to boot partition.
In rootfs partition copied only the lost+found directory.

Script Output,

Well, thanks for the bug report, but you are a little late, as that
was fixed "a long" time ago.. Based on the version it installed, that
commit was around "Nov 26, 2012", care to 'retry' with the top of the
"v3.6.x" branch?

Regards,

btw, just noticed this ^^...

So... "install_kernel.sh" aka "install" "kernel" related files...

I'll give you another guess why it didn't install the "other" files
related to your root file system.

The script isn't magic..

Regards,

Assuming you don't have a root file system, as looking back you never
mentioned downloading.. I've already written a step by step guide
here:
http://eewiki.net/display/linuxonarm/BeagleBoard

Regards,

I followed the steps given in eewiki link,

I have two queries :

1 ) Updated the kernel source to ``````v3.9.x and downloaded the rootfs.
Copied the zImage to /boot partition and rootfs directory extracted to /rootfs partition of sd card.
How do I generate the uImage ? In the updated kernel source , i didn’t find any option to enable uImage.

  1. Observed compile error for the u-boot source,

Generating include/generated/asm-offsets.h
tools/scripts/make-asm-offsets arch/arm/cpu/armv7/omap3/asm-offsets.s include/generated/asm-offsets.h
for dir in tools examples/standalone examples/api arch/arm/cpu/armv7 ; do
make -C $dir _depend ; done
make[1]: Entering directory /home/ch/kp_ubuntu_work/u-boot/tools' cat /dev/null >.depend /home/ch/kp_ubuntu_work/u-boot/lib/rsa/rsa-sign.c:26:25: fatal error: openssl/rsa.h: No such file or directory compilation terminated. make[1]: *** No rule to make target .depend’, needed by `_depend’. Stop.

Thank you !

I followed the steps given in eewiki link,

Actually, you didn't follow the directions.. That error you got from
u-boot is from the top of the tree, so you failed to checkout the
tag..

I have two queries :

1 ) Updated the kernel source to v3.9.x and downloaded the rootfs.
      Copied the zImage to /boot partition and rootfs directory extracted to
/rootfs partition of sd card.
      How do I generate the uImage ? In the updated kernel source , i
didn't find any option to enable uImage.

Did you search the list? or google? it's been documented a few hundred
times over the last few years.. hint: "mkimage" "0x80008000"

Otherwise you should join the future, uImage's are limited when you
start looking at multiarch enabled kernel builds.

2) Observed compile error for the u-boot source,

Generating include/generated/asm-offsets.h
tools/scripts/make-asm-offsets arch/arm/cpu/armv7/omap3/asm-offsets.s
include/generated/asm-offsets.h
for dir in tools examples/standalone examples/api arch/arm/cpu/armv7 ; do \
            make -C $dir _depend ; done
make[1]: Entering directory `/home/ch/kp_ubuntu_work/u-boot/tools'
cat /dev/null >.depend
/home/ch/kp_ubuntu_work/u-boot/lib/rsa/rsa-sign.c:26:25: fatal error:
openssl/rsa.h: No such file or directory
compilation terminated.
make[1]: *** No rule to make target `.depend', needed by `_depend'. Stop.

HEAD of u-boot now needs "libssl-dev" installed...

Regards,

I created a new branch of u-boot source with steps below,

git clone git://git.denx.de/u-boot.git
cd u-boot/
git checkout v2013.04 -b tmp
wget https://raw.github.com/eewiki/u-boot-patches/master/v2013.04/0001-omap3_beagle-uEnv.txt-bootz-n-fixes.patch
patch -p1 < 0001-omap3_beagle-uEnv.txt-bootz-n-fixes.patch

After installing the “libssl-dev” , I get the following error

root@ubuntu:/home/ch/kp_ubuntu_work/u-boot# make ARCH=arm CROSS_COMPILE=${CC} distclean
root@ubuntu:/home/ch/kp_ubuntu_work/u-boot# make ARCH=arm CROSS_COMPILE=${CC} omap3_beagle_config
Configuring for omap3_beagle board…
root@ubuntu:/home/ch/kp_ubuntu_work/u-boot# make ARCH=arm CROSS_COMPILE=${CC}
Generating include/autoconf.mk
cc1: error: bad value (armv5) for -march= switch
Generating include/autoconf.mk.dep
cc1: error: bad value (armv5) for -march= switch
gcc -DDO_DEPS_ONLY
-g -Os -fno-common -ffixed-r8 -msoft-float -D__KERNEL__ -I/home/ch/kp_ubuntu_work/u-boot/include -fno-builtin -ffreestanding -nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/4.6/include -pipe -DCONFIG_ARM -D__ARM__ -march=armv5 -Wall -Wstrict-prototypes
-o lib/asm-offsets.s lib/asm-offsets.c -c -S
lib/asm-offsets.c:1:0: error: bad value (armv5) for -march= switch
make: *** [lib/asm-offsets.s] Error 1
root@ubuntu:/home/ch/kp_ubuntu_work/u-boot#

I created a new branch of u-boot source with steps below,

git clone git://git.denx.de/u-boot.git
cd u-boot/
git checkout v2013.04 -b tmp
wget
https://raw.github.com/eewiki/u-boot-patches/master/v2013.04/0001-omap3_beagle-uEnv.txt-bootz-n-fixes.patch
patch -p1 < 0001-omap3_beagle-uEnv.txt-bootz-n-fixes.patch

After installing the "libssl-dev" , I get the following error

root@ubuntu:/home/ch/kp_ubuntu_work/u-boot# make ARCH=arm
CROSS_COMPILE=${CC} distclean

Why are you building as root???

root@ubuntu:/home/ch/kp_ubuntu_work/u-boot# make ARCH=arm
CROSS_COMPILE=${CC} omap3_beagle_config
Configuring for omap3_beagle board...
root@ubuntu:/home/ch/kp_ubuntu_work/u-boot# make ARCH=arm
CROSS_COMPILE=${CC}
Generating include/autoconf.mk
cc1: error: bad value (armv5) for -march= switch
Generating include/autoconf.mk.dep
cc1: error: bad value (armv5) for -march= switch
gcc -DDO_DEPS_ONLY \
        -g -Os -fno-common -ffixed-r8 -msoft-float -D__KERNEL__
-I/home/ch/kp_ubuntu_work/u-boot/include -fno-builtin -ffreestanding
-nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/4.6/include -pipe

-----------------------------------------------^^^^^
You just built with the x86 gcc compiler, so you never re-set "CC",
"export CC=<somethign> is only valid for as long as your terminal
window remains open..

-DCONFIG_ARM -D__ARM__ -march=armv5 -Wall -Wstrict-prototypes \
        -o lib/asm-offsets.s lib/asm-offsets.c -c -S
lib/asm-offsets.c:1:0: error: bad value (armv5) for -march= switch
make: *** [lib/asm-offsets.s] Error 1
root@ubuntu:/home/ch/kp_ubuntu_work/u-boot#

-----------------------------------------------------------------------------------

Is this the correct way to create the uImage ?
output size is large , is it due to unwanted kernel configs added ??

NO idea, it should be less then 4Mb, so YOU must have enabled something...

root@ubuntu:/home/ch/kp_ubuntu_work/stable-kernel/KERNEL# mkimage -A arm -O
linux -T kernel -C none -a 0x80008000 -e 0x80008000 -n "Linux" -d ./vmlinux
./uImage

Yeap, that's correct, you can also use the "zImage" target from the
deploy directory..

mkimage -A arm -O linux -T kernel -C none -a 0x80008000 -e 0x80008000
-n "Linux" -d ./stable-kernel/deploy/${kernel_version}.zImage ./uImage

Regards,

I have formatted and created two partitions in SD Card,

/media/boot - size 120 MB

/media/rootfs - size 2.7 GB

After compiling the u-boot source ,I copied the MLO , u-bbot.bin,u-boot.img , uEnv.txt , uImage , zImage to FAT32 partition /media/BOOT.

Extracted rootfs tar to the partition /media/rootfs.

But after inserting the sd card to my target beagle board xm (rev C1) , it failed to start up with u-boot and no output in the terminal.

I have my actual sd card shipped with angstorm image for backup , and using the new transcend 4gb sd card for this testing.

Attached the environment variables present in the target.

Please suggest whether the boot environment variables needs to be modified ?

I used the uEnv.txt as below,

#Camera: Uncomment to enable:
#http://shop.leopardimaging.com/product.sc?productId=17
#camera=li5m03

#SPI: enable for userspace spi access on expansion header
#buddy=spidev

#LSR COM6L Adapter Board
#http://eewiki.net/display/linuxonarm/LSR+COM6L+Adapter+Board
#First production run has unprogramed eeprom:
#buddy=lsr-com6l-adpt

#LSR COM6L Adapter Board + TiWi5
#wl12xx_clk=wl12xx_26mhz

#These are now set by default: uncomment/change if you need something else
#defaultdisplay=dvi
#dvimode=1280x720MR-16@60

console=ttyS2,115200n8 mmcroot=/dev/mmcblk0p2 rw rootdelay=1
mmcrootfstype=ext4 rootwait fixrtc

Thanks.

uEnv.txt (1.98 KB)

Did you set the boot flag for the boot partition?

Regards,

After setting the boot flag , uboot started up , but fails to load the image.

U-Boot 2013.04-dirty (Jul 03 2013 - 03:15:27)

OMAP36XX/37XX-GP ES1.2, CPU-OPP2, L3-165MHz, Max CPU Clock 1 Ghz
OMAP3 Beagle board + LPDDR/NAND
I2C: ready
DRAM: 512 MiB
NAND: 0 MiB
MMC: OMAP SD/MMC: 0
*** Warning - readenv() failed, using default environment

In: serial
Out: serial
Err: serial
Beagle xM Rev C
No EEPROM on expansion board
No EEPROM on expansion board
Die ID #368e00029ff80000016849a906024023
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
musb-hdrc: MHDRC RTL version 1.800
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Peripheral mode controller at 480ab000 using PIO, IRQ 0
Net: usb_ether
Hit any key to stop autoboot: 0
mmc0 is current device
gpio: pin 173 (gpio 173) value is 0
gpio: pin 4 (gpio 4) value is 0
SD/MMC found on device 0
reading uEnv.txt
633 bytes read in 4 ms (154.3 KiB/s)
Importing environment from mmc …
reading zImage
3953664 bytes read in 260 ms (14.5 MiB/s)
Booting from mmc …
Bad Linux ARM zImage magic!
Booting from nand …

no devices available
Bad Linux ARM zImage magic!
OMAP3 beagleboard.org #

Does the zImage is not compatible ?
should i need to modify uEnv.txt given in my eariler post ?

Thank you !

I tried to boot manually as below , it got stuck at ‘starting kernel’

I tried to boot manually as below , it got stuck at 'starting kernel'

--------------------------------------------------------------------------------------------------------------------------------
OMAP3 beagleboard.org # fatload mmc0 0 80200000 zImage
reading zImage
3953664 bytes read in 248 ms (15.2 MiB/s)
OMAP3 beagleboard.org #
OMAP3 beagleboard.org # bootm 80200000
## Booting kernel from Legacy Image at 80200000 ...
   Image Name: Linux

   Image Type: ARM Linux Kernel Image (uncompressed)
   Data Size: 3953600 Bytes = 3.8 MiB

   Load Address: 80008000
   Entry Point: 80008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

LOL!! Based on that, your "zImage" is actually a "uImage", zImage's
come straight from the kernel build...

Starting kernel ...
--------------------------------------------------------------------------------------------------------------------------------

Honestly, I'm a little disappointed. You do realize I wrote the
eewiki directions that you claim to have followed.. But based on this
email thread, it's quite obvious you aren't even reading the written
directions.

If you follow the instructions line by line, it'll work...

Regards,

Here : http://www.eewiki.net/display/linuxonarm/BeagleBone#BeagleBone-SetupmicroSDcard

It was able to boot successfully with kernel build zImage (;
But It takes sometime @ “Starting Kernel” then login prompt shown without any debug messages in start up sequence of kernel .
(pasted the log below)

How do we enable the serial output debug message during the start up ?

( I use usb serial port cable mounted as /dev/ttyUSB0 , using minicom connected to target for the serial output)

U-Boot 2013.04-dirty (Jul 03 2013 - 03:15:27)

OMAP36XX/37XX-GP ES1.2, CPU-OPP2, L3-165MHz, Max CPU Clock 1 Ghz
OMAP3 Beagle board + LPDDR/NAND
I2C: ready
DRAM: 512 MiB
NAND: 0 MiB
MMC: OMAP SD/MMC: 0
*** Warning - readenv() failed, using default environment

In: serial
Out: serial
Err: serial
Beagle xM Rev C
No EEPROM on expansion board
No EEPROM on expansion board
Die ID #368e00029ff80000016849a906024023
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
musb-hdrc: MHDRC RTL version 1.800
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Peripheral mode controller at 480ab000 using PIO, IRQ 0
Net: usb_ether
Hit any key to stop autoboot: 0
mmc0 is current device
gpio: pin 173 (gpio 173) value is 0
gpio: pin 4 (gpio 4) value is 0
SD/MMC found on device 0
reading uEnv.txt
633 bytes read in 3 ms (206.1 KiB/s)
Importing environment from mmc …
reading zImage
3953600 bytes read in 249 ms (15.1 MiB/s)
Booting from mmc …

Starting kernel …

Ubuntu 13.04 arm ttyO2

arm login: ubuntu
Password:
Last login: Sat Jan 1 00:03:46 UTC 2000 on ttyO2
Welcome to Ubuntu 13.04 (GNU/Linux 3.9.7-x3 armv7l)

  • Documentation: https://help.ubuntu.com/
    To run a command as administrator (user “root”), use "sudo ".
    See “man sudo_root” for details.

ubuntu@arm:~$
ubuntu@arm:~$

add:
console=ttyO2,115200n8

to your bootargs:

Regards,

using dmesg option , printed the kernel debug message ,
does this could be reason for any delay in the boot process ?

[ 11.373596] init: Failed to open system console: No such device
[ 11.389709] init: Failed to open system console: No such device
[ 13.277557] smsc95xx 1-2.1:1.0 eth0: hardware isn’t capable of remote wakeup
[ 13.278045] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 131.572113] init: Failed to open system console: No such device
[ 131.801879] init: Failed to open system console: No such device
[ 133.403656] init: plymouth-stop pre-start process (574) terminated with status 1