Back to Home

Configuring Intel Galileo from scratch to installing the full version of Debian

intel galileo · debian · arduino

Configuring Intel Galileo from scratch to installing the full version of Debian

The other day I received the long-awaited Intel Galileo, I ordered from SparkFun Electronics , it arrived pretty quickly and cheaply. In a few minutes, I installed Little Linux from Intel, connected to it via SSH and immediately became sad :) because The possibilities of this Linux are extremely limited.

A search on the Internet for instructions on installing full-fledged Linux on Intel Galileo did not succeed. So I decided to write an article for a full installation from start to finish and at the same time to get an invite to Habr .

So let's start, the instruction will be based on this .

Introduction

Before proceeding with the installation of Debian, you need to activate the network card on Intel Galileo, this is done using a sketch for Arduino (the connection and configuration procedure is here ):
#include 
#include 
// Enter a MAC address for your controller below.
// Newer Ethernet shields have a MAC address printed on a sticker on the shield
byte mac[] = {  
  0x98, 0x4F, 0xEE, 0x00, 0x66, 0x74 };
// Initialize the Ethernet client library
// with the IP address and port of the server 
// that you want to connect to (port 80 is default for HTTP):
EthernetClient client;
void setup() {
  // start the serial library:
  Serial.begin(9600);
  // start the Ethernet connection:
  if (Ethernet.begin(mac) == 0) {
    Serial.println("Failed to configure Ethernet using DHCP");
    // no point in carrying on, so do nothing forevermore:
    for(;;)
      ;
  }
  // print your local IP address:
  Serial.println(Ethernet.localIP());
}
void loop() {
}


After that, in the router, you need to create a binding of the IP address to the Intel Galileo MAC address (indicated by a sticker on the LAN port).

Install Debian

“Step 1: Download Debian-7.3.0-i386-netinst.iso for the virtual machine”
“Note: Set the following parameters for the virtual machine: 256 MB RAM, 1 CPU, 3.8 GB HDD (mark up as ext3), disable the printer, and sound a card and a CD-ROM (after installation). ”
“ Note: create a second hard drive with 20 GB HDD and mark it under ext3 ”
” Note: We will work from the root “
“ Note: We will install only SSH from all packages ”

“ Step 2. We test SHH and update. ”
“ Note: Once again, we do everything as root. ”

apt-get update
apt-get upgrade


(personally, I didn’t have updates and the commands were completed in a couple of seconds)

“Step 3. Setting the date and time”
“Note: You can skip if you already selected during installation”
date
apt-get install ntpdate
y
ntpdate pool.ntp.org


“Step 4. Mount the second hard drive (the one that is 20 GB).”
“Note: Quite an interesting step, note that if Debian was installed on the ext3 file system, then everything below must also be performed under this file system. I did not take this into account and there were many interesting and incomprehensible mistakes. ”
fdisk –l

“Note: The second hard drive in my case is called / dev / sdb1. If the disk was not mounted on the system, then execute the commands below „
fdisk /dev/sdb1
n
p

“We agree with everything and press Enter until they ask us again (about 2-3 times)”
w
mkfs.ext3 /dev/sdb1
y
cd /
mkdir sdb
mount -t ext3 /dev/sdb1 /sdb
e2label /dev/sdb1 /sdb
df -h
cd sdb
ls

“Note: hereafter, you can skip ls if you are sure that copying / mounting was successful.”

“Step 5. Download small Linux.”
cd /sdb
wget http://downloadmirror.intel.com/23171/eng/LINUX_IMAGE_FOR_SD_Intel_Galileo_v0.7.5.7z

“Note: If you have not installed the archiver yet.”
apt-get install p7zip
p7zip -d LINUX_IMAGE_FOR_SD_Intel_Galileo_v0.7.5.7z
cd /sdb/LINUX_IMAGE_FOR_SD_Intel_Galileo_v0.7.5

“Note: Let's see what they removed.”
ls
cd /sdb
mv /sdb/LINUX_IMAGE_FOR_SD_Intel_Galileo_v0.7.5/image-full-clanton.ext3 /sdb/image-full-clanton_original.ext3
mkdir /sdb/image-full-clanton_original
mount -t ext3 /sdb/image-full-clanton_original.ext3 /sdb/image-full-clanton_original
cd /sdb/image-full-clanton_original

“Note: Let's see how everything fit in.”
ls


“Step 6: Modify Debian for Intel Galileo.”
cd /media
mkdir /media/card
mkdir /media/cf
mkdir /media/hdd
mkdir /media/mmc1
mkdir /media/net
mkdir /media/ram
mkdir /media/realroot
mkdir /media/union
mkdir /sketch
cp -avr /sdb/image-full-clanton_original/lib/modules/3.8.7-yocto-standard/ /lib/modules/3.8.7-yocto-standard
cd /lib/modules/3.8.7-yocto-standard

“Note: Make sure everything is copied.”
ls
cp -avr /sdb/image-full-clanton_original/opt/cln/ /opt/cln
cd /opt/cln/galileo

“Note: And here, too, everything was copied.”
ls


“Step 7. Make changes to initialize Debian.”
nano /etc/inittab

“Note: insert at the end of the file”
“s0: 2345: respawn: / sbin / getty -L 115200 ttyS1 vt102”

“Step 8. Create an image of our Linux.”
cd /sdb

“Note: If it fails, try restarting Debian in safe mode. Personally, it was here that I started to get errors due to the difference between ext3 and ext4 - I fixed it by formatting the first hard one for ext3 and starting over. ”
fdisk -l

“Note: Pay attention to the number of blocks in / dev / sda1 in my case it is 3766272.”
dd if=/dev/sda1 of=/sdb/image-full-clanton.ext3 bs=3766272 conv=sync,noerror
mkdir /sdb/image-full-clanton
mount -t ext3 /sdb/image-full-clanton.ext3 /sdb/image-full-clanton
cd /sdb/image-full-clanton

“Note: Make sure everything is copied.”
ls


“Step 9. Final touches in the installation.”
rm -rf /sdb/image-full-clanton/sys
rm -rf /sdb/image-full-clanton/proc
mkdir /sdb/image-full-clanton/sys
mkdir /sdb/image-full-clanton/proc
cd /sdb
umount -l /sdb/image-full-clanton
mv /sdb/image-full-clanton.ext3 /sdb/LINUX_IMAGE_FOR_SD_Intel_Galileo_v0.7.5/image-full-clanton.ext3
cd /sdb/LINUX_IMAGE_FOR_SD_Intel_Galileo_v0.7.5

“Note: Make sure the image-full-clanton.ext3 file is available”
ls


“Step 10. Preparing MicroSD - according to the instructions
“On behalf of the Administrator, run diskpart.exe from the command line.”
"Run diskpart.exe"
"DISKPART> list disk"
"DISKPART> select vol 
; (where “a” is your SD card) (with two physical hard drives it is VOLUME 5. But at this stage you can already “buy” and install Paragon Partition Manager> _ <sorry I didn’t know this before. A couple of times I deleted the hard disk layout I understood the algorithm for determining the memory card in the card reader: Select volume 10, if not found select 9 ... a flash drive is the last volume from the end that he finds, I had it 5) "
"DISKPART> clean"

(If after this command you lost some of the shortcuts from the desktop and the hard drive disappeared, then you obviously did not clear the memory card. Paragon eliminates this oversight by simply reconnecting the drive letters and updating the MBR)
"DISKPART> create part primary"
"DISKPART> active"
'DISKPART> format quick label="BOOTME"'

“Note: Full formatting of the memory card may be necessary, but“ quick “formatting was enough for me.”
'DISKPART> format label="BOOTME"'
"DISKPART> exit"


“Step 11. Download the new image-full-clanton.ext3 to the SD card”
“Note: If you rebooted, you need to mount the / sdb1 partitions again.”

mount -t ext3 /dev/sdb1 /sdb
cd /sdb/LINUX_IMAGE_FOR_SD_Intel_Galileo_v0.7.5


“We activate the SD card in the virtual machine and run the fdisk -l command to understand the name of the card. In my case, the SD card is dev / sdc1 ":

mkdir mnt/usb
mount -t vfat -o iocharset=utf8,codepage=866 /dev/sdc1 /mnt/usb


“Now you need to copy the contents of the“ /sdb/LINUX_IMAGE_FOR_SD_Intel_Galileo_v0.7.5 ”folder to the memory card, there are many ways, I chose to install the mc file manager (apt-get install mc), run it and copy in it”

At this point, I hurried and brazenly pulled out a card reader, after which Intel Galileo refused to start it. I copied the image-full-clanton.ext3 file from the memory card to the desktop and repeated step 10, then unzipped the original LINUX_IMAGE_FOR_SD_Intel_Galileo_v0.7.5.7z to the memory card, copied image-full-clanton.ext3 (from the desktop) with the replacement, added 2 file from the original archive LITTLE_LINUX_IMAGE_FirmwareUpdate_Intel_Galileo_v0.7.5 and inserted a memory card into Intel Galileo. After about 20 seconds, I logged on to it via SSH.



First I installed “mc”, the installation took quite a long period of time, but ended successfully. In the future I plan to install a web server, but for now I choose the least "heavy" systems for this.



Instead of output

Thus, I got a full-fledged Debian on Intel Galileo, on which most commands work correctly, but some of them do not work or work unstably. In the near future, Galileo will be forced to read data from sensors and write the result to an SQL table, followed by data output to the site.

As soon as they give an invite on
Windows 8 for Galileo, it’s possible its functionality will increase, in any case I’ll install it and it will be interesting.

I remind you that Intel Galileo does not support SD cards larger than 32 GB and it is extremely preferable to use class 10 memory cards.

Download page on Intel website (to original archives)

Read Next