Inspired by the blog from Bruce_Richardson about running debian on the Galileo board, I tried that as well. https://communities.intel.com/message/218148
Instead of copying a running debian distro, I start from scratch with debootstrap. Here is a braindump:
Create some directories we need:
> mkdir galileo-debian
> cd gaileo-debian
> mkdir mnt-loop sdcard image
Let's create an empty image that we format with a filesystem and mount it.
> dd if=/dev/zero of=loopback.img bs=1G count=3
> mkfs.ext3 loopback.img
> sudo mount -o loop loopback.img mnt-loop
You may get asked if you want to format the file because it isn't a block device. Just say Y
Get a coffee and start the interesting part. It's time for bootstrapping debian into the image.
> sudo debootstrap --arch i386 wheezy ./mnt-loop http://http.debian.net/debian/
I choose i386 just to be sure. I think on Quark, up to i586 should work. Please report if you try it with other architectures. (wheeze is the last stable repository)
Thanks Bruce for pointing out to copy the we need to copy the modules. What we need is the original image that was build by yocto or is already on the sdcard. Mount and copy:
> sudo mount -o loop <bsp0.7.5/tmp/deploy/images/>image-sdk-clanton.ext3 image
> sudo cp -r image/lib/modules mnt-loop/lib
> sudo umount image
Before we copy and boot the image, we need to set a password and enable the serial console to login later.
> sudo mount -t proc proc mnt-loop/proc
> sudo mount -t sysfs sysfs mnt-loop/sys
> sudo chroot mnt-loop /bin/bash
set new root password
> vi /etc/hostname
change the hostname
> vi /etc/inittab
I uncommented the T1 line (ttyS1) and changes 9600 to 115200
> sudo umount mnt-loop/proc
> sudo umount mnt-loop/sys
Copy the image to the sdcard. On that sdcard there should be already be the initramdisk (core-image-minimal-initramfs-clanton.cpio.gz), bzImage and grub.conf (in boot/grub/) from the default Galileo yocto installation.
> sudo umount mnt-loop
> sudo mount /dev/mmcblk0p1 sdcard
> sudo rm sdcard/image-full-clanton.ext3
> sudo cp loopback.img sdcard/image-full-clanton.ext3
> sudo umount sdcard
The copy and the umount will take a while. Depending on the speed of the sdcard. Here, a Class 10 sdcard really pays back it's extra money.
Put the sdcard into the Galileo board and put it to work. The first time I booted, I missed the mount point and got this error message:
> mount: mounting /media/mmcblk0p1 on /rootfs//media/realroot failed: No such file or directory
> Couldn't remount /media/mmcblk0p1, dropping to shell
A simple mkdir and reset will do the trick:
> mkdir /roofs/media/realroot
If you are lucky, your board should boot into a serial console now.
Now that the Galileo board boots up with that fileset, let's use it. We have a real package management system.
> ifconfig eth0 up
> dhclient eth0
> apt-get update
> apt-get install ...
The bad part is, that I have the same issue that Bruce reported. Seg-faults in libpthread is also happening, so you don't really win anything. I discovered it when installing the SSH server, set-up a new user and tried to connect. Bang …
I will install a compiler and debugger, compile pthread with debug info and see if I can find what is causing this. Wish me luck.linux