Difference between revisions of "Manufacturing:X2 Ubuntu Configuration for MicroSD programming"

From Idrive
Jump to navigation Jump to search
Line 50: Line 50:
 
::Click Finish
 
::Click Finish
  
==System Configuration==
+
==System Configuration - old ==
  
 
After installation has finished start the virtual machine by double clicking on Ubuntu 64-Bit
 
After installation has finished start the virtual machine by double clicking on Ubuntu 64-Bit

Revision as of 21:56, 9 January 2017

Programming of Micro SD cards for X2 using Ubuntu Linux

MicroSD programming

Setup programming stations for MicroSD programming

Basic Install

Install VMplayer

https://my.vmware.com/web/vmware/free#desktop_end_user_computing/vmware_player/7_0

Launch VMware
Check use VMware Player in free non-comercial mode (enter an email address)

Create Ubuntu Virtual Machine

Download the latest Ubuntu version Ubuntu 14.0.4 with LTS(long term support) can be downloaded from the link below:

http://www.ubuntu.com/download/desktop

Open VMware player and click on "Create a new virtual machine" to open the "New virtual machine wizard"

Browse for the .iso image of Ubuntu and click next:
Full Name: ubuntu
User name: ubuntu
password: none (the word, not blank)
Click Next
Use default Virtual Machine name: Ubuntu 64-bit
Click Next
Maximum disk size (30GB recommended)
Select Split virtual disk into multiple files

after that the Ubuntu Linux install will start.

Click Next
Click Finish

System Configuration - old

After installation has finished start the virtual machine by double clicking on Ubuntu 64-Bit

Log into the system ubuntu/none

Open a Terminal (search for it and pin to the desktop

Sudo apt-get install udisks (password) (Installs UDISK)

Configure main.sh for the number of SD cards devices

depends on the actual hardware used

copy main.sh, card.sh, idrive.ico to /usr/local/bin (use sudo because the location is system protected)

sudo cp main.sh /usr/local/bin (password)
sudo cp card.sh /usr/local/bin (password)
sudo cp idrive.ico /usr/local/bin (password)
cd /usr/local/bin
sudo chmod 775 card.sh
sudo chmod 775 main.sh

Copy firmware image to the Documents directory (ensure name and location match the card.sh) (Example ltib-x2-061515.tar.gz)

Copy X2_MicroSD_prog.desktop to the Desktop directory

sudo visudo (edits sudo so you can disable the password requirements to run sfdisk, mkfs.ext4, tar , umount) add the following lines:

%ubuntu ALL=(ALL:ALL) /bin/tar
%ubuntu ALL=(ALL:ALL) /bin/umount
%ubuntu ALL=(ALL:ALL) /sbin/mkfs.ext4
%ubuntu ALL=(ALL:ALL) /sbin/sfdisk

Install Updates : System>Details>Overview

System Configuration Update for new scripts Jan 9 2017

From Florin: added checks for read-only cards, bad sectors, bad MBR, etc.

Now the script creates the partition and formats it the way SD Formatter does (quick or full), so there is no need of using that tool anymore. Also it show progress for each card in case multiple ones are written.

The script can be executed with (or without) parameters, you can pass: devices, OS image path, formatting mode.

You can edit the idrive_card_deployer.sh and set the following default variable as well: DEPLOY_DEVICES=”” #default devices, for example “sdc sdd sde” FILESYSTEM_ARCHIVE=”” #default path to OD image archive DEPLOY_MODE=”” #formatting mode, “verify” = full or “simple” = quick

The only script you have to execute is idrive_card_deployer.sh but all the rest form archive need to be placed in the same directory.

Also by executing the script without parameter and no default device configured, a list of all device will be displayed so you can easy find the “target”. If you set only the DEPLOY_MODE and FILESYSTEM_ARCHIVE you can run the script “./idrive_card_deployer.sh sdc”, it’s easier when you create one card and not know all the time how the Linux OS attaches the device (see attached pics).


After installation has finished start the virtual machine by double clicking on Ubuntu 64-Bit

Log into the system ubuntu/none

Open a Terminal (search for it and pin to the desktop

Sudo apt-get install udisks (password) (Installs UDISK)

Configure main.sh for the number of SD cards devices

depends on the actual hardware used

copy main.sh, card.sh, idrive.ico to /usr/local/bin (use sudo because the location is system protected)

sudo cp main.sh /usr/local/bin (password)
sudo cp card.sh /usr/local/bin (password)
sudo cp idrive.ico /usr/local/bin (password)
cd /usr/local/bin
sudo chmod 775 card.sh
sudo chmod 775 main.sh

Copy firmware image to the Documents directory (ensure name and location match the card.sh) (Example ltib-x2-061515.tar.gz)

Copy X2_MicroSD_prog.desktop to the Desktop directory

sudo visudo (edits sudo so you can disable the password requirements to run sfdisk, mkfs.ext4, tar , umount) add the following lines:

%ubuntu ALL=(ALL:ALL) /bin/tar
%ubuntu ALL=(ALL:ALL) /bin/umount
%ubuntu ALL=(ALL:ALL) /sbin/mkfs.ext4
%ubuntu ALL=(ALL:ALL) /sbin/sfdisk

Install Updates : System>Details>Overview

Add suppport for Exfat filesystem (64GB cards)

sudo add-apt-repository -y ppa:relan/exfat
sudo apt-get update -qq
sudo apt-get install exfat-utils


Double click the X2 MicroSD Programming Icon

Still waiting for cards… 1min50sec for 1 card

Wait for the "Cards are done!" message.

Partitioning SD Cards in Linux

  1. dmesg (display kernel messages after SD card is plugged in order to find your device path - probably /dev/sdc )
  1. sudo fdisk /dev/sdc

Command(m for help): p (print the partition table)

Command(m for help): n (add a new partition)

Select (default p): p

Partition number (1-4, default 1): 1

First sector (….): [ENTER]

Last sector, +sectors or +size{K,M,G} (….): [ENTER]

Command(m for help): p (print the partition table...just check)

Command(m for help): w (write table to disk and exit)

This is all, now you can go and hit “Eject” to disconnect the device