Difference between pages "Debian" and "Compiling Angstrom for pico-SAM9G45"

From Low cost, low power, android ARM system board by Mini-Box.com - pico WiKi
(Difference between pages)
Jump to navigation Jump to search
(Created page with "=Prep= 1. Get two SD cards (A USB drive should also work with the Angstrom kernel, I haven't tested)<br> 2. Install the precompiled Angstrom image on to one of the SD cards an...")
 
(Created page with "<h1>Compile using the new meta-angstrom distribution based on meta-openembedded branch (new branch)</h1> git clone git://github.com/Angstrom-distribution/setup-scripts.git -...")
 
Line 1: Line 1:
=Prep=
+
<h1>Compile using the new meta-angstrom distribution based on meta-openembedded branch (new branch)</h1>
1. Get two SD cards (A USB drive should also work with the Angstrom kernel, I haven't tested)<br>
+
  git clone git://github.com/Angstrom-distribution/setup-scripts.git -b angstrom-v2012.05-yocto1.2
2. Install the precompiled Angstrom image on to one of the SD cards and insert it into the MicroSD slot<br>
+
  cd setup-scripts/sources
3. Format the other SD card (Or USB drive) with mkfs.ext3
+
  git clone git://gitorious.org/picopc-tools/meta-picosam9.git
 +
  cd ..
 +
  echo 'EXTRALAYERS="${TOPDIR}/sources/meta-picosam9"' >> conf/bblayers.conf
 +
  MACHINE=picosam9 ./oebb.sh config picosam9
  
=Creating a Debian environment=
+
<h1> Start building</h1>
This stage creates your Debian root fs.
+
If you want to build only the kernel:
  
===On your Debian machine===
+
  MACHINE=picosam9 ./oebb.sh bitbake virtual/kernel
1. use the command:
 
apt-get install debootstrap
 
2. then
 
debootstrap --arch=armel --foreign [stable|testing|unstable] <targetdirectory>
 
3. Copy the resulting chroot directory to your empty SD card
 
  
===On your Pico board===
+
or if you want a small base image:
4. Mount the SD card in the reader slot on the pico board (The card should be auto mounted to ''/media/mmcblk1p1'')<br>
 
5. then type:
 
chroot /path/to/chrootdir
 
6. then
 
/debootstrap/debootstrap --second-stage
 
  
You should install any apps you might need to access the board, and do any configuration.<br>
+
  MACHINE=picosam9 ./oebb.sh bitbake console-image
I couldn't get the serial console to work at this point so I installed ''openssh-server'' and configured my network and users so that when I booted Debian for the first time I could ssh into it.
 
  
=Building a new kernel=
 
  
Debian doesn't include a kernel that's workable so you will need to build your own (the pre-compiled image I think will work with squeeze, but I haven't tried).
+
<h1>Compile using the classic angstrom distribution based on openembedded.dev branch (old branch)</h1>
I suggest compiling 3.1rc? if you want to run testing or unstable. 3.0.4 has issues in the atmel-mci driver and 3.1rc? should get some new features soon like a driver for the hardware random number generator.
+
This is obsolete and kept for reference. All development and maintenance are done on the new meta-angstrom.
  
'''Required Packages'''
+
  git clone git://gitorious.org/picopc-tools/picopc-angstrom-setup.git
 +
  cd picopc-angstrom-setup
 +
  MACHINE=picosam9 ./oebb.sh update
 +
  MACHINE=picosam9 ./oebb.sh config picosam9
  
*build-essential -- GCC etc
+
The script will also download and install picosam9 recipes for angstrom from here: [https://gitorious.org/picopc-tools/picopc-angstrom  https://gitorious.org/picopc-tools/picopc-angstrom]
*uboot-mkimage -- uboot's mkimage
 
  
'''Patched Kernel'''
+
To get the same build as the binary ones provided by mini-box.com you can use (note: this recipes only work on old openembedded.dev branch NOT the new meta-angstrom):
 +
  MACHINE=picosam9 ./oebb.sh bitbake picosam9-gpe-image
 +
  MACHINE=picosam9 ./oebb.sh bitbake picosam9-console-image
  
You can find a mini-box.com pre-patched 3.x kernel tree [https://gitorious.org/picopc-kernel/kernel/commits/minibox-picopc-3.1 here].  
+
<h2>Notes</h2>
 +
* The build process builds kernel and a rootfs, you will still need to copy those file to a microSD respecting the info here: http://arm.mini-box.com/index.php?title=Main_Page#Building_an_image_from_scratch
  
Daniel Palmer keeps a "bleeding edge" 3.x version [http://code.google.com/p/linux-picosam9g45/ here].
+
* The BOOT.BIN bootstrap is not built by angstrom. You can get a binary from:http://resources.mini-box.com/online/pico-SAM9G45/android/BOOT.BIN or [http://arm.mini-box.com/index.php?title=Bootstrap compile] your own version.
  
=Switching rootfs=
+
* Latest version that our '''classic''' angstrom build (openembedded.dev) has been tested is: ''tested_2011-01-13''. Other versions might have a different behavior. You can get this version by doing:
  
1. using fdisk or similar remove the root partition from Angstrom and create a new root partition with the size you want.<br>
+
  cd sources/openembedded
2. format it with mkfs.ext3<br>
+
  git checkout tested_2011-01-13 -b tested_2011-01-13
3. copy the debian chroot into the new root partition<br>
 
<br>
 
You should be ready to boot into Debian now :)
 
  
 +
* The version of bitbake used is:
  
=Post install configuration=
+
  cd sources/bitbake
 +
  git checkout 1.12
  
=== Fix up /etc/fstab ===
+
* All above commands from step #2 downward must be issued from the picopc-angstrom-setup/ folder.
 
 
debootstrap creates an empty fstab. You can boot with this but you should configure it at some point. The example below defines root and mounts the bootloader/kernel partition to /boot for easy kernel upgrades.
 
 
 
# <file system> <mount point>  <type>  <options>      <dump>  <pass>
 
/dev/mmcblk0p2  /              ext3    defaults        0      0
 
/dev/mmcblk0p1  /boot/          vfat    defaults        0      0
 
 
 
=== Disable LCD backlight ===
 
If you don't have an LCD you should turn the backlight off. Add this to your /etc/rc.local
 
 
 
echo 0 > /sys/class/backlight/backlight/brightness
 
 
 
=== Fix MAC address ===
 
 
 
The board doesn't seem to have anywhere to store it's MAC address so the kernel generates a bogus one on boot up.. this causes issues if you want to have fixed IP allocations over DHCP etc. You can fix this by configuring a MAC address for the interface by inserting something like the following in your /etc/network/interfaces file;
 
 
 
auto eth0
 
iface eth0 inet dhcp
 
'''hwaddress ether 00:04:14:C0:FF:EE'''
 
 
 
MAC addresses need to be unique on your network!
 
 
 
=== Fix/add loopback device ===
 
 
 
You should add a loopback device. Some server daemons that need to bind to the loopback device will fail to install or start (such as mysql). You can fix this by configuring a loopback device by inserting something like the following in your /etc/network/interfaces file;
 
 
 
auto lo
 
iface lo inet loopback
 
 
 
=== Serial Console ===
 
 
 
Enabling a serial console is easy and will allow you to login via one of the UARTs. I have used ttyS0 (RXD0 and TXD0) on J7. The other UART should also work but I haven't checked. A serial console on ttyS0 can be enabled by finding the line that starts with #T0:23.. in your /etc/inittab, un-commenting it and if you want changing the baud rate.
 
 
 
Mine looks like this;
 
 
 
S0:23:respawn:/sbin/getty -L ttyS0 115200 vt100
 

Latest revision as of 06:35, 20 October 2020

Compile using the new meta-angstrom distribution based on meta-openembedded branch (new branch)

 git clone git://github.com/Angstrom-distribution/setup-scripts.git -b angstrom-v2012.05-yocto1.2
 cd setup-scripts/sources
 git clone git://gitorious.org/picopc-tools/meta-picosam9.git
 cd ..
 echo 'EXTRALAYERS="${TOPDIR}/sources/meta-picosam9"' >> conf/bblayers.conf
 MACHINE=picosam9 ./oebb.sh config picosam9

Start building

If you want to build only the kernel:

 MACHINE=picosam9 ./oebb.sh bitbake virtual/kernel

or if you want a small base image:

 MACHINE=picosam9 ./oebb.sh bitbake console-image


Compile using the classic angstrom distribution based on openembedded.dev branch (old branch)

This is obsolete and kept for reference. All development and maintenance are done on the new meta-angstrom.

 git clone git://gitorious.org/picopc-tools/picopc-angstrom-setup.git
 cd picopc-angstrom-setup
 MACHINE=picosam9 ./oebb.sh update
 MACHINE=picosam9 ./oebb.sh config picosam9

The script will also download and install picosam9 recipes for angstrom from here: https://gitorious.org/picopc-tools/picopc-angstrom

To get the same build as the binary ones provided by mini-box.com you can use (note: this recipes only work on old openembedded.dev branch NOT the new meta-angstrom):

 MACHINE=picosam9 ./oebb.sh bitbake picosam9-gpe-image
 MACHINE=picosam9 ./oebb.sh bitbake picosam9-console-image

Notes

  • Latest version that our classic angstrom build (openembedded.dev) has been tested is: tested_2011-01-13. Other versions might have a different behavior. You can get this version by doing:
  cd sources/openembedded
  git checkout tested_2011-01-13 -b tested_2011-01-13
  • The version of bitbake used is:
  cd sources/bitbake
  git checkout 1.12
  • All above commands from step #2 downward must be issued from the picopc-angstrom-setup/ folder.