📜 ⬆️ ⬇️

Configuring Intel Galileo from scratch to installing Debian full version

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

Searches on the Internet for installing instructions on a full-fledged Linux on Intel Galileo did not bring success. Therefore, I decided to write an article on the full installation from start to finish and at the same time get an invite to Habr .

So here we go, the instruction will be based on this .

Introduction

Before you start installing Debian, you must activate the network card on Intel Galileo, this is done using the sketch for Arduino (the connection procedure and settings here ):
#include <SPI.h> #include <Ethernet.h> // 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 must create a binding IP address to the Intel Galileo MAC address (indicated by a sticker on the LAN port).

Install debian

"Stage 1.Download Debian-7.3.0-i386-netinst.iso for a virtual machine"
“Note: Set the following values ​​for a virtual machine: 256 MB RAM, 1 CPU, 3.8 GB HDD (partitioned under ext3), turn off the printer, sound card and CD-ROM (after installation).”
“Note: create a second hard disk with 20 GB HDD and partition it under ext3”
"Note: We will work from under the root"
“Note: Of all the packages, we will install only SSH”

“Stage 2. We are testing SHH and updating.”
“Note: Once again, we do everything as root.”

 apt-get update apt-get upgrade 


(I personally had no updates and the commands were completed in a couple of seconds)

"Stage 3. Setting the date and time"
"Note: You can skip if you have already chosen during the installation process"
 date apt-get install ntpdate y ntpdate pool.ntp.org 


"Stage 4. Mount the second hard drive (the one that is 20 GB)."
“Note: A rather interesting step, note that if Debian was installed on an ext3 file system, then everything below should 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 / dev / sdb1. If the disk was not mounted in the system, then we execute the commands below „
 fdisk /dev/sdb1 n p 

“We agree with everything and press Enter until we are asked 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: here and below, you can skip ls if you are sure that the copy / mount was successful.”

"Stage 5. Downloading a little 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 yet installed the archiver."
 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 have learned."
 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: We'll see how everything is installed”
 ls 


"Stage 6. Modifying 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 


"Stage 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"

"Stage 8. Create the image of our Linux."
 cd /sdb 

“Note: If it fails, try restarting Debian in safe mode. Personally, I got errors here because of the difference between ext3 and ext4 - fixed the formatting of the first hard drive under 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 


"Stage 9. The 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 that the image-full-clanton.ext3 file is present”
 ls 


"Stage 10. MicroSD preparation - according to the instructions "
"On behalf of the Administrator, we run diskpart.exe from the command line."
 "Run diskpart.exe" "DISKPART> list disk" "DISKPART> select vol <a> 
; (where “a” is your SD card) (with two physical hard drives this is VOL. 5. But at this stage you can already “buy” and install Paragon Partition Manager> _ <sorry, I did not know this before. I deleted the hard mark a couple of times I understand the disk 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 it finds, I had 5) "
 "DISKPART> clean" 

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

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


“Stage 11. Download the new image-full-clanton.ext3 to the SD card”
“Note: If you have rebooted, you must 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 execute the fdisk -l command to understand the card name. 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 folder“ /sdb/LINUX_IMAGE_FOR_SD_Intel_Galileo_v0.7.5 ”to the memory card, there are many ways, I preferred to install the mc file manager (apt-get install mc), run it and copy it”

At this stage, I hurried and brazenly pulled out a card reader, after which Intel Galileo refused to start with 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 with the replacement image-full-clanton.ext3 (from the desktop), added 2 the file from the original archive LITTLE_LINUX_IMAGE_FirmwareUpdate_Intel_Galileo_v0.7.5 and inserted the memory card into Intel Galileo. After about 20 seconds, I logged in via SSH.



To begin with, 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 select the least “heavy” systems for this.



Instead of output

Thus, I received a full-fledged Debian on Intel Galileo, on which most of the teams work properly, but some of them do not work or are unstable. In the near future, we plan to force Galileo to read data from sensors and write the result to an SQL table with the subsequent output of data to the site.

As soon as they give an invite to Windows 8 for Galileo , its functionality will probably increase, in any case I will 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 highly preferable to use memory cards of class 10.

Intel's downloads page (on original archives)

Source: https://habr.com/ru/post/218993/


All Articles