Building a Custom Linux Image

There are two machines for building a custom linux image (apply to both mLinux 3.x and 4.x) :

1) For MTCDT and MTCDTIP (IP67), MACHINE=mtcdt
2) For MTCAP, MACHINE=mtcap

In the build, their names are given in lowercase.

First, select your machine and set your password, using the following command:

$ export MACHINE=mtcap  ROOT_PASSWORD="MtechPassword"

For versions of mLinux below 4.0:

 

Required Dependencies for Building

Ubuntu or Debian are recommended as build systems, because MultiTech does more testing with these options. For more information regarding distribution compatibility, refer to the release notes.

Ensure the required dependencies for your operating system are installed.

Password

The setup.sh script allows for either an environmental password or, if that is not provided, a random one.

The setup.sh creates a file called password.txt in its home directory which contains the password and its hash.  It also adds two lines to conf/local.conf which match password.txt.

The initial build may take a few hours depending on your hardware. If you have more than 2 cores and lots of RAM, you can increase the BB_NUMBER_THREADS and PARALLEL_MAKE settings in conf/local.conf to speed up build time considerably.

Download Source & Build Default Images

$ git clone git://git.multitech.net/mlinux mlinux-3.x
$ cd mlinux-3.x
$ git checkout 3
$ ./setup.sh  # Random root password or
$ ROOT_PASSWORD="mypassword" ./setup.sh
$ source env-oe.sh
$ bitbake mlinux-base-image
# OR
$ bitbake mlinux-factory-image

The mlinux-base-image recipe will build an image with basic networking, file system, and time utilities.

The mlinux-factory-image recipe is flashed into Conduits at the factory and adds to mlinux-base-image a full array of extra software including python, ruby, nodejs, and the lighttpd web server.

Download Source & Build Images for Wi-Fi/BT version (see Downloads on how to get the rs9113 Redpine file)

$ tar -C downloads -xzf ~/Downloads/rs9113-from-src-1.5.0-3.12.27r13.0_mtcdt.tar.gz
$ source env-oe.sh
$ bitbake mlinux-rs9113-base-image
# OR
$ bitbake mlinux-rs9113-factory-image

If you skip the tar step, the system displays the following error from the bitbake command:

ERROR: Need /mlinux-3.3x/downloads/rs9113-ipk/rs9113-from-src_1.5.0-3.12.27r13.0_mtcdt.ipk or set MTS_INTERNAL_GIT and add it to BB_ENV_EXTRAWHITE

The built image files will be located here: build/tmp/deploy/images/mtcdt/ (mtcdt is the machine name)

Create & Build a Custom Image

First, you’ll need to create your custom image recipe here: layers/user-layer/recipes-core/images/ You’ll likely want to build your recipe on top of mlinux-base-image.

A specific recipe must exist in order to add it to an image recipe. To view available recipes, run bitbake-layers show-recipes. If a recipe for your desired software is not available, you’ll need to write a custom recipe.

Example

Perhaps you’d like to build a simple image with LoRa support but without python, node, lighttpd, etc.

The recipe file would be:

# layers/user-layer/recipes-core/images/lora-only-image.bb
require recipes-core/images/mlinux-base-image.bb

IMAGE_INSTALL += "lora-network-server"

To build it, run bitbake lora-only-image

 

For versions of mLinux 4.0 and higher:

 

Required Dependencies for Building

Ubuntu or Debian are recommended as build systems, because MultiTech does more testing with these options. For more information regarding distribution compatibility, refer to the release notes.

Ensure the required dependencies for your operating system are installed.

Logging in for the 1st Time Pre-Production

From Software Wiki
Jump to: navigation, search

These instructions are intended for internal use, or by users that create their own images.

The administrator login on mLinux is now mtadm. There is no root password. You cannot log into the device as the root user. Administrative commands may be executed by prefixing with sudo.

The initial mtadm password for mLinux on production images is “root”.

If the user creates his own images he may choose any password for his image. This is useful if the image is to be installed on a system that is on the public internet. See:

(This link is not correct for mLinux 4.0 TBD) Building a Custom Image

Entering the default root and U-Boot password[edit]

mtcdt:~$ sudo mts-ubpasswd                                                                                                                                                             
Password:
salt: ZdQV5pyDW//0qZ2nX51PzGSi6c6TE7MagR9FvwmMXC6W7HS5I8sRC592Om2ApEUZysXaR40QvanwA+qZojrf2udXJ1CtvfmPK/SBi6dLuMpRBh6xyLNjz6pDTCGAv4gD                                                 
uboot password hash: "7a35a6c891c12840199293acdb717190cf09c114b891c8005ec161dbc2883d28"                                                                                                
setting mtadm password to 2CSYQDpG                                                                                                                                                     
u-boot password is 2CSYQDpG                                                                                                                                                            
+ /usr/bin/u-boot setenv mtss ZdQV5pyDW//0qZ2nX51PzGSi6c6TE7MagR9FvwmMXC6W7HS5I8sRC592Om2ApEUZysXaR40QvanwA+qZojrf2udXJ1CtvfmPK/SBi6dLuMpRBh6xyLNjz6pDTCGAv4gD                         
+ /usr/bin/u-boot setenv mtsp 7a35a6c891c12840199293acdb717190cf09c114b891c8005ec161dbc2883d28                                                                                         
mtcdt:~$

The environmental variables mtss and mtsp are the salt and password used to create the U-Boot password. To remove the U-Boot password, do the following:

sudo u-boot setenv mtss
sudo u-boot setenv mtsp

To dump the U-Boot environment:

sudo u-boot printenv

Password

For mLinux 4, there is no root password.  Logins should use the user-id mtadm, or one created by the user after the system first boots.

The setup.sh script allows for either an environmental password or, if that is not provided, a random one.

The setup.sh creates a file called password.txt in its home directory which contains the password and its hash.  It also adds two lines to conf/local.conf which match password.txt.

The initial build may take a few hours depending on your hardware. If you have more than 2 cores and lots of RAM, you can increase the BB_NUMBER_THREADS and PARALLEL_MAKE settings in conf/local.conf to speed up build time considerably.

Download Source & Build Default Images

$ git clone git://git.multitech.net/mlinux mlinux-4.x
$ cd mlinux-4.x
$ ./setup.sh  # Random root password or
$ MTADM_PASSWORD="mypassword" ./setup.sh
$ source oe-init-build-env
$ bitbake mlinux-base-image
# OR
$ bitbake mlinux-factory-image

The mlinux-base-image recipe will build an image with basic networking, file system, and time utilities.

The mlinux-factory-image recipe is flashed into Conduits at the factory and adds to mlinux-base-image a full array of extra software including python, ruby, nodejs, and the lighttpd web server.

Download Source & Build Images for Wi-Fi/BT version (see Downloads on how to get the rs9113 Redpine file)

$ tar -C downloads -xzf ~/Downloads/rs9113-from-src-1.5.0-3.12.27r13.0_mtcdt.tar.gz
$ source oe-init-build-env
$ bitbake mlinux-rs9113-base-image
# OR
$ bitbake mlinux-rs9113-factory-image

If you skip the tar step, the system displays the following error from the bitbake command:

ERROR: Need /mlinux-3.3x/downloads/rs9113-ipk/rs9113-from-src_1.5.0-3.12.27r13.0_mtcdt.ipk or set MTS_INTERNAL_GIT and add it to BB_ENV_EXTRAWHITE

The built image files will be located here: build/tmp/deploy/images/mtcdt/ (mtcdt is the machine name)

Create & Build a Custom Image

First, you’ll need to create your custom image recipe here: layers/user-layer/recipes-core/images/ You’ll likely want to build your recipe on top of mlinux-base-image.

A specific recipe must exist in order to add it to an image recipe. To view available recipes, run bitbake-layers show-recipes. If a recipe for your desired software is not available, you’ll need to write a custom recipe.

Example

Perhaps you’d like to build a simple image with LoRa support but without python, node, lighttpd, etc.

The recipe file would be:

# layers/user-layer/recipes-core/images/lora-only-image.bb
require recipes-core/images/mlinux-base-image.bb

IMAGE_INSTALL += "lora-network-server"

To build it, run bitbake lora-only-image